allreduce#

caput.mpiarray.MPIArray.allreduce(op: mpi4py.MPI.Op | None = None) numpy.number[source]#

Perform MPI reduction op within memory buffer.

Usage is restricted to arrays with a single element per rank. Returns same scalar final result to all ranks.

E.g. usage: mpi_array.sum().allreduce() to every rank.

Parameters:
opMPI.Op | None

Reduction operation to perform. Default: SUM().

Returns:
valuenumber

Result of reduction. This is a single value which is the same on all ranks.