Go to main content
Oracle® Developer Studio 12.6: OpenMP API User's Guide

Exit Print View

Updated: June 2017
 
 

9.3 Dynamic Adjustment of the Number of Threads

This implementation provides the ability to dynamically adjust the number of threads. Dynamic adjustment is enabled by default. Set the OMP_DYNAMIC environment variable to FALSE or call the omp_set_dynamic() routine with a false argument to disable dynamic adjustment.

When a thread encounters a parallel construct, the number of threads delivered by this implementation is determined according to Algorithm 2.1 in the OpenMP 4.0 Specification. In exceptional situations, such as lack of system resources, the number of threads supplied will be less than that described in Algorithm 2.1.

If the implementation cannot supply the requested number of threads and dynamic adjustment of the number of threads is enabled, then program execution will continue with the smaller number of threads. If SUNW_MP_WARN is set to TRUE or a callback function is registered through a call to sunw_mp_register_warn(), a warning message is issued.

If the implementation cannot supply the requested number of threads and dynamic adjustment of the number of threads is disabled, then the program will issue an error message and the program will stop execution.