Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::ParallelLoopOptions Class Reference

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.

Detailed Description

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.

Member Enumeration Documentation

◆ Partitioner

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.

Note
Currently, this partitioning mode is only available for 1D loop parallelization.

Definition at line 49 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.

Constructor & Destructor Documentation

◆ ParallelLoopOptions()

Arcane::ParallelLoopOptions::ParallelLoopOptions ( )
inline

Member Function Documentation

◆ grainSize()

Integer Arcane::ParallelLoopOptions::grainSize ( ) const
inline

◆ hasGrainSize()

bool Arcane::ParallelLoopOptions::hasGrainSize ( ) const
inline

Indicates if grainSize() is set.

Definition at line 111 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.

Referenced by mergeUnsetValues().

◆ hasMaxThread()

bool Arcane::ParallelLoopOptions::hasMaxThread ( ) const
inline

Indicates if maxThread() is set.

Definition at line 100 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.

Referenced by mergeUnsetValues().

◆ hasPartitioner()

bool Arcane::ParallelLoopOptions::hasPartitioner ( ) const
inline

Indicates if grainSize() is set.

Definition at line 122 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.

Referenced by mergeUnsetValues().

◆ maxThread()

◆ mergeUnsetValues()

void Arcane::ParallelLoopOptions::mergeUnsetValues ( const ParallelLoopOptions & po)
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().

◆ partitioner()

Partitioner Arcane::ParallelLoopOptions::partitioner ( ) const
inline

◆ setGrainSize()

◆ setMaxThread()

void Arcane::ParallelLoopOptions::setMaxThread ( Integer v)
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().

◆ setPartitioner()

void Arcane::ParallelLoopOptions::setPartitioner ( Partitioner v)
inline

Sets the partitioner type.

Definition at line 116 of file arccore/src/base/arccore/base/ParallelLoopOptions.h.

Referenced by mergeUnsetValues().


The documentation for this class was generated from the following file: