The CHUNK directive sets a default chunksize to adjust the number
of iterations assigned to a thread. The effect of CHUNK varies,
depending on the scheduling type.
The CHUNK directive takes the following form:
- c$PAR CHUNK = chunksize
Is one of the following: C (or c), !, or * (see
Is a scalar integer expression.
Rules and Behavior
The effect of chunksize varies by scheduling type, as
- For DYNAMIC and INTERLEAVED scheduling, iterations
are always assigned to threads in chunksized
groups. If the total number of iterations is not divisible
by chunksize, the last group has fewer than
- For GUIDED scheduling, chunksize is the minimum
number of iterations that can be assigned to a thread. If less
than chunksize iterations remain, the next available
thread is assigned all of the remaining iterations.
- For STATIC scheduling, chunksize is ignored and
has no effect.
The chunksize used for any parallel DO loop is determined by the
following (in the order shown):
- A chunksize specified in the PDO directive for the current
- A user-specified default specified in the most recent
- If the scheduling for the current DO loop is INTERLEAVED,
DYNAMIC, GUIDED, or RUNTIME, a user-specified default specified
in the environment variable MP_CHUNK
- The compiler default of one
Note: The following form is also allowed:
c$CHUNK = chunksize
For More Information:
For details about scheduling types, see
Previous Page Next Page Table of Contents