Technical data

72
Chapter 5: Fortran Enhancements for Multiprocessors
The C$DOACROSS directive has the form
C$DOACROSS [clause [ , clause] ]
where a clause is one of the following:
SHARE (variable list)
LOCAL (variable list)
LASTLOCAL (variable list)
REDUCTION (scalar variable list)
IF (logical expression)
CHUNK=integer expression
MP_SCHEDTYPE=schedule type
The meaning of each clause is discussed below. All of these clauses are
optional.
SHARE, LOCAL, LASTLOCAL
These are lists of variables as discussed in the Analyzing Data
Dependencies for Multiprocessing on page 79. A variable may appear in
only one of these lists. To make the task of writing these lists easier, there are
several defaults. The loop-iteration variable is LASTLOCAL by default. All
other variables are SHARE by default.
LOCAL is a little faster than LASTLOCAL, so if you do not need the nal
value, it is good practice to put the DO loop index variable into the LOCAL
list, although this is not required.
Only variables can appear in these lists. In particular, COMMON blocks
cannot appear in a LOCAL list (but see the discussion of local COMMON
blocks in Advanced Features on page 97). The SHARE, LOCAL, and
LASTLOCAL lists give only the names of the variables. If any member of the
list is an array, it is listed without any subscripts.
Note: There is a minor aw in the way unlisted variables default to SHARE.
There must be at least one reference to the variable in a nonparallel region or
at least one appearance of that variable in the SHARE list of some loop. If
not, the compiler will complain that the variable in the multiprocessed loop
has not been previously referenced.