Advanced Multi-Physics (AMP)
On-Line Documentation
CommunicationList.h
Go to the documentation of this file.
1#ifndef included_AMP_CommunicationList_h
2#define included_AMP_CommunicationList_h
3
4#include "AMP/utils/AMP_MPI.h"
5#include "AMP/utils/ParameterBase.h"
6#include <memory>
7
8#include <vector>
9
10
11namespace AMP::LinearAlgebra {
12
13class VectorData;
14class VectorIndexer;
15
16
42
43
55{
56public:
65 CommunicationList( std::shared_ptr<const CommunicationListParameters> params );
66
74 CommunicationList( size_t local, const AMP_MPI &comm );
75
83 CommunicationList( const AMP_MPI &comm, std::vector<size_t> local, std::vector<size_t> remote );
84
90 CommunicationList( const std::vector<size_t> &d_partition, const AMP_MPI &comm );
91
95 std::shared_ptr<CommunicationList> getNoCommunicationList();
96
102 std::shared_ptr<CommunicationList> subset( std::shared_ptr<VectorIndexer> sub );
103
113
123
128 const std::vector<size_t> &getGhostIDList() const;
129
138 const std::vector<size_t> &getReplicatedIDList() const;
139
149 const std::vector<int> &getReceiveSizes() const;
150
160 const std::vector<int> &getSendSizes() const;
161
163 const std::vector<int> &getReceiveDisp() const;
164
166 const std::vector<int> &getSendDisp() const;
167
173 const std::vector<size_t> &getPartition() const;
174
179 size_t getStartGID() const;
180
184 size_t getTotalSize() const;
185
190 size_t numLocalRows() const;
191
196
199
207 size_t getLocalGhostID( size_t dof ) const;
208
213 const AMP_MPI &getComm() const;
214
216 uint64_t getID() const;
217
218
219public:
220 // Initialize the internal data
221 void initialize() const;
222
223protected:
224 // Empty constructor
226
227private:
228 AMP_MPI d_comm; // Communicator
229 mutable bool d_initialized = false; // Have we initialized all of the data
230 mutable bool d_anyRankRemote = false; // Does any rank have remote data
231 std::vector<size_t> d_ReceiveDOFList; // Sorted DOF receive lists
232 std::vector<size_t> d_partition; // Partition info
233 mutable std::vector<size_t> d_SendDOFList; // Sorted DOF send lists
234 mutable std::vector<int> d_ReceiveSizes; // Number of DOFs to receive from each rank
235 mutable std::vector<int> d_ReceiveDisp; // Displacement for each rank
236 mutable std::vector<int> d_SendSizes; // Number of DOFs to send from each rank
237 mutable std::vector<int> d_SendDisp; // Displacement for each rank
238};
239
240} // namespace AMP::LinearAlgebra
241
242#endif
Provides C++ wrapper around MPI routines.
Definition AMP_MPI.h:63
Parameters class encapsulating the data necessary to instantiate a communication list.
CommunicationListParameters & operator=(const CommunicationListParameters &)=delete
Assignment operator.
size_t d_localsize
The number of local entities in the vector.
std::vector< size_t > d_remote_DOFs
The remote DOFs that we need to receive.
CommunicationListParameters(const CommunicationListParameters &)
Copy constructor.
AMP_MPI d_comm
The communicator over which the communication list is computed.
What to send where and what to receive from where.
size_t getStartGID() const
Return the first d.o.f. on this core.
CommunicationList(const std::vector< size_t > &d_partition, const AMP_MPI &comm)
const std::vector< int > & getReceiveDisp() const
Get the receive displacements.
size_t numLocalRows() const
Return the number of local rows for this communication list.
std::shared_ptr< CommunicationList > subset(std::shared_ptr< VectorIndexer > sub)
Subset a communication list based on a VectorIndexer.
const std::vector< int > & getSendSizes() const
Retrieve number of DOFs sent to each rank.
size_t getTotalSize() const
Return the total d.o.f. on entire communicator.
const std::vector< size_t > & getPartition() const
Retrieve the partition of DOFs.
size_t getVectorSendBufferSize() const
Retrieve the size of the buffer used to send data to other processes.
bool anyCommunication()
Returns true if any rank has remote data.
uint64_t getID() const
Get a unique id hash.
const std::vector< int > & getReceiveSizes() const
Retrieve number of DOFs received from each rank.
const std::vector< int > & getSendDisp() const
Get the send displacements.
const std::vector< size_t > & getReplicatedIDList() const
Retrieve list of global indices stored here and shared elsewhere.
std::shared_ptr< CommunicationList > getNoCommunicationList()
Returns a shared_ptr to a CommunicationList with no data communication.
size_t getLocalGhostID(size_t dof) const
Return the local index of a shared datum.
size_t getVectorReceiveBufferSize() const
Retrieve the size of the buffer used to receive data from other processes.
const std::vector< size_t > & getGhostIDList() const
Retrieve list of global indices shared locally stored elsewhere.
CommunicationList(size_t local, const AMP_MPI &comm)
Construct a CommunicationList with no comunication.
CommunicationList(std::shared_ptr< const CommunicationListParameters > params)
Construct a communication list.
const AMP_MPI & getComm() const
Return the communicator used for this communication list.
CommunicationList(const AMP_MPI &comm, std::vector< size_t > local, std::vector< size_t > remote)
Construct a CommunicationList with comunication.



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page