From: Mark Abraham Date: Mon, 1 Nov 2021 07:58:18 +0000 (+0100) Subject: Add missing MPI_Barrier to MpiTest X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?p=alexxy%2Fgromacs.git;a=commitdiff_plain;h=e51034e33f225cbc0563941cfe3028149b5ee875 Add missing MPI_Barrier to MpiTest Fixes #4261 --- diff --git a/src/testutils/tests/mpitest.cpp b/src/testutils/tests/mpitest.cpp index f3d8c0f4ec..8d3b9521fc 100644 --- a/src/testutils/tests/mpitest.cpp +++ b/src/testutils/tests/mpitest.cpp @@ -74,6 +74,9 @@ TEST_F(MpiSelfTest, Runs) { reached_.resize(getNumberOfTestMpiRanks(), 0); } + // Needed for thread-MPI so that we resize the buffer before we + // fill it on non-master ranks. + MPI_Barrier(MPI_COMM_WORLD); int value = 1; MPI_Gather(&value, 1, MPI_INT, reached_.data(), 1, MPI_INT, 0, MPI_COMM_WORLD); if (gmx_node_rank() == 0)