What to send where and what to receive from where. More...
#include <CommunicationList.h>
Public Member Functions | |
| bool | anyCommunication () |
| Returns true if any rank has remote data. | |
| void | clearBuffers () |
| CommunicationList (const AMP_MPI &comm, std::vector< size_t > local, std::vector< size_t > remote) | |
| Construct a CommunicationList with comunication. | |
| CommunicationList (const std::vector< size_t > &d_partition, const AMP_MPI &comm) | |
| 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. | |
| const std::vector< size_t > & | getGhostIDList () const |
| Retrieve list of global indices shared locally stored elsewhere. | |
| uint64_t | getID () const |
| Get a unique id hash. | |
| size_t | getLocalGhostID (size_t dof) const |
| Return the local index of a shared datum. | |
| std::shared_ptr< CommunicationList > | getNoCommunicationList () |
| Returns a shared_ptr to a CommunicationList with no data communication. | |
| const std::vector< size_t > & | getPartition () const |
| Retrieve the partition of DOFs. | |
| const std::vector< int > & | getReceiveDisp () const |
| Get the receive displacements. | |
| const std::vector< int > & | getReceiveSizes () const |
| Retrieve number of DOFs received from each rank. | |
| const std::vector< size_t > & | getReplicatedIDList () const |
| Retrieve list of global indices stored here and shared elsewhere. | |
| const std::vector< int > & | getSendDisp () const |
| Get the send displacements. | |
| const std::vector< int > & | getSendSizes () const |
| Retrieve number of DOFs sent to each rank. | |
| size_t | getStartGID () const |
| Return the first d.o.f. on this core. | |
| size_t | getTotalSize () const |
| Return the total d.o.f. on entire communicator. | |
| size_t | getVectorReceiveBufferSize () const |
| Retrieve the size of the buffer used to receive data from other processes. | |
| size_t | getVectorSendBufferSize () const |
| Retrieve the size of the buffer used to send data to other processes. | |
| void | initialize () const |
| 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. | |
Protected Member Functions | |
| CommunicationList () | |
Private Attributes | |
| bool | d_anyRankRemote = false |
| AMP_MPI | d_comm |
| bool | d_initialized = false |
| std::vector< size_t > | d_partition |
| std::vector< int > | d_ReceiveDisp |
| std::vector< size_t > | d_ReceiveDOFList |
| std::vector< int > | d_ReceiveSizes |
| std::vector< int > | d_SendDisp |
| std::vector< size_t > | d_SendDOFList |
| std::vector< int > | d_SendSizes |
What to send where and what to receive from where.
This interface provides communication routines to compute send and receive lists for blocks of data with global indices. For instance, a vector storing degrees of freedom for nodes in a finite element analysis may share data with other cores in a parallel computation. This class tracks which local data need to be communicated with other cores and which data should be received from those cores.
Definition at line 54 of file CommunicationList.h.
| AMP::LinearAlgebra::CommunicationList::CommunicationList | ( | std::shared_ptr< const CommunicationListParameters > | params | ) |
Construct a communication list.
| [in] | params | A shared pointer to parameters for constructing the list |
This will set the communicator for the communication list. It will not compute the communication lists. Derived classes are expected to call buildCommunicationArrays with appropriate data to compute the communication list This is a blocking call and must be called from all ranks.
| AMP::LinearAlgebra::CommunicationList::CommunicationList | ( | size_t | local, |
| const AMP_MPI & | comm | ||
| ) |
Construct a CommunicationList with no comunication.
| [in] | local | The number of local elements in the vector |
| [in] | comm | The AMP_MPI for the vector. |
Create a communication list with no communication. This is a blocking call and must be called from all ranks.
| AMP::LinearAlgebra::CommunicationList::CommunicationList | ( | const AMP_MPI & | comm, |
| std::vector< size_t > | local, | ||
| std::vector< size_t > | remote | ||
| ) |
Construct a CommunicationList with comunication.
| [in] | comm | The AMP_MPI for the vector. |
| [in] | local | The number of local elements for each rank |
| [in] | remote | The remote DOFs that we need to receive on this rank |
Create a communication list (advanced interface)
| AMP::LinearAlgebra::CommunicationList::CommunicationList | ( | const std::vector< size_t > & | d_partition, |
| const AMP_MPI & | comm | ||
| ) |
Constructor for creating CommunicationLists with no communication from an existing CommunicationList object without incurring global communication (meant for internal use only)
|
protected |
| bool AMP::LinearAlgebra::CommunicationList::anyCommunication | ( | ) |
Returns true if any rank has remote data.
| void AMP::LinearAlgebra::CommunicationList::clearBuffers | ( | ) |
Clears the internal buffers so that they are empty
| const AMP_MPI & AMP::LinearAlgebra::CommunicationList::getComm | ( | ) | const |
Return the communicator used for this communication list.
| const std::vector< size_t > & AMP::LinearAlgebra::CommunicationList::getGhostIDList | ( | ) | const |
Retrieve list of global indices shared locally stored elsewhere.
| uint64_t AMP::LinearAlgebra::CommunicationList::getID | ( | ) | const |
Get a unique id hash.
| size_t AMP::LinearAlgebra::CommunicationList::getLocalGhostID | ( | size_t | dof | ) | const |
Return the local index of a shared datum.
| [in] | dof | The global index to get a local ghost id for |
It is assumed that data are stored in two arrays: an owned array and a shared array. This function returns the local offset of a shared datum into the shared array
| std::shared_ptr< CommunicationList > AMP::LinearAlgebra::CommunicationList::getNoCommunicationList | ( | ) |
Returns a shared_ptr to a CommunicationList with no data communication.
| const std::vector< size_t > & AMP::LinearAlgebra::CommunicationList::getPartition | ( | ) | const |
Retrieve the partition of DOFs.
| const std::vector< int > & AMP::LinearAlgebra::CommunicationList::getReceiveDisp | ( | ) | const |
Get the receive displacements.
| const std::vector< int > & AMP::LinearAlgebra::CommunicationList::getReceiveSizes | ( | ) | const |
Retrieve number of DOFs received from each rank.
Retrieve number of DOFs received from each rank This is a potentially blocking call and must be called from all ranks. It is only blocking if initialize has not been called first. Users can explicitly call initialize() to avoid this.
| const std::vector< size_t > & AMP::LinearAlgebra::CommunicationList::getReplicatedIDList | ( | ) | const |
Retrieve list of global indices stored here and shared elsewhere.
This will obtain the list of indices owned by this rank and shared on other rank. This is a potentially blocking call and must be called from all ranks. It is only blocking if initialize has not been called first. Users can explicitly call initialize() to avoid this.
| const std::vector< int > & AMP::LinearAlgebra::CommunicationList::getSendDisp | ( | ) | const |
Get the send displacements.
| const std::vector< int > & AMP::LinearAlgebra::CommunicationList::getSendSizes | ( | ) | const |
Retrieve number of DOFs sent to each rank.
Retrieve number of DOFs sent to each rank This is a potentially blocking call and must be called from all ranks. It is only blocking if initialize has not been called first. Users can explicitly call initialize() to avoid this.
| size_t AMP::LinearAlgebra::CommunicationList::getStartGID | ( | ) | const |
Return the first d.o.f. on this core.
| size_t AMP::LinearAlgebra::CommunicationList::getTotalSize | ( | ) | const |
Return the total d.o.f. on entire communicator.
| size_t AMP::LinearAlgebra::CommunicationList::getVectorReceiveBufferSize | ( | ) | const |
Retrieve the size of the buffer used to receive data from other processes.
This is an alias of getGhostIDList().size() This is a potentially blocking call and must be called from all ranks. It is only blocking if initialize has not been called first. Users can explicitly call initialize() to avoid this.
| size_t AMP::LinearAlgebra::CommunicationList::getVectorSendBufferSize | ( | ) | const |
Retrieve the size of the buffer used to send data to other processes.
This is an alias of getReplicatedIDList().size() This is a potentially blocking call and must be called from all ranks. It is only blocking if initialize has not been called first. Users can explicitly call initialize() to avoid this.
| void AMP::LinearAlgebra::CommunicationList::initialize | ( | ) | const |
| size_t AMP::LinearAlgebra::CommunicationList::numLocalRows | ( | ) | const |
Return the number of local rows for this communication list.
| std::shared_ptr< CommunicationList > AMP::LinearAlgebra::CommunicationList::subset | ( | std::shared_ptr< VectorIndexer > | sub | ) |
Subset a communication list based on a VectorIndexer.
| [in] | sub | A VectorIndexer pointer that describes a subset This is a blocking call and must be called from all ranks. |
|
mutableprivate |
Definition at line 230 of file CommunicationList.h.
|
private |
Definition at line 228 of file CommunicationList.h.
|
mutableprivate |
Definition at line 229 of file CommunicationList.h.
|
private |
Definition at line 232 of file CommunicationList.h.
|
mutableprivate |
Definition at line 235 of file CommunicationList.h.
|
private |
Definition at line 231 of file CommunicationList.h.
|
mutableprivate |
Definition at line 234 of file CommunicationList.h.
|
mutableprivate |
Definition at line 237 of file CommunicationList.h.
|
mutableprivate |
Definition at line 233 of file CommunicationList.h.
|
mutableprivate |
Definition at line 236 of file CommunicationList.h.
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |