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 thatinter_locale_comm
property over-rides theLocaleComms.inter_locale_comm
property to return thecart_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
oftuple
cartesian coordinate (mpi4py.MPI.CartComm.Get_coords()
) keys which map to the associatedcart_comm
peer_rank.dims
The number of partitions along each array axis. have_valid_cart_comm
Is True
if this peer_rank hasself.cart_comm
which is notNone
and is notmpi4py.MPI.COMM_NULL
.have_valid_inter_locale_comm
Is True
if this peer rank hasself.inter_locale_comm
which is notNone
and is notmpi4py.MPI.COMM_NULL
.inter_locale_comm
Overrides LocaleComms.inter_locale_comm
to returncart_comm
.inter_locale_rank_to_peer_rank_map
Returns sequence, m
say, ofint
wherem[inter_r]
is the peer rank ofself.peer_comm
which corresponds to the inter-locale rankinter_r
ofself.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 viampi4py.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 theintra_locale_comm
andinter_locale_comm
communicators.peer_ranks_per_locale
A numpy.ndarray
of shape(self.num_locales, num_peer_ranks_per_locale)
withnumpy.int64
elements.rank_logger
A peer_comm
logging.Logger
.root_logger
A peer_comm
logging.Logger
.this_locale_rank_info
A ThisLocaleInfo
object.