Repository navigation
OpenBLAS test num threads update - #3402
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## latest #3402 +/- ##
==========================================
- Coverage 75.19% 75.19% -0.01%
==========================================
Files 460 460
Lines 112421 112464 +43
Branches 17826 17828 +2
==========================================
+ Hits 84540 84569 +29
- Misses 27599 27613 +14
Partials 282 282 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
galabovaa
marked this pull request as draft
October 12, 2026 17:03
galabovaa
force-pushed
the
openblas-test-threads
branch
from
October 12, 2026 17:14
e8e508b to
601a87c
Compare
Collaborator
|
Thanks Ivet, this looks great. |
galabovaa
marked this pull request as ready for review
October 22, 2026 13:06
Contributor
Author
|
@filikat I updates the sections to specify OpenBLAS. Would you please have another look? Thank you! |
filikat
approved these changes
Oct 22, 2026
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.
Description
Follow-up to #3293, incorporating the review discussion there.
What the code here introduces, largely following the previous PR:
Before solving, HiPO sets the number of OpenBLAS threads to 1. Previously this was a silent no-op if the build was misconfigured: if HiGHS was linked against OpenBLAS but
HIPO_USES_OPENBLASwas not defined, the call did nothing and OpenBLAS ran multi-threaded, which slows HiPO down considerably.Now
highs_openblas_set_num_threadsreturns the number of threads OpenBLAS reports after the call (-1 if HiGHS was built without OpenBLAS support). Before solving, HiPO checks this against the BLAS provider reported in the build metadata: if the provider is OpenBLAS but the thread count is not 1, HiPO logs an error and returnskSolveErrorinstead of running slowly without warning. Calling it with 0 or less just returns the current number of threads without changing it (used by the tests).This check is skipped when
hipo_serial_blasis false (see below).BLAS_LIBRARIESIf the library name contains "openblas", the BLAS metadata is set to OpenBLAS, so
HIPO_USES_OPENBLASis defined.New option
hipo_serial_blas(defaulttrue). The number of OpenBLAS threads is process-wide, so users running other OpenBLAS work in the same process can set it tofalse. HiPO then neither changes the number of OpenBLAS threads nor checks it.Calls are serialised with a mutex, and
openblas_set_num_threadsis only called when the thread count actually needs to change, so concurrent HiGHS instances don't reconfigure OpenBLAS while another is running BLAS routines.Added a portable, case-insensitive
is_substring_casetostringutil.h, used for the OpenBLAS and Apple Accelerate checks.New "BLAS threads" section in
[parallel.md](http://parallel.md/), the option definition, and notes in the installation, Python and Julia pages.HiGHS.jl uses libblastrampoline, so HiPO does not change the number of BLAS threads there. We should probably document on the JuMP side that users should call
BLAS.set_num_threads(1)to get the best performance out of HiPO, noting that this applies to the whole Julia session, so it may slow down other code that relies on parallel BLAS. cc @odowUnit tests for
is_substring_caseand the OpenBLAS thread wrapper, and a HiPO test checking that OpenBLAS runs in serial by default and is left alone whenhipo_serial_blasis false.Checklist
latestbranch