Sun Studio 12 Update 1: Fortran User's Guide

D.5 Cray Parallelization Directives


Note –

Legacy Sun and Cray parallelization directives are now deprecated and ignored. Use of the OpenMP API for parallelization on Solaris SPARC and x86 platforms is preferred. See the OpenMP API User’s Guide for information on migrating legacy applications to OpenMP.


Cray-style parallelization directives are detailed in the chapter on parallelization in the Fortran Programming Guide. Requires -mp=cray compiler option.

Table D–4 Cray Parallelization Directives Summary

Format

CMIC$ directive qualifiers : initial line

CMIC$& [more_qualifiers] : continuation line

Fixed format. Directive-indicator may be C (as shown here), c, *, or !. With f95 free-format, leading blanks can appear before !MIC$.

DOALL Directive

CMIC$ DOALL SHARED(list), PRIVATE(list) [, more_qualifiers]

Parallelize loop that follows. Qualifiers are: 

Scoping qualifiers are required (unless list is empty)—all variables in the loop must appear in a PRIVATE or SHARED clause:

PRIVATE(list) declare names on list PRIVATE

SHARED(list) declare names on list SHARED

AUTOSCOPE automatically determine scope of variables

The following are optional: 

MAXCPUS(n) use no more than n threads

SAVELAST save last value of all private variables. Only one scheduling qualifier may appear:

GUIDED equivalent to Sun-style GSS(64)

SINGLE equivalent to Sun-style SELF(1)

CHUNKSIZE(n) equivalent to Sun-style SELF(n)

NUMCHUNKS(m) equivalent to Sun-style SELF(n/m)

The default scheduling is Sun-style STATIC, for which there is no Cray-style equivalent. Interpretations of these scheduling qualifiers differ between Sun and Cray style. Check the Fortran Programming Guide for details.

TASKCOMMON Directive

CMIC$ TASKCOMMON block_name

Declares variables in the named common block as thread-private— private to a thread, but global within the thread. Declaring a common block TASKCOMMON requires that this directive appear immediately after every common declaration of that block.

DOSERIAL Directive

CMIC$ DOSERIAL

Disables parallelization of the loop that follows. 

DOSERIAL* Directive

CMIC$ DOSERIAL*

Disables parallelization of the loop nest that follows.