From e87ec7b5a4af293f10c115ae5595e1b4754c0488 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 13:21:23 +0100 Subject: [PATCH 01/61] remove old serialization support for TimeStampUTC --- opm/simulators/utils/ParallelRestart.cpp | 39 ++---------------------- opm/simulators/utils/ParallelRestart.hpp | 2 -- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 1e5cf9b07..716ef8688 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -285,7 +285,6 @@ HANDLE_AS_POD(data::CurrentControl) HANDLE_AS_POD(data::Rates) HANDLE_AS_POD(data::Segment) HANDLE_AS_POD(MLimits) -HANDLE_AS_POD(TimeStampUTC::YMD) HANDLE_AS_POD(Tuning) HANDLE_AS_POD(WellBrineProperties) HANDLE_AS_POD(WellFoamProperties) @@ -915,16 +914,6 @@ std::size_t packSize(const RestartSchedule& data, packSize(data.rptsched_restart, comm); } -std::size_t packSize(const TimeStampUTC& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.ymd(), comm) + - packSize(data.hour(), comm) + - packSize(data.minutes(), comm) + - packSize(data.seconds(), comm) + - packSize(data.microseconds(), comm); -} - std::size_t packSize(const WellPolymerProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1842,17 +1831,6 @@ void pack(const RestartSchedule& data, pack(data.rptsched_restart, buffer, position, comm); } -void pack(const TimeStampUTC& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.ymd(), buffer, position, comm); - pack(data.hour(), buffer, position, comm); - pack(data.minutes(), buffer, position, comm); - pack(data.seconds(), buffer, position, comm); - pack(data.microseconds(), buffer, position, comm); -} - void pack(const WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -3105,21 +3083,6 @@ void unpack(RestartSchedule& data, unpack(data.rptsched_restart, buffer, position, comm); } -void unpack(TimeStampUTC& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - TimeStampUTC::YMD ymd; - int hour, minutes, seconds, usec; - - unpack(ymd, buffer, position, comm); - unpack(hour, buffer, position, comm); - unpack(minutes, buffer, position, comm); - unpack(seconds, buffer, position, comm); - unpack(usec, buffer, position, comm); - data = TimeStampUTC(ymd, hour, minutes, seconds, usec); -} - void unpack(WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -3174,12 +3137,14 @@ INSTANTIATE_PACK_VECTOR(bool) INSTANTIATE_PACK_VECTOR(char) INSTANTIATE_PACK_VECTOR(int) INSTANTIATE_PACK_VECTOR(size_t) +INSTANTIATE_PACK_VECTOR(std::time_t) INSTANTIATE_PACK_VECTOR(std::array) INSTANTIATE_PACK_VECTOR(std::pair) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) +INSTANTIATE_PACK_VECTOR(std::map) INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index b6e175aa2..f3bf3d2fa 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -72,7 +72,6 @@ class RestartSchedule; class RFTConfig; class Segment; class SpiralICD; -class TimeStampUTC; class Tuning; class UDAValue; class UnitSystem; @@ -452,7 +451,6 @@ ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(SpiralICD) ADD_PACK_PROTOTYPES(std::string) ADD_PACK_PROTOTYPES(TimeMap) -ADD_PACK_PROTOTYPES(TimeStampUTC) ADD_PACK_PROTOTYPES(Tuning) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) From f0bc3e38153ac2a7c92bd647f8f66251fd5f9d67 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 13:56:12 +0100 Subject: [PATCH 02/61] add bool parameter ComplexType to EclMpiSerializer::map this is passed on to the serializeOp template for the underlying type. used with maps over DynamicState where DynamicState is over a non-complex type. --- ebos/eclmpiserializer.hh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index 53b7e996e..224837499 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -81,15 +81,20 @@ public: } } - template class Map, class Key, class Data> - void map(Map& data) + template + void map(Map& data) { + using Key = typename Map::key_type; + using Data = typename Map::mapped_type; + auto handle = [&](auto& d) { if constexpr (is_vector::value) vector(d); else if constexpr (is_shared_ptr::value) shared_ptr(d); + else if constexpr (!complexType) + d.template serializeOp(*this); else d.serializeOp(*this); }; From 6d74eb8e88c688acb7c39aac5fc3a2141ffb7e7c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 13:58:42 +0100 Subject: [PATCH 03/61] remove old serialization support for RestartConfig --- opm/simulators/utils/ParallelRestart.cpp | 73 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 4 -- tests/test_ParallelRestart.cpp | 4 +- 3 files changed, 2 insertions(+), 79 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 716ef8688..cfcca9de2 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -24,7 +24,6 @@ #include "ParallelRestart.hpp" #include #include -#include #include #include #include @@ -341,16 +340,6 @@ std::size_t packSize(const TimeMap& data, Dune::MPIHelper::MPICommunicator comm) return packSize(data.timeList(), comm); } -std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.timeMap(), comm) + - packSize(data.getFirstRestartStep(), comm) + - packSize(data.writeInitialRst(), comm) + - packSize(data.restartSchedule(), comm) + - packSize(data.restartKeywords(), comm) + - packSize(data.saveKeywords(), comm); -} - template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); @@ -904,16 +893,6 @@ std::size_t packSize(const Action::Actions& data, return packSize(data.getActions(), comm); } -std::size_t packSize(const RestartSchedule& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.timestep, comm) + - packSize(data.basic, comm) + - packSize(data.frequency, comm) + - packSize(data.rptsched_restart_set, comm) + - packSize(data.rptsched_restart, comm); -} - std::size_t packSize(const WellPolymerProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1221,17 +1200,6 @@ void pack(const TimeMap& data, std::vector& buffer, int& position, pack(data.timeList(), buffer, position, comm); } -void pack(const RestartConfig& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.timeMap(), buffer, position, comm); - pack(data.getFirstRestartStep(), buffer, position, comm); - pack(data.writeInitialRst(), buffer, position, comm); - pack(data.restartSchedule(), buffer, position, comm); - pack(data.restartKeywords(), buffer, position, comm); - pack(data.saveKeywords(), buffer, position, comm); -} - void pack(const OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1820,17 +1788,6 @@ void pack(const Action::Actions& data, pack(data.getActions(), buffer, position, comm); } -void pack(const RestartSchedule& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.timestep, buffer, position, comm); - pack(data.basic, buffer, position, comm); - pack(data.frequency, buffer, position, comm); - pack(data.rptsched_restart_set, buffer, position, comm); - pack(data.rptsched_restart, buffer, position, comm); -} - void pack(const WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2165,25 +2122,6 @@ void unpack(TimeMap& data, std::vector& buffer, int& position, data = TimeMap(timeList); } -void unpack(RestartConfig& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - TimeMap timemap; - int firstRstStep; - bool writeInitialRst; - DynamicState restart_sched; - DynamicState> restart_keyw; - std::vector save_keyw; - unpack(timemap, buffer, position, comm); - unpack(firstRstStep, buffer, position, comm); - unpack(writeInitialRst, buffer, position, comm); - unpack(restart_sched, buffer, position, comm); - unpack(restart_keyw, buffer, position, comm); - unpack(save_keyw, buffer, position, comm); - data = RestartConfig(timemap, firstRstStep, writeInitialRst, restart_sched, - restart_keyw, save_keyw); -} - void unpack(OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -3072,17 +3010,6 @@ void unpack(Action::Actions& data, std::vector& buffer, int& position, data = Action::Actions(actions); } -void unpack(RestartSchedule& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.timestep, buffer, position, comm); - unpack(data.basic, buffer, position, comm); - unpack(data.frequency, buffer, position, comm); - unpack(data.rptsched_restart_set, buffer, position, comm); - unpack(data.rptsched_restart, buffer, position, comm); -} - void unpack(WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index f3bf3d2fa..b96cd0b0f 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -67,8 +67,6 @@ class Location; class MessageLimits; class MLimits; class OilVaporizationProperties; -class RestartConfig; -class RestartSchedule; class RFTConfig; class Segment; class SpiralICD; @@ -442,9 +440,7 @@ ADD_PACK_PROTOTYPES(Location) ADD_PACK_PROTOTYPES(MessageLimits) ADD_PACK_PROTOTYPES(MLimits) ADD_PACK_PROTOTYPES(OilVaporizationProperties) -ADD_PACK_PROTOTYPES(RestartConfig) ADD_PACK_PROTOTYPES(RestartKey) -ADD_PACK_PROTOTYPES(RestartSchedule) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(RFTConfig) ADD_PACK_PROTOTYPES(Segment) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 1805f1549..7fa923da1 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -866,7 +866,7 @@ BOOST_AUTO_TEST_CASE(RestartSchedule) { #if HAVE_MPI Opm::RestartSchedule val1(1, 2, 3); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(RestartSchedule) #endif } @@ -891,7 +891,7 @@ BOOST_AUTO_TEST_CASE(RestartConfig) Opm::IOConfig io(true, false, true, false, false, true, "test1", true, "test2", true, "test3", false); Opm::RestartConfig val1(getTimeMap(), 1, true, rsched, rkw, {false, true}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(RestartConfig) #endif } From bbf3b80b3af6820b207ba3c0c0326bb11acb8ebf Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 14:00:35 +0100 Subject: [PATCH 04/61] remove old serialization support for RFTConfig --- opm/simulators/utils/ParallelRestart.cpp | 52 ++---------------------- opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 4 insertions(+), 52 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index cfcca9de2..e84766aaf 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -777,18 +777,6 @@ std::size_t packSize(const GConSump& data, return packSize(data.getGroups(), comm); } -std::size_t packSize(const RFTConfig& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.timeMap(), comm) + - packSize(data.firstRFTOutput(), comm) + - packSize(data.wellOpenRftTime(), comm) + - packSize(data.wellOpenRftName(), comm) + - packSize(data.wellOpen(), comm) + - packSize(data.rftConfig(), comm) + - packSize(data.pltConfig(), comm); -} - std::size_t packSize(const DeckItem& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1661,19 +1649,6 @@ void pack(const GConSump& data, pack(data.getGroups(), buffer, position, comm); } -void pack(const RFTConfig& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.timeMap(), buffer, position, comm); - pack(data.firstRFTOutput(), buffer, position, comm); - pack(data.wellOpenRftTime(), buffer, position, comm); - pack(data.wellOpenRftName(), buffer, position, comm); - pack(data.wellOpen(), buffer, position, comm); - pack(data.rftConfig(), buffer, position, comm); - pack(data.pltConfig(), buffer, position, comm); -} - void pack(const DeckItem& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2825,30 +2800,6 @@ void unpack(GConSump& data, data = GConSump(groups); } -void unpack(RFTConfig& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - TimeMap timeMap; - std::size_t first_rft; - std::pair wellOpenRftTime; - RFTConfig::WellOpenTimeMap wellOpenRftName; - RFTConfig::WellOpenTimeMap wellOpen; - RFTConfig::RFTMap rftConfig; - RFTConfig::PLTMap pltConfig; - - unpack(timeMap, buffer, position, comm); - unpack(first_rft, buffer, position, comm); - unpack(wellOpenRftTime, buffer, position, comm); - unpack(wellOpenRftName, buffer, position, comm); - unpack(wellOpen, buffer, position, comm); - unpack(rftConfig, buffer, position, comm); - unpack(pltConfig, buffer, position, comm); - data = RFTConfig(timeMap, first_rft, wellOpenRftTime, wellOpenRftName, - wellOpen, rftConfig, pltConfig); -} - - void unpack(DeckItem& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -3074,6 +3025,8 @@ INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::map) INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) +INSTANTIATE_PACK_VECTOR(std::pair) +INSTANTIATE_PACK_VECTOR(std::pair) #undef INSTANTIATE_PACK_VECTOR @@ -3134,6 +3087,7 @@ INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::pair) +INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState>) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index b96cd0b0f..e2d508f64 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -67,7 +67,6 @@ class Location; class MessageLimits; class MLimits; class OilVaporizationProperties; -class RFTConfig; class Segment; class SpiralICD; class Tuning; @@ -442,7 +441,6 @@ ADD_PACK_PROTOTYPES(MLimits) ADD_PACK_PROTOTYPES(OilVaporizationProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) -ADD_PACK_PROTOTYPES(RFTConfig) ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(SpiralICD) ADD_PACK_PROTOTYPES(std::string) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 7fa923da1..5483a5390 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1913,7 +1913,7 @@ BOOST_AUTO_TEST_CASE(RFTConfig) {{"test3", 2}}, {{"test1", {{{Opm::RFTConfig::RFT::TIMESTEP, 3}}, 4}}}, {{"test2", {{{Opm::RFTConfig::PLT::REPT, 5}}, 6}}}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(RFTConfig) #endif } From c00d2f2cb31396eecc2490e7dd7968525c51cdb9 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 14:00:35 +0100 Subject: [PATCH 05/61] remove old serialization support for TimeMap --- opm/simulators/utils/ParallelRestart.cpp | 21 --------------------- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index e84766aaf..4224a9ff8 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -335,11 +334,6 @@ std::size_t packSize(const WellType& data, Dune::MPIHelper::MPICommunicator comm packSize(data.preferred_phase(), comm); } -std::size_t packSize(const TimeMap& data, Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.timeList(), comm); -} - template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); @@ -1182,12 +1176,6 @@ void pack(const WellType& data, std::vector& buffer, int& position, pack(data.preferred_phase(), buffer, position, comm); } -void pack(const TimeMap& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.timeList(), buffer, position, comm); -} - void pack(const OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2088,15 +2076,6 @@ void unpack(WellType& data, std::vector& buffer, int& position, Dune::MPIH data = WellType( producer, preferred_phase ); } -void unpack(TimeMap& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector timeList; - unpack(timeList, buffer, position, comm); - - data = TimeMap(timeList); -} - void unpack(OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index e2d508f64..7f0290aec 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -444,7 +443,6 @@ ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(SpiralICD) ADD_PACK_PROTOTYPES(std::string) -ADD_PACK_PROTOTYPES(TimeMap) ADD_PACK_PROTOTYPES(Tuning) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 5483a5390..2540d5fe6 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -877,7 +877,7 @@ BOOST_AUTO_TEST_CASE(TimeMap) { #if HAVE_MPI Opm::TimeMap val1 = getTimeMap(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(TimeMap) #endif } From e5e8c0c51658ac7a9c5e3e181d045fe818fad0a8 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 14:00:35 +0100 Subject: [PATCH 06/61] remove old serialization support for OilVaporiationProperties --- opm/simulators/utils/ParallelRestart.cpp | 44 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 4 +-- 3 files changed, 2 insertions(+), 48 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 4224a9ff8..64272de54 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include @@ -338,17 +337,6 @@ template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); -std::size_t packSize(const OilVaporizationProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getType(), comm) + - packSize(data.vap1(), comm) + - packSize(data.vap2(), comm) + - packSize(data.maxDRSDT(), comm) + - packSize(data.maxDRSDT_allCells(), comm) + - packSize(data.maxDRVDT(), comm); -} - std::size_t packSize(const Events& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1176,19 +1164,6 @@ void pack(const WellType& data, std::vector& buffer, int& position, pack(data.preferred_phase(), buffer, position, comm); } -void pack(const OilVaporizationProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getType(), buffer, position, comm); - pack(data.vap1(), buffer, position, comm); - pack(data.vap2(), buffer, position, comm); - pack(data.maxDRSDT(), buffer, position, comm); - pack(data.maxDRSDT_allCells(), buffer, position, comm); - pack(data.maxDRVDT(), buffer, position, comm); - -} - void pack(const Events& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2076,24 +2051,6 @@ void unpack(WellType& data, std::vector& buffer, int& position, Dune::MPIH data = WellType( producer, preferred_phase ); } -void unpack(OilVaporizationProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - OilVaporizationProperties::OilVaporization type; - double vap1, vap2; - std::vector maxDRSDT, maxDRVDT; - std::vector maxDRSDT_allCells; - unpack(type, buffer, position, comm); - unpack(vap1, buffer, position, comm); - unpack(vap2, buffer, position, comm); - unpack(maxDRSDT, buffer, position, comm); - unpack(maxDRSDT_allCells, buffer, position, comm); - unpack(maxDRVDT, buffer, position, comm); - data = OilVaporizationProperties(type, vap1, vap2, maxDRSDT, - maxDRSDT_allCells, maxDRVDT); -} - void unpack(Events& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -3068,7 +3025,6 @@ INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) -INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 7f0290aec..1839ab0ee 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -65,7 +65,6 @@ template class IOrderSet; class Location; class MessageLimits; class MLimits; -class OilVaporizationProperties; class Segment; class SpiralICD; class Tuning; @@ -437,7 +436,6 @@ ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(Location) ADD_PACK_PROTOTYPES(MessageLimits) ADD_PACK_PROTOTYPES(MLimits) -ADD_PACK_PROTOTYPES(OilVaporizationProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(Segment) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 2540d5fe6..9d27e4130 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1274,12 +1274,12 @@ BOOST_AUTO_TEST_CASE(OilVaporizationProperties) Opm::OilVaporizationProperties val1(VapType::VAPPARS, 1.0, 2.0, {5.0, 6.0}, {false, true}, {7.0, 8.0}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(OilVaporizationProperties) val1 = Opm::OilVaporizationProperties(VapType::DRDT, 1.0, 2.0, {5.0, 6.0}, {false, true}, {7.0, 8.0}); - val2 = PackUnpack(val1); + val2 = PackUnpack2(val1); DO_CHECKS(OilVaporizationProperties) #endif } From 90710725654ec8851e13b5faa73983882b974290 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 14:37:32 +0100 Subject: [PATCH 07/61] remove old serialization support for Events --- opm/simulators/utils/ParallelRestart.cpp | 24 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 64272de54..95c414fb0 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -337,12 +336,6 @@ template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); -std::size_t packSize(const Events& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.events(), comm); -} - std::size_t packSize(const MessageLimits& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1164,13 +1157,6 @@ void pack(const WellType& data, std::vector& buffer, int& position, pack(data.preferred_phase(), buffer, position, comm); } -void pack(const Events& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.events(), buffer, position, comm); -} - void pack(const MessageLimits& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2051,15 +2037,6 @@ void unpack(WellType& data, std::vector& buffer, int& position, Dune::MPIH data = WellType( producer, preferred_phase ); } -void unpack(Events& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - DynamicVector events; - unpack(events, buffer, position, comm); - data = Events(events); -} - void unpack(MessageLimits& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -3016,7 +2993,6 @@ INSTANTIATE_PACK(unsigned char) INSTANTIATE_PACK(std::map,std::pair>) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map>) -INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map,int>>) INSTANTIATE_PACK(std::map) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1839ab0ee..b10124d5a 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -60,7 +60,6 @@ class Connection; class DeckItem; class DeckRecord; class Dimension; -class Events; template class IOrderSet; class Location; class MessageLimits; @@ -421,7 +420,6 @@ ADD_PACK_PROTOTYPES(DeckItem) ADD_PACK_PROTOTYPES(DeckKeyword) ADD_PACK_PROTOTYPES(DeckRecord) ADD_PACK_PROTOTYPES(Dimension) -ADD_PACK_PROTOTYPES(Events) ADD_PACK_PROTOTYPES(GConSale) ADD_PACK_PROTOTYPES(GConSale::GCONSALEGroup) ADD_PACK_PROTOTYPES(GConSump) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 9d27e4130..f0a39677f 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1289,7 +1289,7 @@ BOOST_AUTO_TEST_CASE(Events) { #ifdef HAVE_MPI Opm::Events val1(Opm::DynamicVector({1,2,3,4,5})); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Events) #endif } From 07d91add01e53b0b18526312752d2f1739fe2e79 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:16:42 +0100 Subject: [PATCH 08/61] remove old serialization support for Tuning --- opm/simulators/utils/ParallelRestart.cpp | 3 --- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 95c414fb0..002d56067 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -281,7 +280,6 @@ HANDLE_AS_POD(data::CurrentControl) HANDLE_AS_POD(data::Rates) HANDLE_AS_POD(data::Segment) HANDLE_AS_POD(MLimits) -HANDLE_AS_POD(Tuning) HANDLE_AS_POD(WellBrineProperties) HANDLE_AS_POD(WellFoamProperties) @@ -3005,7 +3003,6 @@ INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) -INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index b10124d5a..4a5370dc7 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -66,7 +66,6 @@ class MessageLimits; class MLimits; class Segment; class SpiralICD; -class Tuning; class UDAValue; class UnitSystem; class Valve; @@ -439,7 +438,6 @@ ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(SpiralICD) ADD_PACK_PROTOTYPES(std::string) -ADD_PACK_PROTOTYPES(Tuning) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) ADD_PACK_PROTOTYPES(Valve) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index f0a39677f..38efca7a6 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1984,7 +1984,7 @@ BOOST_AUTO_TEST_CASE(Tuning) { #ifdef HAVE_MPI Opm::Tuning val1 = getTuning(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Tuning) #endif } From a9365231656d307a149419202d767e100d2b0ec4 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:16:58 +0100 Subject: [PATCH 09/61] remove old serialization support for MessageLimits --- opm/simulators/utils/ParallelRestart.cpp | 23 ----------------------- opm/simulators/utils/ParallelRestart.hpp | 4 ---- tests/test_ParallelRestart.cpp | 4 ++-- 3 files changed, 2 insertions(+), 29 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 002d56067..6cb682746 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -279,7 +278,6 @@ HANDLE_AS_POD(data::Connection) HANDLE_AS_POD(data::CurrentControl) HANDLE_AS_POD(data::Rates) HANDLE_AS_POD(data::Segment) -HANDLE_AS_POD(MLimits) HANDLE_AS_POD(WellBrineProperties) HANDLE_AS_POD(WellFoamProperties) @@ -334,12 +332,6 @@ template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); -std::size_t packSize(const MessageLimits& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getLimits(), comm); -} - std::size_t packSize(const VFPInjTable& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1155,12 +1147,6 @@ void pack(const WellType& data, std::vector& buffer, int& position, pack(data.preferred_phase(), buffer, position, comm); } -void pack(const MessageLimits& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getLimits(), buffer, position, comm); -} void pack(const VFPInjTable& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2035,15 +2021,6 @@ void unpack(WellType& data, std::vector& buffer, int& position, Dune::MPIH data = WellType( producer, preferred_phase ); } -void unpack(MessageLimits& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - DynamicState limits; - unpack(limits, buffer, position, comm); - data = MessageLimits(limits); -} - void unpack(VFPInjTable& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 4a5370dc7..4fcc00a8f 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -62,8 +62,6 @@ class DeckRecord; class Dimension; template class IOrderSet; class Location; -class MessageLimits; -class MLimits; class Segment; class SpiralICD; class UDAValue; @@ -431,8 +429,6 @@ ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(Location) -ADD_PACK_PROTOTYPES(MessageLimits) -ADD_PACK_PROTOTYPES(MLimits) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(Segment) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 38efca7a6..bfbb96191 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1299,7 +1299,7 @@ BOOST_AUTO_TEST_CASE(MLimits) { #ifdef HAVE_MPI Opm::MLimits val1{1,2,3,4,5,6,7,8,9,10,11,12}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(MLimits) #endif } @@ -1310,7 +1310,7 @@ BOOST_AUTO_TEST_CASE(MessageLimits) #ifdef HAVE_MPI std::vector limits{Opm::MLimits{1,2,3,4,5,6,7,8,9,10,11,12}}; Opm::MessageLimits val1(Opm::DynamicState(limits,2)); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(MessageLimits) #endif } From 778f1cfb8eef1c0e5ca90dea6929309c0a36f8bf Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 10/61] remove old serialization support for WellTestConfig --- opm/simulators/utils/ParallelRestart.cpp | 59 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 3 -- tests/test_ParallelRestart.cpp | 4 +- 3 files changed, 2 insertions(+), 64 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 6cb682746..19c0555bb 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -360,23 +360,6 @@ std::size_t packSize(const VFPProdTable& data, packSize(data.getTable(), comm); } -std::size_t packSize(const WellTestConfig::WTESTWell& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name, comm) + - packSize(data.shut_reason, comm) + - packSize(data.test_interval, comm) + - packSize(data.num_test, comm) + - packSize(data.startup_time, comm) + - packSize(data.begin_report_step, comm); -} - -std::size_t packSize(const WellTestConfig& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getWells(), comm); -} - std::size_t packSize(const WellTracerProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1177,25 +1160,6 @@ void pack(const VFPProdTable& data, pack(data.getTable(), buffer, position, comm); } -void pack(const WellTestConfig::WTESTWell& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name, buffer, position, comm); - pack(data.shut_reason, buffer, position, comm); - pack(data.test_interval, buffer, position, comm); - pack(data.num_test, buffer, position, comm); - pack(data.startup_time, buffer, position, comm); - pack(data.begin_report_step, buffer, position, comm); -} - -void pack(const WellTestConfig& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getWells(), buffer, position, comm); -} - void pack(const WellTracerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2073,27 +2037,6 @@ void unpack(VFPProdTable& data, wfrAxis, gfrAxis, alqAxis, table); } -void unpack(WellTestConfig::WTESTWell& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.name, buffer, position, comm); - unpack(data.shut_reason, buffer, position, comm); - unpack(data.test_interval, buffer, position, comm); - unpack(data.num_test, buffer, position, comm); - unpack(data.startup_time, buffer, position, comm); - unpack(data.begin_report_step, buffer, position, comm); -} - -void unpack(WellTestConfig& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector ddata; - unpack(ddata, buffer, position, comm); - data = WellTestConfig(ddata); -} - void unpack(WellTracerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2945,7 +2888,6 @@ template void unpack(std::shared_ptr<__VA_ARGS__>& data, \ INSTANTIATE_PACK_SHARED_PTR(SpiralICD) INSTANTIATE_PACK_SHARED_PTR(VFPInjTable) INSTANTIATE_PACK_SHARED_PTR(Well) -INSTANTIATE_PACK_SHARED_PTR(WellTestConfig) #undef INSTANTIATE_PACK_SHARED_PTR #define INSTANTIATE_PACK(...) \ @@ -2981,7 +2923,6 @@ INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState) -INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicVector) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 4fcc00a8f..581e72f42 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -450,8 +449,6 @@ ADD_PACK_PROTOTYPES(WellEconProductionLimits) ADD_PACK_PROTOTYPES(WellFoamProperties) ADD_PACK_PROTOTYPES(WellPolymerProperties) ADD_PACK_PROTOTYPES(WellSegments) -ADD_PACK_PROTOTYPES(WellTestConfig) -ADD_PACK_PROTOTYPES(WellTestConfig::WTESTWell) ADD_PACK_PROTOTYPES(WellTracerProperties) ADD_PACK_PROTOTYPES(WList) ADD_PACK_PROTOTYPES(WListManager) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index bfbb96191..05fbe855e 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1341,7 +1341,7 @@ BOOST_AUTO_TEST_CASE(WTESTWell) #ifdef HAVE_MPI Opm::WellTestConfig::WTESTWell val1{"test", Opm::WellTestConfig::ECONOMIC, 1.0, 2, 3.0, 4}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellTestConfig::WTESTWell) #endif } @@ -1353,7 +1353,7 @@ BOOST_AUTO_TEST_CASE(WellTestConfig) Opm::WellTestConfig::WTESTWell tw{"test", Opm::WellTestConfig::ECONOMIC, 1.0, 2, 3.0, 4}; Opm::WellTestConfig val1({tw, tw, tw}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellTestConfig) #endif } From 7389959b88f8058832c31b1538dd6f4fe59f26a2 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 11/61] remove old serialization support for WListManager --- flow/flow.cpp | 2 + flow/flow_tag.hpp | 2 + opm/simulators/utils/ParallelRestart.cpp | 48 +----------------------- opm/simulators/utils/ParallelRestart.hpp | 4 -- tests/test_ParallelRestart.cpp | 4 +- 5 files changed, 7 insertions(+), 53 deletions(-) diff --git a/flow/flow.cpp b/flow/flow.cpp index a80223248..e80981e02 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -60,6 +60,8 @@ #include #include #include +#include +#include #include #include diff --git a/flow/flow_tag.hpp b/flow/flow_tag.hpp index 388166720..7d189257e 100644 --- a/flow/flow_tag.hpp +++ b/flow/flow_tag.hpp @@ -42,6 +42,8 @@ #include #include #include +#include +#include //#include //#include diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 19c0555bb..0cf951aa3 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -44,8 +44,6 @@ #include #include #include -#include -#include #include #include @@ -659,18 +657,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const WList& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.wellList(), comm); -} - -std::size_t packSize(const WListManager& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.lists(), comm); -} - std::size_t packSize(const GuideRateModel& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1472,20 +1458,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const WList& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.wellList(), buffer, position, comm); -} - -void pack(const WListManager& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.lists(), buffer, position, comm); -} - void pack(const GuideRateModel& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2535,24 +2507,6 @@ void unpack(Group& data, injection, production); } -void unpack(WList& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - WList::storage ddata; - unpack(ddata, buffer, position, comm); - data = WList(ddata); -} - -void unpack(WListManager& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::map lists; - unpack(lists, buffer, position, comm); - data = WListManager(lists); -} - void unpack(GuideRateModel& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2915,6 +2869,7 @@ INSTANTIATE_PACK(std::map,int>>) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_map) +INSTANTIATE_PACK(std::unordered_set) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) @@ -2923,7 +2878,6 @@ INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState) -INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicVector) #undef INSTANTIATE_PACK diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 581e72f42..2a212234f 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -74,8 +74,6 @@ class WellFoamProperties; class WellPolymerProperties; class WellSegments; class WellTracerProperties; -class WList; -class WListManager; namespace Mpi { @@ -450,8 +448,6 @@ ADD_PACK_PROTOTYPES(WellFoamProperties) ADD_PACK_PROTOTYPES(WellPolymerProperties) ADD_PACK_PROTOTYPES(WellSegments) ADD_PACK_PROTOTYPES(WellTracerProperties) -ADD_PACK_PROTOTYPES(WList) -ADD_PACK_PROTOTYPES(WListManager) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 05fbe855e..978f9e2ee 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1643,7 +1643,7 @@ BOOST_AUTO_TEST_CASE(WList) { #ifdef HAVE_MPI Opm::WList val1({"test1", "test2", "test3"}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WList) #endif } @@ -1655,7 +1655,7 @@ BOOST_AUTO_TEST_CASE(WListManager) Opm::WList wl({"test1", "test2", "test3"}); std::map data{{"test", wl}, {"test2", wl}}; Opm::WListManager val1(data); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WListManager) #endif } From 1d254914e109b5c489bc5c30ae554b61b92e6e57 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 12/61] remove old serialization support for GuideRateModel --- opm/simulators/utils/ParallelRestart.cpp | 50 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 52 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 0cf951aa3..382f2a44f 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -657,19 +657,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const GuideRateModel& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.timeInterval(), comm) + - packSize(data.target(), comm) + - packSize(data.coefs(), comm) + - packSize(data.allow_increase(), comm) + - packSize(data.damping_factor(), comm) + - packSize(data.free_gas(), comm) + - packSize(data.defaultModel(), comm) + - packSize(data.udaCoefs(), comm); -} - std::size_t packSize(const GuideRateConfig& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1458,20 +1445,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const GuideRateModel& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.timeInterval(), buffer, position, comm); - pack(data.target(), buffer, position, comm); - pack(data.coefs(), buffer, position, comm); - pack(data.allow_increase(), buffer, position, comm); - pack(data.damping_factor(), buffer, position, comm); - pack(data.free_gas(), buffer, position, comm); - pack(data.defaultModel(), buffer, position, comm); - pack(data.udaCoefs(), buffer, position, comm); -} - void pack(const GuideRateConfig& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2507,29 +2480,6 @@ void unpack(Group& data, injection, production); } -void unpack(GuideRateModel& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - double timeInterval; - GuideRateModel::Target target; - std::array coefs; - bool allow_increase, free_gas, defaultModel; - double damping_factor; - std::array udaCoefs; - - unpack(timeInterval, buffer, position, comm); - unpack(target, buffer, position, comm); - unpack(coefs, buffer, position, comm); - unpack(allow_increase, buffer, position, comm); - unpack(damping_factor, buffer, position, comm); - unpack(free_gas, buffer, position, comm); - unpack(defaultModel, buffer, position, comm); - unpack(udaCoefs, buffer, position, comm); - data = GuideRateModel(timeInterval, target, coefs, allow_increase, - damping_factor, free_gas, defaultModel, udaCoefs); -} - void unpack(GuideRateConfig& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 2a212234f..eaed0f206 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -421,7 +421,6 @@ ADD_PACK_PROTOTYPES(GConSump::GCONSUMPGroup) ADD_PACK_PROTOTYPES(GuideRateConfig) ADD_PACK_PROTOTYPES(GuideRateConfig::GroupTarget) ADD_PACK_PROTOTYPES(GuideRateConfig::WellTarget) -ADD_PACK_PROTOTYPES(GuideRateModel) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 978f9e2ee..eb17dd23d 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1808,7 +1808,7 @@ BOOST_AUTO_TEST_CASE(GuideRateModel) { #ifdef HAVE_MPI Opm::GuideRateModel val1 = getGuideRateModel(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GuideRateModel) #endif } From 52bd4cb81ca6d071210b253decfb8fa8850f86be Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 13/61] remove old serialization support for GuideRateConfig --- opm/simulators/utils/ParallelRestart.cpp | 82 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 4 -- tests/test_ParallelRestart.cpp | 6 +- 3 files changed, 3 insertions(+), 89 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 382f2a44f..e3a5490a3 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -657,14 +656,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const GuideRateConfig& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getModel(), comm) + - packSize(data.getWells(), comm) + - packSize(data.getGroups(), comm); -} - std::size_t packSize(const GConSale::GCONSALEGroup& data, Dune::MPIHelper::MPICommunicator comm) { @@ -821,21 +812,6 @@ std::size_t packSize(const Well::WellGuideRate& data, packSize(data.scale_factor, comm); } -std::size_t packSize(const GuideRateConfig::WellTarget& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.guide_rate, comm) + - packSize(data.target, comm) + - packSize(data.scaling_factor, comm); -} - -std::size_t packSize(const GuideRateConfig::GroupTarget& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.guide_rate, comm) + - packSize(data.target, comm); -} - ////// pack routines template @@ -1445,15 +1421,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const GuideRateConfig& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getModel(), buffer, position, comm); - pack(data.getWells(), buffer, position, comm); - pack(data.getGroups(), buffer, position, comm); -} - void pack(const GConSale::GCONSALEGroup& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1626,23 +1593,6 @@ void pack(const Well::WellGuideRate& data, pack(data.scale_factor, buffer, position, comm); } -void pack(const GuideRateConfig::WellTarget& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.guide_rate, buffer, position, comm); - pack(data.target, buffer, position, comm); - pack(data.scaling_factor, buffer, position, comm); -} - -void pack(const GuideRateConfig::GroupTarget& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.guide_rate, buffer, position, comm); - pack(data.target, buffer, position, comm); -} - /// unpack routines template @@ -2480,20 +2430,6 @@ void unpack(Group& data, injection, production); } -void unpack(GuideRateConfig& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::shared_ptr model; - std::unordered_map wells; - std::unordered_map groups; - - unpack(model, buffer, position, comm); - unpack(wells, buffer, position, comm); - unpack(groups, buffer, position, comm); - data = GuideRateConfig(model, wells, groups); -} - void unpack(GConSale::GCONSALEGroup& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2717,23 +2653,6 @@ void unpack(Well::WellGuideRate& data, unpack(data.scale_factor, buffer, position, comm); } -void unpack(GuideRateConfig::WellTarget& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.guide_rate, buffer, position, comm); - unpack(data.target, buffer, position, comm); - unpack(data.scaling_factor, buffer, position, comm); -} - -void unpack(GuideRateConfig::GroupTarget& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.guide_rate, buffer, position, comm); - unpack(data.target, buffer, position, comm); -} - #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ @@ -2826,7 +2745,6 @@ INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) -INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicVector) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index eaed0f206..5925dbf1d 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include @@ -418,9 +417,6 @@ ADD_PACK_PROTOTYPES(GConSale) ADD_PACK_PROTOTYPES(GConSale::GCONSALEGroup) ADD_PACK_PROTOTYPES(GConSump) ADD_PACK_PROTOTYPES(GConSump::GCONSUMPGroup) -ADD_PACK_PROTOTYPES(GuideRateConfig) -ADD_PACK_PROTOTYPES(GuideRateConfig::GroupTarget) -ADD_PACK_PROTOTYPES(GuideRateConfig::WellTarget) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index eb17dd23d..2ee0ed0d2 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1818,7 +1818,7 @@ BOOST_AUTO_TEST_CASE(GuideRateConfigGroup) { #ifdef HAVE_MPI Opm::GuideRateConfig::GroupTarget val1 = getGuideRateConfigGroup(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GuideRateConfig::GroupTarget) #endif } @@ -1828,7 +1828,7 @@ BOOST_AUTO_TEST_CASE(GuideRateConfigWell) { #ifdef HAVE_MPI Opm::GuideRateConfig::WellTarget val1 = getGuideRateConfigWell(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GuideRateConfig::WellTarget) #endif } @@ -1841,7 +1841,7 @@ BOOST_AUTO_TEST_CASE(GuideRateConfig) Opm::GuideRateConfig val1(model, {{"test1", getGuideRateConfigWell()}}, {{"test2", getGuideRateConfigGroup()}}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GuideRateConfig) #endif } From 486c9ce8ddf63722eb4696ed41fedf7d53818b20 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 14/61] remove old serialization support for GConSale --- opm/simulators/utils/ParallelRestart.cpp | 58 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 3 -- tests/test_ParallelRestart.cpp | 4 +- 3 files changed, 2 insertions(+), 63 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index e3a5490a3..15b57a376 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -656,23 +656,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const GConSale::GCONSALEGroup& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.sales_target, comm) + - packSize(data.max_sales_rate, comm) + - packSize(data.min_sales_rate, comm) + - packSize(data.max_proc, comm) + - packSize(data.udq_undefined, comm) + - packSize(data.unit_system, comm); -} - -std::size_t packSize(const GConSale& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getGroups(), comm); -} - std::size_t packSize(const GConSump::GCONSUMPGroup& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1421,25 +1404,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const GConSale::GCONSALEGroup& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.sales_target, buffer, position, comm); - pack(data.max_sales_rate, buffer, position, comm); - pack(data.min_sales_rate, buffer, position, comm); - pack(data.max_proc, buffer, position, comm); - pack(data.udq_undefined, buffer, position, comm); - pack(data.unit_system, buffer, position, comm); -} - -void pack(const GConSale& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getGroups(), buffer, position, comm); -} - void pack(const GConSump::GCONSUMPGroup& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2430,27 +2394,6 @@ void unpack(Group& data, injection, production); } -void unpack(GConSale::GCONSALEGroup& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.sales_target, buffer, position, comm); - unpack(data.max_sales_rate, buffer, position, comm); - unpack(data.min_sales_rate, buffer, position, comm); - unpack(data.max_proc, buffer, position, comm); - unpack(data.udq_undefined, buffer, position, comm); - unpack(data.unit_system, buffer, position, comm); -} - -void unpack(GConSale& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::map groups; - unpack(groups, buffer, position, comm); - data = GConSale(groups); -} - void unpack(GConSump::GCONSUMPGroup& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2743,7 +2686,6 @@ INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState>) -INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicVector) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 5925dbf1d..4a612e871 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -413,8 +412,6 @@ ADD_PACK_PROTOTYPES(DeckItem) ADD_PACK_PROTOTYPES(DeckKeyword) ADD_PACK_PROTOTYPES(DeckRecord) ADD_PACK_PROTOTYPES(Dimension) -ADD_PACK_PROTOTYPES(GConSale) -ADD_PACK_PROTOTYPES(GConSale::GCONSALEGroup) ADD_PACK_PROTOTYPES(GConSump) ADD_PACK_PROTOTYPES(GConSump::GCONSUMPGroup) ADD_PACK_PROTOTYPES(Group) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 2ee0ed0d2..3734ce7e1 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1855,7 +1855,7 @@ BOOST_AUTO_TEST_CASE(GConSaleGroup) Opm::UDAValue(3.0), Opm::GConSale::MaxProcedure::PLUG, 4.0, Opm::UnitSystem()}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GConSale::GCONSALEGroup) #endif } @@ -1870,7 +1870,7 @@ BOOST_AUTO_TEST_CASE(GConSale) Opm::GConSale::MaxProcedure::PLUG, 4.0, Opm::UnitSystem()}; Opm::GConSale val1({{"test1", group}, {"test2", group}}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GConSale) #endif } From 32176b90ef21225b4223d23b0fc559a2b95370ad Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 15/61] remove old serialization support for GConSump --- opm/simulators/utils/ParallelRestart.cpp | 55 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 3 -- tests/test_ParallelRestart.cpp | 4 +- 3 files changed, 2 insertions(+), 60 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 15b57a376..33a68b745 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -656,22 +656,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const GConSump::GCONSUMPGroup& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.consumption_rate, comm) + - packSize(data.import_rate, comm) + - packSize(data.network_node, comm) + - packSize(data.udq_undefined, comm) + - packSize(data.unit_system, comm); -} - -std::size_t packSize(const GConSump& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getGroups(), comm); -} - std::size_t packSize(const DeckItem& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1404,24 +1388,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const GConSump::GCONSUMPGroup& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.consumption_rate, buffer, position, comm); - pack(data.import_rate, buffer, position, comm); - pack(data.network_node, buffer, position, comm); - pack(data.udq_undefined, buffer, position, comm); - pack(data.unit_system, buffer, position, comm); -} - -void pack(const GConSump& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getGroups(), buffer, position, comm); -} - void pack(const DeckItem& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2394,26 +2360,6 @@ void unpack(Group& data, injection, production); } -void unpack(GConSump::GCONSUMPGroup& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.consumption_rate, buffer, position, comm); - unpack(data.import_rate, buffer, position, comm); - unpack(data.network_node, buffer, position, comm); - unpack(data.udq_undefined, buffer, position, comm); - unpack(data.unit_system, buffer, position, comm); -} - -void unpack(GConSump& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::map groups; - unpack(groups, buffer, position, comm); - data = GConSump(groups); -} - void unpack(DeckItem& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2686,7 +2632,6 @@ INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState>) -INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicVector) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 4a612e871..619d775b4 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -412,8 +411,6 @@ ADD_PACK_PROTOTYPES(DeckItem) ADD_PACK_PROTOTYPES(DeckKeyword) ADD_PACK_PROTOTYPES(DeckRecord) ADD_PACK_PROTOTYPES(Dimension) -ADD_PACK_PROTOTYPES(GConSump) -ADD_PACK_PROTOTYPES(GConSump::GCONSUMPGroup) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 3734ce7e1..f8b44c548 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1883,7 +1883,7 @@ BOOST_AUTO_TEST_CASE(GConSumpGroup) Opm::UDAValue(2.0), "test", 3.0, Opm::UnitSystem()}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GConSump::GCONSUMPGroup) #endif } @@ -1897,7 +1897,7 @@ BOOST_AUTO_TEST_CASE(GConSump) "test", 3.0, Opm::UnitSystem()}; Opm::GConSump val1({{"test1", group}, {"test2", group}}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(GConSump) #endif } From 638a53ac88fd33a227828903ceca5c622b633b47 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:17:09 +0100 Subject: [PATCH 16/61] add support for unique_ptr in EclMpiSerializer --- ebos/eclmpiserializer.hh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index 224837499..2ad045af3 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -40,8 +40,8 @@ public: template void operator()(const T& data) { - if constexpr (is_shared_ptr::value) { - shared_ptr(data); + if constexpr (is_ptr::value) { + ptr(data); } else { if (m_op == Operation::PACKSIZE) m_packSize += Mpi::packSize(data, m_comm); @@ -60,8 +60,8 @@ public: for (auto& it : d) { if constexpr (is_pair::value) pair(it); - else if constexpr (is_shared_ptr::value) - shared_ptr(it); + else if constexpr (is_ptr::value) + ptr(it); else it.serializeOp(*this); } @@ -91,8 +91,8 @@ public: { if constexpr (is_vector::value) vector(d); - else if constexpr (is_shared_ptr::value) - shared_ptr(d); + else if constexpr (is_ptr::value) + ptr(d); else if constexpr (!complexType) d.template serializeOp(*this); else @@ -196,12 +196,17 @@ protected: }; template - struct is_shared_ptr { + struct is_ptr { constexpr static bool value = false; }; template - struct is_shared_ptr> { + struct is_ptr> { + constexpr static bool value = true; + }; + + template + struct is_ptr> { constexpr static bool value = true; }; @@ -219,13 +224,13 @@ protected: const_cast(data.second).serializeOp(*this); } - template - void shared_ptr(const std::shared_ptr& data) + template class PtrType, class T1> + void ptr(const PtrType& data) { bool value = data ? true : false; (*this)(value); if (m_op == Operation::UNPACK && value) { - const_cast&>(data) = std::make_shared(); + const_cast&>(data).reset(new T1); } if (data) data->serializeOp(*this); From 195bb8771200713b809922980b5c6ef6baf07fbd Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 17/61] remove old serialization support for DeckItem --- opm/simulators/utils/ParallelRestart.cpp | 59 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 62 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 33a68b745..ecb039bc2 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -656,21 +656,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const DeckItem& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.dVal(), comm) + - packSize(data.iVal(), comm) + - packSize(data.sVal(), comm) + - packSize(data.uVal(), comm) + - packSize(data.getType(), comm) + - packSize(data.name(), comm) + - packSize(data.valueStatus(), comm) + - packSize(data.rawData(), comm) + - packSize(data.activeDimensions(), comm) + - packSize(data.defaultDimensions(), comm); -} - std::size_t packSize(const DeckRecord& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1388,22 +1373,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const DeckItem& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.dVal(), buffer, position, comm); - pack(data.iVal(), buffer, position, comm); - pack(data.sVal(), buffer, position, comm); - pack(data.uVal(), buffer, position, comm); - pack(data.getType(), buffer, position, comm); - pack(data.name(), buffer, position, comm); - pack(data.valueStatus(), buffer, position, comm); - pack(data.rawData(), buffer, position, comm); - pack(data.activeDimensions(), buffer, position, comm); - pack(data.defaultDimensions(), buffer, position, comm); -} - void pack(const DeckRecord& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2360,34 +2329,6 @@ void unpack(Group& data, injection, production); } -void unpack(DeckItem& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector dVal; - std::vector iVal; - std::vector sVal; - std::vector uVal; - type_tag type; - std::string name; - std::vector valueStatus; - bool rawData; - std::vector activeDimensions, defaultDimensions; - - unpack(dVal, buffer, position, comm); - unpack(iVal, buffer, position, comm); - unpack(sVal, buffer, position, comm); - unpack(uVal, buffer, position, comm); - unpack(type, buffer, position, comm); - unpack(name, buffer, position, comm); - unpack(valueStatus, buffer, position, comm); - unpack(rawData, buffer, position, comm); - unpack(activeDimensions, buffer, position, comm); - unpack(defaultDimensions, buffer, position, comm); - data = DeckItem(dVal, iVal, sVal, uVal, type, name, - valueStatus, rawData, activeDimensions, defaultDimensions); -} - void unpack(DeckRecord& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 619d775b4..6cfb75193 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -53,7 +53,6 @@ namespace Action { } class Connection; -class DeckItem; class DeckRecord; class Dimension; template class IOrderSet; @@ -407,7 +406,6 @@ ADD_PACK_PROTOTYPES(data::Solution) ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(Deck) -ADD_PACK_PROTOTYPES(DeckItem) ADD_PACK_PROTOTYPES(DeckKeyword) ADD_PACK_PROTOTYPES(DeckRecord) ADD_PACK_PROTOTYPES(Dimension) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index f8b44c548..caf39522b 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1929,7 +1929,7 @@ BOOST_AUTO_TEST_CASE(DeckItem) {Opm::Dimension(7.0, 8.0)}, {Opm::Dimension(10.0, 11.0)}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(DeckItem) #endif } From d9ab0e75229185ef77101b2c02d5c7fd9d56d14e Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 18/61] remove old serialization support for ASTNode --- flow/flow.cpp | 1 + flow/flow_tag.hpp | 1 + opm/simulators/utils/ParallelRestart.cpp | 43 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 5 files changed, 3 insertions(+), 46 deletions(-) diff --git a/flow/flow.cpp b/flow/flow.cpp index e80981e02..088cc7f90 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/flow/flow_tag.hpp b/flow/flow_tag.hpp index 7d189257e..bc1a565bb 100644 --- a/flow/flow_tag.hpp +++ b/flow/flow_tag.hpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index ecb039bc2..0da2567e1 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -691,17 +690,6 @@ std::size_t packSize(const Deck& data, packSize(data.unitSystemAccessCount(), comm); } -std::size_t packSize(const Action::ASTNode& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.type, comm) + - packSize(data.func_type, comm) + - packSize(data.func, comm) + - packSize(data.argList(), comm) + - packSize(data.getNumber(), comm) + - packSize(data.childrens(), comm); -} - std::size_t packSize(const Action::AST& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1411,18 +1399,6 @@ void pack(const Deck& data, pack(data.unitSystemAccessCount(), buffer, position, comm); } -void pack(const Action::ASTNode& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.type, buffer, position, comm); - pack(data.func_type, buffer, position, comm); - pack(data.func, buffer, position, comm); - pack(data.argList(), buffer, position, comm); - pack(data.getNumber(), buffer, position, comm); - pack(data.childrens(), buffer, position, comm); -} - void pack(const Action::AST& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2384,25 +2360,6 @@ void unpack(Deck& data, std::vector& buffer, int& position, activeUnitSystem.get(), dataFile, inputPath, accessCount); } -void unpack(Action::ASTNode& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - TokenType token; - FuncType func_type; - std::string func; - std::vector argList; - double number; - std::vector children; - - unpack(token, buffer, position, comm); - unpack(func_type, buffer, position, comm); - unpack(func, buffer, position, comm); - unpack(argList, buffer, position, comm); - unpack(number, buffer, position, comm); - unpack(children, buffer, position, comm); - data = Action::ASTNode(token, func_type, func, argList, number, children); -} - void unpack(Action::AST& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 6cfb75193..4b75b69da 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -47,7 +47,6 @@ namespace Action { class Actions; class ActionX; class AST; - class ASTNode; class Condition; class Quantity; } @@ -393,7 +392,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit ADD_PACK_PROTOTYPES(Action::Actions) ADD_PACK_PROTOTYPES(Action::ActionX) ADD_PACK_PROTOTYPES(Action::AST) -ADD_PACK_PROTOTYPES(Action::ASTNode) ADD_PACK_PROTOTYPES(Action::Condition) ADD_PACK_PROTOTYPES(Action::Quantity) ADD_PACK_PROTOTYPES(Connection) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index caf39522b..aac39314a 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1995,7 +1995,7 @@ BOOST_AUTO_TEST_CASE(ASTNode) #ifdef HAVE_MPI Opm::Action::ASTNode child(number, FuncType::field, "test3", {"test2"}, 2.0, {}); Opm::Action::ASTNode val1(number, FuncType::field, "test1", {"test2"}, 1.0, {child}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Action::ASTNode) #endif } From 96cadcc43a93ba4116af9fdcfa77a4af2c89326b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 19/61] remove old serialization support for DeckRecord --- opm/simulators/utils/ParallelRestart.cpp | 22 ---------------------- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 0da2567e1..01c1f1fc3 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -655,12 +655,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const DeckRecord& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getItems(), comm); -} - std::size_t packSize(const Location& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1361,13 +1355,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const DeckRecord& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getItems(), buffer, position, comm); -} - void pack(const Location& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2305,15 +2292,6 @@ void unpack(Group& data, injection, production); } -void unpack(DeckRecord& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector items; - unpack(items, buffer, position, comm); - data = DeckRecord(std::move(items)); -} - void unpack(Location& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 4b75b69da..b795e010d 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -52,7 +52,6 @@ namespace Action { } class Connection; -class DeckRecord; class Dimension; template class IOrderSet; class Location; @@ -405,7 +404,6 @@ ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(Deck) ADD_PACK_PROTOTYPES(DeckKeyword) -ADD_PACK_PROTOTYPES(DeckRecord) ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index aac39314a..cdebfc51b 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1939,7 +1939,7 @@ BOOST_AUTO_TEST_CASE(DeckRecord) { #ifdef HAVE_MPI Opm::DeckRecord val1 = getDeckRecord(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(DeckRecord) #endif } From a289008c961e87ea88cbf33005e417b71ce1727b Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 20/61] remove old serialization support for Location --- opm/simulators/utils/ParallelRestart.cpp | 25 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 01c1f1fc3..01224c64b 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -22,7 +22,6 @@ #endif #include "ParallelRestart.hpp" -#include #include #include #include @@ -655,13 +654,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const Location& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.filename, comm) + - packSize(data.lineno, comm); -} - std::size_t packSize(const DeckKeyword& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1355,14 +1347,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const Location& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.filename, buffer, position, comm); - pack(data.lineno, buffer, position, comm); -} - void pack(const DeckKeyword& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2292,15 +2276,6 @@ void unpack(Group& data, injection, production); } -void unpack(Location& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - data.filename.clear(); - unpack(data.filename, buffer, position, comm); - unpack(data.lineno, buffer, position, comm); -} - void unpack(DeckKeyword& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index b795e010d..b7dcdabb1 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -54,7 +54,6 @@ namespace Action { class Connection; class Dimension; template class IOrderSet; -class Location; class Segment; class SpiralICD; class UDAValue; @@ -408,7 +407,6 @@ ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) -ADD_PACK_PROTOTYPES(Location) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(Segment) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index cdebfc51b..18d91ca0f 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1949,7 +1949,7 @@ BOOST_AUTO_TEST_CASE(Location) { #ifdef HAVE_MPI Opm::Location val1{"test", 1}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Location) #endif } From c5f36bd7cc9170890086b70fe57d56064350af2e Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 21/61] remove old serialization support for DeckKeyword --- opm/simulators/utils/ParallelRestart.cpp | 40 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 01224c64b..bda564b09 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -654,17 +654,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const DeckKeyword& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name(), comm) + - packSize(data.location(), comm) + - packSize(data.records(), comm) + - packSize(data.isDataKeyword(), comm) + - packSize(data.isSlashTerminated(), comm); -} - - std::size_t packSize(const Deck& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1347,17 +1336,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const DeckKeyword& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name(), buffer, position, comm); - pack(data.location(), buffer, position, comm); - pack(data.records(), buffer, position, comm); - pack(data.isDataKeyword(), buffer, position, comm); - pack(data.isSlashTerminated(), buffer, position, comm); -} - void pack(const Deck& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2276,24 +2254,6 @@ void unpack(Group& data, injection, production); } -void unpack(DeckKeyword& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name; - Location location; - std::vector records; - bool isDataKeyword, isSlashTerminated; - - unpack(name, buffer, position, comm); - unpack(location, buffer, position, comm); - unpack(records, buffer, position, comm); - unpack(isDataKeyword, buffer, position, comm); - unpack(isSlashTerminated, buffer, position, comm); - data = DeckKeyword(name, location, records, - isDataKeyword, isSlashTerminated); -} - void unpack(Deck& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index b7dcdabb1..bbd753edd 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -402,7 +402,6 @@ ADD_PACK_PROTOTYPES(data::Solution) ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(Deck) -ADD_PACK_PROTOTYPES(DeckKeyword) ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 18d91ca0f..191648022 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1960,7 +1960,7 @@ BOOST_AUTO_TEST_CASE(DeckKeyword) #ifdef HAVE_MPI Opm::DeckKeyword val1("test", {"test",1}, {getDeckRecord(), getDeckRecord()}, true, false); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(DeckKeyword) #endif } From 2c1d45ea549a7f769f4394071c7de4557516e2a4 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 22/61] remove old serialization support for ActionX --- opm/simulators/utils/ParallelRestart.cpp | 56 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 59 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index bda564b09..76df7a843 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -688,20 +687,6 @@ std::size_t packSize(const Action::Condition& data, packSize(data.cmp_string, comm); } -std::size_t packSize(const Action::ActionX& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name(), comm) + - packSize(data.max_run(), comm) + - packSize(data.min_wait(), comm) + - packSize(data.start_time(), comm) + - packSize(data.getKeywords(), comm) + - packSize(data.getCondition(), comm) + - packSize(data.conditions(), comm) + - packSize(data.getRunCount(), comm) + - packSize(data.getLastRun(), comm); -} - std::size_t packSize(const Action::Actions& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1374,21 +1359,6 @@ void pack(const Action::Condition& data, pack(data.cmp_string, buffer, position, comm); } -void pack(const Action::ActionX& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name(), buffer, position, comm); - pack(data.max_run(), buffer, position, comm); - pack(data.min_wait(), buffer, position, comm); - pack(data.start_time(), buffer, position, comm); - pack(data.getKeywords(), buffer, position, comm); - pack(data.getCondition(), buffer, position, comm); - pack(data.conditions(), buffer, position, comm); - pack(data.getRunCount(), buffer, position, comm); - pack(data.getLastRun(), buffer, position, comm); -} - void pack(const Action::Actions& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2298,32 +2268,6 @@ void unpack(Action::Condition& data, std::vector& buffer, int& position, unpack(data.cmp_string, buffer, position, comm); } -void unpack(Action::ActionX& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name; - size_t max_run; - double min_wait; - std::time_t start_time; - std::vector keywords; - Action::AST condition; - std::vector conditions; - size_t run_count; - std::time_t last_run; - - unpack(name, buffer, position, comm); - unpack(max_run, buffer, position, comm); - unpack(min_wait, buffer, position, comm); - unpack(start_time, buffer, position, comm); - unpack(keywords, buffer, position, comm); - unpack(condition, buffer, position, comm); - unpack(conditions, buffer, position, comm); - unpack(run_count, buffer, position, comm); - unpack(last_run, buffer, position, comm); - data = Action::ActionX(name, max_run, min_wait, start_time, keywords, - condition, conditions, run_count, last_run); -} - void unpack(Action::Actions& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index bbd753edd..52140455b 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -45,7 +45,6 @@ namespace Opm namespace Action { class Actions; - class ActionX; class AST; class Condition; class Quantity; @@ -388,7 +387,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit Dune::MPIHelper::MPICommunicator comm); ADD_PACK_PROTOTYPES(Action::Actions) -ADD_PACK_PROTOTYPES(Action::ActionX) ADD_PACK_PROTOTYPES(Action::AST) ADD_PACK_PROTOTYPES(Action::Condition) ADD_PACK_PROTOTYPES(Action::Quantity) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 191648022..eafe8af35 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2040,7 +2040,7 @@ BOOST_AUTO_TEST_CASE(ActionX) { #ifdef HAVE_MPI Opm::Action::ActionX val1 = getActionX(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Action::ActionX) #endif } From 5c89c4855434dc8eefaf0fa623b6818ef9644dd7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Tue, 17 Mar 2020 15:40:52 +0100 Subject: [PATCH 23/61] remove old serialization support for Action::AST --- opm/simulators/utils/ParallelRestart.cpp | 22 ---------------------- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 76df7a843..78f9922fc 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -23,7 +23,6 @@ #include "ParallelRestart.hpp" #include -#include #include #include #include @@ -664,12 +663,6 @@ std::size_t packSize(const Deck& data, packSize(data.unitSystemAccessCount(), comm); } -std::size_t packSize(const Action::AST& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getCondition(), comm); -} - std::size_t packSize(const Action::Quantity& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1333,13 +1326,6 @@ void pack(const Deck& data, pack(data.unitSystemAccessCount(), buffer, position, comm); } -void pack(const Action::AST& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getCondition(), buffer, position, comm); -} - void pack(const Action::Quantity& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2243,14 +2229,6 @@ void unpack(Deck& data, std::vector& buffer, int& position, activeUnitSystem.get(), dataFile, inputPath, accessCount); } -void unpack(Action::AST& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::shared_ptr condition; - unpack(condition, buffer, position, comm); - data = Action::AST(condition); -} - void unpack(Action::Quantity& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 52140455b..738cbe2e4 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -45,7 +45,6 @@ namespace Opm namespace Action { class Actions; - class AST; class Condition; class Quantity; } @@ -387,7 +386,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit Dune::MPIHelper::MPICommunicator comm); ADD_PACK_PROTOTYPES(Action::Actions) -ADD_PACK_PROTOTYPES(Action::AST) ADD_PACK_PROTOTYPES(Action::Condition) ADD_PACK_PROTOTYPES(Action::Quantity) ADD_PACK_PROTOTYPES(Connection) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index eafe8af35..93cdd1ad8 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2008,7 +2008,7 @@ BOOST_AUTO_TEST_CASE(AST) node.reset(new Opm::Action::ASTNode(number, FuncType::field, "test1", {"test2"}, 1.0, {})); Opm::Action::AST val1(node); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Action::AST) #endif } From 18a1e735fb63300a9716c2a3fd98c40167e5617e Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 24/61] remove old serialization support for Action::Quantity --- opm/simulators/utils/ParallelRestart.cpp | 22 ---------------------- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 78f9922fc..415aa52ac 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -663,13 +663,6 @@ std::size_t packSize(const Deck& data, packSize(data.unitSystemAccessCount(), comm); } -std::size_t packSize(const Action::Quantity& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.quantity, comm) + - packSize(data.args, comm); -} - std::size_t packSize(const Action::Condition& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1326,14 +1319,6 @@ void pack(const Deck& data, pack(data.unitSystemAccessCount(), buffer, position, comm); } -void pack(const Action::Quantity& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.quantity, buffer, position, comm); - pack(data.args, buffer, position, comm); -} - void pack(const Action::Condition& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2229,13 +2214,6 @@ void unpack(Deck& data, std::vector& buffer, int& position, activeUnitSystem.get(), dataFile, inputPath, accessCount); } -void unpack(Action::Quantity& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.quantity, buffer, position, comm); - unpack(data.args, buffer, position, comm); -} - void unpack(Action::Condition& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 738cbe2e4..26e05671b 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -46,7 +46,6 @@ namespace Opm namespace Action { class Actions; class Condition; - class Quantity; } class Connection; @@ -387,7 +386,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit ADD_PACK_PROTOTYPES(Action::Actions) ADD_PACK_PROTOTYPES(Action::Condition) -ADD_PACK_PROTOTYPES(Action::Quantity) ADD_PACK_PROTOTYPES(Connection) ADD_PACK_PROTOTYPES(data::CellData) ADD_PACK_PROTOTYPES(data::Connection) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 93cdd1ad8..752ebaf64 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2020,7 +2020,7 @@ BOOST_AUTO_TEST_CASE(Quantity) Opm::Action::Quantity val1; val1.quantity = "test1"; val1.args = {"test2", "test3"}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Action::Quantity) #endif } From 781b11fb0782b6b68598b7a862ccce8c743ee3e9 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 25/61] remove old serialization support for Action::Condition --- opm/simulators/utils/ParallelRestart.cpp | 32 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 3 --- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 415aa52ac..0fd3fd094 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -24,7 +24,6 @@ #include "ParallelRestart.hpp" #include #include -#include #include #include #include @@ -663,16 +662,6 @@ std::size_t packSize(const Deck& data, packSize(data.unitSystemAccessCount(), comm); } -std::size_t packSize(const Action::Condition& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.lhs, comm) + - packSize(data.rhs, comm) + - packSize(data.logic, comm) + - packSize(data.cmp, comm) + - packSize(data.cmp_string, comm); -} - std::size_t packSize(const Action::Actions& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1319,17 +1308,6 @@ void pack(const Deck& data, pack(data.unitSystemAccessCount(), buffer, position, comm); } -void pack(const Action::Condition& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.lhs, buffer, position, comm); - pack(data.rhs, buffer, position, comm); - pack(data.logic, buffer, position, comm); - pack(data.cmp, buffer, position, comm); - pack(data.cmp_string, buffer, position, comm); -} - void pack(const Action::Actions& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2214,16 +2192,6 @@ void unpack(Deck& data, std::vector& buffer, int& position, activeUnitSystem.get(), dataFile, inputPath, accessCount); } -void unpack(Action::Condition& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.lhs, buffer, position, comm); - unpack(data.rhs, buffer, position, comm); - unpack(data.logic, buffer, position, comm); - unpack(data.cmp, buffer, position, comm); - unpack(data.cmp_string, buffer, position, comm); -} - void unpack(Action::Actions& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 26e05671b..24f6cc957 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -45,9 +45,7 @@ namespace Opm namespace Action { class Actions; - class Condition; } - class Connection; class Dimension; template class IOrderSet; @@ -385,7 +383,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit Dune::MPIHelper::MPICommunicator comm); ADD_PACK_PROTOTYPES(Action::Actions) -ADD_PACK_PROTOTYPES(Action::Condition) ADD_PACK_PROTOTYPES(Connection) ADD_PACK_PROTOTYPES(data::CellData) ADD_PACK_PROTOTYPES(data::Connection) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 752ebaf64..740a82943 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2030,7 +2030,7 @@ BOOST_AUTO_TEST_CASE(Condition) { #ifdef HAVE_MPI Opm::Action::Condition val1 = getCondition(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Action::Condition) #endif } From 81663e2942d690db8d6ec3e67ceaaa8c3b75d1de Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 26/61] remove old serialization support for Action::Actions --- opm/simulators/utils/ParallelRestart.cpp | 23 ----------------------- opm/simulators/utils/ParallelRestart.hpp | 4 ---- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 0fd3fd094..b594da31f 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -23,7 +23,6 @@ #include "ParallelRestart.hpp" #include -#include #include #include #include @@ -662,12 +661,6 @@ std::size_t packSize(const Deck& data, packSize(data.unitSystemAccessCount(), comm); } -std::size_t packSize(const Action::Actions& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getActions(), comm); -} - std::size_t packSize(const WellPolymerProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1308,13 +1301,6 @@ void pack(const Deck& data, pack(data.unitSystemAccessCount(), buffer, position, comm); } -void pack(const Action::Actions& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getActions(), buffer, position, comm); -} - void pack(const WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2192,14 +2178,6 @@ void unpack(Deck& data, std::vector& buffer, int& position, activeUnitSystem.get(), dataFile, inputPath, accessCount); } -void unpack(Action::Actions& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector actions; - unpack(actions, buffer, position, comm); - data = Action::Actions(actions); -} - void unpack(WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2310,7 +2288,6 @@ INSTANTIATE_PACK(std::unordered_set) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) -INSTANTIATE_PACK(DynamicState>) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicVector) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 24f6cc957..045b38db3 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -43,9 +43,6 @@ namespace Opm { -namespace Action { - class Actions; -} class Connection; class Dimension; template class IOrderSet; @@ -382,7 +379,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit void unpack(T& data, std::vector& buffer, int& position, \ Dune::MPIHelper::MPICommunicator comm); -ADD_PACK_PROTOTYPES(Action::Actions) ADD_PACK_PROTOTYPES(Connection) ADD_PACK_PROTOTYPES(data::CellData) ADD_PACK_PROTOTYPES(data::Connection) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 740a82943..825ddff87 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2050,7 +2050,7 @@ BOOST_AUTO_TEST_CASE(Actions) { #ifdef HAVE_MPI Opm::Action::Actions val1({getActionX()}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Action::Actions) #endif } From faffa0678bd75df6e932a8cba45cfeb1b1b1953c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 27/61] remove old serialization support for Deck --- opm/simulators/utils/ParallelRestart.cpp | 43 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 45 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index b594da31f..b59769191 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -650,17 +650,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const Deck& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.keywords(), comm) + - packSize(data.getDefaultUnitSystem(), comm) + - packSize(data.activeUnitSystem(), comm) + - packSize(data.getDataFile(), comm) + - packSize(data.getInputPath(), comm) + - packSize(data.unitSystemAccessCount(), comm); -} - std::size_t packSize(const WellPolymerProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1289,18 +1278,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const Deck& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.keywords(), buffer, position, comm); - pack(data.getDefaultUnitSystem(), buffer, position, comm); - pack(data.activeUnitSystem(), buffer, position, comm); - pack(data.getDataFile(), buffer, position, comm); - pack(data.getInputPath(), buffer, position, comm); - pack(data.unitSystemAccessCount(), buffer, position, comm); -} - void pack(const WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2159,25 +2136,6 @@ void unpack(Group& data, injection, production); } -void unpack(Deck& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector keywords; - UnitSystem defaultUnitSystem; - std::unique_ptr activeUnitSystem; - std::string dataFile, inputPath; - size_t accessCount; - - unpack(keywords, buffer, position, comm); - unpack(defaultUnitSystem, buffer, position, comm); - unpack(activeUnitSystem, buffer, position, comm); - unpack(dataFile, buffer, position, comm); - unpack(inputPath, buffer, position, comm); - unpack(accessCount, buffer, position, comm); - data = Deck(keywords, defaultUnitSystem, - activeUnitSystem.get(), dataFile, inputPath, accessCount); -} - void unpack(WellPolymerProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -2289,7 +2247,6 @@ INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState) -INSTANTIATE_PACK(DynamicVector) #undef INSTANTIATE_PACK diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 045b38db3..1eb8b2f90 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -388,7 +388,6 @@ ADD_PACK_PROTOTYPES(data::Segment) ADD_PACK_PROTOTYPES(data::Solution) ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) -ADD_PACK_PROTOTYPES(Deck) ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 825ddff87..298944d55 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1974,7 +1974,7 @@ BOOST_AUTO_TEST_CASE(Deck) {getDeckRecord(), getDeckRecord()}, true, false)}, Opm::UnitSystem(), unitSys.get(), "test2", "test3", 2); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Deck) #endif } From eb53bb0db951aabbd4d3dfbc9ecd557e4fe23814 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 28/61] remove old serialization support for DynamicVector --- opm/simulators/utils/ParallelRestart.cpp | 22 ---------------------- opm/simulators/utils/ParallelRestart.hpp | 12 ------------ 2 files changed, 34 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index b59769191..a63b250f0 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -211,12 +211,6 @@ std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicat return packSize(split.first, comm) + packSize(split.second, comm); } -template -std::size_t packSize(const DynamicVector& data, Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.data(), comm); -} - std::size_t packSize(const char* str, Dune::MPIHelper::MPICommunicator comm) { #if HAVE_MPI @@ -814,13 +808,6 @@ void pack(const DynamicState& data, std::vector& buffer, int& position, pack(split.second, buffer, position, comm); } -template -void pack(const DynamicVector& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.data(), buffer, position, comm); -} - void pack(const char* str, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { @@ -1458,15 +1445,6 @@ void unpack(DynamicState& data, std::vector& buffer, int& position, reconstructDynState(unique, indices, data); } -template -void unpack(DynamicVector& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector ddata; - unpack(ddata, buffer, position, comm); - data = DynamicVector(ddata); -} - void unpack(char* str, std::size_t length, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1eb8b2f90..df0f90a1e 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -144,9 +143,6 @@ std::size_t packSize(const std::unordered_map& data, Dune::MPIHelpe template std::size_t packSize(const OrderedMap& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const DynamicVector& data, Dune::MPIHelper::MPICommunicator comm); - template std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm); @@ -250,10 +246,6 @@ template void pack(const DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const DynamicVector& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - template void pack(const IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -359,10 +351,6 @@ template void unpack(DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(DynamicVector& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - template void unpack(IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); From c86cfbd83a7edbabff587843212a5dd6fb6bd605 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 11:54:22 +0100 Subject: [PATCH 29/61] add complexType template parameter to EclMpiSerializer::vector set to false if vector contains a type without a serializeOp --- ebos/eclmpiserializer.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index 2ad045af3..04bd3e403 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -52,7 +52,7 @@ public: } } - template + template void vector(std::vector& data) { auto handle = [&](auto& d) @@ -62,6 +62,8 @@ public: pair(it); else if constexpr (is_ptr::value) ptr(it); + else if constexpr (!complexType) + (*this)(it); else it.serializeOp(*this); } From c4e3d9c806f6d1389d6381caae8114c4492eccbc Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 12:30:53 +0100 Subject: [PATCH 30/61] add necessary explicit template instantations --- opm/simulators/utils/ParallelRestart.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index a63b250f0..590e2f353 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -2159,10 +2159,12 @@ INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::map) -INSTANTIATE_PACK_VECTOR(std::pair>) +INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) +INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair) INSTANTIATE_PACK_VECTOR(std::pair) +INSTANTIATE_PACK_VECTOR(std::string) #undef INSTANTIATE_PACK_VECTOR @@ -2217,14 +2219,13 @@ INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map,int>>) +INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_set) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) -INSTANTIATE_PACK(DynamicState) -INSTANTIATE_PACK(DynamicState) #undef INSTANTIATE_PACK From d7916369194e3616d01458d70a53c0cdaf9311a7 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 31/61] remove old serialization support for WellGuideRate --- opm/simulators/utils/ParallelRestart.cpp | 29 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 590e2f353..daea3fceb 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -654,15 +654,6 @@ std::size_t packSize(const WellPolymerProperties& data, packSize(data.m_skprpolytable, comm); } -std::size_t packSize(const Well::WellGuideRate& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.available, comm) + - packSize(data.guide_rate, comm) + - packSize(data.guide_phase, comm) + - packSize(data.scale_factor, comm); -} - ////// pack routines template @@ -1276,16 +1267,6 @@ void pack(const WellPolymerProperties& data, pack(data.m_skprpolytable, buffer, position, comm); } -void pack(const Well::WellGuideRate& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.available, buffer, position, comm); - pack(data.guide_rate, buffer, position, comm); - pack(data.guide_phase, buffer, position, comm); - pack(data.scale_factor, buffer, position, comm); -} - /// unpack routines template @@ -2125,16 +2106,6 @@ void unpack(WellPolymerProperties& data, unpack(data.m_skprpolytable, buffer, position, comm); } -void unpack(Well::WellGuideRate& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.available, buffer, position, comm); - unpack(data.guide_rate, buffer, position, comm); - unpack(data.guide_phase, buffer, position, comm); - unpack(data.scale_factor, buffer, position, comm); -} - #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index df0f90a1e..77086481b 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -392,7 +392,6 @@ ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) -ADD_PACK_PROTOTYPES(Well::WellGuideRate) ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellBrineProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 298944d55..d39c2fa4a 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1458,7 +1458,7 @@ BOOST_AUTO_TEST_CASE(WellGuideRate) { #ifdef HAVE_MPI Opm::Well::WellGuideRate val1{true, 1.0, Opm::Well::GuideRateTarget::COMB, 2.0}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Well::WellGuideRate) #endif } From d6c49bf801d1fbe8af3509df3bb18f371e254356 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 32/61] remove old serialization support for WellEconProductionLimits --- opm/simulators/utils/ParallelRestart.cpp | 76 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 79 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index daea3fceb..ad791b164 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -406,26 +406,6 @@ std::size_t packSize(const Well::WellInjectionProperties& data, packSize(data.controlMode, comm); } -std::size_t packSize(const WellEconProductionLimits& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.minOilRate(), comm) + - packSize(data.minGasRate(), comm) + - packSize(data.maxWaterCut(), comm) + - packSize(data.maxGasOilRatio(), comm) + - packSize(data.maxWaterGasRatio(), comm) + - packSize(data.workover(), comm) + - packSize(data.endRun(), comm) + - packSize(data.followonWell(), comm) + - packSize(data.quantityLimit(), comm) + - packSize(data.maxSecondaryMaxWaterCut(), comm) + - packSize(data.workoverSecondary(), comm) + - packSize(data.maxGasLiquidRatio(), comm) + - packSize(data.minLiquidRate(), comm) + - packSize(data.maxTemperature(), comm) + - packSize(data.minReservoirFluidRate(), comm); -} - std::size_t packSize(const WellConnections& data, Dune::MPIHelper::MPICommunicator comm) { @@ -1011,27 +991,6 @@ void pack(const Well::WellInjectionProperties& data, pack(data.controlMode, buffer, position, comm); } -void pack(const WellEconProductionLimits& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.minOilRate(), buffer, position, comm); - pack(data.minGasRate(), buffer, position, comm); - pack(data.maxWaterCut(), buffer, position, comm); - pack(data.maxGasOilRatio(), buffer, position, comm); - pack(data.maxWaterGasRatio(), buffer, position, comm); - pack(data.workover(), buffer, position, comm); - pack(data.endRun(), buffer, position, comm); - pack(data.followonWell(), buffer, position, comm); - pack(data.quantityLimit(), buffer, position, comm); - pack(data.maxSecondaryMaxWaterCut(), buffer, position, comm); - pack(data.workoverSecondary(), buffer, position, comm); - pack(data.maxGasLiquidRatio(), buffer, position, comm); - pack(data.minLiquidRate(), buffer, position, comm); - pack(data.maxTemperature(), buffer, position, comm); - pack(data.minReservoirFluidRate(), buffer, position, comm); -} - void pack(const WellConnections& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1694,41 +1653,6 @@ void unpack(Well::WellInjectionProperties& data, unpack(data.controlMode, buffer, position, comm); } -void unpack(WellEconProductionLimits& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - double minOilRate, minGasRate, maxWaterCut, maxGasOilRatio, maxWaterGasRatio; - WellEconProductionLimits::EconWorkover workover, workoverSecondary; - bool endRun; - std::string followonWell; - WellEconProductionLimits::QuantityLimit quantityLimit; - double secondaryMaxWaterCut, maxGasLiquidRatio, minLiquidRate, - maxTemperature, minReservoirFluidRate; - unpack(minOilRate, buffer, position, comm); - unpack(minGasRate, buffer, position, comm); - unpack(maxWaterCut, buffer, position, comm); - unpack(maxGasOilRatio, buffer, position, comm); - unpack(maxWaterGasRatio, buffer, position, comm); - unpack(workover, buffer, position, comm); - unpack(endRun, buffer, position, comm); - unpack(followonWell, buffer, position, comm); - unpack(quantityLimit, buffer, position, comm); - unpack(secondaryMaxWaterCut, buffer, position, comm); - unpack(workoverSecondary, buffer, position, comm); - unpack(maxGasLiquidRatio, buffer, position, comm); - unpack(minLiquidRate, buffer, position, comm); - unpack(maxTemperature, buffer, position, comm); - unpack(minReservoirFluidRate, buffer, position, comm); - data = WellEconProductionLimits(minOilRate, minGasRate, maxWaterCut, - maxGasOilRatio, maxWaterGasRatio, - workover, endRun, followonWell, - quantityLimit, secondaryMaxWaterCut, - workoverSecondary, maxGasLiquidRatio, - minLiquidRate, maxTemperature, - minReservoirFluidRate); -} - void unpack(WellConnections& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 77086481b..741be4b52 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -53,7 +53,6 @@ class Valve; class VFPInjTable; class VFPProdTable; class WellConnections; -class WellEconProductionLimits; class WellFoamProperties; class WellPolymerProperties; class WellSegments; @@ -396,7 +395,6 @@ ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellBrineProperties) ADD_PACK_PROTOTYPES(WellConnections) -ADD_PACK_PROTOTYPES(WellEconProductionLimits) ADD_PACK_PROTOTYPES(WellFoamProperties) ADD_PACK_PROTOTYPES(WellPolymerProperties) ADD_PACK_PROTOTYPES(WellSegments) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index d39c2fa4a..3b85182f4 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1448,7 +1448,7 @@ BOOST_AUTO_TEST_CASE(WellEconProductionLimits) 6.0, Opm::WellEconProductionLimits::EconWorkover::WELL, 7.0, 8.0, 9.0, 10.0); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellEconProductionLimits) #endif } From 99898ad79ef9c3819d4197b5367f19c119fe977d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 33/61] remove old serialization support for WellFoamProperties --- opm/simulators/utils/ParallelRestart.cpp | 2 -- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index ad791b164..db254388b 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -264,7 +263,6 @@ HANDLE_AS_POD(data::CurrentControl) HANDLE_AS_POD(data::Rates) HANDLE_AS_POD(data::Segment) HANDLE_AS_POD(WellBrineProperties) -HANDLE_AS_POD(WellFoamProperties) std::size_t packSize(const data::Well& data, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 741be4b52..4c6d3923e 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -53,7 +53,6 @@ class Valve; class VFPInjTable; class VFPProdTable; class WellConnections; -class WellFoamProperties; class WellPolymerProperties; class WellSegments; class WellTracerProperties; @@ -395,7 +394,6 @@ ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellBrineProperties) ADD_PACK_PROTOTYPES(WellConnections) -ADD_PACK_PROTOTYPES(WellFoamProperties) ADD_PACK_PROTOTYPES(WellPolymerProperties) ADD_PACK_PROTOTYPES(WellSegments) ADD_PACK_PROTOTYPES(WellTracerProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 3b85182f4..b510e4980 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1373,7 +1373,7 @@ BOOST_AUTO_TEST_CASE(WellFoamProperties) { #ifdef HAVE_MPI Opm::WellFoamProperties val1{1.0}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellFoamProperties) #endif } From 8a0959b026ac01d1265de1bcad292b9fb2e6e517 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 34/61] remove old serialization support for WellPolymerProperties --- opm/simulators/utils/ParallelRestart.cpp | 33 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index db254388b..d406030e6 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -622,16 +621,6 @@ std::size_t packSize(const Group& data, packSize(data.productionProperties(), comm); } -std::size_t packSize(const WellPolymerProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.m_polymerConcentration, comm) + - packSize(data.m_saltConcentration, comm) + - packSize(data.m_plymwinjtable, comm) + - packSize(data.m_skprwattable, comm) + - packSize(data.m_skprpolytable, comm); -} - ////// pack routines template @@ -1213,17 +1202,6 @@ void pack(const Group& data, pack(data.productionProperties(), buffer, position, comm); } -void pack(const WellPolymerProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.m_polymerConcentration, buffer, position, comm); - pack(data.m_saltConcentration, buffer, position, comm); - pack(data.m_plymwinjtable, buffer, position, comm); - pack(data.m_skprwattable, buffer, position, comm); - pack(data.m_skprpolytable, buffer, position, comm); -} - /// unpack routines template @@ -2017,17 +1995,6 @@ void unpack(Group& data, injection, production); } -void unpack(WellPolymerProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.m_polymerConcentration, buffer, position, comm); - unpack(data.m_saltConcentration, buffer, position, comm); - unpack(data.m_plymwinjtable, buffer, position, comm); - unpack(data.m_skprwattable, buffer, position, comm); - unpack(data.m_skprpolytable, buffer, position, comm); -} - #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 4c6d3923e..9dc520025 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -53,7 +53,6 @@ class Valve; class VFPInjTable; class VFPProdTable; class WellConnections; -class WellPolymerProperties; class WellSegments; class WellTracerProperties; @@ -394,7 +393,6 @@ ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellBrineProperties) ADD_PACK_PROTOTYPES(WellConnections) -ADD_PACK_PROTOTYPES(WellPolymerProperties) ADD_PACK_PROTOTYPES(WellSegments) ADD_PACK_PROTOTYPES(WellTracerProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index b510e4980..ecdeca72a 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1363,7 +1363,7 @@ BOOST_AUTO_TEST_CASE(WellPolymerProperties) { #ifdef HAVE_MPI Opm::WellPolymerProperties val1{1.0, 2.0, 3, 4, 5}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellPolymerProperties) #endif } From 2e34b91b535a0b3d12cc12c6a74088aa62a3827a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 35/61] remove old serialization support for WellBrineProperties --- opm/simulators/utils/ParallelRestart.cpp | 1 - opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index d406030e6..294be7764 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -261,7 +261,6 @@ HANDLE_AS_POD(data::Connection) HANDLE_AS_POD(data::CurrentControl) HANDLE_AS_POD(data::Rates) HANDLE_AS_POD(data::Segment) -HANDLE_AS_POD(WellBrineProperties) std::size_t packSize(const data::Well& data, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 9dc520025..9e9c570ba 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -391,7 +391,6 @@ ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) -ADD_PACK_PROTOTYPES(WellBrineProperties) ADD_PACK_PROTOTYPES(WellConnections) ADD_PACK_PROTOTYPES(WellSegments) ADD_PACK_PROTOTYPES(WellTracerProperties) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index ecdeca72a..3c41d671c 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2223,7 +2223,7 @@ BOOST_AUTO_TEST_CASE(WellBrineProperties) { #ifdef HAVE_MPI Opm::WellBrineProperties val1{1.0}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellBrineProperties) #endif } From 1a4f8f861f7cc13417228249baf9f56e1c5ca743 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 36/61] remove old serialization support for WellTracerProperties --- opm/simulators/utils/ParallelRestart.cpp | 23 ----------------------- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 26 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 294be7764..876bc2bca 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -341,12 +340,6 @@ std::size_t packSize(const VFPProdTable& data, packSize(data.getTable(), comm); } -std::size_t packSize(const WellTracerProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getConcentrations(), comm); -} - std::size_t packSize(const UDAValue& data, Dune::MPIHelper::MPICommunicator comm) { @@ -910,13 +903,6 @@ void pack(const VFPProdTable& data, pack(data.getTable(), buffer, position, comm); } -void pack(const WellTracerProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getConcentrations(), buffer, position, comm); -} - void pack(const UDAValue& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1531,15 +1517,6 @@ void unpack(VFPProdTable& data, wfrAxis, gfrAxis, alqAxis, table); } -void unpack(WellTracerProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - WellTracerProperties::ConcentrationMap ddata; - unpack(ddata, buffer, position, comm); - data = WellTracerProperties(ddata); -} - void unpack(UDAValue& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 9e9c570ba..ef2485d47 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -54,7 +54,6 @@ class VFPInjTable; class VFPProdTable; class WellConnections; class WellSegments; -class WellTracerProperties; namespace Mpi { @@ -393,7 +392,6 @@ ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellConnections) ADD_PACK_PROTOTYPES(WellSegments) -ADD_PACK_PROTOTYPES(WellTracerProperties) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 3c41d671c..b93e804e2 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1383,7 +1383,7 @@ BOOST_AUTO_TEST_CASE(WellTracerProperties) { #ifdef HAVE_MPI Opm::WellTracerProperties val1({{"test", 1.0}, {"test2", 2.0}}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellTracerProperties) #endif } From 8cd3d3c9b909e9249e386e67d6e1c55e991c3cfb Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 37/61] remove old serialization support for Connection --- opm/simulators/utils/ParallelRestart.cpp | 102 ----------------------- opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 105 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 876bc2bca..ce58843e2 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -349,32 +348,6 @@ std::size_t packSize(const UDAValue& data, packSize(data.get(), comm)); } -std::size_t packSize(const Connection& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.dir(), comm) + - packSize(data.depth(), comm) + - packSize(data.state(), comm) + - packSize(data.satTableId(), comm) + - packSize(data.complnum(), comm) + - packSize(data.CF(), comm) + - packSize(data.Kh(), comm) + - packSize(data.rw(), comm) + - packSize(data.r0(), comm) + - packSize(data.skinFactor(), comm) + - packSize(data.getI(), comm) + - packSize(data.getJ(), comm) + - packSize(data.getK(), comm) + - packSize(data.kind(), comm) + - packSize(data.getSeqIndex(), comm) + - packSize(data.getSegDistStart(), comm) + - packSize(data.getSegDistEnd(), comm) + - packSize(data.getDefaultSatTabId(), comm) + - packSize(data.getCompSegSeqIndex(), comm) + - packSize(data.segment(), comm) + - packSize(data.wellPi(), comm); -} - std::size_t packSize(const Well::WellInjectionProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -915,33 +888,6 @@ void pack(const UDAValue& data, pack(data.get(), buffer, position, comm); } -void pack(const Connection& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.dir(), buffer, position, comm); - pack(data.depth(), buffer, position, comm); - pack(data.state(), buffer, position, comm); - pack(data.satTableId(), buffer, position, comm); - pack(data.complnum(), buffer, position, comm); - pack(data.CF(), buffer, position, comm); - pack(data.Kh(), buffer, position, comm); - pack(data.rw(), buffer, position, comm); - pack(data.r0(), buffer, position, comm); - pack(data.skinFactor(), buffer, position, comm); - pack(data.getI(), buffer, position, comm); - pack(data.getJ(), buffer, position, comm); - pack(data.getK(), buffer, position, comm); - pack(data.kind(), buffer, position, comm); - pack(data.getSeqIndex(), buffer, position, comm); - pack(data.getSegDistStart(), buffer, position, comm); - pack(data.getSegDistEnd(), buffer, position, comm); - pack(data.getDefaultSatTabId(), buffer, position, comm); - pack(data.getCompSegSeqIndex(), buffer, position, comm); - pack(data.segment(), buffer, position, comm); - pack(data.wellPi(), buffer, position, comm); -} - void pack(const Well::WellInjectionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1536,54 +1482,6 @@ void unpack(UDAValue& data, } } -void unpack(Connection& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - Connection::Direction dir; - double depth; - Connection::State state; - int satTableId, complnum; - double CF, Kh, rw, r0, skinFactor; - int I, J, K; - size_t seqIndex; - double segDistStart, segDistEnd; - bool defaultSatTabId; - size_t compSegSeqIndex; - int segment; - double wellPi; - Connection::CTFKind kind; - - unpack(dir, buffer, position, comm); - unpack(depth, buffer, position, comm); - unpack(state, buffer, position, comm); - unpack(satTableId, buffer, position, comm); - unpack(complnum, buffer, position, comm); - unpack(CF, buffer, position, comm); - unpack(Kh, buffer, position, comm); - unpack(rw, buffer, position, comm); - unpack(r0, buffer, position, comm); - unpack(skinFactor, buffer, position, comm); - unpack(I, buffer, position, comm); - unpack(J, buffer, position, comm); - unpack(K, buffer, position, comm); - unpack(kind, buffer, position, comm); - unpack(seqIndex, buffer, position, comm); - unpack(segDistStart, buffer, position, comm); - unpack(segDistEnd, buffer, position, comm); - unpack(defaultSatTabId, buffer, position, comm); - unpack(compSegSeqIndex, buffer, position, comm); - unpack(segment, buffer, position, comm); - unpack(wellPi, buffer, position, comm); - - data = Connection(dir, depth, state, satTableId, - complnum, CF, Kh, rw, r0, - skinFactor, {I,J,K}, kind, seqIndex, - segDistStart, segDistEnd, - defaultSatTabId, compSegSeqIndex, - segment, wellPi); -} - void unpack(Well::WellInjectionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index ef2485d47..288ef5472 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -42,7 +42,6 @@ namespace Opm { -class Connection; class Dimension; template class IOrderSet; class Segment; @@ -363,7 +362,6 @@ void unpack(char* str, std::size_t length, std::vector& buffer, int& posit void unpack(T& data, std::vector& buffer, int& position, \ Dune::MPIHelper::MPICommunicator comm); -ADD_PACK_PROTOTYPES(Connection) ADD_PACK_PROTOTYPES(data::CellData) ADD_PACK_PROTOTYPES(data::Connection) ADD_PACK_PROTOTYPES(data::CurrentControl) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index b93e804e2..2af71705e 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1411,7 +1411,7 @@ BOOST_AUTO_TEST_CASE(Connection) {9, 10, 11}, Opm::Connection::CTFKind::Defaulted, 12, 13.0, 14.0, true, 15, 16, 17.0); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Connection) #endif } From a35ba936297f58d4860fcce9606143efdbeebff0 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 38/61] remove old serialization support for WellConnections --- opm/simulators/utils/ParallelRestart.cpp | 36 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 39 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index ce58843e2..d1ccf6869 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -368,15 +367,6 @@ std::size_t packSize(const Well::WellInjectionProperties& data, packSize(data.controlMode, comm); } -std::size_t packSize(const WellConnections& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.ordering(), comm) + - packSize(data.getHeadI(), comm) + - packSize(data.getHeadJ(), comm) + - packSize(data.getConnections(), comm); -} - std::size_t packSize(const Well::WellProductionProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -909,16 +899,6 @@ void pack(const Well::WellInjectionProperties& data, pack(data.controlMode, buffer, position, comm); } -void pack(const WellConnections& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.ordering(), buffer, position, comm); - pack(data.getHeadI(), buffer, position, comm); - pack(data.getHeadJ(), buffer, position, comm); - pack(data.getConnections(), buffer, position, comm); -} - void pack(const Well::WellProductionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1503,22 +1483,6 @@ void unpack(Well::WellInjectionProperties& data, unpack(data.controlMode, buffer, position, comm); } -void unpack(WellConnections& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - int headI, headJ; - Connection::Order ordering; - std::vector connections; - - unpack(ordering, buffer, position, comm), - unpack(headI, buffer, position, comm), - unpack(headJ, buffer, position, comm), - unpack(connections, buffer, position, comm), - - data = WellConnections(ordering, headI, headJ, connections); -} - void unpack(Well::WellProductionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 288ef5472..3d10b083c 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -51,7 +51,6 @@ class UnitSystem; class Valve; class VFPInjTable; class VFPProdTable; -class WellConnections; class WellSegments; namespace Mpi @@ -388,7 +387,6 @@ ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(Well::WellProductionProperties) -ADD_PACK_PROTOTYPES(WellConnections) ADD_PACK_PROTOTYPES(WellSegments) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 2af71705e..82cc5da08 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1474,7 +1474,7 @@ BOOST_AUTO_TEST_CASE(WellConnections) 12, 13.0, 14.0, true, 15, 16, 17.0); Opm::WellConnections val1(Opm::Connection::Order::TRACK, 1, 2, {conn, conn}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellConnections) #endif } From 0cb3e1426c4e236554066209a2bb318e76d335cc Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 39/61] remove old serialization support for WellProductionProperties --- opm/simulators/utils/ParallelRestart.cpp | 88 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 90 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index d1ccf6869..1871ed125 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -367,29 +367,6 @@ std::size_t packSize(const Well::WellInjectionProperties& data, packSize(data.controlMode, comm); } -std::size_t packSize(const Well::WellProductionProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name, comm) + - packSize(data.OilRate, comm) + - packSize(data.WaterRate, comm) + - packSize(data.GasRate, comm) + - packSize(data.LiquidRate, comm) + - packSize(data.ResVRate, comm) + - packSize(data.BHPTarget, comm) + - packSize(data.THPTarget, comm) + - packSize(data.bhp_hist_limit, comm) + - packSize(data.thp_hist_limit, comm) + - packSize(data.BHPH, comm) + - packSize(data.THPH, comm) + - packSize(data.VFPTableNumber, comm) + - packSize(data.ALQValue, comm) + - packSize(data.predictionMode, comm) + - packSize(data.controlMode, comm) + - packSize(data.whistctl_cmode, comm) + - packSize(data.getNumProductionControls(), comm); -} - std::size_t packSize(const SpiralICD& data, Dune::MPIHelper::MPICommunicator comm) { @@ -899,30 +876,6 @@ void pack(const Well::WellInjectionProperties& data, pack(data.controlMode, buffer, position, comm); } -void pack(const Well::WellProductionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name, buffer, position, comm); - pack(data.OilRate, buffer, position, comm); - pack(data.WaterRate, buffer, position, comm); - pack(data.GasRate, buffer, position, comm); - pack(data.LiquidRate, buffer, position, comm); - pack(data.ResVRate, buffer, position, comm); - pack(data.BHPTarget, buffer, position, comm); - pack(data.THPTarget, buffer, position, comm); - pack(data.bhp_hist_limit, buffer, position, comm); - pack(data.thp_hist_limit, buffer, position, comm); - pack(data.BHPH, buffer, position, comm); - pack(data.THPH, buffer, position, comm); - pack(data.VFPTableNumber, buffer, position, comm); - pack(data.ALQValue, buffer, position, comm); - pack(data.predictionMode, buffer, position, comm); - pack(data.controlMode, buffer, position, comm); - pack(data.whistctl_cmode, buffer, position, comm); - pack(data.getNumProductionControls(), buffer, position, comm); -} - void pack(const SpiralICD& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1483,47 +1436,6 @@ void unpack(Well::WellInjectionProperties& data, unpack(data.controlMode, buffer, position, comm); } -void unpack(Well::WellProductionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name; - UDAValue OilRate, WaterRate, GasRate, LiquidRate, ResVRate; - UDAValue BHPTarget, THPTarget; - double bhp_hist_limit, thp_hist_limit; - double BHPH, THPH; - int VFPTableNumber; - double ALQValue; - bool predictionMode; - Well::ProducerCMode controlMode, whistctl_cmode; - int prodCtrls; - - unpack(name, buffer, position, comm); - unpack(OilRate, buffer, position, comm); - unpack(WaterRate, buffer, position, comm); - unpack(GasRate, buffer, position, comm); - unpack(LiquidRate, buffer, position, comm); - unpack(ResVRate, buffer, position, comm); - unpack(BHPTarget, buffer, position, comm); - unpack(THPTarget, buffer, position, comm); - unpack(bhp_hist_limit, buffer, position, comm); - unpack(thp_hist_limit, buffer, position, comm); - unpack(BHPH, buffer, position, comm); - unpack(THPH, buffer, position, comm); - unpack(VFPTableNumber, buffer, position, comm); - unpack(ALQValue, buffer, position, comm); - unpack(predictionMode, buffer, position, comm); - unpack(controlMode, buffer, position, comm); - unpack(whistctl_cmode, buffer, position, comm); - unpack(prodCtrls, buffer, position, comm); - data = Well::WellProductionProperties(name, OilRate, WaterRate, GasRate, - LiquidRate, ResVRate, BHPTarget, - THPTarget, bhp_hist_limit, thp_hist_limit, - BHPH, THPH, VFPTableNumber, - ALQValue, predictionMode, controlMode, - whistctl_cmode, prodCtrls); -} - void unpack(SpiralICD& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 3d10b083c..14c144af0 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -386,7 +386,6 @@ ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) -ADD_PACK_PROTOTYPES(Well::WellProductionProperties) ADD_PACK_PROTOTYPES(WellSegments) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 82cc5da08..439cde3c6 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1498,7 +1498,7 @@ BOOST_AUTO_TEST_CASE(WellProductionProperties) true, Opm::Well::ProducerCMode::CRAT, Opm::Well::ProducerCMode::BHP, 11); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Well::WellProductionProperties) #endif } From 41950690fde9a421555710ad57efe3f9d66b6d90 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 40/61] remove old serialization support for WellInjectionProperties --- opm/simulators/utils/ParallelRestart.cpp | 62 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 64 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 1871ed125..a7f5bbd08 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -347,26 +347,6 @@ std::size_t packSize(const UDAValue& data, packSize(data.get(), comm)); } -std::size_t packSize(const Well::WellInjectionProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name, comm) + - packSize(data.surfaceInjectionRate, comm) + - packSize(data.reservoirInjectionRate, comm) + - packSize(data.BHPTarget, comm) + - packSize(data.THPTarget, comm) + - packSize(data.bhp_hist_limit, comm) + - packSize(data.thp_hist_limit, comm) + - packSize(data.temperature, comm) + - packSize(data.BHPH, comm) + - packSize(data.THPH, comm) + - packSize(data.VFPTableNumber, comm) + - packSize(data.predictionMode, comm) + - packSize(data.injectionControls, comm) + - packSize(data.injectorType, comm) + - packSize(data.controlMode, comm); -} - std::size_t packSize(const SpiralICD& data, Dune::MPIHelper::MPICommunicator comm) { @@ -855,27 +835,6 @@ void pack(const UDAValue& data, pack(data.get(), buffer, position, comm); } -void pack(const Well::WellInjectionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name, buffer, position, comm); - pack(data.surfaceInjectionRate, buffer, position, comm); - pack(data.reservoirInjectionRate, buffer, position, comm); - pack(data.BHPTarget, buffer, position, comm); - pack(data.THPTarget, buffer, position, comm); - pack(data.bhp_hist_limit, buffer, position, comm); - pack(data.thp_hist_limit, buffer, position, comm); - pack(data.temperature, buffer, position, comm); - pack(data.BHPH, buffer, position, comm); - pack(data.THPH, buffer, position, comm); - pack(data.VFPTableNumber, buffer, position, comm); - pack(data.predictionMode, buffer, position, comm); - pack(data.injectionControls, buffer, position, comm); - pack(data.injectorType, buffer, position, comm); - pack(data.controlMode, buffer, position, comm); -} - void pack(const SpiralICD& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1415,27 +1374,6 @@ void unpack(UDAValue& data, } } -void unpack(Well::WellInjectionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.name, buffer, position, comm); - unpack(data.surfaceInjectionRate, buffer, position, comm); - unpack(data.reservoirInjectionRate, buffer, position, comm); - unpack(data.BHPTarget, buffer, position, comm); - unpack(data.THPTarget, buffer, position, comm); - unpack(data.bhp_hist_limit, buffer, position, comm); - unpack(data.thp_hist_limit, buffer, position, comm); - unpack(data.temperature, buffer, position, comm); - unpack(data.BHPH, buffer, position, comm); - unpack(data.THPH, buffer, position, comm); - unpack(data.VFPTableNumber, buffer, position, comm); - unpack(data.predictionMode, buffer, position, comm); - unpack(data.injectionControls, buffer, position, comm); - unpack(data.injectorType, buffer, position, comm); - unpack(data.controlMode, buffer, position, comm); -} - void unpack(SpiralICD& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 14c144af0..ec4f86e69 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -385,7 +385,6 @@ ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) -ADD_PACK_PROTOTYPES(Well::WellInjectionProperties) ADD_PACK_PROTOTYPES(WellSegments) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 439cde3c6..457fa8703 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1432,7 +1432,7 @@ BOOST_AUTO_TEST_CASE(WellInjectionProperties) 8, Opm::InjectorType::OIL, Opm::Well::InjectorCMode::BHP); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Well::WellInjectionProperties) #endif } From 2bb892139d1a6a4219bb297cbea470441692cceb Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 41/61] remove old serialization support for SpiralICD --- opm/simulators/utils/ParallelRestart.cpp | 66 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 69 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index a7f5bbd08..b5c7f08f3 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -24,7 +24,6 @@ #include "ParallelRestart.hpp" #include #include -#include #include #include #include @@ -347,22 +346,6 @@ std::size_t packSize(const UDAValue& data, packSize(data.get(), comm)); } -std::size_t packSize(const SpiralICD& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.strength(), comm) + - packSize(data.length(), comm) + - packSize(data.densityCalibration(), comm) + - packSize(data.viscosityCalibration(), comm) + - packSize(data.criticalValue(), comm) + - packSize(data.widthTransitionRegion(), comm) + - packSize(data.maxViscosityRatio(), comm) + - packSize(data.methodFlowScaling(), comm) + - packSize(data.maxAbsoluteRate(), comm) + - packSize(data.status(), comm) + - packSize(data.scalingFactor(), comm); -} - std::size_t packSize(const Valve& data, Dune::MPIHelper::MPICommunicator comm) { @@ -835,23 +818,6 @@ void pack(const UDAValue& data, pack(data.get(), buffer, position, comm); } -void pack(const SpiralICD& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.strength(), buffer, position, comm); - pack(data.length(), buffer, position, comm); - pack(data.densityCalibration(), buffer, position, comm); - pack(data.viscosityCalibration(), buffer, position, comm); - pack(data.criticalValue(), buffer, position, comm); - pack(data.widthTransitionRegion(), buffer, position, comm); - pack(data.maxViscosityRatio(), buffer, position, comm); - pack(data.methodFlowScaling(), buffer, position, comm); - pack(data.maxAbsoluteRate(), buffer, position, comm); - pack(data.status(), buffer, position, comm); - pack(data.scalingFactor(), buffer, position, comm); -} - void pack(const Valve& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1374,37 +1340,6 @@ void unpack(UDAValue& data, } } -void unpack(SpiralICD& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - double strength, length, densityCalibration, - viscosityCalibration, criticalValue, - widthTransitionRegion, maxViscosityRatio; - int methodFlowScaling; - double maxAbsoluteRate; - ICDStatus status; - double scalingFactor; - - unpack(strength, buffer, position, comm); - unpack(length, buffer, position, comm); - unpack(densityCalibration, buffer, position, comm); - unpack(viscosityCalibration, buffer, position, comm); - unpack(criticalValue, buffer, position, comm); - unpack(widthTransitionRegion, buffer, position, comm); - unpack(maxViscosityRatio, buffer, position, comm); - unpack(methodFlowScaling, buffer, position, comm); - unpack(maxAbsoluteRate, buffer, position, comm); - unpack(status, buffer, position, comm); - unpack(scalingFactor, buffer, position, comm); - - data = SpiralICD(strength, length, densityCalibration, - viscosityCalibration, criticalValue, - widthTransitionRegion, maxViscosityRatio, - methodFlowScaling, maxAbsoluteRate, - status, scalingFactor); -} - void unpack(Valve& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1740,7 +1675,6 @@ template void unpack(std::shared_ptr<__VA_ARGS__>& data, \ std::vector& buffer, int& position, \ Dune::MPIHelper::MPICommunicator comm); -INSTANTIATE_PACK_SHARED_PTR(SpiralICD) INSTANTIATE_PACK_SHARED_PTR(VFPInjTable) INSTANTIATE_PACK_SHARED_PTR(Well) #undef INSTANTIATE_PACK_SHARED_PTR diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index ec4f86e69..5ee784c05 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -45,7 +45,6 @@ namespace Opm class Dimension; template class IOrderSet; class Segment; -class SpiralICD; class UDAValue; class UnitSystem; class Valve; @@ -376,7 +375,6 @@ ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(Segment) -ADD_PACK_PROTOTYPES(SpiralICD) ADD_PACK_PROTOTYPES(std::string) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 457fa8703..0e83a8246 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1509,7 +1509,7 @@ BOOST_AUTO_TEST_CASE(SpiralICD) #ifdef HAVE_MPI Opm::SpiralICD val1(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8, 9.0, Opm::ICDStatus::OPEN, 10.0); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(SpiralICD) #endif } From e53584ffec174c9e2819d8d175df3f06eb6fe5ae Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 42/61] remove old serialization support for Valve --- opm/simulators/utils/ParallelRestart.cpp | 54 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 57 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index b5c7f08f3..9289459c5 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -24,7 +24,6 @@ #include "ParallelRestart.hpp" #include #include -#include #include #include #include @@ -346,19 +345,6 @@ std::size_t packSize(const UDAValue& data, packSize(data.get(), comm)); } -std::size_t packSize(const Valve& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.conFlowCoefficient(), comm) + - packSize(data.conCrossArea(), comm) + - packSize(data.conMaxCrossArea(), comm) + - packSize(data.pipeAdditionalLength(), comm) + - packSize(data.pipeDiameter(), comm) + - packSize(data.pipeRoughness(), comm) + - packSize(data.pipeCrossArea(), comm) + - packSize(data.status(), comm); -} - std::size_t packSize(const Segment& data, Dune::MPIHelper::MPICommunicator comm) { @@ -818,20 +804,6 @@ void pack(const UDAValue& data, pack(data.get(), buffer, position, comm); } -void pack(const Valve& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.conFlowCoefficient(), buffer, position, comm); - pack(data.conCrossArea(), buffer, position, comm); - pack(data.conMaxCrossArea(), buffer, position, comm); - pack(data.pipeAdditionalLength(), buffer, position, comm); - pack(data.pipeDiameter(), buffer, position, comm); - pack(data.pipeRoughness(), buffer, position, comm); - pack(data.pipeCrossArea(), buffer, position, comm); - pack(data.status(), buffer, position, comm); -} - void pack(const Segment& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1340,32 +1312,6 @@ void unpack(UDAValue& data, } } -void unpack(Valve& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - double conFlowCoefficient; - double conCrossArea; - double conMaxCrossArea; - double pipeAdditionalLength; - double pipeDiameter; - double pipeRoughness; - double pipeCrossArea; - ICDStatus status; - - unpack(conFlowCoefficient, buffer, position, comm); - unpack(conCrossArea, buffer, position, comm); - unpack(conMaxCrossArea, buffer, position, comm); - unpack(pipeAdditionalLength, buffer, position, comm); - unpack(pipeDiameter, buffer, position, comm); - unpack(pipeRoughness, buffer, position, comm); - unpack(pipeCrossArea, buffer, position, comm); - unpack(status, buffer, position, comm); - data = Valve(conFlowCoefficient, conCrossArea, conMaxCrossArea, - pipeAdditionalLength, pipeDiameter, pipeRoughness, - pipeCrossArea, status); -} - void unpack(Segment& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 5ee784c05..1f98d653f 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -47,7 +47,6 @@ template class IOrderSet; class Segment; class UDAValue; class UnitSystem; -class Valve; class VFPInjTable; class VFPProdTable; class WellSegments; @@ -378,7 +377,6 @@ ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(std::string) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) -ADD_PACK_PROTOTYPES(Valve) ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 0e83a8246..d8955e849 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1519,7 +1519,7 @@ BOOST_AUTO_TEST_CASE(Valve) { #ifdef HAVE_MPI Opm::Valve val1(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, Opm::ICDStatus::OPEN); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Valve) #endif } From fde0e42e8d76b52b0b92c2041250d3d81cc5913c Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 43/61] remove old serialization support for Segment --- opm/simulators/utils/ParallelRestart.cpp | 71 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 74 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 9289459c5..9d957085d 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -345,25 +345,6 @@ std::size_t packSize(const UDAValue& data, packSize(data.get(), comm)); } -std::size_t packSize(const Segment& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.segmentNumber(), comm) + - packSize(data.branchNumber(), comm) + - packSize(data.outletSegment(), comm) + - packSize(data.inletSegments(), comm) + - packSize(data.totalLength(), comm) + - packSize(data.depth(), comm) + - packSize(data.internalDiameter(), comm) + - packSize(data.roughness(), comm) + - packSize(data.crossArea(), comm) + - packSize(data.volume(), comm) + - packSize(data.dataReady(), comm) + - packSize(data.segmentType(), comm) + - packSize(data.spiralICD(), comm) + - packSize(data.getValve(), comm); -} - template std::size_t packSize(const std::shared_ptr& data, Dune::MPIHelper::MPICommunicator comm) @@ -804,26 +785,6 @@ void pack(const UDAValue& data, pack(data.get(), buffer, position, comm); } -void pack(const Segment& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.segmentNumber(), buffer, position, comm); - pack(data.branchNumber(), buffer, position, comm); - pack(data.outletSegment(), buffer, position, comm); - pack(data.inletSegments(), buffer, position, comm); - pack(data.totalLength(), buffer, position, comm); - pack(data.depth(), buffer, position, comm); - pack(data.internalDiameter(), buffer, position, comm); - pack(data.roughness(), buffer, position, comm); - pack(data.crossArea(), buffer, position, comm); - pack(data.volume(), buffer, position, comm); - pack(data.dataReady(), buffer, position, comm); - pack(data.segmentType(), buffer, position, comm); - pack(data.spiralICD(), buffer, position, comm); - pack(data.getValve(), buffer, position, comm); -} - template void pack(const std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1312,38 +1273,6 @@ void unpack(UDAValue& data, } } -void unpack(Segment& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - int segmentNumber, branchNumber, outletSegment; - std::vector inletSegments; - double totalLength, depth, internalDiameter, roughness, crossArea, volume; - bool dataReady; - Segment::SegmentType segmentType; - std::shared_ptr spiralICD; - std::shared_ptr valve; - - unpack(segmentNumber, buffer, position, comm); - unpack(branchNumber, buffer, position, comm); - unpack(outletSegment, buffer, position, comm); - unpack(inletSegments, buffer, position, comm); - unpack(totalLength, buffer, position, comm); - unpack(depth, buffer, position, comm); - unpack(internalDiameter, buffer, position, comm); - unpack(roughness, buffer, position, comm); - unpack(crossArea, buffer, position, comm); - unpack(volume, buffer, position, comm); - unpack(dataReady, buffer, position, comm); - unpack(segmentType, buffer, position, comm); - unpack(spiralICD, buffer, position, comm); - unpack(valve, buffer, position, comm); - data = Segment(segmentNumber, branchNumber, outletSegment, - inletSegments, totalLength, depth, - internalDiameter, roughness, crossArea, - volume, dataReady, segmentType, spiralICD, valve); -} - template void unpack(std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1f98d653f..f347cecd3 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -44,7 +44,6 @@ namespace Opm class Dimension; template class IOrderSet; -class Segment; class UDAValue; class UnitSystem; class VFPInjTable; @@ -373,7 +372,6 @@ ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) -ADD_PACK_PROTOTYPES(Segment) ADD_PACK_PROTOTYPES(std::string) ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index d8955e849..456a9dbea 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1532,7 +1532,7 @@ BOOST_AUTO_TEST_CASE(Segment) Opm::Segment::SegmentType::SICD, std::make_shared(), std::make_shared()); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Segment) #endif } From 9aa464c4acde77c299221be648b62d5777b7efdc Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 44/61] remove old serialization support for WellSegments --- opm/simulators/utils/ParallelRestart.cpp | 28 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 31 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 9d957085d..82f18df01 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -383,13 +383,6 @@ std::size_t packSize(const UnitSystem& data, packSize(data.use_count(), comm); } -std::size_t packSize(const WellSegments& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.compPressureDrop(), comm) + - packSize(data.segments(), comm); -} - std::size_t packSize(const Well& data, Dune::MPIHelper::MPICommunicator comm) { @@ -821,14 +814,6 @@ void pack(const UnitSystem& data, pack(data.use_count(), buffer, position, comm); } -void pack(const WellSegments& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.compPressureDrop(), buffer, position, comm); - pack(data.segments(), buffer, position, comm); -} - void pack(const Well& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1324,19 +1309,6 @@ void unpack(UnitSystem& data, data = UnitSystem(name, type, dimensions, use_count); } -void unpack(WellSegments& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - WellSegments::CompPressureDrop compPressureDrop; - std::vector segments; - - unpack(compPressureDrop, buffer, position, comm); - unpack(segments, buffer, position, comm); - - data = WellSegments(compPressureDrop, segments); -} - void unpack(Well& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index f347cecd3..2dc6e58ea 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -48,7 +48,6 @@ class UDAValue; class UnitSystem; class VFPInjTable; class VFPProdTable; -class WellSegments; namespace Mpi { @@ -379,7 +378,6 @@ ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) ADD_PACK_PROTOTYPES(WellType) -ADD_PACK_PROTOTYPES(WellSegments) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 456a9dbea..58c91e0d5 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1568,7 +1568,7 @@ BOOST_AUTO_TEST_CASE(WellSegments) Opm::WellSegments val1(Opm::WellSegments::CompPressureDrop::HF_, {seg, seg}); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellSegments) #endif } From eda5fc2d33594f1848bb47cd6a7985990c99e2fd Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 45/61] remove old serialization support for WellType --- opm/simulators/utils/ParallelRestart.cpp | 22 ---------------------- opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 82f18df01..685b73dd2 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -298,12 +297,6 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator return packSize(data.solution, comm) + packSize(data.wells, comm) + packSize(data.extra, comm); } -std::size_t packSize(const WellType& data, Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.producer(), comm) + - packSize(data.preferred_phase(), comm); -} - template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); @@ -730,12 +723,6 @@ void pack(const RestartValue& data, std::vector& buffer, int& position, pack(data.extra, buffer, position, comm); } -void pack(const WellType& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) { - pack(data.producer(), buffer, position, comm); - pack(data.preferred_phase(), buffer, position, comm); -} - void pack(const VFPInjTable& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1178,15 +1165,6 @@ void unpack(RestartValue& data, std::vector& buffer, int& position, unpack(data.extra, buffer, position, comm); } -void unpack(WellType& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) -{ - Phase preferred_phase; - bool producer; - unpack(producer, buffer, position, comm); - unpack(preferred_phase, buffer, position, comm); - data = WellType( producer, preferred_phase ); -} - void unpack(VFPInjTable& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 2dc6e58ea..920e9f955 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -377,7 +377,6 @@ ADD_PACK_PROTOTYPES(UnitSystem) ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) ADD_PACK_PROTOTYPES(Well) -ADD_PACK_PROTOTYPES(WellType) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 58c91e0d5..3075ae4d0 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -2320,7 +2320,7 @@ BOOST_AUTO_TEST_CASE(WellType) { #ifdef HAVE_MPI Opm::WellType val1(true, Opm::Phase::OIL); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(WellType) #endif } From 2c41427f3bcadb2d9e4aa1e7c2b6a35fe30415cf Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 46/61] remove old serialization support for Well --- opm/simulators/utils/ParallelRestart.cpp | 141 ----------------------- opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 144 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 685b73dd2..a14496db8 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -376,42 +376,6 @@ std::size_t packSize(const UnitSystem& data, packSize(data.use_count(), comm); } -std::size_t packSize(const Well& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(data.name(), comm) + - packSize(data.groupName(), comm) + - packSize(data.firstTimeStep(), comm) + - packSize(data.seqIndex(), comm) + - packSize(data.getHeadI(), comm) + - packSize(data.getHeadJ(), comm) + - packSize(data.getRefDepth(), comm) + - packSize(data.wellType(), comm) + - packSize(data.units(), comm) + - packSize(data.udqUndefined(), comm) + - packSize(data.getStatus(), comm) + - packSize(data.getDrainageRadius(), comm) + - packSize(data.getAllowCrossFlow(), comm) + - packSize(data.getAutomaticShutIn(), comm) + - packSize(data.wellGuideRate(), comm) + - packSize(data.getEfficiencyFactor(), comm) + - packSize(data.getSolventFraction(), comm) + - packSize(data.predictionMode(), comm) + - packSize(data.getEconLimits(), comm) + - packSize(data.getFoamProperties(), comm) + - packSize(data.getPolymerProperties(), comm) + - packSize(data.getBrineProperties(), comm) + - packSize(data.getTracerProperties(), comm) + - packSize(data.getConnections(), comm) + - packSize(data.getProductionProperties(), comm) + - packSize(data.getInjectionProperties(), comm) + - packSize(data.hasSegments(), comm); - if (data.hasSegments()) - size += packSize(data.getSegments(), comm); - - return size; -} - template std::size_t packSize(const IOrderSet& data, Dune::MPIHelper::MPICommunicator comm) @@ -801,41 +765,6 @@ void pack(const UnitSystem& data, pack(data.use_count(), buffer, position, comm); } -void pack(const Well& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name(), buffer, position, comm); - pack(data.groupName(), buffer, position, comm); - pack(data.firstTimeStep(), buffer, position, comm); - pack(data.seqIndex(), buffer, position, comm); - pack(data.getHeadI(), buffer, position, comm); - pack(data.getHeadJ(), buffer, position, comm); - pack(data.getRefDepth(), buffer, position, comm); - pack(data.wellType(), buffer, position, comm); - pack(data.units(), buffer, position, comm); - pack(data.udqUndefined(), buffer, position, comm); - pack(data.getStatus(), buffer, position, comm); - pack(data.getDrainageRadius(), buffer, position, comm); - pack(data.getAllowCrossFlow(), buffer, position, comm); - pack(data.getAutomaticShutIn(), buffer, position, comm); - pack(data.wellGuideRate(), buffer, position, comm); - pack(data.getEfficiencyFactor(), buffer, position, comm); - pack(data.getSolventFraction(), buffer, position, comm); - pack(data.predictionMode(), buffer, position, comm); - pack(data.getEconLimits(), buffer, position, comm); - pack(data.getFoamProperties(), buffer, position, comm); - pack(data.getPolymerProperties(), buffer, position, comm); - pack(data.getBrineProperties(), buffer, position, comm); - pack(data.getTracerProperties(), buffer, position, comm); - pack(data.getConnections(), buffer, position, comm); - pack(data.getProductionProperties(), buffer, position, comm); - pack(data.getInjectionProperties(), buffer, position, comm); - pack(data.hasSegments(), buffer, position, comm); - if (data.hasSegments()) - pack(data.getSegments(), buffer, position, comm); -} - template void pack(const IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1287,74 +1216,6 @@ void unpack(UnitSystem& data, data = UnitSystem(name, type, dimensions, use_count); } -void unpack(Well& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name, groupName; - std::size_t firstTimeStep, seqIndex; - int headI, headJ; - double ref_depth; - WellType wtype; - UnitSystem units; - double udq_undefined; - Well::Status status; - double drainageRadius; - bool allowCrossFlow, automaticShutIn; - Well::WellGuideRate guideRate; - double efficiencyFactor; - double solventFraction; - bool prediction_mode; - auto econLimits = std::make_shared(); - auto foamProperties = std::make_shared(); - auto polymerProperties = std::make_shared(); - auto brineProperties = std::make_shared(); - auto tracerProperties = std::make_shared(); - auto connection = std::make_shared(); - auto production = std::make_shared(); - auto injection = std::make_shared(); - std::shared_ptr segments; - - unpack(name, buffer, position, comm); - unpack(groupName, buffer, position, comm); - unpack(firstTimeStep, buffer, position, comm); - unpack(seqIndex, buffer, position, comm); - unpack(headI, buffer, position, comm); - unpack(headJ, buffer, position, comm); - unpack(ref_depth, buffer, position, comm); - unpack(wtype, buffer, position, comm); - unpack(units, buffer, position, comm); - unpack(udq_undefined, buffer, position, comm); - unpack(status, buffer, position, comm); - unpack(drainageRadius, buffer, position, comm); - unpack(allowCrossFlow, buffer, position, comm); - unpack(automaticShutIn, buffer, position, comm); - unpack(guideRate, buffer, position, comm); - unpack(efficiencyFactor, buffer, position, comm); - unpack(solventFraction, buffer, position, comm); - unpack(prediction_mode, buffer, position, comm); - unpack(*econLimits, buffer, position, comm); - unpack(*foamProperties, buffer, position, comm); - unpack(*polymerProperties, buffer, position, comm); - unpack(*brineProperties, buffer, position, comm); - unpack(*tracerProperties, buffer, position, comm); - unpack(*connection, buffer, position, comm); - unpack(*production, buffer, position, comm); - unpack(*injection, buffer, position, comm); - bool hasSegments; - unpack(hasSegments, buffer, position, comm); - if (hasSegments) { - segments = std::make_shared(); - unpack(*segments, buffer, position, comm); - } - data = Well(name, groupName, firstTimeStep, seqIndex, headI, headJ, - ref_depth, wtype, units, udq_undefined, status, - drainageRadius, allowCrossFlow, automaticShutIn, - guideRate, efficiencyFactor, solventFraction, prediction_mode, - econLimits, foamProperties, polymerProperties, brineProperties, - tracerProperties, connection, production, injection, segments); -} - template void unpack(IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1465,7 +1326,6 @@ INSTANTIATE_PACK_VECTOR(std::pair) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) -INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::map) INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) @@ -1501,7 +1361,6 @@ template void unpack(std::shared_ptr<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); INSTANTIATE_PACK_SHARED_PTR(VFPInjTable) -INSTANTIATE_PACK_SHARED_PTR(Well) #undef INSTANTIATE_PACK_SHARED_PTR #define INSTANTIATE_PACK(...) \ diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 920e9f955..654b95184 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include @@ -376,7 +375,6 @@ ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) -ADD_PACK_PROTOTYPES(Well) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 3075ae4d0..a2bf3e8a0 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1578,7 +1578,7 @@ BOOST_AUTO_TEST_CASE(Well) { #ifdef HAVE_MPI Opm::Well val1 = getFullWell(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Well) #endif } From c8b14dcbb1fdfc127a1f0a7064e13b08730732fb Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 47/61] remove old serialization support for IOrderSet --- opm/simulators/utils/ParallelRestart.cpp | 31 +++--------------------- opm/simulators/utils/ParallelRestart.hpp | 12 --------- 2 files changed, 3 insertions(+), 40 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index a14496db8..4b1f6f227 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #define HANDLE_AS_POD(T) \ @@ -376,14 +375,6 @@ std::size_t packSize(const UnitSystem& data, packSize(data.use_count(), comm); } -template -std::size_t packSize(const IOrderSet& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.index(), comm) + - packSize(data.data(), comm); -} - std::size_t packSize(const Group::GroupInjectionProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -765,14 +756,6 @@ void pack(const UnitSystem& data, pack(data.use_count(), buffer, position, comm); } -template -void pack(const IOrderSet& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.index(), buffer, position, comm); - pack(data.data(), buffer, position, comm); -} - void pack(const Group::GroupInjectionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1216,17 +1199,6 @@ void unpack(UnitSystem& data, data = UnitSystem(name, type, dimensions, use_count); } -template -void unpack(IOrderSet& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - typename IOrderSet::index_type index; - typename IOrderSet::storage_type storage; - unpack(index, buffer, position, comm); - unpack(storage, buffer, position, comm); - data = IOrderSet(index, storage); -} - template void unpack(std::map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -1379,6 +1351,7 @@ INSTANTIATE_PACK(bool) INSTANTIATE_PACK(int) INSTANTIATE_PACK(std::array) INSTANTIATE_PACK(std::array) +INSTANTIATE_PACK(std::array) INSTANTIATE_PACK(unsigned char) INSTANTIATE_PACK(std::map,std::pair>) INSTANTIATE_PACK(std::map) @@ -1386,6 +1359,8 @@ INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map,int>>) INSTANTIATE_PACK(std::map) +INSTANTIATE_PACK(std::map) +INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_map) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 654b95184..6c8c81331 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -42,7 +42,6 @@ namespace Opm { class Dimension; -template class IOrderSet; class UDAValue; class UnitSystem; class VFPInjTable; @@ -135,9 +134,6 @@ std::size_t packSize(const OrderedMap& data, Dune::MPIHelper::MPIComm template std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const IOrderSet& data, Dune::MPIHelper::MPICommunicator comm); - ////// pack routines template @@ -235,10 +231,6 @@ template void pack(const DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const IOrderSet& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - void pack(const char* str, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -340,10 +332,6 @@ template void unpack(DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(IOrderSet& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - void unpack(char* str, std::size_t length, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); From d496b93cfa1fbf513aefd47c58afb634127f1a30 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 48/61] remove old serialization support for GroupInjectionProperties --- opm/simulators/utils/ParallelRestart.cpp | 60 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 62 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 4b1f6f227..2f98ce020 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -296,10 +296,6 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator return packSize(data.solution, comm) + packSize(data.wells, comm) + packSize(data.extra, comm); } -template -std::size_t packSize(const std::map& data, - Dune::MPIHelper::MPICommunicator comm); - std::size_t packSize(const VFPInjTable& data, Dune::MPIHelper::MPICommunicator comm) { @@ -375,20 +371,6 @@ std::size_t packSize(const UnitSystem& data, packSize(data.use_count(), comm); } -std::size_t packSize(const Group::GroupInjectionProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.phase, comm) + - packSize(data.cmode, comm) + - packSize(data.surface_max_rate, comm) + - packSize(data.resv_max_rate, comm) + - packSize(data.target_reinj_fraction, comm) + - packSize(data.target_void_fraction, comm) + - packSize(data.reinj_group, comm) + - packSize(data.voidage_group, comm) + - packSize(data.injection_controls, comm); -} - std::size_t packSize(const Group::GroupProductionProperties& data, Dune::MPIHelper::MPICommunicator comm) { @@ -616,13 +598,6 @@ void pack(const std::unordered_map& data, std::vector& buffer } } - -template void pack(const std::map& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - - - void pack(const data::Well& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { @@ -756,21 +731,6 @@ void pack(const UnitSystem& data, pack(data.use_count(), buffer, position, comm); } -void pack(const Group::GroupInjectionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.phase, buffer, position, comm); - pack(data.cmode, buffer, position, comm); - pack(data.surface_max_rate, buffer, position, comm); - pack(data.resv_max_rate, buffer, position, comm); - pack(data.target_reinj_fraction, buffer, position, comm); - pack(data.target_void_fraction, buffer, position, comm); - pack(data.reinj_group, buffer, position, comm); - pack(data.voidage_group, buffer, position, comm); - pack(data.injection_controls, buffer, position, comm); -} - void pack(const Group::GroupProductionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1199,26 +1159,6 @@ void unpack(UnitSystem& data, data = UnitSystem(name, type, dimensions, use_count); } -template void unpack(std::map& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - -void unpack(Group::GroupInjectionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.phase, buffer, position, comm); - unpack(data.cmode, buffer, position, comm); - unpack(data.surface_max_rate, buffer, position, comm); - unpack(data.resv_max_rate, buffer, position, comm); - unpack(data.target_reinj_fraction, buffer, position, comm); - unpack(data.target_void_fraction, buffer, position, comm); - unpack(data.reinj_group, buffer, position, comm); - unpack(data.voidage_group, buffer, position, comm); - unpack(data.injection_controls, buffer, position, comm); -} - - void unpack(Group::GroupProductionProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 6c8c81331..41b3ecf4b 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -354,7 +354,6 @@ ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(Group) -ADD_PACK_PROTOTYPES(Group::GroupInjectionProperties) ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index a2bf3e8a0..8225654e8 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1595,7 +1595,7 @@ BOOST_AUTO_TEST_CASE(GroupInjectionProperties) Opm::UDAValue(4.0), "test1", "test2", 5}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Group::GroupInjectionProperties) #endif } From 714caef9c678cde1e24ea012c5df04680027809a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 49/61] remove old serialization support for GroupProductionProperties --- opm/simulators/utils/ParallelRestart.cpp | 47 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 1 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 49 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 2f98ce020..2dc5c5e9b 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -371,21 +371,6 @@ std::size_t packSize(const UnitSystem& data, packSize(data.use_count(), comm); } -std::size_t packSize(const Group::GroupProductionProperties& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.cmode, comm) + - packSize(data.exceed_action, comm) + - packSize(data.oil_target, comm) + - packSize(data.water_target, comm) + - packSize(data.gas_target, comm) + - packSize(data.liquid_target, comm) + - packSize(data.guide_rate, comm) + - packSize(data.guide_rate_def, comm) + - packSize(data.resv_target, comm) + - packSize(data.production_controls, comm); -} - std::size_t packSize(const Group& data, Dune::MPIHelper::MPICommunicator comm) { @@ -731,22 +716,6 @@ void pack(const UnitSystem& data, pack(data.use_count(), buffer, position, comm); } -void pack(const Group::GroupProductionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.cmode, buffer, position, comm); - pack(data.exceed_action, buffer, position, comm); - pack(data.oil_target, buffer, position, comm); - pack(data.water_target, buffer, position, comm); - pack(data.gas_target, buffer, position, comm); - pack(data.liquid_target, buffer, position, comm); - pack(data.guide_rate, buffer, position, comm); - pack(data.guide_rate_def, buffer, position, comm); - pack(data.resv_target, buffer, position, comm); - pack(data.production_controls, buffer, position, comm); -} - void pack(const Group& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1159,22 +1128,6 @@ void unpack(UnitSystem& data, data = UnitSystem(name, type, dimensions, use_count); } -void unpack(Group::GroupProductionProperties& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - unpack(data.cmode, buffer, position, comm); - unpack(data.exceed_action, buffer, position, comm); - unpack(data.oil_target, buffer, position, comm); - unpack(data.water_target, buffer, position, comm); - unpack(data.gas_target, buffer, position, comm); - unpack(data.liquid_target, buffer, position, comm); - unpack(data.guide_rate, buffer, position, comm); - unpack(data.guide_rate_def, buffer, position, comm); - unpack(data.resv_target, buffer, position, comm); - unpack(data.production_controls, buffer, position, comm); -} - void unpack(Group& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 41b3ecf4b..9890867b5 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -354,7 +354,6 @@ ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(Group) -ADD_PACK_PROTOTYPES(Group::GroupProductionProperties) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 8225654e8..c61647475 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1613,7 +1613,7 @@ BOOST_AUTO_TEST_CASE(GroupProductionProperties) 5.0, Opm::Group::GuideRateTarget::COMB, 6.0, 7}; - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Group::GroupProductionProperties) #endif } From eef690f9107083ae761f9046778b62604ff48422 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 50/61] remove old serialization support for Group --- opm/simulators/utils/ParallelRestart.cpp | 83 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 86 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 2dc5c5e9b..17bc308d1 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -371,26 +371,6 @@ std::size_t packSize(const UnitSystem& data, packSize(data.use_count(), comm); } -std::size_t packSize(const Group& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.name(), comm) + - packSize(data.insert_index(), comm) + - packSize(data.initStep(), comm) + - packSize(data.udqUndefined(), comm) + - packSize(data.units(), comm) + - packSize(data.type(), comm) + - packSize(data.getGroupEfficiencyFactor(), comm) + - packSize(data.getTransferGroupEfficiencyFactor(), comm) + - packSize(data.isAvailableForGroupControl(), comm) + - packSize(data.getGroupNetVFPTable(), comm) + - packSize(data.parent(), comm) + - packSize(data.iwells(), comm) + - packSize(data.igroups(), comm) + - packSize(data.injectionProperties(), comm) + - packSize(data.productionProperties(), comm); -} - ////// pack routines template @@ -716,27 +696,6 @@ void pack(const UnitSystem& data, pack(data.use_count(), buffer, position, comm); } -void pack(const Group& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.name(), buffer, position, comm); - pack(data.insert_index(), buffer, position, comm); - pack(data.initStep(), buffer, position, comm); - pack(data.udqUndefined(), buffer, position, comm); - pack(data.units(), buffer, position, comm); - pack(data.type(), buffer, position, comm); - pack(data.getGroupEfficiencyFactor(), buffer, position, comm); - pack(data.getTransferGroupEfficiencyFactor(), buffer, position, comm); - pack(data.isAvailableForGroupControl(), buffer, position, comm); - pack(data.getGroupNetVFPTable(), buffer, position, comm); - pack(data.parent(), buffer, position, comm); - pack(data.iwells(), buffer, position, comm); - pack(data.igroups(), buffer, position, comm); - pack(data.injectionProperties(), buffer, position, comm); - pack(data.productionProperties(), buffer, position, comm); -} - /// unpack routines template @@ -1128,47 +1087,6 @@ void unpack(UnitSystem& data, data = UnitSystem(name, type, dimensions, use_count); } -void unpack(Group& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name; - std::size_t insert_index, initStep; - double udqUndefined; - UnitSystem units; - Group::GroupType type; - double groupEfficiencyFactor; - bool transferGroupEfficiencyFactor; - bool availableForGroupControl; - int groupNetVFPTable; - std::string parent; - IOrderSet wells, groups; - std::map injection; - Group::GroupProductionProperties production; - - unpack(name, buffer, position, comm); - unpack(insert_index, buffer, position, comm); - unpack(initStep, buffer, position, comm); - unpack(udqUndefined, buffer, position, comm); - unpack(units, buffer, position, comm); - unpack(type, buffer, position, comm); - unpack(groupEfficiencyFactor, buffer, position, comm); - unpack(transferGroupEfficiencyFactor, buffer, position, comm); - unpack(availableForGroupControl, buffer, position, comm); - unpack(groupNetVFPTable, buffer, position, comm); - unpack(parent, buffer, position, comm); - unpack(wells, buffer, position, comm); - unpack(groups, buffer, position, comm); - unpack(injection, buffer, position, comm); - unpack(production, buffer, position, comm); - data = Group(name, insert_index, initStep, udqUndefined, - units, type, groupEfficiencyFactor, - transferGroupEfficiencyFactor, - availableForGroupControl, - groupNetVFPTable, parent, wells, groups, - injection, production); -} - #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ @@ -1188,7 +1106,6 @@ INSTANTIATE_PACK_VECTOR(size_t) INSTANTIATE_PACK_VECTOR(std::time_t) INSTANTIATE_PACK_VECTOR(std::array) INSTANTIATE_PACK_VECTOR(std::pair) -INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::map) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 9890867b5..9e23cbcfa 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -353,7 +352,6 @@ ADD_PACK_PROTOTYPES(data::Solution) ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(Dimension) -ADD_PACK_PROTOTYPES(Group) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index c61647475..965e98902 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1633,7 +1633,7 @@ BOOST_AUTO_TEST_CASE(Group) injection, Opm::Group::GroupProductionProperties()); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Group) #endif } From 37ab44d805ec4296462f6e4a0fe7006116f8b70a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 51/61] remove old serialization support for UDAValue --- opm/simulators/utils/ParallelRestart.cpp | 40 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 4 +-- 3 files changed, 2 insertions(+), 44 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 17bc308d1..1105434b2 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -324,15 +324,6 @@ std::size_t packSize(const VFPProdTable& data, packSize(data.getTable(), comm); } -std::size_t packSize(const UDAValue& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.get_dim(), comm) + - packSize(data.is(), comm) + - (data.is() ? packSize(data.get(), comm) : - packSize(data.get(), comm)); -} - template std::size_t packSize(const std::shared_ptr& data, Dune::MPIHelper::MPICommunicator comm) @@ -648,18 +639,6 @@ void pack(const VFPProdTable& data, pack(data.getTable(), buffer, position, comm); } -void pack(const UDAValue& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.get_dim(), buffer, position, comm); - pack(data.is(), buffer, position, comm); - if (data.is()) - pack(data.get(), buffer, position, comm); - else - pack(data.get(), buffer, position, comm); -} - template void pack(const std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1017,25 +996,6 @@ void unpack(VFPProdTable& data, wfrAxis, gfrAxis, alqAxis, table); } -void unpack(UDAValue& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - bool isDouble; - Dimension dim; - unpack(dim, buffer, position, comm); - unpack(isDouble, buffer, position, comm); - if (isDouble) { - double val; - unpack(val, buffer, position, comm); - data = UDAValue(val, dim); - } else { - std::string val; - unpack(val, buffer, position, comm); - data = UDAValue(val, dim); - } -} - template void unpack(std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 9e23cbcfa..a8a783851 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -41,7 +41,6 @@ namespace Opm { class Dimension; -class UDAValue; class UnitSystem; class VFPInjTable; class VFPProdTable; @@ -355,7 +354,6 @@ ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) -ADD_PACK_PROTOTYPES(UDAValue) ADD_PACK_PROTOTYPES(UnitSystem) ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 965e98902..a71e5a023 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1393,10 +1393,10 @@ BOOST_AUTO_TEST_CASE(UDAValue) { #ifdef HAVE_MPI Opm::UDAValue val1("test"); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(UDAValue) val1 = Opm::UDAValue(1.0); - val2 = PackUnpack(val1); + val2 = PackUnpack2(val1); DO_CHECKS(UDAValue) #endif } From 02af9159178eb1f7508cc7b75755260ee3ff30ed Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 52/61] remove old serialization support for Dimension --- opm/simulators/utils/ParallelRestart.hpp | 2 -- tests/test_ParallelRestart.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index a8a783851..ccd9b1097 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -40,7 +40,6 @@ namespace Opm { -class Dimension; class UnitSystem; class VFPInjTable; class VFPProdTable; @@ -350,7 +349,6 @@ ADD_PACK_PROTOTYPES(data::Segment) ADD_PACK_PROTOTYPES(data::Solution) ADD_PACK_PROTOTYPES(data::Well) ADD_PACK_PROTOTYPES(data::WellRates) -ADD_PACK_PROTOTYPES(Dimension) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index a71e5a023..a23c7369b 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1542,7 +1542,7 @@ BOOST_AUTO_TEST_CASE(Dimension) { #ifdef HAVE_MPI Opm::Dimension val1(1.0, 2.0); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(Dimension) #endif } From d905e0f037187521e44dd8e8f361c11de6732e64 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH 53/61] remove old serialization support for UnitSystem --- opm/simulators/utils/ParallelRestart.cpp | 61 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 64 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 1105434b2..d89d24e02 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -346,22 +346,6 @@ std::size_t packSize(const std::unique_ptr& data, return size; } -std::size_t packSize(const Dimension& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getSIScalingRaw(), comm) + - packSize(data.getSIOffset(), comm); -} - -std::size_t packSize(const UnitSystem& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getName(), comm) + - packSize(data.getType(), comm) + - packSize(data.getDimensions(), comm) + - packSize(data.use_count(), comm); -} - ////// pack routines template @@ -657,24 +641,6 @@ void pack(const std::unique_ptr& data, std::vector& buffer, int& positi pack(*data, buffer, position, comm); } -void pack(const Dimension& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getSIScalingRaw(), buffer, position, comm); - pack(data.getSIOffset(), buffer, position, comm); -} - -void pack(const UnitSystem& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getName(), buffer, position, comm); - pack(data.getType(), buffer, position, comm); - pack(data.getDimensions(), buffer, position, comm); - pack(data.use_count(), buffer, position, comm); -} - /// unpack routines template @@ -1020,33 +986,6 @@ void unpack(std::unique_ptr& data, std::vector& buffer, int& position, } } -void unpack(Dimension& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - double siScaling, siOffset; - - unpack(siScaling, buffer, position, comm); - unpack(siOffset, buffer, position, comm); - data = Dimension(siScaling, siOffset); -} - -void unpack(UnitSystem& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::string name; - UnitSystem::UnitType type; - std::map dimensions; - size_t use_count; - unpack(name, buffer, position, comm); - unpack(type, buffer, position, comm); - unpack(dimensions, buffer, position, comm); - unpack(use_count, buffer, position, comm); - - data = UnitSystem(name, type, dimensions, use_count); -} - #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index ccd9b1097..b2d1017fe 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -40,7 +40,6 @@ namespace Opm { -class UnitSystem; class VFPInjTable; class VFPProdTable; @@ -352,7 +351,6 @@ ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) -ADD_PACK_PROTOTYPES(UnitSystem) ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index a23c7369b..75ee362e5 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1552,7 +1552,7 @@ BOOST_AUTO_TEST_CASE(UnitSystem) { #ifdef HAVE_MPI Opm::UnitSystem val1(Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(UnitSystem) #endif } From 58b0ed66fc6da7b242d407f87800754a6b2f8d4a Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 14:54:04 +0100 Subject: [PATCH 54/61] remove old serialization support for VFPInjTable --- opm/simulators/utils/ParallelRestart.cpp | 63 +----------------------- opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 3 insertions(+), 64 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index d89d24e02..3294400ac 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -25,9 +25,7 @@ #include #include #include -#include -#include -#include +#include #include #include @@ -296,17 +294,6 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator return packSize(data.solution, comm) + packSize(data.wells, comm) + packSize(data.extra, comm); } -std::size_t packSize(const VFPInjTable& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getTableNum(), comm) + - packSize(data.getDatumDepth(), comm) + - packSize(data.getFloType(), comm) + - packSize(data.getFloAxis(), comm) + - packSize(data.getTHPAxis(), comm) + - packSize(data.getTable(), comm); -} - std::size_t packSize(const VFPProdTable& data, Dune::MPIHelper::MPICommunicator comm) { @@ -593,18 +580,6 @@ void pack(const RestartValue& data, std::vector& buffer, int& position, pack(data.extra, buffer, position, comm); } -void pack(const VFPInjTable& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getTableNum(), buffer, position, comm); - pack(data.getDatumDepth(), buffer, position, comm); - pack(data.getFloType(), buffer, position, comm); - pack(data.getFloAxis(), buffer, position, comm); - pack(data.getTHPAxis(), buffer, position, comm); - pack(data.getTable(), buffer, position, comm); -} - void pack(const VFPProdTable& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -910,27 +885,6 @@ void unpack(RestartValue& data, std::vector& buffer, int& position, unpack(data.extra, buffer, position, comm); } -void unpack(VFPInjTable& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - int tableNum; - double datumDepth; - VFPInjTable::FLO_TYPE floType; - std::vector floAxis, thpAxis; - VFPInjTable::array_type table; - - unpack(tableNum, buffer, position, comm); - unpack(datumDepth, buffer, position, comm); - unpack(floType, buffer, position, comm); - unpack(floAxis, buffer, position, comm); - unpack(thpAxis, buffer, position, comm); - unpack(table, buffer, position, comm); - - data = VFPInjTable(tableNum, datumDepth, floType, - floAxis, thpAxis, table); -} - void unpack(VFPProdTable& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -1005,7 +959,6 @@ INSTANTIATE_PACK_VECTOR(size_t) INSTANTIATE_PACK_VECTOR(std::time_t) INSTANTIATE_PACK_VECTOR(std::array) INSTANTIATE_PACK_VECTOR(std::pair) -INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::map) INSTANTIATE_PACK_VECTOR(std::pair>) @@ -1031,19 +984,6 @@ INSTANTIATE_PACK_SET(std::string) #undef INSTANTIATE_PACK_SET -#define INSTANTIATE_PACK_SHARED_PTR(...) \ -template std::size_t packSize(const std::shared_ptr<__VA_ARGS__>& data, \ - Dune::MPIHelper::MPICommunicator comm); \ -template void pack(const std::shared_ptr<__VA_ARGS__>& data, \ - std::vector& buffer, int& position, \ - Dune::MPIHelper::MPICommunicator comm); \ -template void unpack(std::shared_ptr<__VA_ARGS__>& data, \ - std::vector& buffer, int& position, \ - Dune::MPIHelper::MPICommunicator comm); - -INSTANTIATE_PACK_SHARED_PTR(VFPInjTable) -#undef INSTANTIATE_PACK_SHARED_PTR - #define INSTANTIATE_PACK(...) \ template std::size_t packSize(const __VA_ARGS__& data, \ Dune::MPIHelper::MPICommunicator comm); \ @@ -1076,6 +1016,7 @@ INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_set) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) +INSTANTIATE_PACK(std::pair) #undef INSTANTIATE_PACK diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index b2d1017fe..81b06e253 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -40,7 +40,6 @@ namespace Opm { -class VFPInjTable; class VFPProdTable; namespace Mpi @@ -351,7 +350,6 @@ ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) -ADD_PACK_PROTOTYPES(VFPInjTable) ADD_PACK_PROTOTYPES(VFPProdTable) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 75ee362e5..defab6821 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1320,7 +1320,7 @@ BOOST_AUTO_TEST_CASE(VFPInjTable) { #ifdef HAVE_MPI Opm::VFPInjTable val1 = getVFPInjTable(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(VFPInjTable) #endif } From 777e2f768355ad8c1d87d264850431efb62fb465 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 14:54:04 +0100 Subject: [PATCH 55/61] remove old serialization support for VFPProdTable --- opm/simulators/utils/ParallelRestart.cpp | 68 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 3 -- tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 1 insertion(+), 72 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 3294400ac..834a8c5f2 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #define HANDLE_AS_POD(T) \ @@ -294,23 +293,6 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator return packSize(data.solution, comm) + packSize(data.wells, comm) + packSize(data.extra, comm); } -std::size_t packSize(const VFPProdTable& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getTableNum(), comm) + - packSize(data.getDatumDepth(), comm) + - packSize(data.getFloType(), comm) + - packSize(data.getWFRType(), comm) + - packSize(data.getGFRType(), comm) + - packSize(data.getALQType(), comm) + - packSize(data.getFloAxis(), comm) + - packSize(data.getTHPAxis(), comm) + - packSize(data.getWFRAxis(), comm) + - packSize(data.getGFRAxis(), comm) + - packSize(data.getALQAxis(), comm) + - packSize(data.getTable(), comm); -} - template std::size_t packSize(const std::shared_ptr& data, Dune::MPIHelper::MPICommunicator comm) @@ -580,24 +562,6 @@ void pack(const RestartValue& data, std::vector& buffer, int& position, pack(data.extra, buffer, position, comm); } -void pack(const VFPProdTable& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getTableNum(), buffer, position, comm); - pack(data.getDatumDepth(), buffer, position, comm); - pack(data.getFloType(), buffer, position, comm); - pack(data.getWFRType(), buffer, position, comm); - pack(data.getGFRType(), buffer, position, comm); - pack(data.getALQType(), buffer, position, comm); - pack(data.getFloAxis(), buffer, position, comm); - pack(data.getTHPAxis(), buffer, position, comm); - pack(data.getWFRAxis(), buffer, position, comm); - pack(data.getGFRAxis(), buffer, position, comm); - pack(data.getALQAxis(), buffer, position, comm); - pack(data.getTable(), buffer, position, comm); -} - template void pack(const std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -885,37 +849,6 @@ void unpack(RestartValue& data, std::vector& buffer, int& position, unpack(data.extra, buffer, position, comm); } -void unpack(VFPProdTable& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - int tableNum; - double datumDepth; - VFPProdTable::FLO_TYPE floType; - VFPProdTable::WFR_TYPE wfrType; - VFPProdTable::GFR_TYPE gfrType; - VFPProdTable::ALQ_TYPE alqType; - std::vector floAxis, thpAxis, wfrAxis, gfrAxis, alqAxis; - VFPProdTable::array_type table; - - unpack(tableNum, buffer, position, comm); - unpack(datumDepth, buffer, position, comm); - unpack(floType, buffer, position, comm); - unpack(wfrType, buffer, position, comm); - unpack(gfrType, buffer, position, comm); - unpack(alqType, buffer, position, comm); - unpack(floAxis, buffer, position, comm); - unpack(thpAxis, buffer, position, comm); - unpack(wfrAxis, buffer, position, comm); - unpack(gfrAxis, buffer, position, comm); - unpack(alqAxis, buffer, position, comm); - unpack(table, buffer, position, comm); - - data = VFPProdTable(tableNum, datumDepth, floType, wfrType, - gfrType, alqType, floAxis, thpAxis, - wfrAxis, gfrAxis, alqAxis, table); -} - template void unpack(std::shared_ptr& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -959,7 +892,6 @@ INSTANTIATE_PACK_VECTOR(size_t) INSTANTIATE_PACK_VECTOR(std::time_t) INSTANTIATE_PACK_VECTOR(std::array) INSTANTIATE_PACK_VECTOR(std::pair) -INSTANTIATE_PACK_VECTOR(std::shared_ptr) INSTANTIATE_PACK_VECTOR(std::map) INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 81b06e253..a24c70811 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -40,8 +40,6 @@ namespace Opm { -class VFPProdTable; - namespace Mpi { template @@ -350,7 +348,6 @@ ADD_PACK_PROTOTYPES(data::WellRates) ADD_PACK_PROTOTYPES(RestartKey) ADD_PACK_PROTOTYPES(RestartValue) ADD_PACK_PROTOTYPES(std::string) -ADD_PACK_PROTOTYPES(VFPProdTable) } // end namespace Mpi diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index defab6821..4b4b7003e 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1330,7 +1330,7 @@ BOOST_AUTO_TEST_CASE(VFPProdTable) { #ifdef HAVE_MPI Opm::VFPProdTable val1 = getVFPProdTable(); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(VFPProdTable) #endif } From e71670e2317065e9c990ae547282e8bec16dd894 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 14:54:04 +0100 Subject: [PATCH 56/61] remove old serialization support for OrderedMap --- opm/simulators/utils/ParallelRestart.cpp | 25 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 12 ------------ 2 files changed, 37 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 834a8c5f2..b72a90db5 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -185,12 +185,6 @@ std::size_t packSize(const std::set& data, return totalSize; } -template -std::size_t packSize(const OrderedMap& data, Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.getIndex(), comm) + packSize(data.getStorage(), comm); -} - template std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm) { @@ -443,14 +437,6 @@ void pack(const std::tuple& data, std::vector& buffer, pack_tuple_entry(data, buffer, position, comm); } -template -void pack(const OrderedMap& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.getIndex(), buffer, position, comm); - pack(data.getStorage(), buffer, position, comm); -} - template void pack(const DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -717,17 +703,6 @@ void unpack(std::array& data, std::vector& buffer, int& position, unpack(entry, buffer, position, comm); } -template -void unpack(OrderedMap& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - typename OrderedMap::index_type index; - typename OrderedMap::storage_type storage; - unpack(index, buffer, position, comm); - unpack(storage, buffer, position, comm); - data = OrderedMap(index, storage); -} - template void unpack(DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index a24c70811..f214645ab 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -27,7 +27,6 @@ #include #include #include -#include #include @@ -121,9 +120,6 @@ std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommun template std::size_t packSize(const std::unordered_map& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const OrderedMap& data, Dune::MPIHelper::MPICommunicator comm); - template std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm); @@ -216,10 +212,6 @@ template void pack(const std::unordered_map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const OrderedMap& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - template void pack(const DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -317,10 +309,6 @@ template void unpack(std::unordered_map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(OrderedMap& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - template void unpack(DynamicState& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); From aa7eba1f982f8f5acb99c107c84e473136b38e84 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 14:54:04 +0100 Subject: [PATCH 57/61] remove old serialization support for DynamicState --- opm/simulators/utils/ParallelRestart.cpp | 64 ------------------------ opm/simulators/utils/ParallelRestart.hpp | 12 ----- 2 files changed, 76 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index b72a90db5..52ef1eb13 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -44,42 +44,6 @@ unpack(data, buffer, position, comm, std::integral_constant()); \ } -namespace -{ -template -std::pair, std::vector> -splitDynState(const Opm::DynamicState& state) -{ - std::vector unique; - for (const auto& w : state.data()) { - if (std::find(unique.begin(), unique.end(), w) == unique.end()) - unique.push_back(w); - } - std::vector idxVec; - idxVec.reserve(state.data().size()+1); - for (const auto& w : state.data()) { - auto uIt = std::find(unique.begin(), unique.end(), w); - idxVec.push_back(uIt-unique.begin()); - } - idxVec.push_back(state.initialRange()); - - return std::make_pair(unique, idxVec); -} - -template -void reconstructDynState(const std::vector& unique, - const std::vector& idxVec, - Opm::DynamicState& result) -{ - std::vector ptrData; - for (size_t i = 0; i < idxVec.size()-1; ++i) { - ptrData.push_back(unique[idxVec[i]]); - } - result = Opm::DynamicState(ptrData, idxVec.back()); -} - -} - namespace Opm { namespace Mpi @@ -185,14 +149,6 @@ std::size_t packSize(const std::set& data, return totalSize; } -template -std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm) -{ - - auto split = splitDynState(data); - return packSize(split.first, comm) + packSize(split.second, comm); -} - std::size_t packSize(const char* str, Dune::MPIHelper::MPICommunicator comm) { #if HAVE_MPI @@ -437,15 +393,6 @@ void pack(const std::tuple& data, std::vector& buffer, pack_tuple_entry(data, buffer, position, comm); } -template -void pack(const DynamicState& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - auto split = splitDynState(data); - pack(split.first, buffer, position, comm); - pack(split.second, buffer, position, comm); -} - void pack(const char* str, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { @@ -703,17 +650,6 @@ void unpack(std::array& data, std::vector& buffer, int& position, unpack(entry, buffer, position, comm); } -template -void unpack(DynamicState& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - std::vector unique; - std::vector indices; - Opm::Mpi::unpack(unique, buffer, position, comm); - Opm::Mpi::unpack(indices, buffer, position, comm); - reconstructDynState(unique, indices, data); -} - void unpack(char* str, std::size_t length, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) { diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index f214645ab..92fbce806 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -26,7 +26,6 @@ #include #include #include -#include #include @@ -120,9 +119,6 @@ std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommun template std::size_t packSize(const std::unordered_map& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm); - ////// pack routines template @@ -212,10 +208,6 @@ template void pack(const std::unordered_map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const DynamicState& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - void pack(const char* str, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -309,10 +301,6 @@ template void unpack(std::unordered_map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(DynamicState& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - void unpack(char* str, std::size_t length, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); From 9b545e58a4e5c079217f195273a8ceb7e912e4de Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 15:02:46 +0100 Subject: [PATCH 58/61] remove old serialization support for pointers --- opm/simulators/utils/ParallelRestart.cpp | 77 +----------------------- opm/simulators/utils/ParallelRestart.hpp | 24 -------- 2 files changed, 1 insertion(+), 100 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 52ef1eb13..28d19343d 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -243,28 +243,6 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator return packSize(data.solution, comm) + packSize(data.wells, comm) + packSize(data.extra, comm); } -template -std::size_t packSize(const std::shared_ptr& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(bool(), comm); - if (data) - size += packSize(*data, comm); - - return size; -} - -template -std::size_t packSize(const std::unique_ptr& data, - Dune::MPIHelper::MPICommunicator comm) -{ - std::size_t size = packSize(bool(), comm); - if (data) - size += packSize(*data, comm); - - return size; -} - ////// pack routines template @@ -495,24 +473,6 @@ void pack(const RestartValue& data, std::vector& buffer, int& position, pack(data.extra, buffer, position, comm); } -template -void pack(const std::shared_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data != nullptr, buffer, position, comm); - if (data) - pack(*data, buffer, position, comm); -} - -template -void pack(const std::unique_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data != nullptr, buffer, position, comm); - if (data) - pack(*data, buffer, position, comm); -} - /// unpack routines template @@ -760,30 +720,6 @@ void unpack(RestartValue& data, std::vector& buffer, int& position, unpack(data.extra, buffer, position, comm); } -template -void unpack(std::shared_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - bool hasVal; - unpack(hasVal, buffer, position, comm); - if (hasVal) { - data = std::make_shared(); - unpack(*data, buffer, position, comm); - } -} - -template -void unpack(std::unique_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - bool hasVal; - unpack(hasVal, buffer, position, comm); - if (hasVal) { - data.reset(new T); - unpack(*data, buffer, position, comm); - } -} - #define INSTANTIATE_PACK_VECTOR(...) \ template std::size_t packSize(const std::vector<__VA_ARGS__>& data, \ Dune::MPIHelper::MPICommunicator comm); \ @@ -813,18 +749,6 @@ INSTANTIATE_PACK_VECTOR(std::string) #undef INSTANTIATE_PACK_VECTOR -#define INSTANTIATE_PACK_SET(...) \ -template std::size_t packSize(const std::set<__VA_ARGS__>& data, \ - Dune::MPIHelper::MPICommunicator comm); \ -template void pack(const std::set<__VA_ARGS__>& data, \ - std::vector& buffer, int& position, \ - Dune::MPIHelper::MPICommunicator comm); \ -template void unpack(std::set<__VA_ARGS__>& data, \ - std::vector& buffer, int& position, \ - Dune::MPIHelper::MPICommunicator comm); - -INSTANTIATE_PACK_SET(std::string) - #undef INSTANTIATE_PACK_SET #define INSTANTIATE_PACK(...) \ @@ -857,6 +781,7 @@ INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_set) +INSTANTIATE_PACK(std::set) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(std::pair) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 92fbce806..647b38fef 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -98,17 +98,9 @@ std::size_t packSize(const std::vector& data, Dune::MPIHelper::MPICommun template std::size_t packSize(const std::tuple& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const std::shared_ptr& data, - Dune::MPIHelper::MPICommunicator comm); - template std::size_t packSize(const std::array& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const std::unique_ptr& data, - Dune::MPIHelper::MPICommunicator comm); - std::size_t packSize(const char* str, Dune::MPIHelper::MPICommunicator comm); std::size_t packSize(const std::string& str, Dune::MPIHelper::MPICommunicator comm); @@ -188,18 +180,10 @@ void pack(const std::unordered_set& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const std::shared_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - template void pack(const std::array& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const std::unique_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - template void pack(const std::map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); @@ -281,18 +265,10 @@ void unpack(std::unordered_set& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(std::shared_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - template void unpack(std::array& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(std::unique_ptr& data, std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm); - template void unpack(std::map& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); From 59d1ff9b88f84393ac90b860ce2693f2ddfa05d5 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 15:43:27 +0100 Subject: [PATCH 59/61] updates in EclMpiSerializer to avoid explicit instances in serializer now the serializer is 'standard', as in we only require basic types + stl containers. this should make the actual implementation pretty pluggable. will ease replacing our serialization routines with those in Dune 2.7 later. --- ebos/eclmpiserializer.hh | 22 ++++++++++++++++++---- opm/simulators/utils/ParallelRestart.cpp | 12 ------------ tests/test_ParallelRestart.cpp | 11 +++++++---- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index 04bd3e403..0027089fc 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -42,6 +42,8 @@ public: { if constexpr (is_ptr::value) { ptr(data); + } else if constexpr (is_pair::value) { + pair(data); } else { if (m_op == Operation::PACKSIZE) m_packSize += Mpi::packSize(data, m_comm); @@ -92,13 +94,15 @@ public: auto handle = [&](auto& d) { if constexpr (is_vector::value) - vector(d); + this->template vector(d); else if constexpr (is_ptr::value) ptr(d); - else if constexpr (!complexType) - d.template serializeOp(*this); - else + else if constexpr (is_dynamic_state::value) + d.template serializeOp(*this); + else if constexpr (complexType) d.serializeOp(*this); + else + (*this)(d); }; if (m_op == Operation::PACKSIZE) { @@ -212,6 +216,16 @@ protected: constexpr static bool value = true; }; + template + struct is_dynamic_state { + constexpr static bool value = false; + }; + + template + struct is_dynamic_state> { + constexpr static bool value = true; + }; + template void pair(const std::pair& data) { diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 28d19343d..49de0b66f 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -22,10 +22,6 @@ #endif #include "ParallelRestart.hpp" -#include -#include -#include -#include #include #define HANDLE_AS_POD(T) \ @@ -743,8 +739,6 @@ INSTANTIATE_PACK_VECTOR(std::map) INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) INSTANTIATE_PACK_VECTOR(std::pair>) -INSTANTIATE_PACK_VECTOR(std::pair) -INSTANTIATE_PACK_VECTOR(std::pair) INSTANTIATE_PACK_VECTOR(std::string) #undef INSTANTIATE_PACK_VECTOR @@ -770,21 +764,15 @@ INSTANTIATE_PACK(std::array) INSTANTIATE_PACK(std::array) INSTANTIATE_PACK(unsigned char) INSTANTIATE_PACK(std::map,std::pair>) -INSTANTIATE_PACK(std::map) -INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map,int>>) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map) -INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::unordered_set) INSTANTIATE_PACK(std::set) -INSTANTIATE_PACK(std::pair) -INSTANTIATE_PACK(std::pair) -INSTANTIATE_PACK(std::pair) #undef INSTANTIATE_PACK diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 4b4b7003e..b7a37a9a4 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -483,7 +483,8 @@ Opm::Action::ActionX getActionX() } -Opm::AquiferCT getAquiferCT() { +Opm::AquiferCT getAquiferCT() +{ Opm::AquiferCT::AQUCT_data data; data.aquiferID = 1; data.inftableID = 2; @@ -504,7 +505,9 @@ Opm::AquiferCT getAquiferCT() { return Opm::AquiferCT( { data } ); } -Opm::Aquifetp getAquifetp() { + +Opm::Aquifetp getAquifetp() +{ Opm::Aquifetp::AQUFETP_data data; data.aquiferID = 1; @@ -518,8 +521,8 @@ Opm::Aquifetp getAquifetp() { } - -Opm::Aquancon getAquancon() { +Opm::Aquancon getAquancon() +{ Opm::Aquancon::AquancCell cell(1, 100, std::make_pair(false, 0), 100, Opm::FaceDir::XPlus); return Opm::Aquancon( std::unordered_map>{{1, {cell}}}); } From 4c5f9f22415b19ee2fdc417fea13293376d8bd08 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 19 Mar 2020 09:09:58 +0100 Subject: [PATCH 60/61] add doxy to eclmpiserializer --- ebos/eclmpiserializer.hh | 64 ++++++++++++++++++++++++++++++++-------- 1 file changed, 51 insertions(+), 13 deletions(-) diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index 0027089fc..73a49b04a 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -25,18 +25,22 @@ namespace Opm { +/*! \brief Class for (de-)serializing and broadcasting data in parallel. + *! \details Can be called on any class with a serializeOp member. Such classes + *! are referred to as 'complex types' in the documentation. +*/ + class EclMpiSerializer { public: - enum class Operation { - PACKSIZE, - PACK, - UNPACK - }; - + //! \brief Constructor. + //! \param comm The global communicator to broadcast using explicit EclMpiSerializer(Dune::CollectiveCommunication comm) : m_comm(comm) {} + //! \brief (De-)serialization for simple types. + //! \details The data handled by this depends on the underlying serialization used. + //! Currently you can call this for scalars, and stl containers with scalars. template void operator()(const T& data) { @@ -54,6 +58,10 @@ public: } } + //! \brief Handler for vectors. + //! \tparam T Type for vector elements + //! \tparam complexType Whether or not T is a complex type + //! \param data The vector to (de-)serialize template void vector(std::vector& data) { @@ -85,6 +93,10 @@ public: } } + //! \brief Handler for maps. + //! \tparam Map map type + //! \tparam complexType Whether or not Data in map is a complex type + //! \param map The map to (de-)serialize template void map(Map& data) { @@ -130,6 +142,9 @@ public: } } + //! \brief Call this to serialize data. + //! \tparam T Type of class to serialize + //! \param data Class to serialize template void pack(T& data) { @@ -142,6 +157,9 @@ public: data.serializeOp(*this); } + //! \brief Call this to de-serialize data. + //! \tparam T Type of class to de-serialize + //! \param data Class to de-serialize template void unpack(T& data) { @@ -150,13 +168,15 @@ public: data.serializeOp(*this); } + //! \brief Serialize and broadcast on root process, de-serialize on others. + //! \tparam T Type of class to broadcast + //! \param data Class to broadcast template void broadcast(T& data) { if (m_comm.size() == 1) return; -#if HAVE_MPI if (m_comm.rank() == 0) { pack(data); m_comm.broadcast(&m_position, 1, 0); @@ -167,20 +187,29 @@ public: m_comm.broadcast(m_buffer.data(), m_packSize, 0); unpack(data); } -#endif } + //! \brief Returns current position in buffer. size_t position() const { return m_position; } + //! \brief Returns true if we are currently doing a serialization operation. bool isSerializing() const { return m_op != Operation::UNPACK; } protected: + //! \brief Enumeration of operations. + enum class Operation { + PACKSIZE, //!< Calculating serialization buffer size + PACK, //!< Performing serialization + UNPACK //!< Performing de-serialization + }; + + //! \brief Predicate for detecting pairs. template struct is_pair { constexpr static bool value = false; @@ -191,6 +220,7 @@ protected: constexpr static bool value = true; }; + //! \brief Predicate for detecting vectors. template struct is_vector { constexpr static bool value = false; @@ -201,6 +231,7 @@ protected: constexpr static bool value = true; }; + //! \brief Predicate for smart pointers. template struct is_ptr { constexpr static bool value = false; @@ -216,6 +247,7 @@ protected: constexpr static bool value = true; }; + //! \brief Predicate for DynamicState. template struct is_dynamic_state { constexpr static bool value = false; @@ -226,6 +258,9 @@ protected: constexpr static bool value = true; }; + //! \brief Handler for pairs. + //! \details If data is POD or a string, we pass it to the underlying serializer, + //! if not we assume a complex type. template void pair(const std::pair& data) { @@ -240,6 +275,9 @@ protected: const_cast(data.second).serializeOp(*this); } + //! \brief Handler for smart pointers. + //! \details If data is POD or a string, we pass it to the underlying serializer, + //! if not we assume a complex type. template class PtrType, class T1> void ptr(const PtrType& data) { @@ -252,12 +290,12 @@ protected: data->serializeOp(*this); } - Dune::CollectiveCommunication m_comm; + Dune::CollectiveCommunication m_comm; //!< Communicator to broadcast using - Operation m_op = Operation::PACKSIZE; - size_t m_packSize = 0; - int m_position = 0; - std::vector m_buffer; + Operation m_op = Operation::PACKSIZE; //!< Current operation + size_t m_packSize = 0; //!< Required buffer size after PACKSIZE has been done + int m_position = 0; //!< Current position in buffer + std::vector m_buffer; //!< Buffer for serialized data }; } From a2d840a5f744b6c32a7196d7080f9afaa05bec03 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 19 Mar 2020 09:10:19 +0100 Subject: [PATCH 61/61] changed: put eclipse state broadcast in separate compilation unit to avoid compiling several times for each flow variant --- CMakeLists_files.cmake | 3 +- flow/flow.cpp | 13 +---- flow/flow_tag.hpp | 13 +---- opm/simulators/utils/ParallelEclipseState.hpp | 2 - .../utils/ParallelSerialization.cpp | 49 +++++++++++++++++++ .../utils/ParallelSerialization.hpp | 38 ++++++++++++++ 6 files changed, 93 insertions(+), 25 deletions(-) create mode 100644 opm/simulators/utils/ParallelSerialization.cpp create mode 100644 opm/simulators/utils/ParallelSerialization.hpp diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 50e4dcea5..410fb1212 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -46,7 +46,8 @@ if(CUDA_FOUND) list (APPEND MAIN_SOURCE_FILES opm/simulators/linalg/bda/cusparseSolverBackend.cu) endif() if(MPI_FOUND) - list(APPEND MAIN_SOURCE_FILES opm/simulators/utils/ParallelEclipseState.cpp) + list(APPEND MAIN_SOURCE_FILES opm/simulators/utils/ParallelEclipseState.cpp + opm/simulators/utils/ParallelSerialization.cpp) endif() # originally generated with the command: diff --git a/flow/flow.cpp b/flow/flow.cpp index 088cc7f90..4a41bb3f5 100644 --- a/flow/flow.cpp +++ b/flow/flow.cpp @@ -56,13 +56,7 @@ #include #include #include -#include #include -#include -#include -#include -#include -#include #include #include @@ -76,8 +70,8 @@ #endif #if HAVE_MPI -#include #include +#include #endif BEGIN_PROPERTIES @@ -395,10 +389,7 @@ int main(int argc, char** argv) schedule.reset(new Opm::Schedule); eclipseState.reset(new Opm::ParallelEclipseState); } - Opm::EclMpiSerializer ser(mpiHelper.getCollectiveCommunication()); - ser.broadcast(*summaryConfig); - ser.broadcast(*eclipseState); - ser.broadcast(*schedule); + Opm::eclStateBroadcast(*eclipseState, *schedule, *summaryConfig); #endif Opm::checkConsistentArrayDimensions(*eclipseState, *schedule, parseContext, errorGuard); diff --git a/flow/flow_tag.hpp b/flow/flow_tag.hpp index bc1a565bb..570519b10 100644 --- a/flow/flow_tag.hpp +++ b/flow/flow_tag.hpp @@ -38,13 +38,7 @@ #include #include #include -#include -#include #include -#include -#include -#include -#include //#include //#include @@ -59,8 +53,8 @@ #endif #if HAVE_MPI -#include #include +#include #endif @@ -406,10 +400,7 @@ int mainFlow(int argc, char** argv) schedule.reset(new Opm::Schedule); eclipseState.reset(new Opm::ParallelEclipseState); } - Opm::EclMpiSerializer ser(mpiHelper.getCollectiveCommunication()); - ser.broadcast(*summaryConfig); - ser.broadcast(*eclipseState); - ser.broadcast(*schedule); + Opm::eclStateBroadcast(*eclipseState, *schedule, *summaryConfig); #endif Opm::checkConsistentArrayDimensions(*eclipseState, *schedule, parseContext, errorGuard); diff --git a/opm/simulators/utils/ParallelEclipseState.hpp b/opm/simulators/utils/ParallelEclipseState.hpp index 8518740be..60a189ce1 100644 --- a/opm/simulators/utils/ParallelEclipseState.hpp +++ b/opm/simulators/utils/ParallelEclipseState.hpp @@ -27,8 +27,6 @@ namespace Opm { -class EclMpiSerializer; - /*! \brief Parallel frontend to the field properties. * * \details This is a parallel frontend to the mpi-unaware diff --git a/opm/simulators/utils/ParallelSerialization.cpp b/opm/simulators/utils/ParallelSerialization.cpp new file mode 100644 index 000000000..bd2144669 --- /dev/null +++ b/opm/simulators/utils/ParallelSerialization.cpp @@ -0,0 +1,49 @@ +/* + Copyright 2020 Equinor AS. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +namespace Opm { + +void eclStateBroadcast(EclipseState& eclState, Schedule& schedule, + SummaryConfig& summaryConfig) +{ + Opm::EclMpiSerializer ser(Dune::MPIHelper::getCollectiveCommunication()); + ser.broadcast(eclState); + ser.broadcast(schedule); + ser.broadcast(summaryConfig); +} + +} diff --git a/opm/simulators/utils/ParallelSerialization.hpp b/opm/simulators/utils/ParallelSerialization.hpp new file mode 100644 index 000000000..fc78222b9 --- /dev/null +++ b/opm/simulators/utils/ParallelSerialization.hpp @@ -0,0 +1,38 @@ +/* + Copyright 2020 Equinor AS. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ +#ifndef PARALLEL_SERIALIZATION_HPP +#define PARALLEL_SERIALIZATION_HPP + +namespace Opm { + +class EclipseState; +class Schedule; +class SummaryConfig; + +/*! \brief Broadcasts an eclipse state from root node in parallel runs. + *! \param eclState EclipseState to broadcast + *! \param schedule Schedule to broadcast + *! \param summaryConfig SummaryConfig to broadcast +*/ +void eclStateBroadcast(EclipseState& eclState, Schedule& schedule, + SummaryConfig& summaryConfig); + +} // end namespace Opm + +#endif // PARALLEL_SERIALIZATION_HPP