Here, @code{true} and @code{false} represent their language-specific
counterparts.
+The dynamic team setting may be initialized at startup by the
+@code{OMP_DYNAMIC} environment variable or at runtime using
+@code{omp_set_dynamic}. If undefined, dynamic adjustment is
+disabled by default.
+
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_dynamic();}
@end multitable
@item @emph{See also}:
-@ref{omp_set_dynamic}
+@ref{omp_set_dynamic}, @ref{OMP_DYNAMIC}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v2.5}, section 3.2.8.
enabled, @code{false} otherwise. Here, @code{true} and @code{false}
represent their language-specific counterparts.
+Nested parallel regions may be initialized at startup by the
+@code{OMP_NESTED} environment variable or at runtime using
+@code{omp_set_nested}. If undefined, nested parallel regions are
+disabled by default.
+
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_nested();}
@end multitable
@item @emph{See also}:
-@ref{omp_set_nested}
+@ref{omp_set_nested}, @ref{OMP_NESTED}
@item @emph{Reference}:
@uref{http://www.openmp.org/, OpenMP specifications v2.5}, section 3.2.10.
The number of threads in the current team. In a sequential section of
the program @code{omp_get_num_threads} returns 1.
+The default team size may be initialized at startup by the
+@code{OMP_NUM_THREADS} environment variable. At runtime, the size
+of the current team may be set either by the @code{NUM_THREADS}
+clause or by @code{omp_set_num_threads}. If none of the above were
+used to define a specific value and @code{OMP_DYNAMIC} is disabled,
+one thread per CPU online is used.
+
@item @emph{C/C++}:
@multitable @columnfractions .20 .80
@item @emph{Prototype}: @tab @code{int omp_get_num_threads();}
@section @code{omp_set_nested} -- Enable/disable nested parallel regions
@table @asis
@item @emph{Description}:
-Enable or disable nested parallel regions, i. e. whether team members
+Enable or disable nested parallel regions, i.e., whether team members
are allowed to create new teams. The function takes the language-specific
equivalent of @code{true} and @code{false}, where @code{true} enables
dynamic adjustment of team sizes and @code{false} disables it.
@section @code{omp_get_wtick} -- Get timer precision
@table @asis
@item @emph{Description}:
-Gets the timer precision, i. e. the number of seconds between two
+Gets the timer precision, i.e., the number of seconds between two
successive clock ticks.
@item @emph{C/C++}:
@node OMP_DYNAMIC
@section @env{OMP_DYNAMIC} -- Dynamic adjustment of threads
@cindex Environment Variable
+@cindex Implementation specific setting
@table @asis
@item @emph{Description}:
Enable or disable the dynamic adjustment of the number of threads
@node OMP_NESTED
@section @env{OMP_NESTED} -- Nested parallel regions
@cindex Environment Variable
+@cindex Implementation specific setting
@table @asis
@item @emph{Description}:
-Enable or disable nested parallel regions, i. e. whether team members
+Enable or disable nested parallel regions, i.e., whether team members
are allowed to create new teams. The value of this environment variable
shall be @code{TRUE} or @code{FALSE}. If undefined, nested parallel
regions are disabled by default.
@node OMP_NUM_THREADS
@section @env{OMP_NUM_THREADS} -- Specifies the number of threads to use
@cindex Environment Variable
+@cindex Implementation specific setting
@table @asis
@item @emph{Description}:
-Specifies the number of threads to use in parallel regions. If undefined
-one thread per CPU online is used. The value of this variable shall be
-positive integer.
+Specifies the default number of threads to use in parallel regions. The
+value of this variable shall be positive integer. If undefined one thread
+per CPU online is used.
@item @emph{See also}:
@ref{omp_set_num_threads}
@node OMP_SCHEDULE
@section @env{OMP_SCHEDULE} -- How threads are scheduled
@cindex Environment Variable
+@cindex Implementation specific setting
@table @asis
@item @emph{Description}:
Allows to specify @code{schedule type} and @code{chunk size}.
@cindex Environment Variable
@table @asis
@item @emph{Description}:
-A patch for this extension has been submitted, but was not yet applied at the
-time of writing.
-
-@item @emph{Reference}:
-@uref{http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00982.html,
-GCC Patches Mailinglist}
-@uref{http://gcc.gnu.org/ml/gcc-patches/2006-05/msg01133.html,
-GCC Patches Mailinglist}
+Binds threads to specific CPUs. The variable should contain a space- or
+comma-separated list of CPUs. This list may contain different kind of
+entries: either single CPU numbers in any order, a range of CPUs (M-N)
+or a range with some stride (M-N:S). CPU numbers are zero based. For example,
+@code{GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"} will bind the initial thread
+to CPU 0, the second to CPU 3, the third to CPU 1, the fourth to
+CPU 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8, 10, 12,
+and 14 respectively and then start assigning back from the beginning of
+the list. @code{GOMP_CPU_AFFINITY=0} binds all threads to CPU 0.
+
+There is no GNU OpenMP library routine to determine whether a CPU affinity
+specification is in effect. As a workaround, language-specific library
+functions, e.g., @code{getenv} in C or @code{GET_ENVIRONMENT_VARIABLE} in
+Fortran, may be used to query the setting of the @code{GOMP_CPU_AFFINITY}
+environment variable. A defined CPU affinity on startup cannot be changed
+or disabled during the runtime of the application.
+
+If this environment variable is omitted, the host system will handle the
+assignment of threads to CPUs.
@end table
@node GOMP_STACKSIZE
@section @env{GOMP_STACKSIZE} -- Set default thread stack size
@cindex Environment Variable
+@cindex Implementation specific setting
@table @asis
@item @emph{Description}:
Set the default thread stack size in kilobytes. This is in opposition
The @var{DATA} argument is a pointer to a structure used to
communicate data in and out of the subfunction, as discussed
-above wrt FIRSTPRIVATE et al.
+above with respect to FIRSTPRIVATE et al.
The @var{NUM_THREADS} argument is 1 if an IF clause is present
and false, or the value of the NUM_THREADS clause, if