mpi_array.comms.CartLocaleComms

class mpi_array.comms.CartLocaleComms(ndims=None, dims=None, peer_comm=None, intra_locale_comm=None, inter_locale_comm=None, cart_comm=None)[source]

Bases: mpi_array.comms.LocaleComms

Defines cartesian communication topology for locales. In addition to the LocaleComms communicators, defines:

cart_comm
Typically this communicator is created using the call inter_locale_comm.Create_cart(...). This communicator (and associated mpi4py.MPI.Win window) is used to exchange data between locales. Note that inter_locale_comm property over-rides the LocaleComms.inter_locale_comm property to return the cart_comm communicator.

Methods

__init__([ndims, dims, peer_comm, ...]) Initialises cartesian communicator for inter-locale data exchange.
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

cart_comm A mpi4py.MPI.CartComm communicator defining a cartesian topology of MPI processes (typically one process per locale) used for inter-locale exchange of array data.
cart_coord_to_cart_rank_map A dict of tuple cartesian coordinate (mpi4py.MPI.CartComm.Get_coords()) keys which map to the associated cart_comm peer_rank.
dims The number of partitions along each array axis.
have_valid_cart_comm Is True if this peer_rank has self.cart_comm which is not None and is not mpi4py.MPI.COMM_NULL.
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 Overrides LocaleComms.inter_locale_comm to return cart_comm.
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).
ndim An int indicating the dimension of the cartesian topology.
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.