From 030f381574e1668c2f9e50087d00054cfe6e3348 Mon Sep 17 00:00:00 2001 From: Luke Robison Date: Thu, 22 Feb 2024 17:24:42 +0000 Subject: [PATCH] pml/cm: Correct pml request memory leak in MPI_Recv This addresses a leak introduced in 73977ba114284cb1cd11c9a7819e678778754ee5. It can be observed by an mpi application using pml/cm calling MPI_Recv many times which will eventually OOM. During investigation I also wondered if there was significant performance impact from using the list rather than stack-based alloca, however testing shows no performance difference beyond measurement noise of ~0.5 usec, so keep the refactor, and just ensure the request object is returned. Signed-off-by: Luke Robison --- ompi/mca/pml/cm/pml_cm.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ompi/mca/pml/cm/pml_cm.h b/ompi/mca/pml/cm/pml_cm.h index e0671aaca7f..4abf40c5f94 100644 --- a/ompi/mca/pml/cm/pml_cm.h +++ b/ompi/mca/pml/cm/pml_cm.h @@ -121,14 +121,6 @@ mca_pml_cm_irecv(void *addr, return ret; } -__opal_attribute_always_inline__ static inline void -mca_pml_cm_recv_fast_completion(struct mca_mtl_request_t *mtl_request) -{ - // Do nothing! - ompi_request_complete(mtl_request->ompi_req, true); - return; -} - __opal_attribute_always_inline__ static inline int mca_pml_cm_recv(void *addr, size_t count, @@ -159,7 +151,6 @@ mca_pml_cm_recv(void *addr, count, flags); - recvreq->req_mtl.completion_callback = mca_pml_cm_recv_fast_completion; assert(NULL == recvreq->req_base.req_ompi.req_complete_cb); MCA_PML_CM_THIN_RECV_REQUEST_START(recvreq, comm, tag, src, ret);