Asynchronous (coroutine) interface to coll::SparseAlltoall.
More...
#include <sparse_alltoall.hpp>
Public Member Functions | |
| SparseAlltoall (std::shared_ptr< Context > ctx, std::shared_ptr< Communicator > comm, OpID op_id, std::vector< Rank > srcs, std::vector< Rank > dsts) | |
| Construct an asynchronous sparse all-to-all. More... | |
| SparseAlltoall (SparseAlltoall const &)=delete | |
| SparseAlltoall & | operator= (SparseAlltoall const &)=delete |
| SparseAlltoall (SparseAlltoall &&)=delete | |
| SparseAlltoall & | operator= (SparseAlltoall &&)=delete |
| std::shared_ptr< Context > const & | ctx () const noexcept |
| Gets the streaming context associated with this object. More... | |
| std::shared_ptr< Communicator > const & | comm () const noexcept |
| Gets the communicator associated with this SparseAlltoall. More... | |
| void | insert (Rank dst, PackedData &&packed_data) |
| Insert data to send to a destination rank. More... | |
| coro::task< void > | insert_finished () |
| Indicate that no more data will be inserted for any destination. More... | |
| std::vector< PackedData > | extract (Rank src) |
| Extract all received messages from a source rank. More... | |
Asynchronous (coroutine) interface to coll::SparseAlltoall.
Many tasks may insert data concurrently. If multiple tasks insert data, the caller is responsible for arranging that insert_finished() is only called after all insert() operations have completed. Once insert_finished() is awaited, extraction is non-blocking.
Definition at line 29 of file sparse_alltoall.hpp.
| rapidsmpf::streaming::SparseAlltoall::SparseAlltoall | ( | std::shared_ptr< Context > | ctx, |
| std::shared_ptr< Communicator > | comm, | ||
| OpID | op_id, | ||
| std::vector< Rank > | srcs, | ||
| std::vector< Rank > | dsts | ||
| ) |
Construct an asynchronous sparse all-to-all.
| ctx | Streaming context. |
| comm | Communicator for the collective operation. |
| op_id | Unique identifier for the collective. |
| srcs | Ranks this rank expects to receive from. |
| dsts | Ranks this rank may send to. |
|
noexcept |
Gets the communicator associated with this SparseAlltoall.
|
noexcept |
Gets the streaming context associated with this object.
| std::vector<PackedData> rapidsmpf::streaming::SparseAlltoall::extract | ( | Rank | src | ) |
Extract all received messages from a source rank.
The returned vector is ordered by the sender's local insertion order.
| src | Source rank. Must be present in the constructor's srcs. |
src.| std::logic_error | If extracting before the collective is complete. |
| void rapidsmpf::streaming::SparseAlltoall::insert | ( | Rank | dst, |
| PackedData && | packed_data | ||
| ) |
Insert data to send to a destination rank.
The order the destination rank obtains the sent data is given by the insertion order on the send side. If inserting concurrently to the same destination, the caller must establish a total order of the insertions, otherwise the reconstruction order on the receive side is unspecified.
insert_finished() is called after all insert() calls have completed.| dst | Destination rank. Must be present in the constructor's dsts. |
| packed_data | Packed payload and metadata to send. |
| coro::task<void> rapidsmpf::streaming::SparseAlltoall::insert_finished | ( | ) |
Indicate that no more data will be inserted for any destination.
Must be called exactly once.
insert()ing, you must establish a happens-before relationship between the completion of all insert()s and the final call to insert_finished().