vt::messaging::ActiveMessenger struct

Core component of VT used to send messages.

ActiveMessenger is a core VT component that provides the ability to send messages Message to registered handlers. It manages the incoming and outgoing messages using MPI to communicate MPI_Irecv and MPI_Isend

Calls that send messages, such as sendMsg and broadcastMsg, relinquish ownership of the message supplied. This is implied regardless of the type of the message argument. This implicit behavior is equivalent to the explicit use of std::move.

The following two code snippets have the same semantics:

theMsg()-sendMsg(0, msg);
theMsg()-sendMsg(0, std::move(msg));

It is invalid to attempt to access the messages after such calls, and doing so may result in a vtAssert or undefined behavior. In special cases promoteMsg can be used to acquire secondary ownership.

There are various ways to send messages:

Base classes

template<typename T>
struct vt::runtime::component::PollableComponent<ActiveMessenger>
Component class for a generic, pollable VT runtime module, CRTP'ed over the component's actual type. A pollable component will be registered with the VT scheduler to ensure it makes progress.

Public types

using BufferedMsgType = BufferedActiveMsg
using MessageType = ShortMessage
using CountType = int32_t
using PendingRecvType = PendingRecv
using EventRecordType = event::AsyncEvent::EventRecordType
using SendFnType = std::function<SendInfo(PtrLenPairType, NodeType, TagType)>
using UserSendFnType = std::function<void(SendFnType)>
using ContainerPendingType = std::unordered_map<TagType, PendingRecvType>
using ReadyHanTagType = std::tuple<HandlerType, TagType>
using HandlerManagerType = HandlerManager
using PendingSendType = PendingSend

Public functions

