Repository navigation
Default SuperLU_DIST to PARMETIS ordering and expose ParSymbFact - #4665
Merged
Merged
Conversation
With METIS_AT_PLUS_A every rank orders the global matrix itself and SuperLU_DIST assumes the orderings agree. Scotch's METIS emulation, used by the wheels, returns different orderings on different ranks for the same graph, so parallel factorisations deadlock. PARMETIS ordering is a single collective call and is also faster on larger 3D problems. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2
ParSymbFact runs the symbolic factorisation in parallel. With RowPerm NOROWPERM it also avoids gathering the global matrix on every process. It needs PARMETIS ordering, so solve rejects other orderings before entering SuperLU_DIST. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2
Serial symbolic factorisation replicates the global matrix and L/U structure on every rank, which limits memory scalability. Turn on parallel symbolic factorisation wherever PARMETIS ordering is the default. ParSymbFact needs the ordering step, so setting ColPerm to another ordering turns it off. SamePattern skips the ordering and crashes in symbfact_dist, so set_A treats SamePattern as DOFACT under ParSymbFact. A DOFACT refactorisation in set_A now also releases the solve communication structure, which a new ordering invalidates. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2
This was referenced Oct 19, 2026
jhale
enabled auto-merge
October 19, 2026 08:18
An uninitialised send buffer in SuperLU_DIST's dist_symbLU makes ParSymbFact hang on non-power-of-two rank counts, which the int64 CI legs hit on 3 ranks. Fixed upstream in xiaoyeli/superlu_dist#231. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When SuperLU_DIST has ParMETIS support (
HAVE_PARMETIS, which is set for both real ParMETIS and Scotch's emulation), this PR makesColPerm=PARMETISthe default in place ofMETIS_AT_PLUS_A. Builds without ParMETIS keep SuperLU_DIST's own default (MMD_AT_PLUS_A). It also exposesParSymbFactthroughset_option, off by default.Deadlock with the default ordering
With
ColPerm=METIS_AT_PLUS_A, every rank computes the column ordering of the gathered global matrix independently (get_perm_c_distinpdgssvx), with no broadcast, so all ranks must get the same permutation. The wheels (#4652) build SuperLU_DIST against Scotch's METIS/ParMETIS emulation. ItsMETIS_NodeNDreturns different permutations on different ranks for identical input. I checked this by interposing it in a 2-rank solve: the ranks had the same input hash and got different outputs. Resetting Scotch's RNG and running single-threaded didn't make the orderings consistent. The ranks then reach mismatched collectives and the factorisation deadlocks. The existing tests use 5×5 meshes, which happen to order consistently, so CI didn't catch this.PARMETISis a single collective call, so the ranks agree by construction. It's also faster on larger 3D problems. Solve times on the wheels, 4 ranks, Poisson on a unit cube:| Problem | DOFs | MMD_AT_PLUS_A | PARMETIS | |---|---|---|---| | P1 | 69k | 3.6 s | 1.6 s | | P1 | 185k | 22.1 s | 6.6 s | | P2 | 118k | 10.0 s | 3.7 s |
On 2D problems MMD is about 1.5× faster: 0.69 s against 1.03 s at 263k DOFs. Sequential METIS couldn't be benchmarked on the wheels because it hangs.
Reported upstream as xiaoyeli/superlu_dist#229. Follow-up once it's fixed: #4666.
Parallel symbolic factorisation (opt-in)
Serial symbolic factorisation builds the gathered global matrix and the global L/U structure on every rank, so its memory per rank grows with the problem size whatever the rank count.
ParSymbFact=YESdistributes both. WithRowPerm=NOROWPERMit also removes the remaining global gather (pdgssvx.c:789). On a 3D 7-point Laplacian, using a C driver linked against the wheel's SuperLU_DIST, it saved ~110 MB per rank at 373k unknowns on 8 ranks (1249 MB against 1139 MB). The cost in time ranged from 10% faster to 14% slower.It isn't the default, because it can hang. In
dist_symbLU, a process with nothing to send passes an uninitialisedsnd_luindtoMPI_Alltoallv. WithParSymbFacton a non-power-of-two process count, the processes outside the symbolic factorisation have nothing to send. When the garbage equalsMPI_IN_PLACE, the collective mismatches, and the job hangs or aborts withMPI_ERR_TRUNCATE. An earlier version of this PR madeParSymbFact=YESthe default. It then hung on 3 ranks in bothint64CI legs, and passed on 2 and 4. Backtraces showed rank 2 in Open MPI's in-placeAlltoallvand ranks 0 and 1 in the pairwise one. The bug is in 9.2.1, 9.3.0 andmaster, and the one-line fix is xiaoyeli/superlu_dist#231. #4666 tracks makingParSymbFactthe default once a fixed release is the minimum.For users who opt in:
ColPerm=PARMETIS. SettingColPermto another ordering throughset_optionturnsParSymbFactoff. An explicit inconsistent combination makessolvethrow before entering SuperLU_DIST.Fact=SamePatterncrashes with it.SamePatternskips the ordering step, but parallel symbolic factorisation needs the separator tree from that step. SuperLU_DIST 9.3.0 segfaults insymbfact_dist, so underParSymbFactset_A(A, "SamePattern")refactors withDOFACT, andsolverejectsFact=SamePatternset throughset_option. Reported as Segfault in symbfact_dist with ParSymbFact=YES and Fact=SamePattern xiaoyeli/superlu_dist#230.DOFACTrefactorisation needs a fresh solve structure.DOFACTinset_Anow also calls*SolveFinalize, because a new ordering invalidates the cached solve communication pattern. This also fixes the existingset_A(A, "DOFACT")path, which until now left that structure stale, whatever theParSymbFactsetting.Using the C driver with
ParSymbFacton and off, MC64 on and off, and 1–4 ranks, these refactorisation sequences give correct solutions for the latest matrix:DOFACT → DOFACT → FACTORED,SamePattern_SameRowPerm → FACTOREDandDOFACT → SamePattern_SameRowPerm → FACTORED.Tests
RowPerm=NOROWPERMand withColPerm=MMD_AT_PLUS_A. On the current wheels the default case hangs on 2 ranks. WithColPerm=PARMETISset, the whole SuperLU_DIST test file passes on 2, 3 and 4 ranks.ParSymbFactwithout PARMETIS is rejected.The tests don't turn
ParSymbFacton, because CI runs them on 3 ranks.🤖 Generated with Claude Code
https://claude.ai/code/session_01JudYk8UecTQyirGsLsHUN2