Contents
use_threads - Sets the number of threads to use for subse-
quent parallel regions
SUBROUTINE USE_THREADS(NTHREADS)
INTEGER NTHREADS
SUBROUTINE USE_THREADS_64(NTHREADS)
INTEGER*8 NTHREADS
F95 INTERFACE
SUBROUTINE USE_THREADS(NTHREADS)
INTEGER :: NTHREADS
SUBROUTINE USE_THREADS_64(NTHREADS)
INTEGER(8) :: NTHREADS
C INTERFACE
#include <sunperf.h>
void use_threads(int nthreads);
void use_threads_64(long nthreads);
USE_THREADS(NTHREADS) sets the number of threads to
MAX(1,NTHREADS) to use for subsequent parallel regions by
calling library routine OMP_SET_NUM_THREADS which is part of
the OpenMP Fortran Application Program Interface. From the
OpenMP Fortran Application Program Interface which can be
found at the official OpenMP website,
http://www.openmp.org/,
OMP_SET_NUM_THREADS(scalar_integer_expression), where
scalar_integer_expression = MAX(1,NTHREADS), is described as
follows: "The effect of this function depends on whether
dynamic adjustment of the number of threads is enabled. If
dynamic adjustment is disabled, the value of the
scalar_integer_expression is used as the number of threads
for all subsequent parallel regions prior to the next call
to this function; otherwise, the value is used as the max-
imum number of threads that will be used. This function has
effect only when called from serial portions of the program.
If it is called from a portion of the program where the
OMP_IN_PARALLEL function returns .TRUE., the behavior of
this function is unspecified."