"MapReduce-MPI WWW Site"_mws - "MapReduce-MPI Documentation"_md :c

:link(mws,http://www.cs.sandia.gov/~sjplimp/mapreduce.html)
:link(md,Manual.html)

:line

MapReduce scrunch() method :h3

int MapReduce::scrunch(int nprocs, char *key, int keybytes) :pre

This calls the scrunch() method of a MapReduce object, which gathers a
KeyValue object onto nprocs and collapses it into a KeyMultiValue
object.  This method is exactly the same as performing a
"gather()"_gather.html followed by a "collapse()"_collapse.html.  The
method returns the total number of key/value pairs in the
KeyMultiValue object which should be one for each of the nprocs.

The nprocs argument is used by the "gather()"_gather.html portion of
the operation.  See the "gather()"_gather.html doc page for details.
The key and keybytes arguments are used by the
"collapse()"_collapse.html portion of the operation.  See the
"collapse()"_collapse.html doc page for details.

Note that if nprocs > 1, then the same key will be assigned to the
collapsed key/multi-value pairs on each processor.

This method can be used to collect a set of key/value pairs to use in
a "reduce()"_reduce.html method so that it can all be passed to a
single invocation of your myreduce() function for output.

This method is a parallel operation ("gather()"_gather.html), followed
by an on-processor operation ("collapse()"_collapse.html).

:line

[Related methods]: "collapse()"_collapse.html, "gather()"_gather.html
