]> Savannah Git Hosting - gnulib.git/commit
nproc: support nested OMP_NUM_THREADS, and OMP_THREAD_LIMIT
authorPádraig Brady <P@draigBrady.com>
Tue, 21 Feb 2017 04:26:35 +0000 (20:26 -0800)
committerPádraig Brady <P@draigBrady.com>
Sun, 26 Feb 2017 11:38:20 +0000 (03:38 -0800)
commit3f61a6d1c24ba50e31edb2200f7400d0b029d4cc
tree7476fa189bd8124cc95a4b85702ed176c0c56a7e
parenta7c0c973afa3658784be567158e582aef516d7ce
nproc: support nested OMP_NUM_THREADS, and OMP_THREAD_LIMIT

* lib/nproc.c (parse_omp_threads): A new function refactored
from num_processors() to support parsing both of the
above environment variables.
(num_processors): Prefer using omp_get_num_threads() with [_OPENMP]
to accurately reflect the current OpenMP nesting level.
Also support the OMP_THREAD_LIMIT environment variable
to limit the max value determined from OMP_NUM_THREADS.
* modules/nproc: Depend on minmax header.
Suggested by Oliver Heimlich.
ChangeLog
lib/nproc.c
modules/nproc