HOME
| OPENMP API Specification: Version 5.1 November 2020

3.2.3  omp_get_max_threads

Summary The omp_get_max_threads routine returns an upper bound on the number of threads that could be used to form a new team if a parallel construct without a num_threads clause were encountered after execution returns from this routine.

Format

SVG-Viewer needed.

 

 
int omp_get_max_threads(void);  

SVG-Viewer needed.

SVG-Viewer needed.

 

 
integer function omp_get_max_threads()  

SVG-Viewer needed.

Binding The binding task set for an omp_get_max_threads region is the generating task.

Effect The value returned by omp_get_max_threads is the value of the first element of the nthreads-var ICV of the current task. This value is also an upper bound on the number of threads that could be used to form a new team if a parallel region without a num_threads clause were encountered after execution returns from this routine.

SVG-Viewer needed.

Note – The return value of the omp_get_max_threads routine can be used to allocate sufficient storage dynamically for all threads in the team formed at the subsequent active parallel region.

SVG-Viewer needed.

Cross References