Send Data Message with data payload module
Send message that includes a payload of data.
Send message that includes a payload that can be arbitrary data that is coordinated by the system
struct PutMessage : vt::Message { PutMessage() { } vt::TagType mpi_tag_to_recv = vt::no_tag; }; void myHandler(PutMessage* msg) { NodeType send_node = 0; theMsg()->recvDataMsg( msg->mpi_tag_to_recv, send_node, [=](PtrLenPairType ptr, ActionType deleter){ // do something with ptr deleter(); } ); } void sendCode() { NodeType put_node = 1; // The user's payload function that invokes the system send function // passed to the lambda auto send_payload = [&](Active::SendFnType send){ auto ret = send(vt::PtrLenPairType{ptr, num_bytes}, put_node, vt::no_tag); msg->mpi_tag_to_recv = std::get<1>(ret); }; theMsg()->sendMsg<PutMessage, myHandler>(1, msg); }
Functions
-
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.
Function documentation
#include <src/vt/messaging/active.h>
template<typename MsgT>
PendingSendType broadcastMsg(HandlerType han,
MsgPtrThief<MsgT> msg,
bool deliver_to_sender = true,
TagType tag = no_tag)
Broadcast a message.
Parameters | |
---|---|
han in | the handler to invoke |
msg in | the message to broadcast |
deliver_to_sender in | whether msg should be delivered to sender |
tag in | the optional tag to put on the message |
Returns | the PendingSend for the send |
#include <src/vt/messaging/active.h>
template<typename MsgT>
PendingSendType sendMsg(NodeType dest,
HandlerType han,
MsgPtrThief<MsgT> msg,
UserSendFnType send_payload_fn)
Send a message with a special payload function.
Parameters | |
---|---|
dest in | the destination node to send the message to |
han in | the handler to invoke |
msg in | the message to send |
send_payload_fn in | |
Returns | the PendingSend for the send |
#include <src/vt/messaging/active.h>
template<typename MsgT, ActiveTypedFnType<MsgT>* f>
PendingSendType sendMsg(NodeType dest,
MsgPtrThief<MsgT> msg,
UserSendFnType send_payload_fn)
Send a message with a special payload function.
Parameters | |
---|---|
dest in | the destination node to send the message to |
msg in | the message to send |
send_payload_fn in | |
Returns | the PendingSend for the send |
#include <src/vt/messaging/active.h>
template<typename MsgT>
PendingSendType broadcastMsgAuto(HandlerType han,
MsgPtrThief<MsgT> msg,
TagType tag = no_tag)
Broadcast a message.
Parameters | |
---|---|
han in | the handler to invoke |
msg in | the message to broadcast |
tag in | the optional tag to put on the message |
Returns | the PendingSend for the send |