MapReduce-MPI WWW Site - MapReduce-MPI Documentation

MapReduce broadcast() method

uint64_t MapReduce::broadcast(int root) 

This calls the broadcast() method of a MapReduce object, which delete the key/value pairs of a KeyValue object on all processors except root, and then broadcasts the key/value pairs owned by the root processor to all the other processors. The end result is that all processors have a copy of the key/value pairs initially owned by the root processor.

The resulting set of distributed key/value pairs will have P copies of each entry, where P = the # of processors. This will in general not be useful for further MapReduce operations, but it can be useful after a gather() before doing a final reduce() where you want to give each processor access to the entire gathered result and let it make a local copy of the datums.

This method requires parallel communication as processors send their key/value pairs to other processors.

Related methods: gather()