legate::ParallelPolicy#
-
class ParallelPolicy#
A helper class that describes parallelization policies for tasks.
A
ParallelPolicy
consists of knobs to control the parallelization policy for tasks in a given scope. To change the parallelization policy of the scope, a newScope
must be created with aParallelPolicy
. Currently, theParallelPolicy
class provides the following parameters:streaming()
(default:false
): When thestreaming()
istrue
in a scope, the runtime executes the tasks in a streaming fashion. For example, if there are two tasksT1
andT2
in the scope, the normal execution would run all parallel instances ofT1
before it would move on toT2
’s, whereas the streaming execution would alternative betweenT1
andT2
, launching a subset of parallel instances at a time that would fit to the memory. The granularity of tasks can be configured by theoverdecompose_factor()
(see below), and if theoverdecompose_factor()
is1
, no streaming would happen even if thestreaming()
istrue
.overdecompose_factor()
(default:1
): When the value is greater than1
, the auto-partitioner will over-decompose the stores when partitioning them; by default, the auto-partitioner createsN
chunks in a store partition when there areN
processors, but if theoverdecompose_factor()
isk
in the scope, it would createkN
chunks in the partition.
Public Functions
-
ParallelPolicy &with_streaming(bool streaming)#
Sets the flag that indicates whether tasks in a given scope should be streamed.
- Parameters:
streaming – A boolean value to set to the streaming flag.
- ParallelPolicy &with_overdecompose_factor(
- std::uint32_t overdecompose_factor
Sets the over-decomposing factor.
See also
set_overdecompose_factor.
- Parameters:
overdecompose_factor – An over-decomposing factor.
-
inline bool streaming() const#
Returns the streaming flag.
- Returns:
true If the streaming is enabled.
- Returns:
false If the streaming is not enabled.
-
inline std::uint32_t overdecompose_factor() const#
Returns the over-decomposing factor.
- Returns:
The over-decomposing factor.
-
bool operator==(const ParallelPolicy &other) const#
Checks equality between
ParallelPolicy
s.- Parameters:
other – A
ParallelPolicy
to compare this with.- Returns:
true If
*this
is the same asother
- Returns:
false Otherwise.
-
bool operator!=(const ParallelPolicy &other) const#
Checks inequality between
ParallelPolicy
s.- Parameters:
other – A
ParallelPolicy
to compare this with.- Returns:
true If
*this
is different fromother
- Returns:
false Otherwise.