This function implements the reduction operation using MPI. The general syntax for its use is
x = mpireduce(y,operation,root,comm)
where y
is the current processes contribution to the
reduction operation, operation
is either '+','*','>','<'
for
an additive, multiplicative, max or min type reduction operations
respectively,
root
is the rank of the process that will retrieve the
result of the reduction operation, and comm
is the MPI
communicator handle. If no communicator is provided,
then MPI_COMM_WORLD
is used by default. Note that FreeMat does not
check to ensure that the reduction operation y
arguments
are all the same size across the various processes in the group.
Instead, you must make sure that each process passes the same
sized array to the mpireduce
operation.