Merge pull request #3671 from joakim-hove/broadcast-mult-update

Broadcast mult update
This commit is contained in:
Joakim Hove authored and GitHub committed 2021-11-09 14:50:11 +01:00
commit c97447892e
4 files changed
+18 -5

No files matched your search

+1 -1
View File
@@ -330,7 +330,7 @@ void EclGenericCpGridVanguard<ElementMapper,GridView,Scalar>::doFilterConnection
{ {
// Broadcast another time to remove inactive peforations on // Broadcast another time to remove inactive peforations on
// slave processors. // slave processors.
eclScheduleBroadcast(EclGenericVanguard::comm(), schedule); eclBroadcast(EclGenericVanguard::comm(), schedule);
} }
catch(const std::exception& broadcast_error) catch(const std::exception& broadcast_error)
{ {
+3
View File
@@ -69,6 +69,7 @@
#include <opm/core/props/satfunc/RelpermDiagnostics.hpp> #include <opm/core/props/satfunc/RelpermDiagnostics.hpp>
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp> #include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
#include <opm/simulators/utils/ParallelSerialization.hpp>
#include <opm/models/utils/pffgridvector.hh> #include <opm/models/utils/pffgridvector.hh>
#include <opm/models/blackoil/blackoilmodel.hh> #include <opm/models/blackoil/blackoilmodel.hh>
@@ -1023,7 +1024,9 @@ public:
// has changed, the grid may need be re-created which has some serious // has changed, the grid may need be re-created which has some serious
// implications on e.g., the solution of the simulation.) // implications on e.g., the solution of the simulation.)
const auto& miniDeck = schedule[episodeIdx].geo_keywords(); const auto& miniDeck = schedule[episodeIdx].geo_keywords();
const auto& cc = simulator.vanguard().grid().comm();
eclState.apply_schedule_keywords( miniDeck ); eclState.apply_schedule_keywords( miniDeck );
eclBroadcast(cc, eclState.getTransMult() );
// re-compute all quantities which may possibly be affected. // re-compute all quantities which may possibly be affected.
transmissibilities_.update(true); transmissibilities_.update(true);
@@ -34,6 +34,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp>
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp> #include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/TransMult.hpp>
#include <ebos/eclmpiserializer.hh> #include <ebos/eclmpiserializer.hh>
@@ -57,9 +58,15 @@ void eclStateBroadcast(Parallel::Communication comm, EclipseState& eclState, Sch
ser.broadcast(wtestState); ser.broadcast(wtestState);
} }
void eclScheduleBroadcast(Parallel::Communication comm, Schedule& schedule) template <class T>
void eclBroadcast(Parallel::Communication comm, T& data)
{ {
Opm::EclMpiSerializer ser(comm); Opm::EclMpiSerializer ser(comm);
ser.broadcast(schedule); ser.broadcast(data);
} }
template void eclBroadcast<TransMult>(Parallel::Communication, TransMult&);
template void eclBroadcast<Schedule>(Parallel::Communication, Schedule&);
} }
@@ -28,6 +28,7 @@ class Schedule;
class SummaryConfig; class SummaryConfig;
class UDQState; class UDQState;
class WellTestState; class WellTestState;
class TransMult;
namespace Action { namespace Action {
class State; class State;
@@ -45,8 +46,10 @@ void eclStateBroadcast(Parallel::Communication comm, EclipseState& eclState, Sc
Action::State& actionState, Action::State& actionState,
WellTestState& wtestState); WellTestState& wtestState);
/// \brief Broadcasts an schedule from root node in parallel runs.
void eclScheduleBroadcast(Parallel::Communication comm, Schedule& schedule); template <class T>
void eclBroadcast(Parallel::Communication comm, T& );
} // end namespace Opm } // end namespace Opm