From 267ca781cdffc0c7006a848bb3467b6d176eaccd Mon Sep 17 00:00:00 2001 From: Joost VandeVondele Date: Sat, 29 Dec 2018 19:01:10 +0100 Subject: [PATCH] Always wait before posting the next call in _sync. --- src/cluster.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/cluster.cpp b/src/cluster.cpp index 40f5aae4..d01a05e5 100644 --- a/src/cluster.cpp +++ b/src/cluster.cpp @@ -191,10 +191,11 @@ void signals_sync() { uint64_t globalCounter; MPI_Allreduce(&signalsCallCounter, &globalCounter, 1, MPI_UINT64_T, MPI_MAX, MoveComm); // MoveComm needed if (signalsCallCounter < globalCounter) + { + MPI_Wait(&reqSignals, MPI_STATUS_IGNORE); signals_send(); - + } assert(signalsCallCounter == globalCounter); - MPI_Wait(&reqSignals, MPI_STATUS_IGNORE); signals_process(); @@ -204,12 +205,14 @@ void signals_sync() { if (gathersPosted < globalCounter) { size_t recvBuffPerRankSize = Threads.size() * TTCacheSize; + MPI_Wait(&reqGather, MPI_STATUS_IGNORE); MPI_Iallgather(MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, TTRecvBuff.data(), recvBuffPerRankSize * sizeof(KeyedTTEntry), MPI_BYTE, TTComm, &reqGather); ++gathersPosted; } assert(gathersPosted == globalCounter); + MPI_Wait(&reqGather, MPI_STATUS_IGNORE); }