Name

auto_partitioner Class — A class that models an adaptive partitioner that monitors the work-stealing actions of the task_scheduler to manage the number of splits performed.

Synopsis

#include "tbb/partitioner.h"

class auto_partitioner;

Description

The class auto_partitioner models an adaptive partitioner that limits the number of splits needed for load balancing by reacting to work-stealing events.

The range is first divided into SI subranges, where SI is proportional to the number of threads created by the task scheduler. These subranges are executed to completion by tasks unless they are stolen. If a subrange is stolen by an idle thread, the auto_partitioner further subdivides the range to create additional subranges.

The auto_partitioner creates additional subranges only if threads are actively stealing work. If the load is well balanced, the use of only a few large initial subranges reduces the overheads incurred when splitting and joining ranges. However, if there is a load imbalance that results in work stealing, the auto_partitioner creates additional subranges that can be stolen to more finely balance the load.

The auto_partitioner therefore attempts to minimize the number of range splits, while providing ample opportunities for work stealing.

auto_partitioner()

An empty default constructor.

auto_partitioner (auto_partitioner & partitioner, split)

A splitting constructor that divides the auto_partitioner partitioner into two partitioners.

template<typenameRange > bool should_execute_range ...

Get Intel Threading Building Blocks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.