barrier before and after MPI_Broadcast in non-production runs.

This helps with debugging as for some OpenMPI versions communication
might interfere with other communications if there are bugs.
This commit is contained in:
Markus Blatt 2020-11-17 17:09:03 +01:00
parent 901327ac54
commit 6f4fa114c1

View File

@ -136,8 +136,17 @@ public:
template<class T>
T broadcastFirstPerforationValue(const T& t) const
{
T res=t;
T res = t;
#ifndef NDEBUG
assert(rankWithFirstPerf_ >= 0 && rankWithFirstPerf_ < comm_->size());
// At least on some OpenMPI version this might broadcast might interfere
// with other communication if there are bugs
comm_->barrier();
#endif
comm_->broadcast(&res, 1, rankWithFirstPerf_);
#ifndef NDEBUG
comm_->barrier();
#endif
return res;
}