summaryrefslogtreecommitdiff
path: root/modules/nproc
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2017-02-20 20:26:35 -0800
committerPádraig Brady <P@draigBrady.com>2017-02-26 03:38:20 -0800
commit3f61a6d1c24ba50e31edb2200f7400d0b029d4cc (patch)
tree7476fa189bd8124cc95a4b85702ed176c0c56a7e /modules/nproc
parenta7c0c973afa3658784be567158e582aef516d7ce (diff)
downloadgnulib-3f61a6d1c24ba50e31edb2200f7400d0b029d4cc.tar.gz
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.
Diffstat (limited to 'modules/nproc')
-rw-r--r--modules/nproc1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/nproc b/modules/nproc
index 2cbf04d92b..5259579427 100644
--- a/modules/nproc
+++ b/modules/nproc
@@ -9,6 +9,7 @@ m4/nproc.m4
Depends-on:
c-ctype
extensions
+minmax
unistd
configure.ac: