Represents a data chunk in the allgather operation. More...
#include <allgather.hpp>
Public Member Functions | |
| bool | is_ready () const noexcept |
| Check if the chunk is ready for processing. More... | |
| MemoryType | memory_type () const noexcept |
| Return the memory type of the chunk. More... | |
| bool | is_finish () const noexcept |
| Check if this is a finish marker chunk. More... | |
| ChunkID | id () const noexcept |
| The unique identifier of the chunk. More... | |
| ChunkID | sequence () const noexcept |
| The sequence number of the chunk. More... | |
| Rank | origin () const noexcept |
| The origin rank of the chunk. More... | |
| std::uint64_t | data_size () const noexcept |
| The size of the data buffer in bytes. More... | |
| std::uint64_t | metadata_size () const noexcept |
| The size of the metadata buffer in bytes. More... | |
| PackedData | release () |
| Release the chunk's data as PackedData. More... | |
| std::unique_ptr< std::vector< std::uint8_t > > | serialize () const |
| Serialize the metadata of the chunk to a byte vector. More... | |
| std::unique_ptr< Buffer > | release_data_buffer () noexcept |
| Release and return the data buffer. More... | |
| void | attach_data_buffer (std::unique_ptr< Buffer > data) |
| Attach a data buffer to this chunk. More... | |
| ~Chunk ()=default | |
| Default destructor. | |
| Chunk (Chunk &&)=default | |
| Move constructor. | |
| Chunk & | operator= (Chunk &&)=default |
| Move assignment operator. More... | |
| Chunk (Chunk const &)=delete | |
| Deleted copy constructor. | |
| Chunk & | operator= (Chunk const &)=delete |
| Deleted copy assignment operator. | |
Static Public Member Functions | |
| static std::unique_ptr< Chunk > | from_packed_data (std::uint64_t sequence, Rank origin, PackedData &&packed_data) |
| Create a data chunk from packed data. More... | |
| static std::unique_ptr< Chunk > | from_empty (std::uint64_t num_local_insertions, Rank origin) |
| Create an empty finish marker chunk. More... | |
| static constexpr ChunkID | chunk_id (std::uint64_t sequence, Rank origin) |
Create a ChunkID from a sequence number and origin rank. More... | |
| static std::unique_ptr< Chunk > | deserialize (std::vector< std::uint8_t > &data, BufferResource *br) |
| Deserialize a chunk from a byte vector of its metadata. More... | |
Static Public Attributes | |
| static constexpr std::uint64_t | ID_BITS = 38 |
| Number of bits used for the sequence ID in the chunk identifier. | |
| static constexpr std::uint64_t | RANK_BITS |
| Number of bits used for the rank in the chunk identifier. More... | |
Represents a data chunk in the allgather operation.
A chunk is either a data message (in which case metadata indicates how the data are to be interpreted), or a control (finish) message (in which case metadata and data are empty). Chunks within a single AllGather operation are uniquely identified by an (id, is_finish) pair.
Definition at line 51 of file allgather.hpp.
| void rapidsmpf::allgather::detail::Chunk::attach_data_buffer | ( | std::unique_ptr< Buffer > | data | ) |
Attach a data buffer to this chunk.
| data | The data buffer to attach. |
| std::logic_error | If the data_size() of the chunk does not match the size of the provided new data buffer, or the chunk already has a data buffer. |
|
staticconstexpr |
Create a ChunkID from a sequence number and origin rank.
| sequence | the sequence number. |
| origin | the origin rank. |
|
noexcept |
The size of the data buffer in bytes.
|
static |
Deserialize a chunk from a byte vector of its metadata.
| data | The serialized chunk data. |
| br | Buffer resource for memory allocation. |
|
static |
Create an empty finish marker chunk.
| num_local_insertions | The number of data insertions on this rank. |
| origin | The originating rank. |
|
static |
Create a data chunk from packed data.
| sequence | The sequence number for the chunk. |
| origin | The originating rank. |
| packed_data | The packed data to create the chunk from. |
|
noexcept |
The unique identifier of the chunk.
|
noexcept |
Check if this is a finish marker chunk.
|
noexcept |
Check if the chunk is ready for processing.
A chunk is ready either if it has no data buffer, or any outstanding operations on the data buffer have completed.
|
noexcept |
Return the memory type of the chunk.
|
noexcept |
The size of the metadata buffer in bytes.
Move assignment operator.
|
noexcept |
The origin rank of the chunk.
| PackedData rapidsmpf::allgather::detail::Chunk::release | ( | ) |
Release the chunk's data as PackedData.
| std::logic_error | if the chunk is not a data chunk. |
|
noexcept |
Release and return the data buffer.
|
noexcept |
The sequence number of the chunk.
| std::unique_ptr<std::vector<std::uint8_t> > rapidsmpf::allgather::detail::Chunk::serialize | ( | ) | const |
Serialize the metadata of the chunk to a byte vector.
|
staticconstexpr |
Number of bits used for the rank in the chunk identifier.
Definition at line 183 of file allgather.hpp.