From 5f4efbde73392ad7467da2412aeaf50a813b23e9 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Mon, 8 Nov 2021 12:02:04 +0100 Subject: [PATCH] broadcast with Schedule and TransMult specialization --- ebos/eclgenericcpgridvanguard.cc | 2 +- opm/simulators/utils/ParallelSerialization.cpp | 10 ++++++++-- opm/simulators/utils/ParallelSerialization.hpp | 6 ++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ebos/eclgenericcpgridvanguard.cc b/ebos/eclgenericcpgridvanguard.cc index de5e1c938..a1300252b 100644 --- a/ebos/eclgenericcpgridvanguard.cc +++ b/ebos/eclgenericcpgridvanguard.cc @@ -330,7 +330,7 @@ void EclGenericCpGridVanguard::doFilterConnection { // Broadcast another time to remove inactive peforations on // slave processors. - eclScheduleBroadcast(EclGenericVanguard::comm(), schedule); + eclBroadcast(EclGenericVanguard::comm(), schedule); } catch(const std::exception& broadcast_error) { diff --git a/opm/simulators/utils/ParallelSerialization.cpp b/opm/simulators/utils/ParallelSerialization.cpp index df63ae841..c7632679c 100644 --- a/opm/simulators/utils/ParallelSerialization.cpp +++ b/opm/simulators/utils/ParallelSerialization.cpp @@ -57,9 +57,15 @@ void eclStateBroadcast(Parallel::Communication comm, EclipseState& eclState, Sch ser.broadcast(wtestState); } -void eclScheduleBroadcast(Parallel::Communication comm, Schedule& schedule) +template +void eclBroadcast(Parallel::Communication comm, T& data) { Opm::EclMpiSerializer ser(comm); - ser.broadcast(schedule); + ser.broadcast(data); } + + +template void eclBroadcast(Parallel::Communication, TransMult&); +template void eclBroadcast(Parallel::Communication, Schedule&); + } diff --git a/opm/simulators/utils/ParallelSerialization.hpp b/opm/simulators/utils/ParallelSerialization.hpp index 5c24eddd3..1263d0c1d 100644 --- a/opm/simulators/utils/ParallelSerialization.hpp +++ b/opm/simulators/utils/ParallelSerialization.hpp @@ -45,8 +45,10 @@ void eclStateBroadcast(Parallel::Communication comm, EclipseState& eclState, Sc Action::State& actionState, WellTestState& wtestState); -/// \brief Broadcasts an schedule from root node in parallel runs. -void eclScheduleBroadcast(Parallel::Communication comm, Schedule& schedule); + +template +void eclBroadcast(Parallel::Communication comm, T& ); + } // end namespace Opm