cosmocore.mpi_utils module

MPI utilities for shared memory and array broadcasting.

class cosmocore.mpi_utils.MPISharedMemoryMixin[source]

Bases: object

Mixin providing shared memory array distribution for MPI classes.

Requires self.comm and self.rank. _shared_array places one copy of each array per node in shared memory; intra-node ranks get a zero-copy view, and a single buffer-based Bcast seeds each node’s local rank 0. _bcast_array is the buffer-based broadcast fallback. Call close() (or use as a context manager) to release windows and split communicators.

close()[source]

Release all MPI shared-memory resources owned by this instance.

Return type:

None