mpi_array.comms.LocaleComms

class mpi_array.comms.LocaleComms(peer_comm=None, intra_locale_comm=None, inter_locale_comm=None, comms_info=None)[source]

Bases: object

MPI communicators for inter and intra locale data exchange. There are three communicators:

peer_comm
Typically this is mpi4py.MPI.COMM_WORLD. It is the group of processes which operate on (perform computations on portions of) a globale array.
intra_locale_comm
Can be mpi4py.MPI.COMM_SELF, but is more typically the communicator returned by self.peer_comm.Split_type(mpi4py.MPI.COMM_TYPE_SHARED, key=self.peer_comm.rank). It is the communicator passed to the mpi4py.MPI.Win.Allocate_shared() function which allocates shared-memory and creates a shared-memory mpi4py.MPI.Win window.
inter_locale_comm
Typically this communicator is formed by selecting a single process from each locale. This communicator (and associated mpi4py.MPI.Win window) is used to exchange data between locales.

Methods

__init__([peer_comm, intra_locale_comm, ...]) Construct, this is a collective call over the peer_comm communcator.
alloc_locale_buffer(shape, dtype) Allocates a buffer using mpi4py.MPI.Win.Allocate_shared() which provides storage for the elements of the locale multi-dimensional array.
free()

Attributes

have_valid_inter_locale_comm Is True if this peer rank has self.inter_locale_comm which is not None and is not mpi4py.MPI.COMM_NULL.
inter_locale_comm A mpi4py.MPI.Comm communicator defining the group of processes which exchange data between locales.
inter_locale_rank_to_peer_rank_map Returns sequence, m say, of int where m[inter_r] is the peer rank of self.peer_comm which corresponds to the inter-locale rank inter_r of self.inter_locale_comm.
intra_locale_comm A mpi4py.MPI.Comm object which defines the group of processes which can allocate (and access) MPI window shared memory (allocated via mpi4py.MPI.Win.Allocate_shared() if available).
num_locales An int indicating the number of locales over which an array is distributed.
peer_comm A mpi4py.MPI.Comm which is super-set of the intra_locale_comm and inter_locale_comm communicators.
peer_ranks_per_locale A numpy.ndarray of shape (self.num_locales, num_peer_ranks_per_locale) with numpy.int64 elements.
rank_logger A peer_comm logging.Logger.
root_logger A peer_comm logging.Logger.
this_locale_rank_info A ThisLocaleInfo object.