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.

!$OMP SINGLE [Clauses]< Fortran code in body of SINGLE processor section >!$OMP END SINGLE [NOWAIT]Clauses:PRIVATE(list)FIRSTPRIVATE(list)In a parallel region of code, there may be a sub-region of code that will only execute correctly on asingle thread. Instead of ending the parallel region before the sub-region and then starting it upagain after the sub-region, the SINGLE...END SINGLE directive pair lets you convenientlydesignate code that executes on a single thread and is skipped by the other threads. There is animplied barrier on exit from a SINGLE...END SINGLE section of code unless the optionalNOWAIT clause is specified.Nested single process sections are ignored. Branching into or out of a single process section is notsupported.PROGRAM SINGLE_USEINTEGER A(0:1)INTEGER omp_get_thread_num()!$OMP PARALLELA(omp_get_thread_num()) = omp_get_thread_num()!$OMP SINGLEPRINT *, "YOU SHOULD ONLY SEE THIS ONCE"!$OMP END SINGLE!$OMP END PARALLELPRINT *, "A(0)=", A(0), " A(1)=", A(1)ENDThe PRIVATE and FIRSTPRIVATE clauses are as described in the PARALLEL...ENDPARALLEL section.8.6 DO ... END DOThe OpenMP DO...END DO directive uses the following syntax.Syntax:Clauses:!$OMP DO [Clauses ]< Fortran DO loop to be executed in parallel >!$OMP END DO [NOWAIT]PRIVATE(list)FIRSTPRIVATE(list)LASTPRIVATE(list)OpenMP Directives for Fortran 293

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

Saved successfully!

Ooh no, something went wrong!