Skip to content

Commit 3b1ba26

Browse files
nitbhatrbuch
authored andcommitted
GNI ZC: Cleanup and bug fix in freeing short messages for gni-crayxe (#3003)
1 parent 851c1d0 commit 3b1ba26

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/arch/gni/machine-onesided.C

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,16 @@ void LrtsIssueRget(NcpyOperationInfo *ncpyOpInfo) {
244244
// send the small message to the other node through the comm thread
245245
buffer_small_msgs(&smsg_queue, ncpyOpInfo, ncpyOpInfo->ncpyOpInfoSize, CmiNodeOf(ncpyOpInfo->srcPe), RDMA_PUT_MD_DIRECT_TAG);
246246
#else // nonsmp mode
247-
// send the small message directly
248247
int msgMode = (ncpyOpInfo->freeMe == CMK_FREE_NCPYOPINFO) ? CHARM_SMSG : SMSG_DONT_FREE;
249248

250-
gni_return_t status = send_smsg_message(&smsg_queue, CmiNodeOf(ncpyOpInfo->srcPe), ncpyOpInfo, ncpyOpInfo->ncpyOpInfoSize, RDMA_PUT_MD_DIRECT_TAG, 0, NULL, SMSG_DONT_FREE, 1);
249+
// send the small message directly
250+
gni_return_t status = send_smsg_message(&smsg_queue,
251+
CmiNodeOf(ncpyOpInfo->srcPe),
252+
ncpyOpInfo,
253+
ncpyOpInfo->ncpyOpInfoSize,
254+
RDMA_PUT_MD_DIRECT_TAG,
255+
0, NULL, msgMode, 1);
256+
251257
#if !CMK_SMSGS_FREE_AFTER_EVENT
252258
if(status == GNI_RC_SUCCESS && ncpyOpInfo->freeMe == CMK_FREE_NCPYOPINFO) {
253259
CmiFree(ncpyOpInfo);

src/arch/gni/machine.C

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,26 +3270,16 @@ INLINE_KEYWORD gni_return_t _sendOneBufferedSmsg(SMSG_QUEUE *queue, MSG_LIST *pt
32703270
#endif
32713271
break;
32723272
#endif
3273-
case RDMA_PUT_MD_DIRECT_TAG:
3274-
ncpyOpInfo = (NcpyOperationInfo *)(ptr->msg);
3275-
msgMode = (ncpyOpInfo->freeMe == CMK_FREE_NCPYOPINFO) ? CHARM_SMSG : SMSG_DONT_FREE;
3276-
status = send_smsg_message(queue, ptr->destNode, ptr->msg, ncpyOpInfo->ncpyOpInfoSize, ptr->tag, 1, ptr, msgMode, 1);
3277-
#if !CMK_SMSGS_FREE_AFTER_EVENT
3278-
if(status == GNI_RC_SUCCESS && msgMode) {
3279-
CmiFree(ptr->msg);
3280-
}
3281-
#endif
3282-
break;
32833273

3274+
case RDMA_PUT_MD_DIRECT_TAG:
32843275
case RDMA_REG_AND_GET_MD_DIRECT_TAG:
32853276
case RDMA_REG_AND_PUT_MD_DIRECT_TAG:
32863277
case RDMA_DEREG_AND_ACK_MD_DIRECT_TAG:
3287-
//msgSize = sizeof(CmiGNIRzvRdmaReverseOp_t) + 2*(((CmiGNIRzvRdmaReverseOp_t *)(ptr->msg))->ackSize);
32883278
ncpyOpInfo = (NcpyOperationInfo *)(ptr->msg);
32893279
msgMode = (ncpyOpInfo->freeMe == CMK_FREE_NCPYOPINFO) ? CHARM_SMSG : SMSG_DONT_FREE;
32903280
status = send_smsg_message(queue, ptr->destNode, ptr->msg, ncpyOpInfo->ncpyOpInfoSize, ptr->tag, 1, ptr, msgMode, 1);
32913281
#if !CMK_SMSGS_FREE_AFTER_EVENT
3292-
if(status == GNI_RC_SUCCESS && msgMode) {
3282+
if(status == GNI_RC_SUCCESS && ncpyOpInfo->freeMe == CMK_FREE_NCPYOPINFO) {
32933283
CmiFree(ptr->msg);
32943284
}
32953285
#endif

0 commit comments

Comments
 (0)