Skip to content

Docs: OMP_NUM_THREADS also affects non-OpenMP builds#5529

Open
takluyver wants to merge 1 commit intoOpenMathLib:developfrom
takluyver:patch-1
Open

Docs: OMP_NUM_THREADS also affects non-OpenMP builds#5529
takluyver wants to merge 1 commit intoOpenMathLib:developfrom
takluyver:patch-1

Conversation

@takluyver
Copy link

I had a brief bit of confusion because the docs suggested that OMP_NUM_THREADS would only affect OpenMP builds, when actually it's used as a fallback in non-OpenMP builds as well.

#ifdef USE_OPENMP
numprocs = 0;
#else
numprocs = readenv_atoi("OPENBLAS_NUM_THREADS");
if (numprocs == 0) numprocs = readenv_atoi("GOTO_NUM_THREADS");
#endif
if (numprocs == 0) numprocs = readenv_atoi("OMP_NUM_THREADS");
if (numprocs == 0) numprocs = readenv_atoi("OPENBLAS_DEFAULT_NUM_THREADS");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants