1 #include "RDMAMessages.decl.h"
3 #ifdef ENABLE_RDMA_HANDSHAKES
8 #ifndef RDMA_MESSAGES_H
9 #define RDMA_MESSAGES_H
12 #ifdef ENABLE_RDMA_HANDSHAKES
21 template <
class tokenType>
26 inline tokenType
token()
const {
return handshakeToken; }
28 inline int sender()
const {
return senderID; }
30 inline int senderPE()
const {
return senderProc; }
38 senderID(-1), senderProc(-1), numUnits(0) {}
39 RDMASetupRequestMsg(
const tokenType tkn,
const int sndr,
const int sndrPE,
const int dataSize,
const CkCallback cb):
41 senderID(sndr), senderProc(sndrPE),
42 numUnits(dataSize), callbk(cb) {}
45 int senderID, senderProc, numUnits;
47 tokenType handshakeToken;
50 inline friend std::ostream& operator<< (std::ostream &out, const RDMASetupRequestMsg<tokenType> &obj)
52 out<<
"RDMA setup request from "<<obj.senderID<<
" on proc "<<obj.senderProc
53 <<
" sending "<<obj.numUnits<<
" units. Token data: "<<obj.handshakeToken;
62 template <
class tokenType>
68 inline tokenType token()
const {
return handshakeToken; }
72 tokenType handshakeToken;
76 inline friend std::ostream& operator<< (std::ostream &out, const RDMASetupConfirmationMsg<tokenType> &obj)
78 out<<
"RDMA setup confirmation msg. Token data: "<<obj.handshakeToken;
99 gspIndex.x = gspIndex.y = 0;
100 pcIndex.w = pcIndex.x = pcIndex.y = pcIndex.z = 0;
102 bool shouldSendLeft, symmetric;
109 out<<
"GSpace["<<obj.gspIndex.x<<
","<<obj.gspIndex.y
110 <<
"] - PC["<<obj.pcIndex.w<<
","<<obj.pcIndex.x<<
","<<obj.pcIndex.y<<
","<<obj.pcIndex.z<<
","<<obj.symmetric<<
"] "
111 <<(obj.shouldSendLeft?
"Left ":
"Right ");
121 #define CK_TEMPLATES_ONLY
122 #include "RDMAMessages.def.h"
123 #undef CK_TEMPLATES_ONLY
124 #endif // RDMA_MESSAGES_H
const CkCallback & senderCallback() const
Get hold of the callback the sender has configured.
friend std::ostream & operator<<(std::ostream &out, const RDMApair_GSP_PC &obj)
Stream inserter. Note: not a member function.
int numDataUnits() const
Get the number of records of data that will be sent by RDMA.
int senderPE() const
Get the PE number of the sender.
A request from a data sender to setup an RDMA link. Initiates the sender-receiver handshake required ...
Based on whether RDMA is enabled, the handle type is either the actual handle or just an empty struct...
tokenType token() const
Get a copy of the handshake token the sender created.
RDMASetupRequestMsg()
Constructors.
int sender() const
Get an integer representation of the sender's ID.
A (hopefully) tiny token that is unique to every data sender-receiver pair, and is shared by them dur...
Reply from data receiver to the data sender indicating completion of setup on the receiver side...