A thread-safe container for managing chunks in an AllGather.
More...
#include <allgather.hpp>
Public Member Functions | |
| PostBox ()=default | |
| Default constructor. | |
| ~PostBox ()=default | |
| Default destructor. | |
| PostBox (PostBox const &)=delete | |
| Deleted copy constructor. | |
| PostBox & | operator= (PostBox const &)=delete |
| Deleted copy assignment operator. | |
| PostBox (PostBox &&)=delete | |
| Deleted move constructor. | |
| PostBox & | operator= (PostBox &&)=delete |
| Deleted move assignment operator. | |
| void | insert (std::unique_ptr< Chunk > chunk) |
| Insert a single chunk into the postbox. More... | |
| void | insert (std::vector< std::unique_ptr< Chunk >> &&chunks) |
| Insert multiple chunks into the postbox. More... | |
| void | increment_goalpost (std::uint64_t amount) |
| Increment the goalpost to a new expected chunk count. More... | |
| bool | ready () const noexcept |
| Check if the postbox has reached its goal. More... | |
| std::vector< std::unique_ptr< Chunk > > | extract_ready () |
| Extract ready chunks from the postbox. More... | |
| std::vector< std::unique_ptr< Chunk > > | extract () |
| Extract all chunks from the postbox. More... | |
| bool | empty () const noexcept |
| Check if the postbox is empty. More... | |
| std::size_t | spill (BufferResource *br, Communicator::Logger &log, std::size_t amount) |
| Spill device data from the post box. More... | |
A thread-safe container for managing chunks in an AllGather.
A PostBox provides a synchronized storage mechanism for chunks, allowing multiple threads to insert chunks and extract ready chunks safely. It maintains a goalpost mechanism to track when all expected chunks have been received.
Definition at line 255 of file allgather.hpp.
|
noexcept |
Check if the postbox is empty.
| std::vector<std::unique_ptr<Chunk> > rapidsmpf::allgather::detail::PostBox::extract | ( | ) |
Extract all chunks from the postbox.
| std::vector<std::unique_ptr<Chunk> > rapidsmpf::allgather::detail::PostBox::extract_ready | ( | ) |
Extract ready chunks from the postbox.
| void rapidsmpf::allgather::detail::PostBox::increment_goalpost | ( | std::uint64_t | amount | ) |
Increment the goalpost to a new expected chunk count.
| amount | The amount to move the goalpost by. |
| void rapidsmpf::allgather::detail::PostBox::insert | ( | std::unique_ptr< Chunk > | chunk | ) |
Insert a single chunk into the postbox.
| chunk | The chunk to insert. |
| void rapidsmpf::allgather::detail::PostBox::insert | ( | std::vector< std::unique_ptr< Chunk >> && | chunks | ) |
Insert multiple chunks into the postbox.
| chunks | A vector of chunks to insert. |
|
noexcept |
Check if the postbox has reached its goal.
| std::size_t rapidsmpf::allgather::detail::PostBox::spill | ( | BufferResource * | br, |
| Communicator::Logger & | log, | ||
| std::size_t | amount | ||
| ) |
Spill device data from the post box.
The spilling is stream ordered by the spilled buffers' CUDA streams.
| br | The buffer resource for host and device allocations. |
| log | Logger instance. |
| amount | Requested amount of data to spill in bytes. |