mpi.allreduce are global reduction operations.
mpi.reduce combines each member's result, using the operation
op, and returns the combined value(s) to the member specified by
mpi.allreduce is the same as
mpi.reduce except that all members receive the combined value(s).
1 2 3 4 5
data to be reduced. Must be the same dim and the same type for all members.
1 for integer and 2 for double. Others are not supported.
one of "sum", "prod", "max", "min", "maxloc", or "minloc".
rank of destination
a communicator number
It is important that all members in a comm call either all
mpi.allreduce even though the master may not be in
computation. They must provide exactly the same type and dim
vectors to be reduced. If the operation "maxloc" or "minloc" is used,
the combined vector is twice as long as the original one since the
maximum or minimum ranks are included.
mpi.reduce returns the combined value(s) to the member specified
mpi.allreduce returns the combined values(s) to
every member in a comm. The combined value(s) may be the summation,
production, maximum, or minimum specified by the argument
op is either "maxloc" or "minloc", then the maximum (minimum)
value(s) along the maximum (minimum) rank(s) will be returned.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.