HP aC++/HP C Programmer's Guide (B3901-90036; A.06.26; September 2011)
setenv OMP_NESTED value
The OMP_NESTED environment variable enables or disables nested parallelism. Its value
must be TRUE or FALSE.
If the value is set to TRUE, nested parallelism is enabled and if the value is set to FALSE,
the nested parallelism is disabled. The default value is FALSE.
Runtime Library Functions in OpenMP
The OpenMP library functions are external functions. The header <omp.h> declares
three types of functions:
• Several functions that can be used to control and query the parallel execution
environment.
• Lock functions that can be used to synchronize access to data.
• Timing functions that support a wall-clock timer.
Description of library functions are divided into the following topics:
• Execution Environment Functions
• Lock Functions
• Timing Functions
Execution Environment Functions
The execution environment functions affect and monitor threads, processors, and the
parallel environment. This section discusses the following environment functions:
• omp_set_num_threads
• omp_get_num_threads
• omp_get_max_threads
• omp_get_thread_num
• omp_get_num_procs
• omp_in_parallel
• omp_set_dynamic
• omp_get_dynamic
• omp_set_nested
• omp_get_nested
omp_set_num_threads
#include <omp.h>
void omp_set_num_threads(int num_threads);
212 Exception Handling