omp_get_max_threads
int omp_get_max_threads (void);
Purpose
Returns the number of threads used for subsequent parallel regions that do not specify a num_threads clause.
![]() |
Note The OpenMP Run-Time Library is available only in the LabWindows/CVI Full Development System. |
LabWindows/CVI determines the number of threads used for a parallel region by the following rules (in order of precdence):
- The value specified by the num_threads clause, else
- The value specified by the omp_set_num_threads function, else
- The value of the OMP_NUM_THREADS environment variable, else
- The number of logical processors
For more information on the rules governing the number of threads used to execute a parallel region, refer to Section 2.4.1 of the OpenMP 2.5 specification.
The behavior of this function is the same regardless of whether you call it from the sequential region or a parallel region of an application.
Binding thread set: all threads
Parameters
None.
Return Value
Name | Type | Description |
returnValue | int | The number of threads used for subsequent parallel regions that do not specify a num_threads clause. |
Additional Information
Library: OpenMP Run-Time Library
Include file: omp.h
LabWindows/CVI compatibility: LabWindows/CVI 2013 and later
Example
Refer to OpenMP\2dfft_omp.cws for an example of using the omp_get_max_threads function.