OMP_NUM_THREADS (GNU libgomp)

### 4.12 `OMP_NUM_THREADS` – Specifies the number of threads to use ¶

ICV: nthreads-var
Scope: data environment
Description:

  Specifies the default number of threads to use in parallel regions. The value of this variable shall be a comma-separated list of positive integers; the value specifies the number of threads to use for the corresponding nested level. Specifying more than one item in the list automatically enables nesting by default. If undefined one thread per CPU is used.

  When a list with more than value is specified, it also affects the max-active-levels-var ICV as described in `OMP_MAX_ACTIVE_LEVELS` – Set the maximum number of nested parallel regions.

See also:

  `omp_set_num_threads` – Set upper team size limit, `OMP_MAX_ACTIVE_LEVELS` – Set the maximum number of nested parallel regions

Reference:

  OpenMP specification v4.5, Section 4.2