Repository navigation
Throttle OpenMP stress tests to 2 threads for CRAN (#3, part 2/2) - #5
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
==========================================
+ Coverage 91.80% 92.00% +0.20%
==========================================
Files 26 26
Lines 3917 3916 -1
==========================================
+ Hits 3596 3603 +7
+ Misses 321 313 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mattfidler
force-pushed
the
issue-3-part2
branch
from
October 27, 2026 18:35
9f4fb29 to
c73d2a8
Compare
The trust stress test asked for 8 threads; under CRAN's OMP_THREAD_LIMIT=2 libomp warned 'Cannot form a team with 8 threads'. Request 2 threads and cap both stress helpers at omp_get_thread_limit() (#3).
mattfidler
force-pushed
the
issue-3-part2
branch
from
October 27, 2026 21:02
c73d2a8 to
c9ba9bc
Compare
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.
Part 2 of 2 for #3, stacked on #4 (base:
issue-3).Problem
CRAN's check log showed
OMP: Warning #96: Cannot form a team with 8 threads, using 2 instead.:test-c-objfun-threadsafety.Raskedtrust_openmp_stress_test()for 8 threads, and the helpers capped only atomp_get_max_threads(), not atOMP_THREAD_LIMIT.Fix
trust_openmp_stress_test()andsolver_openmp_stress_test()also cap atomp_get_thread_limit(), so the runtime never has to shrink the team.Verification
With a clang/libomp build and
OMP_THREAD_LIMIT=2 OMP_NUM_THREADS=8, the warning reproduces on part 1 and is gone here, even when 8 threads are requested; 2 distinct threads are still used.devtools::test(): 293 pass.🤖 Generated with Claude Code