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:
objectMPI 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 byself.peer_comm.Split_type(mpi4py.MPI.COMM_TYPE_SHARED, key=self.peer_comm.rank). It is the communicator passed to thempi4py.MPI.Win.Allocate_shared()function which allocates shared-memory and creates a shared-memorympi4py.MPI.Winwindow. 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_commcommuncator.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_commIs Trueif this peer rank hasself.inter_locale_commwhich is notNoneand is notmpi4py.MPI.COMM_NULL.inter_locale_commA mpi4py.MPI.Commcommunicator defining the group of processes which exchange data between locales.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).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.