CnC
|
Interface for partitioners: configuring how ranges are partitioned. More...
Inherited by tag_partitioner< grainSize >.
Public Types | |
typedef range_is_range_type | split_type |
Public Member Functions | |
template<typename Range , typename StepInstance > | |
bool | divide_and_originate (Range &range, StepInstance &si) const |
divide given range into in arbitrary number of ranges of type Range More... | |
Protected Member Functions | |
template<typename Range > | |
bool | is_divisible (const Range &range) const |
return true, if given range is divisible, false otherwise | |
int | grain_size (size_t fullRangeSize) const |
Interface for partitioners: configuring how ranges are partitioned.
The default_partitioner implements the template interface that each partitioner must satisfy.
Given a range type "R", a partitioner "P" must provide a copy-constructor and the following (template) interface:
The default_partitioner can be parametrized as follows: Set template argument to > 0 to let it use a fixed grainsize. If it equals 0, the grainsize is set to "original_rangeSize / #threads / 4" If it is < 0, the grainsize of the given range is obeyed.
Definition at line 58 of file default_partitioner.h.
typedef range_is_range_type split_type |
set to range_is_tag_type if tag is self-dividing, e.g. if the range-type is also the tag-type as passed to the step set to range_is_range_type if tag is undivisible, e.g. if range-type != step_type
Definition at line 91 of file default_partitioner.h.
|
inline |
divide given range into in arbitrary number of ranges of type Range
Call si.originate_range( r ) for each new range. The original - but modified - range must not be passed to originate_range! If tag-types are self-dividing (e.g. if range-type == tag-type) you should call "originate" instead of "originate_range" for leaves of the recursive range-tree.
The aggregated set of the members of the sub-ranges applied to "t.originate[_range]" must equal the set of member in given range. Overlapping ranges or gaps may lead to arbitrary effects.
range | the original range to split, may be altered |
si | opaque object, call t.originate[_range]( r ) for all split-off sub-ranges |
Definition at line 150 of file default_partitioner.h.
|
inlineprotected |
Definition at line 119 of file default_partitioner.h.