Mercurial > gnulib
view modules/nproc @ 18711:545a79f1cab7
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.
author | Pádraig Brady <P@draigBrady.com> |
---|---|
date | Mon, 20 Feb 2017 20:26:35 -0800 |
parents | 0d0daceb5bdd |
children |
line wrap: on
line source
Description: Detect the number of processors Files: lib/nproc.h lib/nproc.c m4/nproc.m4 Depends-on: c-ctype extensions minmax unistd configure.ac: gl_NPROC Makefile.am: lib_SOURCES += nproc.c Include: "nproc.h" License: LGPLv2+ Maintainer: Glen Lenker and Paul Eggert