From 4492bac7bfe6decd7f7bbac6886cbd51e23786c0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 16 Jun 2023 10:01:16 -0600 Subject: [PATCH] Wait for communication to finish. --- source/grid/grid_tools.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index ef9414da49..75c0240007 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -3665,6 +3665,11 @@ namespace GridTools AssertThrowMPI(ierr); } + // At this point, wait for all of the isend operations to finish: + MPI_Waitall(first_requests.size(), + first_requests.data(), + MPI_STATUSES_IGNORE); + // Send second message std::vector> cellids_send_buffers( @@ -3773,6 +3778,12 @@ namespace GridTools } } } + + // At this point, wait for all of the isend operations of the second round + // to finish: + MPI_Waitall(second_requests.size(), + second_requests.data(), + MPI_STATUSES_IGNORE); #endif return local_to_global_vertex_index; -- 2.39.5