Implementation of guided scheduling.
More...
|
static Schedule | Static [get] |
| The static scheduling strategy. Iterations are divided amongst threads in round-robin fashion. Each thread gets a 'chunk' of iterations, determined by the chunk size. If no chunk size is specified, it's computed as total iterations divided by number of threads. More...
|
|
static Schedule | Dynamic [get] |
| The dynamic scheduling strategy. Iterations are managed in a central queue. Threads fetch chunks of iterations from this queue when they have no assigned work. If no chunk size is defined, a basic heuristic is used to determine a chunk size. More...
|
|
static Schedule | Guided [get] |
| The guided scheduling strategy. Similar to dynamic, but the chunk size starts larger and shrinks as iterations are consumed. The shrinking formula is based on the remaining iterations divided by the number of threads. The chunk size parameter sets a minimum chunk size. More...
|
|
static Schedule | Runtime [get] |
| Runtime-defined scheduling strategy. Schedule is determined by the 'OMP_SCHEDULE' environment variable. Expected format: "schedule[,chunk_size]", e.g., "static,128", "guided", or "dynamic,3". More...
|
|
static Schedule | WorkStealing [get] |
| The work-stealing scheduling strategy. Each thread gets its own local queue of iterations to execute. If a thread's queue is empty, it randomly selects another thread's queue as its "victim" and steals half of its remaining iterations. The chunk size parameter specifies how many iterations a thread should execute from its local queue at a time. More...
|
|
Implementation of guided scheduling.
◆ LoopInit()
override void DotMP.Schedulers.GuidedScheduler.LoopInit |
( |
int |
start, |
|
|
int |
end, |
|
|
uint |
num_threads, |
|
|
uint |
chunk_size |
|
) |
| |
|
inlinevirtual |
Override method for LoopInit, is called when first starting a guided loop.
- Parameters
-
start | The start of the loop, inclusive. |
end | The end of the loop, exclusive. |
num_threads | The number of threads. |
chunk_size | The chunk size. |
Implements DotMP.Schedule.
◆ LoopNext()
override void DotMP.Schedulers.GuidedScheduler.LoopNext |
( |
int |
thread_id, |
|
|
out int |
start, |
|
|
out int |
end |
|
) |
| |
|
inlinevirtual |
Override method for LoopNext, is called to get the bounds of the next chunk to execute.
- Parameters
-
thread_id | The thread ID. |
start | The start of the chunk, inclusive. |
end | The end of the chunk, exclusive. |
- Exceptions
-
OverflowException | Thrown if there's an internal scheduler overflow. |
Implements DotMP.Schedule.
◆ chunk_size
uint DotMP.Schedulers.GuidedScheduler.chunk_size |
|
private |
◆ end
int DotMP.Schedulers.GuidedScheduler.end |
|
private |
End of the loop, exclusive.
◆ num_threads
uint DotMP.Schedulers.GuidedScheduler.num_threads |
|
private |
◆ sched_lock
object DotMP.Schedulers.GuidedScheduler.sched_lock |
|
private |
Lock for scheduling purposes.
◆ start
int DotMP.Schedulers.GuidedScheduler.start |
|
private |
Start of the loop, inclusive.
The documentation for this class was generated from the following file: