LRTS: Add API for RDMA GET operations
[charm.git] / src / arch / util / machine-rdma.h
blobed61cd9810168a4fd4a476e48df256dac5a514b1
1 #ifndef _MACHINE_RDMA_H_
2 #define _MACHINE_RDMA_H_
4 /*Function Pointer to Acknowledgement Handler*/
5 typedef void (*RdmaAckHandlerFn)(void *token);
7 /*Acknowledgement constisting of handler and token*/
8 typedef struct _cmi_rdma_ack{
9 RdmaAckHandlerFn fnPtr;
10 void *token;
11 } CmiRdmaAck;
14 /*Lrts Function declarations*/
16 /*Sender Functions*/
17 void LrtsSetRdmaInfo(void *dest, int destPE, int numOps);
18 void LrtsSetRdmaOpInfo(void *dest, void *ptr, int size);
19 int LrtsGetRdmaOpInfoSize();
20 int LrtsGetRdmaGenInfoSize();
21 int LrtsGetRdmaInfoSize(int numOps);
22 void LrtsSetRdmaRecvInfo(void *dest, int numOps, void *charmMsg, void *rdmaInfo);
24 /*Receiver Functions*/
25 void LrtsSetRdmaRecvOpInfo(void *dest, void *buffer, void *src_ref, int size, int opIndex, void *rdmaRecv);
26 int LrtsGetRdmaOpRecvInfoSize();
27 int LrtsGetRdmaGenRecvInfoSize();
28 int LrtsGetRdmaRecvInfoSize(int numOps);
29 void LrtsIssueRgets(void *recv, int pe);
33 /* Converse Machine Interface Functions*/
35 /* Sender Side Functions */
37 /* Set the machine layer info generic to RDMA ops*/
38 void CmiSetRdmaInfo(void *dest, int destPE, int numOps){
39 LrtsSetRdmaInfo(dest, destPE, numOps);
42 /* Set the machine layer info specific to RDMA op*/
43 void CmiSetRdmaOpInfo(void *dest, void *ptr, int size){
44 LrtsSetRdmaOpInfo(dest, ptr, size);
47 /* Getter for size help upper layers allocate space for machine layer info
48 * while allocating the message*/
50 /* Get the size occupied by the machine layer info specific to RDMA op*/
51 int CmiGetRdmaOpInfoSize(){
52 return LrtsGetRdmaOpInfoSize();
55 /* Get the size occupied by the macine layer info generic to RDMA ops*/
56 int CmiGetRdmaGenInfoSize(){
57 return LrtsGetRdmaGenInfoSize();
60 /* Get the total size occupied by the machine layer info (specific + generic)*/
61 int CmiGetRdmaInfoSize(int numOps){
62 return LrtsGetRdmaInfoSize(numOps);
65 /* Set the ack function handler and token*/
66 void *CmiSetRdmaAck(RdmaAckHandlerFn fn, void *token){
67 CmiRdmaAck *ack = malloc(sizeof(CmiRdmaAck));
68 ack->fnPtr = fn;
69 ack->token = token;
70 return ack;
74 /* Receiver side functions */
76 /* Set the receiver specific machine layer info generic to RDMA ops*/
77 void CmiSetRdmaRecvInfo(void *dest, int numOps, void *charmMsg, void *rdmaInfo){
78 LrtsSetRdmaRecvInfo(dest, numOps, charmMsg, rdmaInfo);
81 /* Set the receiver specific machine layer info specific to RDMA ops*/
82 void CmiSetRdmaRecvOpInfo(void *dest, void *buffer, void *src_ref, int size, int opIndex, void *rdmaInfo){
83 LrtsSetRdmaRecvOpInfo(dest, buffer, src_ref, size, opIndex, rdmaInfo);
86 /* Get the size occupied by the receiver specific machine layer specific to RDMA op*/
87 int CmiGetRdmaOpRecvInfoSize(){
88 return LrtsGetRdmaOpRecvInfoSize();
91 /* Get the size occupied by the receiver specific machine layer info generic to RDMA ops*/
92 int CmiGetRdmaGenRecvInfoSize(){
93 return LrtsGetRdmaGenRecvInfoSize();
96 /* Get the total size occupied by the receiver specific machine layer info*/
97 int CmiGetRdmaRecvInfoSize(int numOps){
98 return LrtsGetRdmaRecvInfoSize(numOps);
101 /* Issue RDMA get calls on the pe using the message containing the metadata information*/
102 void CmiIssueRgets(void *recv, int pe){
103 return LrtsIssueRgets(recv, pe);
106 #endif