Basic Active Message Send with Pre-Registered Handler module
Send a message to pre-registered active message handler.
struct MyMsg : vt::Message { explicit MyMsg(int in_a) : a_(in_a) { } int a_; }; void myHandler(MyMsg* msg) { // do work ... } void sendCode() { // Explicit user registration of the handler, must be ordered as a // collective invocation across nodes HandlerType const han = registerNewHandler(my_handler); auto msg = makeMessage<MyMsg>(156); theMsg()->sendMsg(29, han, msg); }
Functions
-
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.
Function documentation
#include <src/vt/messaging/active.h>
template<typename MsgT>
PendingSendType sendMsgSz(NodeType dest,
HandlerType han,
MsgPtrThief<MsgT> msg,
ByteType msg_size,
TagType tag = no_tag)
Send a message with a pre-registered handler.
Parameters | |
---|---|
dest in | node to send the message to |
han in | handler to send the message to |
msg in | the message to send |
msg_size in | the size of the message being sent |
tag in | the tag to put on the message |
Returns | the PendingSend for the send |
Only invoke this variant if you know the size or the sizeof(Message)
is different than the number of bytes you actually want to send
#include <src/vt/messaging/active.h>
template<typename MsgT>
PendingSendType sendMsg(NodeType dest,
HandlerType han,
MsgPtrThief<MsgT> msg,
TagType tag = no_tag)
Send a message with a pre-registered handler.
Parameters | |
---|---|
dest in | node to send the message to |
han in | handler to send the message to |
msg in | the message to send (shared ptr) |
tag in | the tag to put on the message |
Returns | the PendingSend for the send |
#include <src/vt/messaging/active.h>
template<typename MsgT>
PendingSendType sendMsgAuto(NodeType dest,
HandlerType han,
MsgPtrThief<MsgT> msg,
TagType tag = no_tag)
Send a message with a pre-registered handler.
Parameters | |
---|---|
dest in | the destination node to send the message to |
han in | the handler to invoke |
msg in | the message to send |
tag in | the tag to put on the message |
Returns | the PendingSend for the send |