code clean up
[charm.git] / src / arch / gemini_gni / machine-cmidirect.c
index 6df3deb827fa480b3f60717629d09e623dfe0049..772051e42a1c0ee2fdfa8332a6bf4b1b092bbc73 100644 (file)
@@ -121,20 +121,7 @@ void CmiDirect_put(CmiDirectUserHandle *userHandle) {
             status = GNI_PostFma(ep_hndl_array[userHandle->remoteNode],  pd);
         if(status == GNI_RC_ERROR_RESOURCE|| status == GNI_RC_ERROR_NOMEM )
         {
-            MallocRdmaRequest(rdma_request_msg);
-            rdma_request_msg->destNode = userHandle->remoteNode;
-            rdma_request_msg->pd = pd;
-#if CMK_SMP
-            PCQueuePush(sendRdmaBuf, (char*)rdma_request_msg);
-#else
-            if(sendRdmaBuf == 0)
-            {
-                sendRdmaBuf = sendRdmaTail = rdma_request_msg;
-            }else{
-                sendRdmaTail->next = rdma_request_msg;
-                sendRdmaTail =  rdma_request_msg;
-            }
-#endif
+            bufferRdmaMsg(userHandle->remoteNode, pd); 
         }else
             GNI_RC_CHECK("CMI_Direct_PUT", status);
     }
@@ -185,20 +172,7 @@ void CmiDirect_get(CmiDirectUserHandle *userHandle) {
             status = GNI_PostFma(ep_hndl_array[userHandle->remoteNode],  pd);
         if(status == GNI_RC_ERROR_RESOURCE|| status == GNI_RC_ERROR_NOMEM )
         {
-            MallocRdmaRequest(rdma_request_msg);
-            rdma_request_msg->destNode = userHandle->remoteNode;
-            rdma_request_msg->pd = pd;
-#if CMK_SMP
-            PCQueuePush(sendRdmaBuf, (char*)rdma_request_msg);
-#else
-            if(sendRdmaBuf == 0)
-            {
-                sendRdmaBuf = sendRdmaTail = rdma_request_msg;
-            }else{
-                sendRdmaTail->next = rdma_request_msg;
-                sendRdmaTail =  rdma_request_msg;
-            }
-#endif
+            bufferRdmaMsg(userHandle->remoteNode, pd); 
         }else
             GNI_RC_CHECK("CMI_Direct_GET", status);
     }