auto name() -> std::string override
Get the name of the component.
void startup() override
Empty default overridden startup method.
void initialize() override
Empty default overridden initialize method.
template<typename MsgPtrT>
void markAsTermMessage(MsgPtrT const msg)
Mark a message as a termination message.
template<typename MsgPtrT>
void markAsLocationMessage(MsgPtrT const msg)
Mark a message as a location message.
template<typename MsgPtrT>
void markAsSerialMsgMessage(MsgPtrT const msg)
Mark a message as a serialization control message.
template<typename MsgPtrT>
void markAsCollectionMessage(MsgPtrT const msg)
Mark a message as a collection message.
template<typename MsgT>
void setEpochMessage(MsgT* msg, EpochType epoch)
Set the epoch in the envelope of a message.
template<typename MsgT>
void setTagMessage(MsgT* msg, TagType tag)
Set the tag in the envelope of a message.
auto makeTraceCreationSend(HandlerType const handler, ByteType serialized_msg_size, bool is_bcast) -> trace::TraceEventIDType
template<typename MsgT>
auto sendMsgSerializableImpl(NodeType dest, HandlerType han, MsgSharedPtr<MsgT>& msg, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT, std::enable_if_t<true and not ::vt::messaging::msg_defines_serialize_mode<MsgT>::value, int> = 0>
auto sendMsgImpl(NodeType dest, HandlerType han, MsgSharedPtr<MsgT>& msg, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT, std::enable_if_t<true and ::vt::messaging::msg_defines_serialize_mode<MsgT>::value and ::vt::messaging::msg_serialization_mode<MsgT>::required, int> = 0>
auto sendMsgImpl(NodeType dest, HandlerType han, MsgSharedPtr<MsgT>& msg, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT, std::enable_if_t<true and ::vt::messaging::msg_defines_serialize_mode<MsgT>::value and ::vt::messaging::msg_serialization_mode<MsgT>::supported, int> = 0>
auto sendMsgImpl(NodeType dest, HandlerType han, MsgSharedPtr<MsgT>& msg, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT, std::enable_if_t<true and ::vt::messaging::msg_defines_serialize_mode<MsgT>::value and ::vt::messaging::msg_serialization_mode<MsgT>::prohibited, int> = 0>
auto sendMsgImpl(NodeType dest, HandlerType han, MsgSharedPtr<MsgT>& msg, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT>
auto sendMsgCopyableImpl(NodeType dest, HandlerType han, MsgSharedPtr<MsgT>& msg, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT>
auto sendMsgSz(NodeType dest, HandlerType han, MsgPtrThief<MsgT> msg, ByteType msg_size, TagType tag = no_tag) -> PendingSendType
Send a message with a pre-registered handler.
template<typename MsgT>
auto sendMsg(NodeType dest, HandlerType han, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message with a pre-registered handler.
template<typename MsgT>
auto sendMsgAuto(NodeType dest, HandlerType han, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Send a message with a pre-registered handler.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsgSz(MsgPtrThief<MsgT> msg, ByteType msg_size, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message with an explicit size.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsg(MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message.
template<auto f>
auto broadcastMsg(MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message (message type not required).
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message.
template<auto f>
auto sendMsg(NodeType dest, MsgPtrThief<typename FuncTraits<decltype(f)>::MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message (message type not required).
template<auto f, typename... Params>
auto send(Node dest, Params && ... params) -> PendingSendType
Send parameters to a handler in a message.
template<auto f, typename... Params>
auto broadcast(Params && ... params) -> PendingSendType
Broadcast parameters to a handler in a message.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsgSz(NodeType dest, MsgPtrThief<MsgT> msg, ByteType msg_size, TagType tag = no_tag) -> PendingSendType
Send a message with explicit size.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsgAuto(MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Broadcast a message.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsgAuto(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Send a message.
template<ActiveFnType* f, typename MsgT>
auto broadcastMsg(MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message with a type-safe handler.
template<ActiveFnType* f, typename MsgT>
auto sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message with a type-safe handler.
template<typename FunctorT, typename MsgT>
auto broadcastMsg(MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message.
template<typename FunctorT>
auto broadcastMsg(MsgPtrThief<typename util::FunctorExtractor<FunctorT>::MessageType> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message.
template<typename FunctorT, typename MsgT = typename util::FunctorExtractor<FunctorT>::MessageType>
auto broadcastMsgAuto(MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Broadcast a message.
template<typename FunctorT, typename MsgT>
auto sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType
Send a message with a type-safe handler.
template<typename FunctorT>
auto sendMsg(NodeType dest, MsgPtrThief<typename util::FunctorExtractor<FunctorT>::MessageType> msg, TagType tag = no_tag) -> PendingSendType
Send a message with a type-safe handler.
template<typename FunctorT, typename MsgT = typename util::FunctorExtractor<FunctorT>::MessageType>
auto sendMsgAuto(NodeType dest, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Send a message.
template<typename MsgT>
auto broadcastMsg(HandlerType han, MsgPtrThief<MsgT> msg, bool deliver_to_sender = true, TagType tag = no_tag) -> PendingSendType
Broadcast a message.
template<typename MsgT>
auto sendMsg(NodeType dest, HandlerType han, MsgPtrThief<MsgT> msg, UserSendFnType send_payload_fn) -> PendingSendType
Send a message with a special payload function.
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsg(NodeType dest, MsgPtrThief<MsgT> msg, UserSendFnType send_payload_fn) -> PendingSendType
Send a message with a special payload function.
template<typename MsgT>
auto broadcastMsgAuto(HandlerType han, MsgPtrThief<MsgT> msg, TagType tag = no_tag) -> PendingSendType deprecated
Broadcast a message.
auto packMsg(MessageType* msg, MsgSizeType size, std::byte* ptr, MsgSizeType ptr_bytes) -> MsgSizeType
Pack a message, used by the system.
auto sendData(PtrLenPairType const& ptr, NodeType const& dest, TagType const& tag) -> SendInfo
Send raw bytes to a node.
auto sendDataMPI(PtrLenPairType const& ptr, NodeType const& dest, TagType const& tag) -> std::tuple<EventType, int>
Send raw bytes to a node with potentially multiple sends.
auto recvDataMsgPriority(int nchunks, PriorityType priority, TagType const& tag, NodeType const& node, ContinuationDeleterType next = nullptr) -> bool
Receive data as bytes from a node with a priority.
auto recvDataMsg(int nchunks, TagType const& tag, NodeType const& node, ContinuationDeleterType next = nullptr) -> bool
Receive data as bytes from a node.
auto recvDataMsg(int nchunks, PriorityType priority, TagType const& tag, NodeType const& sender, bool const& enqueue, ContinuationDeleterType next = nullptr) -> bool
Receive data as bytes from a node with a priority.
auto recvDataMsgBuffer(int nchunks, std::byte*const user_buf, PriorityType priority, TagType const& tag, NodeType const& node = uninitialized_destination, bool const& enqueue = true, ActionType dealloc_user_buf = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false) -> bool
Receive data as bytes with a buffer and priority.
auto recvDataMsgBuffer(int nchunks, std::byte*const user_buf, TagType const& tag, NodeType const& node = uninitialized_destination, bool const& enqueue = true, ActionType dealloc_user_buf = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false) -> bool
Receive data as bytes with a buffer.
void recvDataDirect(int nchunks, std::byte*const buf, TagType const tag, NodeType const from, MsgSizeType len, PriorityType prio, ActionType dealloc = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false)
Receive data from MPI in multiple chunks.
void recvDataDirect(int nchunks, TagType const tag, NodeType const from, MsgSizeType len, ContinuationDeleterType next)
Receive data from MPI in multiple chunks.
auto doMessageSend(MsgSharedPtr<BaseMsgType>& msg) -> EventType
Low-level send of a message, handler and other control data should be set already.
auto tryProcessIncomingActiveMsg() -> bool
Poll MPI to discover an incoming message with a handler.
auto tryProcessDataMsgRecv() -> bool
Poll MPI for raw data messages.
auto progress(TimeType current_time) -> int override
Call into the progress engine.
void processActiveMsg(MsgSharedPtr<BaseMsgType> const& base, NodeType const& sender, bool insert, ActionType cont = nullptr)
Process an incoming active message.
void prepareActiveMsgToRun(MsgSharedPtr<BaseMsgType> const& base, NodeType const& from_node, bool insert, ActionType cont)
Prepare an active message to run by building a RunnableNew.
auto sendMsgBytes(NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base, MsgSizeType const& msg_size, TagType const& send_tag) -> EventType
Send message as low-level bytes after packing put bytes if needed.
auto sendMsgBytesWithPut(NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base, TagType const& send_tag) -> EventType
Send message as low-level bytes that is already packed.
auto sendMsgMPI(NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base, MsgSizeType const& msg_size, TagType const& send_tag) -> EventType
Send already-packed message bytes with MPI using multiple sends if necessary.
void pushEpoch(EpochType const& epoch)
Push an epoch on the stack.
auto popEpoch(EpochType const& epoch = no_epoch) -> EpochType
Pop an epoch off the stack.
auto getEpoch() const -> EpochType
Returns the top of the epoch stack.
template<typename MsgT>
auto getEpochContextMsg(MsgT* msg) -> EpochType
Get the epoch for a message based on the current context so an subsequent operation on it can be safely delayed.
template<typename MsgT>
auto getEpochContextMsg(MsgSharedPtr<MsgT> const& msg) -> EpochType
Get the epoch for a message based on the current context so an subsequent operation on it can be safely delayed.
template<typename MsgT>
auto setupEpochMsg(MsgT* msg) -> EpochType
Set the epoch on a message.
template<typename MsgT>
auto setupEpochMsg(MsgSharedPtr<MsgT> const& msg) -> EpochType
Set the epoch on th message.
void registerAsyncOp(std::unique_ptr<AsyncOp> op)
Register a async operation that needs polling.
void blockOnAsyncOp(std::unique_ptr<AsyncOp> op)
Block the current task's execution on an pollable async operation until it completes.
template<typename SerializerT>
void serialize(SerializerT& s)
auto getRankLBData() -> auto
Get the rank-based LB data along with element ID for rank-based work.
template<typename MsgPtrT>
void markAsLocationMessage(] MsgPtrT const msg)
template<typename MsgPtrT>
void markAsSerialMsgMessage(] MsgPtrT const msg)
template<typename MsgPtrT>
void markAsCollectionMessage(] MsgPtrT const msg)
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto broadcastMsgSz(MsgPtrThief<MsgT> msg, ] ByteType msg_size, bool deliver_to_sender, TagType tag) -> ActiveMessenger::PendingSendType
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
auto sendMsgSz(NodeType dest, MsgPtrThief<MsgT> msg, ] ByteType msg_size, TagType tag) -> ActiveMessenger::PendingSendType

Function documentation

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsTermMessage(MsgPtrT const msg)

Mark a message as a termination message.

Parameters
msg in the message to mark as a termination message

Used to ignore certain messages for the sake of termination detection considering them control messages instead of normal message which are tracked/counted by the termination detector.

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsLocationMessage(MsgPtrT const msg)

Mark a message as a location message.

Parameters
msg in the message to mark as a location message

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsSerialMsgMessage(MsgPtrT const msg)

Mark a message as a serialization control message.

Parameters
msg in the message to mark as a serialization control message

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsCollectionMessage(MsgPtrT const msg)

Mark a message as a collection message.

Parameters
msg in the message to mark as a collection message

template<typename MsgT>
void vt::messaging::ActiveMessenger::setEpochMessage(MsgT* msg, EpochType epoch)

Set the epoch in the envelope of a message.

Parameters
msg in the message to mark the epoch on (envelope must be able to hold)
epoch in the epoch to mark on the message

template<typename MsgT>
void vt::messaging::ActiveMessenger::setTagMessage(MsgT* msg, TagType tag)

Set the tag in the envelope of a message.

Parameters
msg in the message to mark the tag on (envelope must be able to hold)
tag in the tag to mark on the message

MsgSizeType vt::messaging::ActiveMessenger::packMsg(MessageType* msg, MsgSizeType size, std::byte* ptr, MsgSizeType ptr_bytes)

Pack a message, used by the system.

Parameters
msg in message to pack
size in size of message
ptr in pointer to pack
ptr_bytes in bytes at pointer to pack
Returns the new size of the message

Packs bytes directly after a message into a single contiguous buffer to send. The message better have sufficient space allocated after the message to pack these bytes. This is often used when the memory pool slot selected comes with some extra space instead of sending two separate buffers.

SendInfo vt::messaging::ActiveMessenger::sendData(PtrLenPairType const& ptr, NodeType const& dest, TagType const& tag)

Send raw bytes to a node.

Parameters
ptr in the pointer and bytes to send
dest in the destination node
tag in the MPI tag put on the send (if vt::no_tag, increments tag)
Returns information about the send for receiving the payload

std::tuple<EventType, int> vt::messaging::ActiveMessenger::sendDataMPI(PtrLenPairType const& ptr, NodeType const& dest, TagType const& tag)

Send raw bytes to a node with potentially multiple sends.

Parameters
ptr in the pointer and bytes to send
dest in the destination node
tag in the MPI tag put on the send
Returns a tuple of the event and the number of sends

bool vt::messaging::ActiveMessenger::recvDataMsgPriority(int nchunks, PriorityType priority, TagType const& tag, NodeType const& node, ContinuationDeleterType next = nullptr)

Receive data as bytes from a node with a priority.

Parameters
nchunks in the number of chunks to receive
priority in the priority to receive the data
tag in the MPI tag to receive on
node in the node from which to receive
next in a continuation to execute when data arrives
Returns whether it was successful or pending

bool vt::messaging::ActiveMessenger::recvDataMsg(int nchunks, TagType const& tag, NodeType const& node, ContinuationDeleterType next = nullptr)

Receive data as bytes from a node.

Parameters
nchunks in the number of chunks to receive
tag in the MPI tag to receive on
node in the node from which to receive
next in a continuation to execute when data arrives
Returns whether it was successful or pending

bool vt::messaging::ActiveMessenger::recvDataMsg(int nchunks, PriorityType priority, TagType const& tag, NodeType const& sender, bool const& enqueue, ContinuationDeleterType next = nullptr)

Receive data as bytes from a node with a priority.

Parameters
nchunks in the number of chunks to receive
priority in the priority to receive the data
tag in the MPI tag to receive on
sender in the sender node
enqueue in whether to enqueue the pending receive
next in a continuation to execute when data arrives
Returns whether it was successful or pending

bool vt::messaging::ActiveMessenger::recvDataMsgBuffer(int nchunks, std::byte*const user_buf, PriorityType priority, TagType const& tag, NodeType const& node = uninitialized_destination, bool const& enqueue = true, ActionType dealloc_user_buf = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false)

Receive data as bytes with a buffer and priority.

Parameters
nchunks in the number of chunks to receive
user_buf in the buffer to receive into
priority in the priority for the operation
tag in the MPI tag to use for receive
node in the node receiving from
enqueue in whether to enqueue the operation
dealloc_user_buf in the action to deallocate a user buffer
next in the continuation when the data is ready
is_user_buf in is a user buffer that require user deallocation
Returns whether the data is ready or pending

bool vt::messaging::ActiveMessenger::recvDataMsgBuffer(int nchunks, std::byte*const user_buf, TagType const& tag, NodeType const& node = uninitialized_destination, bool const& enqueue = true, ActionType dealloc_user_buf = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false)

Receive data as bytes with a buffer.

Parameters
nchunks in the number of chunks to receive
user_buf in the buffer to receive into
tag in the MPI tag to use for receive
node in the node receiving from
enqueue in whether to enqueue the operation
dealloc_user_buf in the action to deallocate a user buffer
next in the continuation when the data is ready
is_user_buf in is a user buffer that require user deallocation
Returns whether the data is ready or pending

void vt::messaging::ActiveMessenger::recvDataDirect(int nchunks, std::byte*const buf, TagType const tag, NodeType const from, MsgSizeType len, PriorityType prio, ActionType dealloc = nullptr, ContinuationDeleterType next = nullptr, bool is_user_buf = false)

Receive data from MPI in multiple chunks.

Parameters
nchunks in the number of chunks to receive
buf in the receive buffer
tag in the MPI tag
from in the sender
len in the total length
prio in the priority for the continuation
dealloc in the action to deallocate the buffer
next in the continuation that gets passed the data when ready
is_user_buf in is a user buffer that require user deallocation

void vt::messaging::ActiveMessenger::recvDataDirect(int nchunks, TagType const tag, NodeType const from, MsgSizeType len, ContinuationDeleterType next)

Receive data from MPI in multiple chunks.

Parameters
nchunks in the number of chunks to receive
tag in the MPI tag
from in the sender
len in the total length
next in the continuation that gets passed the data when ready

EventType vt::messaging::ActiveMessenger::doMessageSend(MsgSharedPtr<BaseMsgType>& msg)

Low-level send of a message, handler and other control data should be set already.

Parameters
msg in the message to send
Returns the event for tracking the send completion

bool vt::messaging::ActiveMessenger::tryProcessIncomingActiveMsg()

Poll MPI to discover an incoming message with a handler.

Returns whether a message was found

bool vt::messaging::ActiveMessenger::tryProcessDataMsgRecv()

Poll MPI for raw data messages.

Returns whether a message was found

int vt::messaging::ActiveMessenger::progress(TimeType current_time) override

Call into the progress engine.

Parameters
current_time in current time
Returns whether any action was taken (progress was made)

void vt::messaging::ActiveMessenger::processActiveMsg(MsgSharedPtr<BaseMsgType> const& base, NodeType const& sender, bool insert, ActionType cont = nullptr)

Process an incoming active message.

Parameters
base in the message ptr
sender in the sender of the message
insert in whether to insert the message if handler does not exist
cont in continuation after message is processed

Forwards the message to the appropriate group nodes or broadcasts it depending on envelope. May deliver the message locally or just forward it depending on the target.

void vt::messaging::ActiveMessenger::prepareActiveMsgToRun(MsgSharedPtr<BaseMsgType> const& base, NodeType const& from_node, bool insert, ActionType cont)

Prepare an active message to run by building a RunnableNew.

Parameters
base in the message ptr
from_node in the node the message came from
insert in whether to insert the message if handler does not exist
cont in continuation after message is processed

EventType vt::messaging::ActiveMessenger::sendMsgBytes(NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base, MsgSizeType const& msg_size, TagType const& send_tag)

Send message as low-level bytes after packing put bytes if needed.

Parameters
dest in the destination of the message
base in the message base pointer
msg_size in the size of the message
send_tag in the send tag on the message
Returns the event to test/wait for completion

EventType vt::messaging::ActiveMessenger::sendMsgBytesWithPut(NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base, TagType const& send_tag)

Send message as low-level bytes that is already packed.

Parameters
dest in the destination of the message
base in the message base pointer
send_tag in the send tag on the message
Returns the event to test/wait for completion

EventType vt::messaging::ActiveMessenger::sendMsgMPI(NodeType const& dest, MsgSharedPtr<BaseMsgType> const& base, MsgSizeType const& msg_size, TagType const& send_tag)

Send already-packed message bytes with MPI using multiple sends if necessary.

Parameters
dest in the destination of the message
base in the message base pointer
msg_size in the size of the message
send_tag in the send tag on the message
Returns the event to test/wait for completion

void vt::messaging::ActiveMessenger::pushEpoch(EpochType const& epoch)

Push an epoch on the stack.

Parameters
epoch in the epoch to push

Pushes any epoch onto the local stack iff epoch != no_epoch; the epoch stack includes all locally pushed epochs and the current contexts pushed, transitively causally related active message handlers.

EpochType vt::messaging::ActiveMessenger::popEpoch(EpochType const& epoch = no_epoch)

Pop an epoch off the stack.

Parameters
epoch in the epoch that is expected to exist on the stack
Returns the epoch popped off the stack

Shall remove the top entry from epoch_size_, iff the size is non-zero and the ‘epoch’ passed, if ‘epoch != no_epoch’, is equal to the top of the ‘epoch_stack_.top()’; else, it shall remove any entry from the top of the stack.

EpochType vt::messaging::ActiveMessenger::getEpoch() const

Returns the top of the epoch stack.

Returns the epoch on the top of the stack

template<typename MsgT>
EpochType vt::messaging::ActiveMessenger::getEpochContextMsg(MsgT* msg)

Get the epoch for a message based on the current context so an subsequent operation on it can be safely delayed.

Parameters
msg in the message to set the epoch on
Returns the epoch on the message or from context

template<typename MsgT>
EpochType vt::messaging::ActiveMessenger::getEpochContextMsg(MsgSharedPtr<MsgT> const& msg)

Get the epoch for a message based on the current context so an subsequent operation on it can be safely delayed.

Parameters
msg in the message (shared ptr) to set the epoch on
Returns the epoch on the message or from context

template<typename MsgT>
EpochType vt::messaging::ActiveMessenger::setupEpochMsg(MsgT* msg)

Set the epoch on a message.

Parameters
msg in/out the message to get/set the epoch on
Returns the epoch set

The method finds the current epoch based on whether its already set on the message (which in that case it uses the one on the message already) or obtains the current epoch from the epoch stack based on the handler that is running

template<typename MsgT>
EpochType vt::messaging::ActiveMessenger::setupEpochMsg(MsgSharedPtr<MsgT> const& msg)

Set the epoch on th message.

Parameters
msg in the message to get/set the epoch on
Returns the epoch set

void vt::messaging::ActiveMessenger::registerAsyncOp(std::unique_ptr<AsyncOp> op)

Register a async operation that needs polling.

Parameters
op in the async operation to register

void vt::messaging::ActiveMessenger::blockOnAsyncOp(std::unique_ptr<AsyncOp> op)

Block the current task's execution on an pollable async operation until it completes.

Parameters
op in the async operation to block on

auto vt::messaging::ActiveMessenger::getRankLBData()

Get the rank-based LB data along with element ID for rank-based work.

Returns tuple with pointers to each one

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsLocationMessage(] MsgPtrT const msg)

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsSerialMsgMessage(] MsgPtrT const msg)

template<typename MsgPtrT>
void vt::messaging::ActiveMessenger::markAsCollectionMessage(] MsgPtrT const msg)

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
ActiveMessenger::PendingSendType vt::messaging::ActiveMessenger::broadcastMsgSz(MsgPtrThief<MsgT> msg, ] ByteType msg_size, bool deliver_to_sender, TagType tag)

template<typename MsgT, ActiveTypedFnType<MsgT>* f>
ActiveMessenger::PendingSendType vt::messaging::ActiveMessenger::sendMsgSz(NodeType dest, MsgPtrThief<MsgT> msg, ] ByteType msg_size, TagType tag)