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.

REDUCTION({operator | intrinsic } : list)SCHEDULE (type [, chunk])ORDEREDThe real purpose of supporting parallel execution is the distribution of work across the availablethreads. You can explicitly manage work distribution with constructs such as:IF (omp_get_thread_num() .EQ. 0) THEN...ELSE IF (omp_get_thread_num() .EQ. 1) THEN...ENDIFHowever, these constructs are not in the form of directives. The DO...END DO directive pairprovides a convenient mechanism for the distribution of loop iterations across the available threadsin a parallel region. Items to note about clauses are:• Variables declared in a PRIVATE list are treated as private to each processorparticipating in parallel execution of the loop, meaning that a separate copy of thevariable exists on each processor.• Variables declared in a FIRSTPRIVATE list are PRIVATE, and in addition areinitialized from the original object existing before the construct.• Variables declared in a LASTPRIVATE list are PRIVATE, and in addition the thread thatexecutes the sequentially last iteration updates the version of the object that existedbefore the construct.• The REDUCTION clause is as described in the PARALLEL...END PARALLEL section.• The SCHEDULE clause is explained in the following section.• If ORDERED code blocks are contained in the dynamic extent of the DO directive, theORDERED clause must be present. For more information on ORDERED code blocks, seethe ORDERED section.The DO...END DO directive pair directs the compiler to distribute the iterative DO loopimmediately following the !$OMP DO directive across the threads available to the program. TheDO loop is executed in parallel by the team that was started by an enclosing parallel region. If the!$OMP END DO directive is not specified, the !$OMP DO is assumed to end with the enclosedDO loop. DO...END DO directive pairs may not be nested. Branching into or out of a !$OMPDO loop is not supported.294 Chapter 8

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

Saved successfully!

Ooh no, something went wrong!