Load only one PetscInt width of PETSc_jll per process#241
Open
ViralBShah wants to merge 1 commit into
Open
Conversation
The Int64 and Int32 libpetsc variants link external packages (hypre, SuperLU_DIST) that export identical symbols with different integer ABIs. Loading both widths into one process cross-binds those symbols on platforms with a flat dynamic-linker namespace (Linux ELF), so the `libs` tuple now registers a single width: Int64 by default, Int32 via the new "PetscInt" preference / `set_petscint!(Int32)` (one Julia restart, standard Preferences.jl recompilation). Related robustness fixes for configurations with fewer than eight libraries (single-width JLL mode and set_library! custom mode): - clamp the petsclibs[1:2]/[1:4] loops in the tests - guard the second-library access in the set_petsclib test - examples/ex19.jl falls back to any available Float64 library when the Float64/Int32 combination is not loaded Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
@boriskaus I believe it is best to allow only one combination of PetSc integer type to be loaded in a process. That way only one set of libraries and dependencies are opened. |
Member
Author
|
We'll need the test harness to test all the different PetSc variants (rather than cycle through them in the same Julia process). Is this reasonable - or do people link to more than one variant in a typical PetSc process? |
Collaborator
|
I think this is very reasonable. |
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.
The Int64 and Int32 libpetsc variants in the upcoming PETSc_jll 3.24 (JuliaPackaging/Yggdrasil#13691) link external packages — hypre and SuperLU_DIST — that export identical symbols with different integer ABIs (
libHYPRE64vslibHYPRE,libsuperlu_dist_Int64vs_Int32). Loading both widths into one process cross-binds those symbols on platforms with a flat dynamic-linker namespace (Linux ELF), silently corrupting whichever width loses the load-order race.This PR makes the
libstuple register a single width per process: Int64 by default, Int32 via the new"PetscInt"preference /set_petscint!(Int32)(takes effect after a Julia restart, standard Preferences.jl recompilation). The companion JLL change marks all libpetsc productsdont_dlopensousing PETSc_jlldoesn't eagerly load anything.Also included are robustness fixes for configurations with fewer than eight libraries (single-width JLL mode and the
set_library!custom mode):petsclibs[1:2]/[1:4]test loops are clamped to the available librariesset_petsclibtest is guardedexamples/ex19.jlfalls back to any available Float64 library when Float64/Int32 isn't loadedValidated against locally-built PETSc 3.24.6 binaries (full test suite green in custom-library mode, including the 4-rank MPI tests; all five built variants initialize and report the right version).
🤖 Generated with Claude Code