From 0bf43fc5163afb30f538d7922743134fd5932d7f Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 2 Dec 2019 12:08:16 +0100 Subject: [PATCH] add mpi serialization for WellSegmentDims --- opm/simulators/utils/ParallelRestart.cpp | 1 + opm/simulators/utils/ParallelRestart.hpp | 2 ++ tests/test_ParallelRestart.cpp | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 3e4bad91c..c862676ef 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -209,6 +209,7 @@ HANDLE_AS_POD(RestartSchedule) HANDLE_AS_POD(Tabdims) HANDLE_AS_POD(TimeMap::StepData) HANDLE_AS_POD(Welldims) +HANDLE_AS_POD(WellSegmentDims) 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 1efb60be3..2609e2dc5 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -63,6 +63,7 @@ class TableContainer; class TableSchema; class ThresholdPressure; class Welldims; +class WellSegmentDims; namespace Mpi { @@ -274,6 +275,7 @@ ADD_PACK_PROTOTYPES(ThresholdPressure) ADD_PACK_PROTOTYPES(TimeMap) ADD_PACK_PROTOTYPES(TimeMap::StepData) ADD_PACK_PROTOTYPES(Welldims) +ADD_PACK_PROTOTYPES(WellSegmentDims) } // end namespace Mpi RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState, diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index c16de3a77..4072c2ec5 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -593,6 +593,17 @@ BOOST_AUTO_TEST_CASE(Welldims) } +BOOST_AUTO_TEST_CASE(WellSegmentDims) +{ +#if HAVE_MPI + Opm::WellSegmentDims val1(1,2,3); + auto val2 = PackUnpack(val1); + BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2)); + BOOST_CHECK(val1 == std::get<0>(val2)); +#endif +} + + bool init_unit_test_func() { return true;