ptypy.utils.parallel.allreduce#
- ptypy.utils.parallel.allreduce(a, op=None)#
Wrapper for comm.Allreduce, always in place.
- Parameters:
a (numpy-ndarray) – The array to operate on.
op (operation) – MPI operation to execute. None or one of MPI.BAND, MPI.BOR, MPI.BXOR, MPI.LAND, MPI.LOR, MPI.LXOR, MPI.MAX, MPI.MAXLOC, MPI.MIN, MPI.MINLOC, MPI.OP_NULL, MPI.PROD, MPI.REPLACE or MPI.SUM. If None, uses MPI.SUM.
Note
Explanation : If process #1 has ndarray
aand process #2 has ndarrayb. After calling allreduce, the new arrays after allreduce area'=op(a,b)andb'=op(a,b)on process #1 and #2 respectively