OpenMP* Run-time Library Routines
OpenMP* provides run-time library routines to help you manage your program in parallel mode. Many of these run-time library routines have corresponding environment variables that can be set as defaults. The run-time library routines let you dynamically change these factors to assist in controlling your program. In all cases, a call to a run-time library routine overrides any corresponding environment variable.
Running OpenMP runtime library routines may initialize the OpenMP runtime environment, which might cause a situation where subsequent programmatic setting of OpenMP environment variables has no effect. To avoid this situation, you can use the Intel extension routine
kmp_set_defaults()to set OpenMP environment variables.
The compiler supports all the OpenMP* run-time library routines. Refer to the OpenMP* API specification for detailed information about using these routines.
Include the appropriate declarations of the routines in
your source codeby adding a statement similar to the following:
The header files are provided in the
..\include(Windows*) directory of your compiler installation.
Some of the routines interfaces have offload equivalents. The offload equivalent takes two additional arguments to specify the target type and target number. For more information, see
Calling Functions on the CPU to Modify the Coprocessor's Execution Environment.
Execution Environment Routines
Use these routines to monitor and influence threads and the parallel environment.
void omp_set_num_threads(int nthreads)
Sets the number of threads to use for subsequent parallel regions created by the calling