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 std::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 {3} |
| 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 {20} |
| Number of bits for the operation ID. | |
| static constexpr StorageT | op_id_mask |
| Mask for the operation ID. More... | |
A tag used for identifying messages in a communication operation.
The tag is a 32-bit integer, with the following layout (low bits to high bits left-to-right)
{}
The restriction of 23 used bits comes from empirical MPI implementation limits for MPI_TAG_UB. For example, when using UCX as a transport layer, OpenMPI is restricted to 2^23 distinct tags.
All messages in rapidsmpf over the same Communicator are disambiguated by Tags. A message sent with a given Tag can only be matched by a receive with a matching Tag.
In the same way, collective operations over a Communicator are disambiguated by an OpID: two different collectives with different OpIDs will not interfere.
Due to implementation restrictions, we are limited in the number of distinct tags we can use (the Tag constructor checks for overflow but not reuse). In particular, we support at most 2^20 distinct OpIDs, corresponding to 2^20 distinct collectives running simultaneously.
Definition at line 83 of file communicator.hpp.
Constructs a tag.
| std::overflow_error | If either the op or stage values are negative or too large. |
| op | The operation ID |
| stage | The stage ID |
Definition at line 114 of file communicator.hpp.
|
inlinestaticconstexprnoexcept |
Returns the max number of bits used for the tag.
Definition at line 132 of file communicator.hpp.
|
inlinestaticconstexprnoexcept |
|
inlineconstexprnoexcept |
Extracts the operation ID from the tag.
Definition at line 156 of file communicator.hpp.
|
inlineconstexprnoexcept |
Returns the int32 view of the tag.
Definition at line 148 of file communicator.hpp.
|
inlineconstexprnoexcept |
Extracts the stage ID from the tag.
Definition at line 164 of file communicator.hpp.
|
staticconstexpr |
Mask for the operation ID.
Definition at line 101 of file communicator.hpp.