22 #ifndef TPETRA_DETAILS_DISTRIBUTOR_PLAN_HPP
23 #define TPETRA_DETAILS_DISTRIBUTOR_PLAN_HPP
25 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
26 #include "Teuchos_Array.hpp"
27 #include "Teuchos_Comm.hpp"
28 #include "Teuchos_RCP.hpp"
29 #include "TpetraCore_config.h"
31 #if defined(HAVE_TPETRACORE_MPI_ADVANCE)
32 #include <mpi_advance.h>
46 #if defined(HAVE_TPETRACORE_MPI_ADVANCE)
48 DISTRIBUTOR_MPIADVANCE_ALLTOALL,
49 DISTRIBUTOR_MPIADVANCE_NBRALLTOALLV
65 DISTRIBUTOR_NOT_INITIALIZED,
66 DISTRIBUTOR_INITIALIZED_BY_CREATE_FROM_SENDS,
67 DISTRIBUTOR_INITIALIZED_BY_CREATE_FROM_RECVS,
68 DISTRIBUTOR_INITIALIZED_BY_CREATE_FROM_SENDS_N_RECVS,
69 DISTRIBUTOR_INITIALIZED_BY_REVERSE,
70 DISTRIBUTOR_INITIALIZED_BY_COPY,
91 static constexpr
int DEFAULT_MPI_TAG = 0;
97 size_t createFromSends(
const Teuchos::ArrayView<const int>& exportProcIDs);
98 void createFromRecvs(
const Teuchos::ArrayView<const int>& remoteProcIDs);
99 void createFromSendsAndRecvs(
const Teuchos::ArrayView<const int>& exportProcIDs,
100 const Teuchos::ArrayView<const int>& remoteProcIDs);
102 void setParameterList(
const Teuchos::RCP<Teuchos::ParameterList>& plist);
104 Teuchos::RCP<DistributorPlan> getReversePlan()
const;
106 Teuchos::RCP<const Teuchos::Comm<int>> getComm()
const {
return comm_; }
107 #if defined(HAVE_TPETRACORE_MPI_ADVANCE)
108 Teuchos::RCP<MPIX_Comm*> getMPIXComm()
const {
return mpixComm_; }
111 size_t getNumReceives()
const {
return numReceives_; }
112 size_t getNumSends()
const {
return numSendsToOtherProcs_; }
113 bool hasSelfMessage()
const {
return sendMessageToSelf_; }
114 size_t getMaxSendLength()
const {
return maxSendLength_; }
115 size_t getTotalReceiveLength()
const {
return totalReceiveLength_; }
116 Teuchos::ArrayView<const int> getProcsFrom()
const {
return procsFrom_; }
117 Teuchos::ArrayView<const int> getProcsTo()
const {
return procIdsToSendTo_; }
118 Teuchos::ArrayView<const size_t> getLengthsFrom()
const {
return lengthsFrom_; }
119 Teuchos::ArrayView<const size_t> getLengthsTo()
const {
return lengthsTo_; }
120 Teuchos::ArrayView<const size_t> getStartsTo()
const {
return startsTo_; }
121 Teuchos::ArrayView<const size_t> getIndicesTo()
const {
return indicesTo_; }
127 #if defined(HAVE_TPETRACORE_MPI_ADVANCE)
128 void initializeMpiAdvance();
131 Teuchos::RCP<const Teuchos::ParameterList> getValidParameters()
const;
133 void createReversePlan()
const;
145 void computeReceives();
147 Teuchos::RCP<const Teuchos::Comm<int>> comm_;
148 #if defined(HAVE_TPETRACORE_MPI_ADVANCE)
149 Teuchos::RCP<MPIX_Comm*> mpixComm_;
153 mutable Teuchos::RCP<DistributorPlan> reversePlan_;
160 bool sendMessageToSelf_;
161 size_t numSendsToOtherProcs_;
162 Teuchos::Array<int> procIdsToSendTo_;
172 Teuchos::Array<size_t> startsTo_;
179 Teuchos::Array<size_t> lengthsTo_;
184 size_t maxSendLength_;
201 Teuchos::Array<size_t> indicesTo_;
220 size_t totalReceiveLength_;
227 Teuchos::Array<size_t> lengthsFrom_;
234 Teuchos::Array<int> procsFrom_;
241 Teuchos::Array<size_t> startsFrom_;
248 Teuchos::Array<size_t> indicesFrom_;
EDistributorHowInitialized
Enum indicating how and whether a Distributor was initialized.
std::string DistributorSendTypeEnumToString(EDistributorSendType sendType)
Convert an EDistributorSendType enum value to a string.
std::string DistributorHowInitializedEnumToString(EDistributorHowInitialized how)
Convert an EDistributorHowInitialized enum value to a string.
EDistributorSendType
The type of MPI send that Distributor should use.