Skip to content
Snippets Groups Projects
Commit 219b782f authored by Ben Cumming's avatar Ben Cumming Committed by Sam Yates
Browse files

More robust NMC_NUM_THREADS parsing (#198)

fixes #197

* Add functions that can find thread affinity and the number of available cores on linux systems via `sched_getaffinity`.
* On other systems they default to "unknown affinity" and return 0 to indicate that the number of cores is unknown.
* Set the default number of threads according to the new functions above if no environment variable explicitly setting the number of threads is set.
* Validate environment variable value against regex and range check; terminate if improper.
* Terminate if no number of threads is provided and the library is unable to determine a sensible number automatically.
parent c55d9d66
No related branches found
No related tags found
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment