]> Savannah Git Hosting - gnulib.git/commit
nproc: adjust handling of OpenMP environment variables
authorPádraig Brady <P@draigBrady.com>
Sun, 26 Feb 2017 14:32:19 +0000 (06:32 -0800)
committerPádraig Brady <P@draigBrady.com>
Sun, 26 Feb 2017 15:04:08 +0000 (07:04 -0800)
commit0481ab52033694e1c137d4911f4d025a186d1a2a
tree78f7eb8df59e09525492465f78a1a50d5e91733d
parent3f61a6d1c24ba50e31edb2200f7400d0b029d4cc
nproc: adjust handling of OpenMP environment variables

Adjust to match the return value from omp_get_num_threads(), i.e.:
 - honor OMP_THREAD_LIMIT without OMP_NUM_THREADS
 - Treat 0 as an invalid value and ignore

Also remove the call to omp_get_num_threads()
added in the previous recent commit, because it's
ineffective without the omp pragmas in place.

* lib/nproc.c (parse_omp_threads): Return 0 if specified,
so that it can be ignored.
(num_processors): Honor OMP_THREAD_LIMIT even without
OMP_NUM_THREADS being set.  Also fix a typo in the environment
variable being checked, from the previous recent commit.
ChangeLog
lib/nproc.c