Compute global reduction of a scalar from each process.
(self, local_scalar, mpi_reduce_op)
| 31 | self._scalar_buffer = np.zeros(1, dtype=dtype) |
| 32 | |
| 33 | def reduce_scalar(self, local_scalar, mpi_reduce_op): |
| 34 | """Compute global reduction of a scalar from each process.""" |
| 35 | self._scalar_buffer[0] = local_scalar |
| 36 | self.comm.Allreduce(MPI.IN_PLACE, self._scalar_buffer, op=mpi_reduce_op) |
| 37 | return self._scalar_buffer[0] |
| 38 | |
| 39 | def global_min(self, data, empty=np.inf): |
| 40 | """Compute global min of all array data.""" |
no outgoing calls
no test coverage detected