Boost C++ Libraries

“...one of the most highly regarded and expertly designed C++ library projects in the world.” Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Boost.MapReduce Schedule Policies

Note: This library is not yet part of the Boost Library and is still under development and review.

Schedule Policies are used by the MapReduce runtime system to schedule execution of Map and Reduce tasks. The policy is specified in the call to mapreduce::job::run(), which has two variants for coding convenience.

template<typename SchedulePolicy>
void run(specification const &spec, results &result);

template<typename SchedulePolicy>
void run(SchedulePolicy &schedule, specification const &spec, results &result);

Both overloads of run() are template functions where the template parameter is a SchedulePolicy. The first variant will default construct a schedule policy class, and the second variant will use the supplied policy class. This enables the library user to develop their own scheduler policies that may need configuration before being used.

Boost.MapReduce provides two Schedule Policy implementations in the mapreduce::schedule_policy namespace; sequential and cpu_parallel.

sequential

The sequential schedule policy runs the MapReduce job on the main execution thread, first running a single Map Task followed by a number of Reduce Tasks in sequence. This schedule policy provides a simple MapReduce execution system without any multi-threaded activity. While unlikely to be useful in a production system, it is a very useful policy to aid debugging of a MapReduce-implemented algorithm.

cpu_parallel

The cpu_parallel schedule policy is the main scheduling algorithm for Boost.MapReduce. The class implements a multi-threaded execution of multiple simultaneous Map tasks followed by multiple simultaneous Reduce tasks. Statistics from the individual Map and Reduce tasks are then collated into statistics for the Job as a whole.

The Boost.Threads library is used for the multi-threading to ensure portability is maximised.