mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06: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:
parent
901327ac54
commit
6f4fa114c1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user