Struct partition_hints

Struct Documentation

struct concore::v1::partition_hints

Hints to alter the behavior of a conc_for() or conc_reduce() algorithms.

The hints in this structure can influence the behavior of the conc_for() and conc_reduce() algorithms, but the algorithms can decide to ignore these hints.

In general, the algorithms performs well on a large variety of cases, when the functions being executed per element are not extremely fast. Therefore, manually giving hints to it is not usually needed. If the operations are really fast, the user might want to play with the granularity to ensure that the work unit is sufficiently large.

See

partition_method, conc_for(), conc_reduce()

Public Members

partition_method method_ = partition_method::auto_partition

The method of partitioning the input range.

int granularity_ = {-1}

The granularity of the algorithm.

When choosing how many iterations to handle in one task, this parameter can instruct the algorithm to not place less than the value here. This can be used when the iterations are really small, and the task management overhead can become significant.

Does not apply to the upfront_partition method

int tasks_per_worker_ = {-1}

The (maximum) number of tasks to create per worker

Whenever this is set, we ensure that we don’t break the work into too many tasks. It has a similar effect to setting the granularity.

If, for example, this is set to 10, and we have 8 workers, then the upfront partition will create maximum 80 tasks. The auto partition will not create more than 80 tasks.