* lib/nproc.c (num_processors): Optimize away the
num_processors_ignoring_omp (query) call when possible.
+2025-03-20 Bruno Haible <bruno@clisp.org>
+
+ nproc: Optimize.
+ * lib/nproc.c (num_processors): Optimize away the
+ num_processors_ignoring_omp (query) call when possible.
+
2025-03-19 Paul Eggert <eggert@cs.ucla.edu>
nproc, openmp-init: omit unnecessary strtol code
query = NPROC_CURRENT;
}
/* Here query is one of NPROC_ALL, NPROC_CURRENT. */
+ if (omp_env_limit == 1)
+ /* No need to even call num_processors_ignoring_omp (query). */
+ return 1;
{
unsigned long nprocs = num_processors_ignoring_omp (query);
return MIN (nprocs, omp_env_limit);