Fortran Programming Guide

Qualifiers (Cray Style)

For Cray-style directives, the PRIVATE qualifier is required. Each variable within the DO loop must be qualified as private or shared, and the DO loop index must always be private. The following table summarizes available Cray-style qualifiers.

Table 10-7 DOALL Qualifiers (Cray Style)

Qualifier 

Assertion 

SHARED( v1, v2, ... )

Share the variables v1, v2, ... between parallel processes. That is, they are accessible to all the tasks.

PRIVATE( x1, x2, ... )

Do not share the variables x1, x2, ... between parallel processes. That is, each task has its own private copy of these variables.

SAVELAST

Save the values of private variables from the last DO iteration.

MAXCPUS( n )

Use no more than n CPUs.

For Cray-style directives, the DOALL directive allows a single scheduling qualifier, for example, !MIC$& CHUNKSIZE(100). Table 10-8 shows the Cray-style DOALL directive

Table 10-8 DOALL Cray Scheduling

Qualifier 

Assertion 

GUIDED

Distribute the iterations by use of guided self-scheduling. 

This distribution minimizes synchronization overhead, with acceptable dynamic load balancing. 

SINGLE

Distribute one iteration to each available processor.

CHUNKSIZE( n )

Distribute n iterations to each available processor.

n may be an expression. For best performance, n must be an integer constant. Example: With 100 iterations and CHUNKSIZE(4), distribute 4 iterations to each CPU.

NUMCHUNKS( m )

If there are n iterations, distribute n/m iterations to each available processor. There can be one smaller residual chunk.

m is an expression. For best performance, m must be an integer constant. Example: With 100 iterations and NUMCHUNKS(4), distribute 25 iterations to each CPU.

scheduling qualifiers:

The f77 default scheduling type is the Sun-style STATIC. The f90 default is GUIDED.