triqs.utility.mpi_mpi4py.all_reduce
- triqs.utility.mpi_mpi4py.all_reduce(x, comm=<mpi4py.MPI.Intracomm object>, op=<mpi4py.MPI.Op object>)[source]
Reduce
xacross all ranks ofcommand return the result.Thin wrapper around
mpi4py.MPI.Comm.allreduce().- Parameters:
- xobject
Value contributed by the local rank.
- commmpi4py.MPI.Comm, optional
Communicator over which to reduce. Default
world.- opmpi4py.MPI.Op, optional
Reduction operation. Default
MPI.SUM.
- Returns:
- object
The reduced value, identical on every rank of
comm.
Notes
For backwards compatibility with an earlier signature that had the communicator as the first positional argument, if the call raises
AttributeErrororTypeErrorandxis itself a communicator, the call is retried asworld.allreduce(comm)and a warning is printed.