12.07.2015 Views

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

PGI Fortran - Servidor WWW del Cluster Ladon-Hidra

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.

8 OpenMP Directives for FortranThe PGF77 and PGF95 Fortran compilers support the OpenMP Fortran Application ProgramInterface. The OpenMP shared-memory parallel programming mo<strong>del</strong> is defined by a collection ofcompiler directives, library routines, and environment variables that can be used to specify sharedmemoryparallelism in Fortran programs. The directives include a parallel region construct forwriting coarse grain SPMD programs, work-sharing constructs which specify that DO loopiterations should be split among the available threads of execution, and synchronization constructs.The data environment is controlled using clauses on the directives or with additional directives.Run-time library routines are provided to query the parallel runtime environment, for example todetermine how many threads are participating in execution of a parallel region. Finally,environment variables are provided to control the execution behavior of parallel programs. Formore information on OpenMP, see http://www.openmp.org.For an introduction to how to execute programs that use multiple processors along with somepointers to example code, see “Parallel Programming Using <strong>PGI</strong> Compilers” (Section 1.4 ) in the<strong>PGI</strong> User’s Guide.8.1 Parallelization DirectivesParallelization directives are comments in a program that are interpreted by the <strong>PGI</strong> Fortrancompilers when the option −mp is specified on the command line. The form of a parallelizationdirective is:sentinel directive_name [clauses]With the exception of the SGI-compatible DOACROSS directive, the sentinel must be !$OMP,C$OMP, or *$OMP, must start in column 1 (one), and must appear as a single word withoutembedded white space. The sentinel marking a DOACROSS directive is C$. Standard Fortransyntax restrictions (line length, case insensitivity, etc.) apply to the directive line. Initial directivelines must have a space or zero in column six and continuation directive lines must have acharacter other than space or zero in column six. Continuation lines for C$DOACROSS directivesare specified using the C$& sentinel.The order in which clauses appear in the parallelization directives is not significant. Commasseparate clauses within the directives, but commas are not allowed between the directive name andOpenMP Directive for Fortran 287

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

Saved successfully!

Ooh no, something went wrong!