par-schedule, Qpar-schedule

Specifies a scheduling algorithm for DO loop iterations.

IDE Equivalent

None

Architectures

IA-32 architecture, Intel® 64 architecture, IA-64 architecture

Syntax

Linux and Mac OS: -par-schedule-keyword[=n]
Windows:  /Qpar-schedule-keyword[[:]n]

Arguments

keyword Specifies the scheduling algorithm. Possible values are:
  static Divides iterations into contiguous pieces.
  dynamic Gets a set of iterations dynamically.
  guided Specifies a minimum number of iterations.
  runtime Defers the scheduling decision until run time.
Is the size of the chunk or the number of iterations for each chunk. For more information, see the descriptions of each keyword below.

Default

OFF The compiler uses default algorithms for performance tuning.

Description

This option specifies a scheduling algorithm for DO loop iterations. It specifies how iterations are to be divided among the threads of the team.

This option affects performance tuning and can provide better performance during auto-parallelization.

Option Description
-par-schedule-static or /Qpar-schedule-static Divides iterations into contiguous pieces (chunks) of size n. The chunks are statically assigned to threads in the team in a round-robin fashion in the order of the thread number. Note that the last chunk to be assigned may have a smaller number of iterations.  
If no n is specified, the iteration space is divided into chunks that are approximately equal in size, and each thread is assigned at most one chunk.
-par-schedule-dynamic or /Qpar-schedule-dynamic Can be used to get a set of iterations dynamically. Assigns iterations to threads in chunks as the threads request them. The thread executes the chunk of iterations, then requests another chunk, until no chunks remain to be assigned.
As each thread finishes a piece of the iteration space, it dynamically gets the next set of iterations. Each chunk contains n iterations, except for the last chunk to be assigned, which may have fewer iterations. If no n is specified, the default is 1.
-par-schedule-guided or /Qpar-schedule-guided Can be used to specify a minimum number of iterations. Assigns iterations to threads in chunks as the threads request them. The thread executes the chunk of iterations, then requests another chunk, until no chunks remain to be assigned.
For a chunk of size 1, the size of each chunk is proportional to the number of unassigned iterations divided by the number of threads, decreasing to 1. For an n with value k (greater than 1), the size of each chunk is determined in the same way with the restriction that the chunks do not contain fewer than k iterations (except for the last chunk to be assigned, which may have fewer than k iterations).  If no n is specified, the default is 1.
-par-schedule-runtime or /Qpar-schedule-runtime Defers the scheduling decision until run time. The scheduling algorithm and chunk size are then taken from the setting of environment variable OMP_SCHEDULE. You cannot specify n with this keyword.

Alternate Options

None