From c07fa535bddcb0456e2a2c4f195fe7c88f506e1d Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 16 Mar 2020 15:31:06 +0100 Subject: [PATCH] remove old serialization support for UDQASTNode --- opm/simulators/utils/ParallelRestart.cpp | 54 +----------------------- opm/simulators/utils/ParallelRestart.hpp | 2 - tests/test_ParallelRestart.cpp | 2 +- 3 files changed, 3 insertions(+), 55 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 6307dd272..2022b30ac 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -1103,20 +1102,6 @@ std::size_t packSize(const WListManager& data, return packSize(data.lists(), comm); } - - -std::size_t packSize(const UDQASTNode& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.var_type, comm) + - packSize(data.getType(), comm) + - packSize(data.stringValue(), comm) + - packSize(data.scalarValue(), comm) + - packSize(data.getSelectors(), comm) + - packSize(data.getLeft(), comm) + - packSize(data.getRight(), comm); -} - std::size_t packSize(const UDQDefine& data, Dune::MPIHelper::MPICommunicator comm) { @@ -2457,20 +2442,6 @@ void pack(const WListManager& data, pack(data.lists(), buffer, position, comm); } - -void pack(const UDQASTNode& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.var_type, buffer, position, comm); - pack(data.getType(), buffer, position, comm); - pack(data.stringValue(), buffer, position, comm); - pack(data.scalarValue(), buffer, position, comm); - pack(data.getSelectors(), buffer, position, comm); - pack(data.getLeft(), buffer, position, comm); - pack(data.getRight(), buffer, position, comm); -} - void pack(const UDQDefine& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -4279,29 +4250,6 @@ void unpack(WListManager& data, data = WListManager(lists); } - -void unpack(UDQASTNode& data, - std::vector& buffer, int& position, - Dune::MPIHelper::MPICommunicator comm) -{ - UDQVarType var_type; - UDQTokenType type; - std::string stringValue; - double scalarValue; - std::vector selectors; - std::shared_ptr left; - std::shared_ptr right; - - unpack(var_type, buffer, position, comm); - unpack(type, buffer, position, comm); - unpack(stringValue, buffer, position, comm); - unpack(scalarValue, buffer, position, comm); - unpack(selectors, buffer, position, comm); - unpack(left, buffer, position, comm); - unpack(right, buffer, position, comm); - data = UDQASTNode(var_type, type, stringValue, scalarValue, selectors, left, right); -} - void unpack(UDQDefine& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -4948,7 +4896,9 @@ INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::map>) INSTANTIATE_PACK(std::map,int>>) +INSTANTIATE_PACK(std::map) INSTANTIATE_PACK(std::unordered_map) +INSTANTIATE_PACK(std::unordered_map) INSTANTIATE_PACK(std::pair) INSTANTIATE_PACK(DynamicState) INSTANTIATE_PACK(DynamicState) diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 708b9de0d..cb45e78d9 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -125,7 +125,6 @@ class TlmixparRecord; class TlmixparTable; class Tuning; class UDAValue; -class UDQASTNode; class UDQConfig; class UDQDefine; class UDQIndex; @@ -570,7 +569,6 @@ ADD_PACK_PROTOTYPES(UDQActive::InputRecord) ADD_PACK_PROTOTYPES(UDQActive::Record) ADD_PACK_PROTOTYPES(UDQAssign) ADD_PACK_PROTOTYPES(UDQAssign::AssignRecord) -ADD_PACK_PROTOTYPES(UDQASTNode) ADD_PACK_PROTOTYPES(UDQConfig) ADD_PACK_PROTOTYPES(UDQDefine) ADD_PACK_PROTOTYPES(UDQIndex) diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index 13d1347c6..23fbe4fe7 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1671,7 +1671,7 @@ BOOST_AUTO_TEST_CASE(UDQASTNode) Opm::UDQASTNode val1(Opm::UDQVarType::NONE, Opm::UDQTokenType::error, "test", 1.0, {"test3"}, n1, n1); - auto val2 = PackUnpack(val1); + auto val2 = PackUnpack2(val1); DO_CHECKS(UDQASTNode) #endif }