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.LocaleCommsDefines cartesian communication topology for locales. In addition to the
LocaleCommscommunicators, 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_commproperty over-rides theLocaleComms.inter_locale_commproperty to return thecart_commcommunicator.
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_commA mpi4py.MPI.CartCommcommunicator 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_mapA dictoftuplecartesian coordinate (mpi4py.MPI.CartComm.Get_coords()) keys which map to the associatedcart_commpeer_rank.dimsThe number of partitions along each array axis. have_valid_cart_commIs Trueif this peer_rank hasself.cart_commwhich is notNoneand is notmpi4py.MPI.COMM_NULL.have_valid_inter_locale_commIs Trueif this peer rank hasself.inter_locale_commwhich is notNoneand is notmpi4py.MPI.COMM_NULL.inter_locale_commOverrides LocaleComms.inter_locale_commto returncart_comm.inter_locale_rank_to_peer_rank_mapReturns sequence, msay, ofintwherem[inter_r]is the peer rank ofself.peer_commwhich corresponds to the inter-locale rankinter_rofself.inter_locale_comm.intra_locale_commA mpi4py.MPI.Commobject which defines the group of processes which can allocate (and access) MPI window shared memory (allocated viampi4py.MPI.Win.Allocate_shared()if available).ndimAn intindicating the dimension of the cartesian topology.num_localesAn intindicating the number of locales over which an array is distributed.peer_commA mpi4py.MPI.Commwhich is super-set of theintra_locale_commandinter_locale_commcommunicators.peer_ranks_per_localeA numpy.ndarrayof shape(self.num_locales, num_peer_ranks_per_locale)withnumpy.int64elements.rank_loggerA peer_commlogging.Logger.root_loggerA peer_commlogging.Logger.this_locale_rank_infoA ThisLocaleInfoobject.