Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## latest #3815 +/- ##
=======================================
Coverage 79.94% 79.95%
=======================================
Files 508 508
Lines 121043 121078 +35
Branches 18910 18914 +4
=======================================
+ Hits 96773 96808 +35
Misses 23895 23895
Partials 375 375 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| #### [Changing the number of threads](@id scheduler-change-threads) | ||
|
|
||
| `Highs::getThreadSchedulerNumThreads()` returns `N` for the calling thread's scheduler, or 0 if there is none. To solve with a different number of threads on the same thread, compare it with the new value and reset if they differ: |
There was a problem hiding this comment.
"different number of threads on the same thread" is not very clear. Maybe we can use the terminology introduced in the previous section: "different number of worker threads on the same application thread".
|
|
||
| /** | ||
| * @brief Returns the number of threads used by the scheduler owned by the | ||
| * calling thread, or 0 if the calling thread has no scheduler. If the |
There was a problem hiding this comment.
"the scheduler owned by the calling thread" is not fully correct, as it can be called in a worker thread as well. Maybe say "the scheduler of the calling thread".
| void Highs_resetThreadScheduler(const HighsInt blocking); | ||
|
|
||
| /** | ||
| * Get the number of threads used by the scheduler owned by the calling thread. |
There was a problem hiding this comment.
Same here, it can be called from a worker thread, so "the scheduler of the calling thread"
Description
Changing the threads option between solves on the same thread fails unless resetThreadScheduler() is called first, but there was no way to check the current scheduler's size. The C# wrapper also had no reset.
Changes:
All changes add new functions; nothing existing changes. Tests are in TestHighsParallel.cpp, TestCAPI.c and test_highspy.py.
Checklist
latestbranchCloses #3637