The MP_SCHEDTYPE directive sets a default run-time scheduling type. The scheduling type does not effect the semantics of the program, but may affect performance.
The MP_SCHEDTYPE directive takes the following form: [See Note]
Specifies that when a thread becomes available for more work, it is assigned the next chunksize of the remaining iterations. This is sometimes described as threads competing for iterations. If less than one chunksize of iterations remains, the next available thread is assigned all the remaining iterations.
Similar to DYNAMIC, except that the number of iterations assigned is relatively large at the beginning of the loop, and decreases exponentially as threads become available for more work. The number of iterations assigned is not necessarily divisible by chunksize.
For this scheduling type, chunksize is the minimum number of iterations that can be assigned when a thread becomes available for work. When the number of iterations remaining to be assigned is less than or equal to chunksize, all the remaining iterations are assigned to the next available thread.
In some cases, setting a chunksize greater than 1 improves execution efficiency as the loop nears termination, by reducing contention among the threads for the small number of remaining iterations.
Specifies that chunks of iterations are to be assigned to threads in a round-robin fashion.
Specifies that environment variables are to be used to manage scheduling.
Environment variable names are case-sensitive, but their values are not case-sensitive. Environment variables used are:
Assigns each slave thread one contiguous group of iterations. Each thread is assigned an approximately equal number of iterations.
STATIC is the default scheduling type when no other method has been specified.
Rules and Behavior
The MP_SCHEDTYPE directive can appear anywhere in a Compaq Fortran program. When more than one MP_SCHEDTYPE directive appears in the same program, the most recently encountered directive is used.
The scheduling type used for any parallel DO loop is determined from the following (in the order shown):
The DYNAMIC and GUIDED scheduling types introduce a certain amount of overhead to manage the continuing assignment of iterations to threads during the execution of the loop. However, this overhead is sometimes offset by better load balancing when the average execution time of iterations is not uniform throughout the DO loop.
The STATIC and INTERLEAVED types assign all of the iterations to the threads in advance, with each thread receiving approximately equal numbers of iterations. One of these is usually the most efficient scheduling type when the average execution time of iterations is uniform throughout the DO loop.
c$MP_SCHEDTYPE = mode
For More Information:
For details on chunksize, such as defaults, see Section 188.8.131.52.