mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
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:
@@ -136,8 +136,17 @@ public:
|
|||||||
template<class T>
|
template<class T>
|
||||||
T broadcastFirstPerforationValue(const T& t) const
|
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_);
|
comm_->broadcast(&res, 1, rankWithFirstPerf_);
|
||||||
|
#ifndef NDEBUG
|
||||||
|
comm_->barrier();
|
||||||
|
#endif
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user