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

:link(mws,http://mapreduce.sandia.gov)
:link(md,Manual.html)

:line

MapReduce collate() method :h3

uint64_t MapReduce::collate(int (*myhash)(char *, int)) :pre

This calls the collate() method of a MapReduce object, which
aggregates a KeyValue object across processors and converts it into a
KeyMultiValue object.  This method is exactly the same as performing
an "aggregate()"_aggregate.html followed by a
"convert()"_convert.html.  The method returns the total number of
unique key/value pairs in the KeyMultiValue object.

The hash argument is used by the "aggregate()"_aggregate.html portion
of the operation and can be specified as NULL.  See the
"aggregate()"_aggregate.html doc page for details.

Note that if your map operation does not produce duplicate keys, you
do not typically need to perform a collate().  Instead you can convert
a KeyValue object into a KeyMultiValue object directly via the
"clone()"_clone.html method, which requires no communication.  Or you
can pass it directly to another "map()"_map.html operation.  One
exception would be if your map operation produces a KeyValue object
which is highly imbalanced across processors.  The
"aggregate()"_aggregate.html portion of the operation should
redistribute the key/value pairs more evenly.

This method is a parallel operation ("aggregate()"_aggregate.html),
followed by an on-processor operation ("convert()"_convert.html).

:line

[Related methods]: "aggregate()"_aggregate.html, "clone"_clone.html,
"collapse()"_collapse.html, "compress()"_compress.html,
"convert()"_convert.html
