You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not sure this would be a good idea. It is used to disable multi-threading in BLAS (not sure if syr, syrk, gemm, or gemmt) and LAPACK (potrf, potrs) calls when those are already parallelized through openmp.
If this were to be disabled (as it would be by default without RhpcBLASctl), under some BLASes, there could be a slowdown that users might not know about or might not know how to address.
I guess the most popular choice for BLAS/LAPACK on linux is openblas-pthreads, which not would adjust its threads automatically when running under an OMP section.
I guess it shouldn't be a problem with syrk and potrf/potrs calls in the latest version of openblas when the problem sizes are small (OpenMathLib/OpenBLAS#3237OpenMathLib/OpenBLAS#3284OpenMathLib/OpenBLAS#3244), and it shouldn't be a problem with the '-openmp' version either, nor with MKL; but I don't know for sure what exact functions armadillo would be calling behind the scenes, and don't know about other BLASes like apple's.
Would it be possible to run some benchmarks with/without the RhpcBLASctl calls of the affected routines with different software like apple's blas and openblas-pthreads?
I'm not against adding it to "Suggests". But I think there should be some mechanism to warn users or internal capability to limit BLAS threading. With both BLAS multithreading and outer loop OMP multithreading the thread contention is severe.
Activity
david-cortes commentedon Jun 16, 2026
I am not sure this would be a good idea. It is used to disable multi-threading in BLAS (not sure if syr, syrk, gemm, or gemmt) and LAPACK (potrf, potrs) calls when those are already parallelized through openmp.
If this were to be disabled (as it would be by default without RhpcBLASctl), under some BLASes, there could be a slowdown that users might not know about or might not know how to address.
I guess the most popular choice for BLAS/LAPACK on linux is openblas-pthreads, which not would adjust its threads automatically when running under an OMP section.
I guess it shouldn't be a problem with syrk and potrf/potrs calls in the latest version of openblas when the problem sizes are small (OpenMathLib/OpenBLAS#3237 OpenMathLib/OpenBLAS#3284 OpenMathLib/OpenBLAS#3244), and it shouldn't be a problem with the '-openmp' version either, nor with MKL; but I don't know for sure what exact functions armadillo would be calling behind the scenes, and don't know about other BLASes like apple's.
Would it be possible to run some benchmarks with/without the RhpcBLASctl calls of the affected routines with different software like apple's blas and openblas-pthreads?
dselivanov commentedon Jun 29, 2026
I'm not against adding it to "Suggests". But I think there should be some mechanism to warn users or internal capability to limit BLAS threading. With both BLAS multithreading and outer loop OMP multithreading the thread contention is severe.
MichaelChirico commentedon Jun 30, 2026
It could be an
.onAttach()warning, where if {RhpcBLASctl} is not found, the user sees a strong exhortation on startup?MichaelChirico commentedon Jun 30, 2026
#83 has some GHA benchmarks to investigate this quantitatively.
MichaelChirico commentedon Jun 30, 2026
Summary of the benchmark:
Ubuntu-latest (Linux, OpenBLAS, 2 cores)
macos-latest (macOS, Accelerate)