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>Clause Applies to DescriptionSECTIONSSCHEDULE(type [,chunk])SHAREDUNTIEDDO ... END DOPARALLEL DO...END PARALLEL DOPARALLELPARALLEL DO ...END PARALLEL DOPARALLEL SECTIONS ...END PARALLEL SECTIONSPARALLEL WORKSHARETASKTASKWAITApplies to the FOR directive, allowing the user tospecify the chunking method for parallelization. Work isassigned to threads in different manners depending onthe scheduling type or chunk size used.Specifies that one or more variables should be sharedamong all threads. All threads within a team access thesame storage area for shared variablesSpecifies that any thread in the team can resume thetask region after a suspension.8.6.1. COLLAPSE (n)<strong>The</strong> COLLAPSE(n) clause specifies how many loops are associated with the loop construct.<strong>The</strong> parameter of the collapse clause must be a constant positive integer expression. If noCOLLAPSE clause is present, the only loop that is associated with the loop construct is the onethat immediately follows the construct.If more than one loop is associated with the loop construct, then the iterations of all associatedloops are collapsed into one larger iteration space, which is then divided according to theschedule clause. <strong>The</strong> sequential execution of the iterations in all associated loops determines theorder of the iterations in the collapsed iteration space.If the loop directive contains a COLLAPSE clause then there may be more than one associatedloop.8.6.2. COPYIN (list)<strong>The</strong> COPYIN(list) clause allows threads to access the master thread's value, for a threadprivatevariable. You assign the same value to threadprivate variables for each thread in the teamexecuting the parallel region; that is, for each variable specified, the value of the variable in themaster thread of the team is copied to the threadprivate copies at the beginning of the parallelregion.<strong>The</strong> COPYIN clause applies only to THREADPRIVATE common blocks. If you specify aCOPYIN clause, here are a few tips:‣ You cannot specify the same entity name more than once in the list.‣ You cannot specify the same entity name in separate COPYIN clauses of the same directive.‣ You cannot specify both a common block name and any variable within that same namedcommon block in the list.<strong>PGI</strong> <strong>Fortran</strong> <strong>Reference</strong> Guide 159

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

Saved successfully!

Ooh no, something went wrong!