|
|
MPI_Comm | comm () const |
| | Get the MPI communicator.
|
| |
| int | numNeighbor () const |
| | Get the number of neighbor ranks that this rank will communicate with.
|
| |
| int | neighborRank (const int neighbor) const |
| | Given a local neighbor id get its rank in the MPI communicator.
|
| |
| std::size_t | numExport (const int neighbor) const |
| | Get the number of elements this rank will export to a given neighbor.
|
| |
| std::size_t | totalNumExport () const |
| | Get the total number of exports this rank will do.
|
| |
| std::size_t | numImport (const int neighbor) const |
| | Get the number of elements this rank will import from a given neighbor.
|
| |
| std::size_t | totalNumImport () const |
| | Get the total number of imports this rank will do.
|
| |
| std::size_t | exportSize () const |
| | Get the number of export elements.
|
| |
| Kokkos::View< std::size_t *, memory_space > | getExportSteering () const |
| | Get the steering vector for the exports.
|
| |
| template<class PackViewType, class RankViewType> |
| void | createExportSteering (const PackViewType &neighbor_ids, const RankViewType &element_export_ranks) |
| | Create the export steering vector.
|
| |
| template<class PackViewType, class RankViewType, class IdViewType> |
| void | createExportSteering (const PackViewType &neighbor_ids, const RankViewType &element_export_ranks, const IdViewType &element_export_ids) |
| | Create the export steering vector.
|
| |
|
|
std::shared_ptr< MPI_Comm > | _comm_ptr |
| | Shared pointer to Mpi communicator.
|
| |
|
std::vector< int > | _neighbors |
| | List of Mpi neighbors.
|
| |
|
std::size_t | _total_num_export |
| | Number of elements exported.
|
| |
|
std::size_t | _total_num_import |
| | Number of elements imported.
|
| |
|
std::vector< std::size_t > | _num_export |
| | Number of elements exported to each neighbor.
|
| |
|
std::vector< std::size_t > | _num_import |
| | Number of elements imported from each neighbor.
|
| |
| std::size_t | _num_export_element |
| |
|
Kokkos::View< std::size_t *, memory_space > | _export_steering |
| | Export steering vector.
|
| |
template<class MemorySpace>
class Cabana::CommunicationPlanBase< MemorySpace >
Communication plan base class.
- Template Parameters
-
| DeviceType | Device type for which the data for this class will be allocated and where parallel execution will occur. |
The communication plan computes how to redistribute elements in a parallel data structure using MPI. Given a list of data elements on the local MPI rank and their destination ranks, the communication plan computes which rank each process is sending and receiving from and how many elements we will send and receive. In addition, it provides an export steering vector which describes how to pack the local data to be exported into contiguous send buffers for each destination rank (in the forward communication plan).
Some nomenclature:
Export - elements we are sending in the forward communication plan.
Import - elements we are receiving in the forward communication plan.
- Note
- If a communication plan does self-sends (i.e. exports and imports data from its own ranks) then this data is first in the data structure. What this means is that neighbor 0 is the local rank and the data for that rank that is being exported will appear first in the steering vector.
template<class MemorySpace>
template<class PackViewType, class RankViewType>
| void Cabana::CommunicationPlanBase< MemorySpace >::createExportSteering |
( |
const PackViewType & | neighbor_ids, |
|
|
const RankViewType & | element_export_ranks ) |
|
inline |
Create the export steering vector.
Creates an array describing which export element ids are moved to which location in the send buffer of the communication plan. Ordered such that if a rank sends to itself then those values come first.
- Parameters
-
| neighbor_ids | The id of each element in the neighbor send buffers. |
| element_export_ranks | The ranks to which we are exporting each element. We use this to build the steering vector. The input is expected to be a Kokkos view or Cabana slice in the same memory space as the communication plan. |
template<class MemorySpace>
template<class PackViewType, class RankViewType, class IdViewType>
| void Cabana::CommunicationPlanBase< MemorySpace >::createExportSteering |
( |
const PackViewType & | neighbor_ids, |
|
|
const RankViewType & | element_export_ranks, |
|
|
const IdViewType & | element_export_ids ) |
|
inline |
Create the export steering vector.
Creates an array describing which export element ids are moved to which location in the contiguous send buffer of the communication plan. Ordered such that if a rank sends to itself then those values come first.
- Parameters
-
| neighbor_ids | The id of each element in the neighbor send buffers. |
| element_export_ranks | The ranks to which we are exporting each element. We use this to build the steering vector. The input is expected to be a Kokkos view or Cabana slice in the same memory space as the communication plan. |
| element_export_ids | The local ids of the elements to be exported. This corresponds with the export ranks vector and must be the same length if defined. The input is expected to be a Kokkos view or Cabana slice in the same memory space as the communication plan. |