Go to main content
Oracle Developer Studio 12.5 Man Pages

Exit Print View

Updated: June 2017
 
 

use_threads (3p)

Name

use_threads - Sets the number of threads to use for subsequent parallel regions

Synopsis

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);

Description

Oracle Solaris Studio Performance Library                      use_threads(3P)



NAME
       use_threads - Sets the number of threads to use for subsequent parallel
       regions

SYNOPSIS
       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);



PURPOSE
       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 Inter-
       face  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 fol-
       lows:  "The  effect of this function depends on whether dynamic adjust-
       ment 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 maximum num-
       ber 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."




                                  7 Nov 2015                   use_threads(3P)