From d905e0f037187521e44dd8e8f361c11de6732e64 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Wed, 18 Mar 2020 09:29:02 +0100 Subject: [PATCH] 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 }