Thrill  0.1
StreamMultiplexerHeader Class Reference

Detailed Description

Block header is sent before a sequence of blocks it indicates the number of elements and their boundaries.

Provides a serializer and two partial deserializers. A StreamMultiplexerHeader with size = 0 marks the end of a stream.

Definition at line 80 of file multiplexer_header.hpp.

+ Inheritance diagram for StreamMultiplexerHeader:
+ Collaboration diagram for StreamMultiplexerHeader:

#include <multiplexer_header.hpp>

Public Member Functions

 StreamMultiplexerHeader ()=default
 
 StreamMultiplexerHeader (MagicByte m, const PinnedBlock &b)
 
size_t CalcHostRank (size_t workers_per_host) const
 Calculate the sender host_rank from sender_worker and workers_per_host. More...
 
bool IsAllWorkers () const
 Indicates if this message is for all local workers. More...
 
bool IsEnd () const
 Indicates if this is the end-of-line block header. More...
 
void Serialize (net::BufferBuilder &bb) const
 Serializes the whole block struct into a buffer. More...
 
- Public Member Functions inherited from MultiplexerHeader
 MultiplexerHeader ()=default
 
 MultiplexerHeader (MagicByte m, const PinnedBlock &b)
 

Static Public Member Functions

static StreamMultiplexerHeader Parse (net::BufferReader &br)
 Reads the stream id and the number of elements in this block. More...
 

Public Attributes

uint32_t receiver_local_worker = 0
 
uint32_t sender_worker = 0
 global worker rank of sender More...
 
uint32_t seq = 0
 sequence number in Stream More...
 
size_t stream_id = 0
 
- Public Attributes inherited from MultiplexerHeader
uint32_t first_item: 30
 
uint32_t is_last_block: 1
 is last block piggybacked indicator More...
 
MagicByte magic = MagicByte::Invalid
 
uint32_t num_items = 0
 
uint32_t size = 0
 
uint32_t typecode_verify: 1
 typecode self verify More...
 

Static Public Attributes

static const uint32_t all_workers = uint32_t(-1)
 virtual worker which receives all-close messages More...
 
static const uint32_t final_seq = uint32_t(-1)
 final sequence number More...
 
- Static Public Attributes inherited from MultiplexerHeader
static constexpr size_t header_size
 
static constexpr bool self_verify = common::g_self_verify
 
static constexpr size_t total_size
 

Constructor & Destructor Documentation

◆ StreamMultiplexerHeader() [1/2]

◆ StreamMultiplexerHeader() [2/2]

StreamMultiplexerHeader ( MagicByte  m,
const PinnedBlock b 
)
inlineexplicit

Definition at line 97 of file multiplexer_header.hpp.

Member Function Documentation

◆ CalcHostRank()

size_t CalcHostRank ( size_t  workers_per_host) const
inline

Calculate the sender host_rank from sender_worker and workers_per_host.

Definition at line 123 of file multiplexer_header.hpp.

References thrill::data::TLX_ATTRIBUTE_PACKED, and MultiplexerHeader::total_size.

◆ IsAllWorkers()

bool IsAllWorkers ( ) const
inline

Indicates if this message is for all local workers.

Definition at line 118 of file multiplexer_header.hpp.

Referenced by Multiplexer::OnMultiplexerHeader().

◆ IsEnd()

bool IsEnd ( ) const
inline

Indicates if this is the end-of-line block header.

Definition at line 113 of file multiplexer_header.hpp.

Referenced by Multiplexer::OnMultiplexerHeader().

◆ Parse()

static StreamMultiplexerHeader Parse ( net::BufferReader br)
inlinestatic

Reads the stream id and the number of elements in this block.

Definition at line 108 of file multiplexer_header.hpp.

References BufferReader::Get().

Referenced by Multiplexer::OnMultiplexerHeader().

◆ Serialize()

void Serialize ( net::BufferBuilder bb) const
inline

Serializes the whole block struct into a buffer.

Definition at line 102 of file multiplexer_header.hpp.

References BufferBuilder::Put(), BufferBuilder::Reserve(), and MultiplexerHeader::total_size.

Referenced by StreamSet< StreamData >::OnWriterClosed().

Member Data Documentation

◆ all_workers

const uint32_t all_workers = uint32_t(-1)
static

virtual worker which receives all-close messages

Definition at line 91 of file multiplexer_header.hpp.

Referenced by StreamSet< StreamData >::OnWriterClosed().

◆ final_seq

const uint32_t final_seq = uint32_t(-1)
static

◆ receiver_local_worker

uint32_t receiver_local_worker = 0

◆ sender_worker

uint32_t sender_worker = 0

◆ seq

◆ stream_id


The documentation for this class was generated from the following file: