From 7c633b142093de0e4b75bef0b275f83258dbcb05 Mon Sep 17 00:00:00 2001 From: Artemy Kovalyov Date: Tue, 6 Feb 2024 17:30:41 +0200 Subject: [PATCH] UCP/FLUSH: Flush all EPs in strong fence --- src/ucp/rma/flush.c | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/src/ucp/rma/flush.c b/src/ucp/rma/flush.c index 071dda5575c..e73aae6e79c 100644 --- a/src/ucp/rma/flush.c +++ b/src/ucp/rma/flush.c @@ -720,31 +720,10 @@ static ucs_status_t ucp_worker_fence_weak(ucp_worker_h worker) static ucs_status_t ucp_worker_fence_strong(ucp_worker_h worker) { - ucp_request_t *request; - ucs_status_ptr_t status_ptr; - ucs_status_t status; - - ucp_worker_flush_ops_count_add(worker, 1); - status_ptr = ucp_worker_flush_nbx_internal(worker, - &ucp_request_null_param, - UCT_FLUSH_FLAG_REMOTE); - if (ucs_unlikely(!UCS_PTR_IS_PTR(status_ptr))) { - status = UCS_PTR_STATUS(status_ptr); - goto out; - } - - request = (ucp_request_t*)status_ptr - 1; - - do { - ucp_worker_progress(worker); - } while (request->flush_worker.comp_count > 1); - - ucp_worker_flush_complete_one(request, request->status, 1); - status = request->status; - ucp_request_put(request); -out: - ucp_worker_flush_ops_count_add(worker, -1); - return status; + void *request = ucp_worker_flush_nbx_internal(worker, + &ucp_request_null_param, + UCT_FLUSH_FLAG_REMOTE); + return ucp_rma_wait(worker, request, "strong_fence"); } UCS_PROFILE_FUNC(ucs_status_t, ucp_worker_fence, (worker), ucp_worker_h worker)