Purpose
This function returns the maximum number of threads that can execute concurrently in a single parallel region. The return value is equal to the maximum value that can be returned by the omp_get_num_threads function. If you use omp_set_num_threads to change the number of threads, subsequent calls to omp_get_max_threads will return the new value.
The function has global scope, which means that the maximum value it returns applies to all functions, subroutines, and compilation units in the program. It returns the same value whether executing from a serial or parallel region.
You can use omp_get_max_threads to allocate maximum-sized data structures for each thread when you have enabled dynamic thread adjustment by passing omp_set_dynamic an argument which evaluates to .TRUE.
Class
Function.
Argument Type and Attributes
None.
Result Type and Attributes
Default integer.
Result Value
The maximum number of threads that can execute concurrently in a single parallel region.