From caed3b2eed478c76f34d56b5d0495bf26e44a9bb Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Fri, 26 Jun 2020 22:19:21 +0200 Subject: [PATCH] osc rdma: check for outstanding fragments before completing a request in ompi_osc_rdma_put_complete_flush as well Signed-off-by: Joseph Schuchart --- ompi/mca/osc/rdma/osc_rdma_comm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ompi/mca/osc/rdma/osc_rdma_comm.c b/ompi/mca/osc/rdma/osc_rdma_comm.c index d88fdf5c51..af80efcc98 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.c +++ b/ompi/mca/osc/rdma/osc_rdma_comm.c @@ -422,8 +422,10 @@ static void ompi_osc_rdma_put_complete_flush (struct mca_btl_base_module_t *btl, ompi_osc_rdma_request_t *request = request = (ompi_osc_rdma_request_t *) ((intptr_t) context & ~1); module = request->module; - /* NTH -- TODO: better error handling */ - ompi_osc_rdma_request_complete (request, status); + if (0 == OPAL_THREAD_ADD_FETCH32 (&request->outstanding_requests, -1)) { + /* NTH -- TODO: better error handling */ + ompi_osc_rdma_request_complete (request, status); + } } OSC_RDMA_VERBOSE(status ? MCA_BASE_VERBOSE_ERROR : MCA_BASE_VERBOSE_TRACE, "btl put complete on module %p. local "