Skip to content

Add SuperLUDIST sparse factorization support#1046

Merged
ChrisRackauckas merged 2 commits into
SciML:mainfrom
AJ0070:fix/49
Jun 19, 2026
Merged

Add SuperLUDIST sparse factorization support#1046
ChrisRackauckas merged 2 commits into
SciML:mainfrom
AJ0070:fix/49

Conversation

@AJ0070

@AJ0070 AJ0070 commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional Context

  • Adds a SuperLUDISTFactorization sparse direct solver wrapper and a dedicated LinearSolveSuperLUDIST test group.
  • The current wrapper supports only real-valued (Float32/Float64) inputs. ComplexF64 is rejected for now because the current upstream SuperLUDIST.jl replicated complex solve path crashes during finalization.

fixes #49

AI Disclosure: Used GPT 5.4

@AJ0070

AJ0070 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

@ChrisRackauckas

@ChrisRackauckas ChrisRackauckas merged commit b37c95c into SciML:main Jun 19, 2026
49 of 57 checks passed
@ChrisRackauckas

Copy link
Copy Markdown
Member

Can you join a Friday meeting to chat?

@AJ0070

AJ0070 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

Sure, what time is it?

ChrisRackauckas-Claude pushed a commit to ChrisRackauckas-Claude/LinearSolve.jl that referenced this pull request Jun 21, 2026
The resolve test iterates over all subtypes of AbstractSparseFactorization
and calls `alg()` on each that is not explicitly skipped. SuperLUDIST support
(SciML#1046) added SuperLUDISTFactorization as a subtype, but its constructor
errors unless the LinearSolveSuperLUDISTExt extension is loaded (which
requires `using MPI, SuperLUDIST, SparseArrays` and an initialized MPI
process grid). The Core resolve test never loads those, so construction
errored and broke the Core and Downgrade test groups across all Julia
versions. SuperLUDIST has its own dedicated test group
(test/LinearSolveSuperLUDIST), so skip it in the generic resolve loop like
the other extension/hardware-gated factorizations.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ChrisRackauckas added a commit that referenced this pull request Jun 22, 2026
…cacheval regression (#1053)

* Skip SuperLUDISTFactorization in Core resolve test

The resolve test iterates over all subtypes of AbstractSparseFactorization
and calls `alg()` on each that is not explicitly skipped. SuperLUDIST support
(#1046) added SuperLUDISTFactorization as a subtype, but its constructor
errors unless the LinearSolveSuperLUDISTExt extension is loaded (which
requires `using MPI, SuperLUDIST, SparseArrays` and an initialized MPI
process grid). The Core resolve test never loads those, so construction
errored and broke the Core and Downgrade test groups across all Julia
versions. SuperLUDIST has its own dedicated test group
(test/LinearSolveSuperLUDIST), so skip it in the generic resolve loop like
the other extension/hardware-gated factorizations.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix StaticArrays.LU `.factors` access in GenericLU/RFLU init_cacheval

PR #1038 changed the `GenericLUFactorization` and `RFLUFactorization`
`init_cacheval` to rebuild the cached factorization instance via
`LinearAlgebra.LU(luinst.factors, ipiv, luinst.info)` so the cacheval slot
type would match the `Vector{BlasInt}` pivot used by `solve!` for non-`Array`
dense containers (e.g. `FixedSizeArray`).

That rebuild assumes `ArrayInterface.lu_instance(A)` returns a
`LinearAlgebra.LU`. For static arrays (e.g. `SizedMatrix`) it returns a
`StaticArrays.LU`, whose fields are `L`, `U`, `p` — there is no `factors` or
`info` field, so the access threw `type StaticArrays.LU has no field factors`.
This broke the OrdinaryDiffEq downstream "Sized Matrix Tests" (Rodas4 over a
`SizedMatrix` state routes through the default solver -> RFLU init_cacheval).

Fix: keep the rebuild when `lu_instance` returns a `LinearAlgebra.LU`;
otherwise build the matching `LinearAlgebra.LU` directly from the converted
matrix and the `Vector{BlasInt}` pivot — which is exactly what `solve!` stores
for static-array inputs (`generic_lufact!` / `RecursiveFactorization.lu!`
return `LU{T, typeof(A), Vector{BlasInt}}`).

Verified locally on Julia 1.12 + StaticArrays 1.9.18: `GenericLUFactorization`
and the default-solver (RFLU) paths now solve a `SizedMatrix` LinearProblem;
the Core `fixedsizearrays` (47/47) and `resolve` (123/123) tests still pass.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: ChrisRackauckas-Claude <accounts@chrisrackauckas.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SUPERLU_DIST Wrapper

2 participants