From 85ed26f2f859283522188a68dea493cdc99d76aa Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Tue, 16 Jun 2020 17:45:00 +0200 Subject: [PATCH] osc rdma: check for outstanding fragments before completing a request 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 1c16676778..d88fdf5c51 100644 --- a/ompi/mca/osc/rdma/osc_rdma_comm.c +++ b/ompi/mca/osc/rdma/osc_rdma_comm.c @@ -391,8 +391,10 @@ static void ompi_osc_rdma_put_complete (struct mca_btl_base_module_t *btl, struc ompi_osc_rdma_request_t *request = request = (ompi_osc_rdma_request_t *) ((intptr_t) context & ~1); sync = request->sync; - /* 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 sync %p. local "