omp_get_nested – Nested parallel regions#

Description:

This function returns true if nested parallel regions are enabled, false otherwise. Here, true and false represent their language-specific counterparts.

The state of nested parallel regions at startup depends on several environment variables. If OMP_MAX_ACTIVE_LEVELS is defined and is set to greater than one, then nested parallel regions will be enabled. If not defined, then the value of the OMP_NESTED environment variable will be followed if defined. If neither are defined, then if either OMP_NUM_THREADS or OMP_PROC_BIND are defined with a list of more than one value, then nested parallel regions are enabled. If none of these are defined, then nested parallel regions are disabled by default.

Nested parallel regions can be enabled or disabled at runtime using omp_set_nested, or by setting the maximum number of nested regions with omp_set_max_active_levels to one to disable, or above one to enable.

C/C++:

Prototype:

int omp_get_nested(void);

Fortran:

Interface:

logical function omp_get_nested()

See also:

omp_set_max_active_levels – Limits the number of active parallel regions, omp_set_nested – Enable/disable nested parallel regions, OMP_MAX_ACTIVE_LEVELS – Set the maximum number of nested parallel regions, OMP_NESTED – Nested parallel regions

Reference:

OpenMP specification v4.5, Section 3.2.11.