A thread-safe container for managing chunks in an AllGather.
More...
#include <allgather.hpp>
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 262 of file allgather.hpp.
◆ empty()
| bool rapidsmpf::coll::detail::PostBox::empty |
( |
| ) |
const |
|
noexcept |
Check if the postbox is empty.
- Returns
- True if the postbox contains no chunks, false otherwise.
◆ extract()
| std::vector<std::unique_ptr<Chunk> > rapidsmpf::coll::detail::PostBox::extract |
( |
| ) |
|
Extract all chunks from the postbox.
- Returns
- A vector containing all chunks in the postbox.
- Note
- The caller must ensure that any subsequent operations on the return chunks are stream-ordered.
◆ extract_ready()
| std::vector<std::unique_ptr<Chunk> > rapidsmpf::coll::detail::PostBox::extract_ready |
( |
| ) |
|
Extract ready chunks from the postbox.
- Returns
- A vector of chunks that are ready for processing.
- Note
- Ready chunks are those with no pending operations on their data buffers.
◆ increment_goalpost()
| void rapidsmpf::coll::detail::PostBox::increment_goalpost |
( |
std::uint64_t |
amount | ) |
|
Increment the goalpost to a new expected chunk count.
- Parameters
-
| amount | The amount to move the goalpost by. |
◆ insert() [1/2]
| void rapidsmpf::coll::detail::PostBox::insert |
( |
std::unique_ptr< Chunk > |
chunk | ) |
|
Insert a single chunk into the postbox.
- Parameters
-
| chunk | The chunk to insert. |
◆ insert() [2/2]
| void rapidsmpf::coll::detail::PostBox::insert |
( |
std::vector< std::unique_ptr< Chunk >> && |
chunks | ) |
|
Insert multiple chunks into the postbox.
- Parameters
-
| chunks | A vector of chunks to insert. |
◆ ready()
| bool rapidsmpf::coll::detail::PostBox::ready |
( |
| ) |
const |
|
noexcept |
Check if the postbox has reached its goal.
- Returns
- True if the number of stored chunks matches the current goalpost, false otherwise.
◆ spill()
| std::size_t rapidsmpf::coll::detail::PostBox::spill |
( |
BufferResource * |
br, |
|
|
std::size_t |
amount |
|
) |
| |
Spill device data from the post box.
The spilling is stream ordered by the spilled buffers' CUDA streams.
- Parameters
-
| br | The buffer resource for host and device allocations. |
| amount | Requested amount of data to spill in bytes. |
- Returns
- Actual amount of data spilled in bytes.
- Note
- We attempt to minimise the number of individual buffers spilled, as well as the amount of "overspill".
The documentation for this class was generated from the following file:
- /__w/rapidsmpf/rapidsmpf/cpp/include/rapidsmpf/coll/allgather.hpp