diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index 02ed890d2..79fbf9551 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -46,31 +46,6 @@ public: Mpi::unpack(data, buffer, pos, m_comm); } - template - void staticBroadcast() - { - if (m_comm.size() == 1) - return; - -#if HAVE_MPI - if (m_comm.rank() == 0) { - size_t size = T::packSize(*this); - std::vector buffer(size); - int position = 0; - T::pack(buffer, position, *this); - m_comm.broadcast(&position, 1, 0); - m_comm.broadcast(buffer.data(), position, 0); - } else { - int size; - m_comm.broadcast(&size, 1, 0); - std::vector buffer(size); - m_comm.broadcast(buffer.data(), size, 0); - int position = 0; - T::unpack(buffer, position, *this); - } -#endif - } - template void broadcast(T& data) { diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index 885e87d8d..0a87c7e5c 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -941,39 +941,10 @@ std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator packSize(data.rtemp(), comm); } -template -std::size_t packSize(const Tabulated1DFunction& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.xValues(), comm) + - packSize(data.yValues(), comm); -} - -template -std::size_t packSize(const IntervalTabulated2DFunction& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.xPos(), comm) + - packSize(data.yPos(), comm) + - packSize(data.samples(), comm) + - packSize(data.xExtrapolate(), comm) + - packSize(data.yExtrapolate(), comm); -} - template std::size_t packSize(const std::map& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const UniformXTabulated2DFunction& data, - Dune::MPIHelper::MPICommunicator comm) -{ - return packSize(data.xPos(), comm) + - packSize(data.yPos(), comm) + - packSize(data.samples(), comm) + - packSize(data.interpolationGuide(), comm); -} - template std::size_t packSize(const EclEpsScalingPointsInfo& data, Dune::MPIHelper::MPICommunicator comm) @@ -2624,35 +2595,6 @@ void pack(const TableManager& data, std::vector& buffer, int& position, pack(data.rtemp(), buffer, position, comm); } -template -void pack(const Tabulated1DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.xValues(), buffer, position, comm); - pack(data.yValues(), buffer, position, comm); -} - -template -void pack(const IntervalTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.xPos(), buffer, position, comm); - pack(data.yPos(), buffer, position, comm); - pack(data.samples(), buffer, position, comm); - pack(data.xExtrapolate(), buffer, position, comm); - pack(data.yExtrapolate(), buffer, position, comm); -} - -template -void pack(const UniformXTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm) -{ - pack(data.xPos(), buffer, position, comm); - pack(data.yPos(), buffer, position, comm); - pack(data.samples(), buffer, position, comm); - pack(data.interpolationGuide(), buffer, position, comm); -} - void pack(const OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -4663,47 +4605,6 @@ void unpack(TableManager& data, std::vector& buffer, int& position, watDenT, stcond, gas_comp_index, rtemp); } -template -void unpack(Tabulated1DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm) -{ - std::vector xValues, yValues; - unpack(xValues, buffer, position, comm); - unpack(yValues, buffer, position, comm); - data = Tabulated1DFunction(xValues, yValues, false); -} - -template -void unpack(IntervalTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm) -{ - std::vector xPos, yPos; - std::vector> samples; - bool xExtrapolate, yExtrapolate; - unpack(xPos, buffer, position, comm); - unpack(yPos, buffer, position, comm); - unpack(samples, buffer, position, comm); - unpack(xExtrapolate, buffer, position, comm); - unpack(yExtrapolate, buffer, position, comm); - data = IntervalTabulated2DFunction(xPos, yPos, samples, - xExtrapolate, yExtrapolate); -} - -template -void unpack(UniformXTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm) -{ - std::vector xPos, yPos; - std::vector::SamplePoint>> samples; - typename UniformXTabulated2DFunction::InterpolationPolicy interpolationGuide; - unpack(xPos, buffer, position, comm); - unpack(yPos, buffer, position, comm); - unpack(samples, buffer, position, comm); - unpack(interpolationGuide, buffer, position, comm); - data = UniformXTabulated2DFunction(xPos, yPos, samples, - interpolationGuide); -} - void unpack(OilVaporizationProperties& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm) @@ -6200,10 +6101,8 @@ INSTANTIATE_PACK_VECTOR(std::vector) INSTANTIATE_PACK_VECTOR(bool) INSTANTIATE_PACK_VECTOR(char) INSTANTIATE_PACK_VECTOR(int) -INSTANTIATE_PACK_VECTOR(Tabulated1DFunction) INSTANTIATE_PACK_VECTOR(std::array) INSTANTIATE_PACK_VECTOR(EclEpsScalingPointsInfo) -INSTANTIATE_PACK_VECTOR(IntervalTabulated2DFunction) #undef INSTANTIATE_PACK_VECTOR #define INSTANTIATE_PACK_SHARED_PTR(...) \ @@ -6239,10 +6138,6 @@ INSTANTIATE_PACK(unsigned char) INSTANTIATE_PACK(EclEpsScalingPointsInfo) INSTANTIATE_PACK(EclTwoPhaseApproach) INSTANTIATE_PACK(EclMultiplexerApproach) -INSTANTIATE_PACK(Tabulated1DFunction) -INSTANTIATE_PACK(IntervalTabulated2DFunction) -INSTANTIATE_PACK(UniformXTabulated2DFunction) -INSTANTIATE_PACK(std::map>) #undef INSTANTIATE_PACK } // end namespace Mpi diff --git a/opm/simulators/utils/ParallelRestart.hpp b/opm/simulators/utils/ParallelRestart.hpp index 1f36127b2..7ef437227 100644 --- a/opm/simulators/utils/ParallelRestart.hpp +++ b/opm/simulators/utils/ParallelRestart.hpp @@ -23,9 +23,6 @@ #include #endif -#include -#include -#include #include #include #include @@ -257,15 +254,6 @@ std::size_t packSize(const DynamicVector& data, Dune::MPIHelper::MPICommunica template std::size_t packSize(const DynamicState& data, Dune::MPIHelper::MPICommunicator comm); -template -std::size_t packSize(const Tabulated1DFunction& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const IntervalTabulated2DFunction& data, Dune::MPIHelper::MPICommunicator comm); - -template -std::size_t packSize(const UniformXTabulated2DFunction& data, Dune::MPIHelper::MPICommunicator comm); - template std::size_t packSize(const IOrderSet& data, Dune::MPIHelper::MPICommunicator comm); @@ -358,18 +346,6 @@ template void pack(const DynamicVector& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void pack(const Tabulated1DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const IntervalTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void pack(const UniformXTabulated2DFunction& 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); @@ -466,18 +442,6 @@ template void unpack(DynamicVector& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); -template -void unpack(Tabulated1DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(IntervalTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - -template -void unpack(UniformXTabulated2DFunction& data, std::vector& buffer, - int& position, Dune::MPIHelper::MPICommunicator comm); - template void unpack(IOrderSet& data, std::vector& buffer, int& position, Dune::MPIHelper::MPICommunicator comm); diff --git a/tests/test_ParallelRestart.cpp b/tests/test_ParallelRestart.cpp index a59604d28..d6d1355db 100644 --- a/tests/test_ParallelRestart.cpp +++ b/tests/test_ParallelRestart.cpp @@ -1245,46 +1245,6 @@ BOOST_AUTO_TEST_CASE(TableManager) } -BOOST_AUTO_TEST_CASE(TabulatedOneDFunction) -{ -#ifdef HAVE_MPI - Opm::Tabulated1DFunction val1(2, std::vector{1.0, 2.0}, - std::vector{3.0, 4.0}); - auto val2 = PackUnpack(val1); - DO_CHECKS(Tabulated1DFunction) -#endif -} - - -BOOST_AUTO_TEST_CASE(IntervalTabulatedTwoDFunction) -{ -#ifdef HAVE_MPI - std::vector xPos{1.0, 2.0}; - std::vector yPos{3.0, 4.0}; - std::vector> samples{{1.0, 2.0}, {3.0, 4.0}}; - Opm::IntervalTabulated2DFunction val1(xPos, yPos, samples, true, true); - auto val2 = PackUnpack(val1); - DO_CHECKS(IntervalTabulated2DFunction) -#endif -} - - -BOOST_AUTO_TEST_CASE(UniformXTabulatedTwoDFunction) -{ -#ifdef HAVE_MPI - std::vector xPos{1.0, 2.0}; - std::vector yPos{3.0, 4.0}; - using SampleType = std::vector>>; - SampleType samples{{std::make_tuple(1.0, 2.0, 3.0)}, - {std::make_tuple(4.0, 5.0, 6.0)}}; - using FFuncType = Opm::UniformXTabulated2DFunction; - FFuncType val1(xPos, yPos, samples, FFuncType::Vertical); - auto val2 = PackUnpack(val1); - DO_CHECKS(UniformXTabulated2DFunction) -#endif -} - - BOOST_AUTO_TEST_CASE(OilVaporizationProperties) { #ifdef HAVE_MPI