Admin Production ni-theme
Current Publication

omp_get_num_threads

LabWindows/CVI

omp_get_num_threads

int omp_get_num_threads (void);

Purpose

Returns the number of threads in the current region.

Note 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 precedence):

  1. The value specified by the num_threads clause, else
  2. The value specified by the omp_set_num_threads function, else
  3. The value of the OMP_NUM_THREADS environment variable, else
  4. 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.

Binding thread set: current team

Parameters

None.

Return Value

Name Type Description
returnValue int The number of threads used in the current region.

1—If called from a sequential part of the application.
N—If called from within a parallel region, where N is the number of threads used to execute the region.

Additional Information

Library: OpenMP Run-Time Library

Include file: omp.h

LabWindows/CVI compatibility: LabWindows/CVI 2013 and later