Repository navigation
BLAS threads - #293
Merged
Merged
BLAS threads#293
Conversation
Collaborator
Author
|
Commit 3 (fix, found casually by this PR's new test on Windows): on Windows, no |
Collaborator
|
yes, in |
filoferra
force-pushed
the
blas-threads
branch
from
September 25, 2026 16:02
d714760 to
7be6bfb
Compare
Collaborator
Author
|
Okay then now the default is one BLAS thread per rank when ranks share a node. |
…t its drive letter
filoferra
force-pushed
the
blas-threads
branch
from
September 28, 2026 08:14
7be6bfb to
ba2f36c
Compare
filoferra
marked this pull request as ready for review
September 28, 2026 08:16
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.
Draft, for discussion.
Since PETSc_jll 3.25, all PETSc builds call BLAS through Julia's libblastrampoline, so PETSc's BLAS runs in Julia's own OpenBLAS thread pool. Under MPI, every rank has such a pool, and its idle threads keep spinning. With several ranks on one node, they fight the ranks for the cores. A 4-rank DMStag Stokes solve ran 25× slower (2.0 s instead of 0.07 s per step), with the same results and no warning.
PETSc's
-blas_num_threadsdoesn't help: PETSc can't see that it's OpenBLAS, so it only stores the number.initializepasses-blas_num_threadson toBLAS.set_num_threads. It also stopsinitializefrom changing the caller'soptionsvector. Test:test/blas_threads.jl.initializeuses 1 BLAS thread, unless-blas_num_threads,OPENBLAS_NUM_THREADSorOMP_NUM_THREADSis set. Serial runs and one rank per node are unchanged. This changes a global Julia setting, so we can also drop this commit and just document the option. Test:test/mpi_blas_threads.jl, run on 4 ranks.