There are two global computation routines in MPI: reduce and scan.
Different versions of the reduction routine are provided depending
on whether the results are made available to all processes in the group,
just one process, or are scattered cyclicly across the group.
Common reduction operations are the evaluation of the
maximum, minimum, or sum of a set of values distributed across a group of
processes.
The scan routines perform a parallel prefix with respect to a user-specified
operation on data distributed across a specified group. If is the data
item on the process with rank i, then on
completion the output buffer of this process contains the
result of combining the values from the processes with rank
,
i.e.,
MPI provides a set of pre-defined functions, and a mechanism through
which user-specified functions can be used in reduce and scan operations.