Execution options for a parallel loop in multi-threading. More...
#include <arccore/base/ParallelLoopOptions.h>
Public Types | |
| enum class | Partitioner { Auto = 0 , Static = 1 , Deterministic = 2 } |
| Partitioner type. More... | |
Public Member Functions | |
| Int32 | maxThread () const |
| Maximum number of allowed threads. | |
| void | setMaxThread (Integer v) |
| Sets the maximum number of allowed threads. | |
| bool | hasMaxThread () const |
| Indicates if maxThread() is set. | |
| Integer | grainSize () const |
| Size of an iteration interval. | |
| void | setGrainSize (Integer v) |
| Sets the size (approximate) of an iteration interval. | |
| bool | hasGrainSize () const |
| Indicates if grainSize() is set. | |
| Partitioner | partitioner () const |
| Partitioner type. | |
| void | setPartitioner (Partitioner v) |
| Sets the partitioner type. | |
| bool | hasPartitioner () const |
| Indicates if grainSize() is set. | |
| void | mergeUnsetValues (const ParallelLoopOptions &po) |
| Merges the unmodified values of the instance with those of po. | |
Execution options for a parallel loop in multi-threading.
This class allows specifying execution parameters for a parallel loop.
Definition at line 34 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
|
strong |
Partitioner type.
| Enumerator | |
|---|---|
| Auto | Leaves the partitioner to manage partitioning and scheduling (default). |
| Static | Uses static partitioning. In this mode, grainSize() is not used, and partitioning depends only on the number of threads and the iteration interval. Note that the scheduling remains dynamic, so it is not necessarily the same thread that will execute the same iteration block. |
| Deterministic | Uses static partitioning and scheduling. This mode is similar to Partitioner::Static, but the scheduling is deterministic for task assignment: the value returned by TaskFactory::currentTaskIndex() is deterministic.
|
Definition at line 49 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
|
inline |
Definition at line 77 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
|
inline |
Size of an iteration interval.
Definition at line 103 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by Arcane::Accelerator::Impl::RunCommandLaunchInfo::computeParallelLoopOptions(), Arcane::Parallel::Foreach(), Arcane::Parallel::Foreach(), and mergeUnsetValues().
|
inline |
Indicates if grainSize() is set.
Definition at line 111 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by mergeUnsetValues().
|
inline |
Indicates if maxThread() is set.
Definition at line 100 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by mergeUnsetValues().
|
inline |
Indicates if grainSize() is set.
Definition at line 122 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by mergeUnsetValues().
|
inline |
Maximum number of allowed threads.
Definition at line 87 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by Arcane::Accelerator::Impl::RunCommandLaunchInfo::computeParallelLoopOptions(), mergeUnsetValues(), and Arcane::Accelerator::WorkGroupLoopRangeBase< IsCooperativeLaunch, IndexType_ >::setBlockSize().
|
inline |
Merges the unmodified values of the instance with those of po.
Definition at line 127 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
References grainSize(), hasGrainSize(), hasMaxThread(), hasPartitioner(), maxThread(), partitioner(), setGrainSize(), setMaxThread(), and setPartitioner().
|
inline |
Partitioner type.
Definition at line 114 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by mergeUnsetValues().
|
inline |
Sets the size (approximate) of an iteration interval.
Definition at line 105 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by Arcane::arcaneParallelForeach(), Arcane::arcaneParallelForeach(), Arcane::Accelerator::Impl::RunCommandLaunchInfo::computeParallelLoopOptions(), Arcane::Accelerator::Impl::MultiThreadAlgo::doScan(), Arcane::TBBTaskImplementation::executeParallelFor(), Arcane::Parallel::Foreach(), Arcane::Parallel::Foreach(), mergeUnsetValues(), and Arcane::Accelerator::WorkGroupLoopRangeBase< IsCooperativeLaunch, IndexType_ >::setBlockSize().
|
inline |
Sets the maximum number of allowed threads.
If v is 0 or 1, the execution will be sequential. If v is greater than ConcurrencyBase::maxAllowedThread(), the latter value will be used.
Definition at line 94 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by mergeUnsetValues().
|
inline |
Sets the partitioner type.
Definition at line 116 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.
Referenced by mergeUnsetValues().