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><strong>Fortran</strong> directivesAllow users to place hints in the source code to help the compiler generate more efficientcode. You typically use directives to control the actions of the compiler in a particular portionof a program without affecting the program as a whole. You place them in your source codewhere you want them to take effect; and they usually stay in effect from the point whereincluded until the end of the compilation unit or until another directive or C/C++ pragmachanges its status.<strong>Fortran</strong> directives and C/C++ pragmas include a parallel region construct for writing coarsegrain SPMD programs, work-sharing constructs which specify that DO loop iterations shouldbe split among the available threads of execution, and synchronization constructs.<strong>The</strong> data environment is controlled either by using clauses on the directives or with additionaldirectives.Runtime library routinesAre available to query the parallel runtime environment, for example to determine how manythreads are participating in execution of a parallel region.Environment variablesAre available to control the execution behavior of parallel programs. For more information onOpenMP, refer to www.openmp.org.8.1.2. TerminologyFor OpenMP 3.0 there are a number of terms for which it is useful to have common definitions.ThreadAn execution entity with a stack and associated static memory, called threadprivate memory.‣ An OpenMP thread is a thread that is managed by the OpenMP runtime system.‣ A thread-safe routine is a routine that performs the intended function even when executedconcurrently, that is, by more than one thread.RegionAll code encountered during a specific instance of the execution of a given construct or of anOpenMP library routine. A region includes any code in called routines as well as any implicitcode introduced by the OpenMP implementation.Regions are nested if one region is (dynamically) enclosed by another region, that is, a regionis encountered during the execution of another region. <strong>PGI</strong> currently does not support nestedparallel regions.Parallel regionIn OpenMP 3.0 there is a distinction between a parallel region and an active parallel region. Aparallel region can be either inactive or active.‣ An inactive parallel region is executed by a single thread.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 151

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

Saved successfully!

Ooh no, something went wrong!