Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
rapidsmpf::Tag Class Reference

A tag used for identifying messages in a communication operation. More...

#include <communicator.hpp>

Public Types

using StorageT = std::int32_t
 The physical data type to store the tag.
 

Public Member Functions

constexpr Tag (OpID const op, StageID const stage)
 Constructs a tag. More...
 
constexpr operator StorageT () const noexcept
 Returns the int32 view of the tag. More...
 
constexpr OpID op () const noexcept
 Extracts the operation ID from the tag. More...
 
constexpr StageID stage () const noexcept
 Extracts the stage ID from the tag. More...
 

Static Public Member Functions

static constexpr size_t bit_length () noexcept
 Returns the max number of bits used for the tag. More...
 
static constexpr StorageT max_value () noexcept
 Returns the max value of the tag. More...
 

Static Public Attributes

static constexpr int stage_id_bits {sizeof(StageID) * 8}
 Number of bits for the stage ID.
 
static constexpr StorageT stage_id_mask {(1 << stage_id_bits) - 1}
 Mask for the stage ID.
 
static constexpr int op_id_bits {sizeof(OpID) * 8}
 Number of bits for the operation ID.
 
static constexpr StorageT op_id_mask
 Mask for the operation ID. More...
 

Detailed Description

A tag used for identifying messages in a communication operation.

Note
The tag is a 32-bit integer, with the following layout: bits |31:16| 15:8 | 7:0 | value |empty| op |stage|

Definition at line 57 of file communicator.hpp.

Constructor & Destructor Documentation

◆ Tag()

constexpr rapidsmpf::Tag::Tag ( OpID const  op,
StageID const  stage 
)
inlineconstexpr

Constructs a tag.

Parameters
opThe operation ID
stageThe stage ID

Definition at line 85 of file communicator.hpp.

Member Function Documentation

◆ bit_length()

static constexpr size_t rapidsmpf::Tag::bit_length ( )
inlinestaticconstexprnoexcept

Returns the max number of bits used for the tag.

Returns
bit length

Definition at line 94 of file communicator.hpp.

◆ max_value()

static constexpr StorageT rapidsmpf::Tag::max_value ( )
inlinestaticconstexprnoexcept

Returns the max value of the tag.

Returns
max value

Definition at line 102 of file communicator.hpp.

◆ op()

constexpr OpID rapidsmpf::Tag::op ( ) const
inlineconstexprnoexcept

Extracts the operation ID from the tag.

Returns
The operation ID

Definition at line 118 of file communicator.hpp.

◆ operator StorageT()

constexpr rapidsmpf::Tag::operator StorageT ( ) const
inlineconstexprnoexcept

Returns the int32 view of the tag.

Returns
int32 view of the tag

Definition at line 110 of file communicator.hpp.

◆ stage()

constexpr StageID rapidsmpf::Tag::stage ( ) const
inlineconstexprnoexcept

Extracts the stage ID from the tag.

Returns
The stage ID

Definition at line 126 of file communicator.hpp.

Member Data Documentation

◆ op_id_mask

constexpr StorageT rapidsmpf::Tag::op_id_mask
staticconstexpr
Initial value:
{
}
static constexpr StorageT stage_id_mask
Mask for the stage ID.
static constexpr int stage_id_bits
Number of bits for the stage ID.
static constexpr int op_id_bits
Number of bits for the operation ID.

Mask for the operation ID.

Definition at line 75 of file communicator.hpp.


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