fixed: wrong root rank in variadic broadcast

change the test to broadcast from rank 1 instead of 0
so this bug does not resurface
This commit is contained in:
Arne Morten Kvarving
2022-09-14 19:38:24 +02:00
parent 67ec01a730
commit 5c78925981
2 changed files with 10 additions and 10 deletions

View File

@@ -61,18 +61,18 @@ BOOST_AUTO_TEST_CASE(BroadCast)
auto cc = Dune::MPIHelper::getCollectiveCommunication();
std::vector<double> d(3);
if (cc.rank() == 0)
if (cc.rank() == 1)
std::iota(d.begin(), d.end(), 1.0);
std::vector<int> i(3);
if (cc.rank() == 0)
if (cc.rank() == 1)
std::iota(i.begin(), i.end(), 4);
double d1 = cc.rank() == 0 ? 7.0 : 0.0;
size_t i1 = cc.rank() == 0 ? 8 : 0;
double d1 = cc.rank() == 1 ? 7.0 : 0.0;
size_t i1 = cc.rank() == 1 ? 8 : 0;
Opm::EclMpiSerializer ser(cc);
ser.broadcast(0, d, i, d1, i1);
ser.broadcast(1, d, i, d1, i1);
for (size_t c = 0; c < 3; ++c) {
BOOST_CHECK_EQUAL(d[c], 1.0+c);