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...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

the first clause. Clauses on directives may be repeated as needed subject to the restrictions listed inthe description of each clause.The compiler option −mp enables recognition of the parallelization directives. The use of thisoption also implies:−Mreentrantlocal variables are placed on the stack and optimizations that may resultin non-reentrant code are disabled (e.g., −Mnoframe);−Miomutex critical sections are generated around Fortran I/O statements.Many of the directives are presented in pairs and must be used in pairs. In the examples given witheach section, the routines omp_get_num_threads() and omp_get_thread_num() areused; refer to Run-time Library Routines for more information. These routines return the numberof threads currently in the team executing the parallel region and the thread number within theteam, respectively.8.2 PARALLEL ... END PARALLELThe OpenMP PARALLEL END PARALLEL directive is supported using the following syntax.Syntax:Clauses:!$OMP PARALLEL [Clauses]< Fortran code executed in body of parallel region >!$OMP END PARALLELPRIVATE(list)SHARED(list)DEFAULT(PRIVATE | SHARED | NONE)FIRSTPRIVATE(list)REDUCTION([{operator | intrinsic}:] list)COPYIN (list)IF (scalar_logical_expression)This directive pair declares a region of parallel execution. It directs the compiler to create anexecutable in which the statements between PARALLEL and END PARALLEL are executed bymultiple lightweight threads. The code that lies between PARALLEL and END PARALLEL iscalled a parallel region.The OpenMP parallelization directives support a fork/join execution mo<strong>del</strong> in which a singlethread executes all statements until a parallel region is encountered. At the entrance to the parallelregion, a system-dependent number of symmetric parallel threads begin executing all statements in288 Chapter 8

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

Saved successfully!

Ooh no, something went wrong!