10.07.2015 Views

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

PGI Fortran Reference manual - The Portland Group

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

OpenMP Directives for <strong>Fortran</strong>goal of the WORKSHARE construct is to effect parallel execution of non-iterative but implicitlydata parallel array assignments, FORALL, and WHERE statements and constructs intrinsic tothe <strong>Fortran</strong> language beginning with <strong>Fortran</strong> 90. <strong>The</strong> <strong>Fortran</strong> structured block contained within aWORKSHARE construct must not contain any user-defined function calls unless the function isELEMENTAL.8.8. Runtime Library RoutinesUser-callable functions are available to the programmer to query and alter the parallel executionenvironment.Unlimited OpenMP thread counts are available in all <strong>PGI</strong> configurations. <strong>The</strong> number of threads isunlicensed in the OpenMP runtime libraries - up to the hard limit of 256 threads.<strong>The</strong> following table summarizes the runtime library calls.Table 35 Runtime Library Routines SummaryRuntime Library Routines with Examplesomp_get_num_threadsReturns the number of threads in the team executing the parallel region from which it is called. When called from a serial region,this function returns 1. A nested parallel region is the same as a single parallel region. By default, the value returned by thisfunction is equal to the value of the environment variable OMP_NUM_THREADS or to the value set by the last previouscall to omp_set_num_threads().<strong>Fortran</strong>integer function omp_get_num_threads()omp_set_num_threadsSets the number of threads to use for the next parallel region.This subroutine can only be called from a serial region of code. If it is called from within a parallel region, or from within asubroutine that is called from within a parallel region, the results are undefined. Further, this subroutine has precedence over theOMP_NUM_THREADS environment variable.<strong>Fortran</strong>omp_get_thread_numsubroutine omp_set_num_threads(scalar_integer_exp)Returns the thread number within the team. <strong>The</strong> thread number lies between 0 and omp_get_num_threads()-1. Whencalled from a serial region, this function returns 0. A nested parallel region is the same as a single parallel region.<strong>Fortran</strong>integer function omp_get_thread_num()omp_get_ancestor_thread_numReturns, for a given nested level of the current thread, the thread number of the ancestor.<strong>Fortran</strong>integer function omp_get_ancestor_thread_num(level)integer levelomp_get_active_level<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 180

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!