From 2fb6947f888f85fc53155d1be72c73a605c60315 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Sun, 23 Dec 2007 13:58:31 +0000 Subject: [PATCH] Destroy endpoints that use eager rdma communication before destroying SRQ. Do't skip async event thread destruction if SRQ was not destroyed, or it will segfault on module removal. This commit was SVN r17025. --- ompi/mca/btl/openib/btl_openib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ompi/mca/btl/openib/btl_openib.c b/ompi/mca/btl/openib/btl_openib.c index e2dbd62933..83e4e770b4 100644 --- a/ompi/mca/btl/openib/btl_openib.c +++ b/ompi/mca/btl/openib/btl_openib.c @@ -990,6 +990,12 @@ int mca_btl_openib_finalize(struct mca_btl_base_module_t* btl) } if(endpoint->endpoint_btl != openib_btl) continue; + for(i = 0; i < openib_btl->hca->eager_rdma_buffers_count; i++) { + if(openib_btl->hca->eager_rdma_buffers[i] == endpoint) { + openib_btl->hca->eager_rdma_buffers[i] = NULL; + OBJ_RELEASE(endpoint); + } + } OBJ_RELEASE(endpoint); } /* Release SRQ resources */ @@ -1001,7 +1007,7 @@ int mca_btl_openib_finalize(struct mca_btl_base_module_t* btl) &openib_btl->qps[qp].u.srq_qp.pending_frags[1]); if (ibv_destroy_srq(openib_btl->qps[qp].u.srq_qp.srq)){ BTL_VERBOSE(("Failed to close SRQ %d", qp)); - return OMPI_ERROR; + rc = OMPI_ERROR; } OBJ_DESTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags[0]); OBJ_DESTRUCT(&openib_btl->qps[qp].u.srq_qp.pending_frags[1]);