MCPcopy Create free account
hub / github.com/DedalusProject/dedalus / reduce_scalar

Method reduce_scalar

dedalus/extras/flow_tools.py:33–37  ·  view source on GitHub ↗

Compute global reduction of a scalar from each process.

(self, local_scalar, mpi_reduce_op)

Source from the content-addressed store, hash-verified

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."""

Callers 3

global_minMethod · 0.95
global_maxMethod · 0.95
global_meanMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected