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>‣ You cannot specify both a common block name and any variable within that same namedcommon block in separate COPYIN clauses of the same directive.8.6.3. COPYPRIVATE(list)<strong>The</strong> COPYPRIVATE(list) clause specifies that one or more variables should be shared among allthreads. This clause provides a mechanism to use a private variable to broadcast a value from onemember of a team to the other members.You use a COPYPRIVATE(list) clause on an END SINGLE directive to cause the variables inthe list to be copied from the private copies in the single thread that executes the SINGLE regionto the other copies in all other threads of the team at the end of the SINGLE region.<strong>The</strong> COPYPRIVATE clause must not appear on the same END SINGLE directive as a NOWAIT clause.<strong>The</strong> compiler evaluates a COPYPRIVATE clause before any threads have passed the implied BARRIERdirective at the end of that construct.8.6.4. DEFAULT<strong>The</strong> DEFAULT clause specifies the behavior of unscoped variables in a parallel region, suchas the data-sharing attributes of variables. <strong>The</strong> DEFAULT clause lets you specify the defaultattribute for variables in the lexical extent of the parallel region. Individual clauses specifyingPRIVATE, SHARED, and so on, override the declared DEFAULT.Specifying DEFAULT(NONE) declares that there is no implicit default. With this declaration,each variable in the parallel region must be explicitly listed with an attribute of PRIVATE,SHARED, FIRSTPRIVATE, LASTPRIVATE, or REDUCTION.8.6.5. FIRSTPRIVATE(list)<strong>The</strong> FIRSTPRIVATE(list) clause specifies that each thread should have its own instance of avariable, and that each variable in the list should be initialized with the value of the originalvariable, because it exists before the parallel construct.Variables that appear in the list of a FIRSTPRIVATE clause are subject to the same semantics asPRIVATE variables; however, these variables are initialized from the original object that existsprior to entering the parallel region.If a directive construct contains a FIRSTPRIVATE argument to a Message Passing Interface(MPI) routine performing non-blocking communication, the MPI communication must completebefore the end of the construct.8.6.6. IF()<strong>The</strong> IF() clause specifies whether a loop should be executed in parallel or in serial.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 160

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

Saved successfully!

Ooh no, something went wrong!