mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2420 from akva2/drop_serialization
Drop unused serialization code
This commit is contained in:
commit
f24c8a3b2f
@ -46,31 +46,6 @@ public:
|
||||
Mpi::unpack(data, buffer, pos, m_comm);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void staticBroadcast()
|
||||
{
|
||||
if (m_comm.size() == 1)
|
||||
return;
|
||||
|
||||
#if HAVE_MPI
|
||||
if (m_comm.rank() == 0) {
|
||||
size_t size = T::packSize(*this);
|
||||
std::vector<char> 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<char> buffer(size);
|
||||
m_comm.broadcast(buffer.data(), size, 0);
|
||||
int position = 0;
|
||||
T::unpack(buffer, position, *this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
template<class T>
|
||||
void broadcast(T& data)
|
||||
{
|
||||
|
@ -941,39 +941,10 @@ std::size_t packSize(const TableManager& data, Dune::MPIHelper::MPICommunicator
|
||||
packSize(data.rtemp(), comm);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const Tabulated1DFunction<Scalar>& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.xValues(), comm) +
|
||||
packSize(data.yValues(), comm);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const IntervalTabulated2DFunction<Scalar>& 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<Phase,Group::GroupInjectionProperties>& data,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const UniformXTabulated2DFunction<Scalar>& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.xPos(), comm) +
|
||||
packSize(data.yPos(), comm) +
|
||||
packSize(data.samples(), comm) +
|
||||
packSize(data.interpolationGuide(), comm);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const EclEpsScalingPointsInfo<Scalar>& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
@ -2624,35 +2595,6 @@ void pack(const TableManager& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.rtemp(), buffer, position, comm);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
void pack(const Tabulated1DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.xValues(), buffer, position, comm);
|
||||
pack(data.yValues(), buffer, position, comm);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
void pack(const IntervalTabulated2DFunction<Scalar>& data, std::vector<char>& 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<class Scalar>
|
||||
void pack(const UniformXTabulated2DFunction<Scalar>& data, std::vector<char>& 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<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
@ -4663,47 +4605,6 @@ void unpack(TableManager& data, std::vector<char>& buffer, int& position,
|
||||
watDenT, stcond, gas_comp_index, rtemp);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
void unpack(Tabulated1DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<Scalar> xValues, yValues;
|
||||
unpack(xValues, buffer, position, comm);
|
||||
unpack(yValues, buffer, position, comm);
|
||||
data = Tabulated1DFunction<Scalar>(xValues, yValues, false);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
void unpack(IntervalTabulated2DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<Scalar> xPos, yPos;
|
||||
std::vector<std::vector<Scalar>> 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<Scalar>(xPos, yPos, samples,
|
||||
xExtrapolate, yExtrapolate);
|
||||
}
|
||||
|
||||
template<class Scalar>
|
||||
void unpack(UniformXTabulated2DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<Scalar> xPos, yPos;
|
||||
std::vector<std::vector<typename UniformXTabulated2DFunction<Scalar>::SamplePoint>> samples;
|
||||
typename UniformXTabulated2DFunction<Scalar>::InterpolationPolicy interpolationGuide;
|
||||
unpack(xPos, buffer, position, comm);
|
||||
unpack(yPos, buffer, position, comm);
|
||||
unpack(samples, buffer, position, comm);
|
||||
unpack(interpolationGuide, buffer, position, comm);
|
||||
data = UniformXTabulated2DFunction<Scalar>(xPos, yPos, samples,
|
||||
interpolationGuide);
|
||||
}
|
||||
|
||||
void unpack(OilVaporizationProperties& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
@ -6200,10 +6101,8 @@ INSTANTIATE_PACK_VECTOR(std::vector<double>)
|
||||
INSTANTIATE_PACK_VECTOR(bool)
|
||||
INSTANTIATE_PACK_VECTOR(char)
|
||||
INSTANTIATE_PACK_VECTOR(int)
|
||||
INSTANTIATE_PACK_VECTOR(Tabulated1DFunction<double>)
|
||||
INSTANTIATE_PACK_VECTOR(std::array<double, 3>)
|
||||
INSTANTIATE_PACK_VECTOR(EclEpsScalingPointsInfo<double>)
|
||||
INSTANTIATE_PACK_VECTOR(IntervalTabulated2DFunction<double>)
|
||||
#undef INSTANTIATE_PACK_VECTOR
|
||||
|
||||
#define INSTANTIATE_PACK_SHARED_PTR(...) \
|
||||
@ -6239,10 +6138,6 @@ INSTANTIATE_PACK(unsigned char)
|
||||
INSTANTIATE_PACK(EclEpsScalingPointsInfo<double>)
|
||||
INSTANTIATE_PACK(EclTwoPhaseApproach)
|
||||
INSTANTIATE_PACK(EclMultiplexerApproach)
|
||||
INSTANTIATE_PACK(Tabulated1DFunction<double>)
|
||||
INSTANTIATE_PACK(IntervalTabulated2DFunction<double>)
|
||||
INSTANTIATE_PACK(UniformXTabulated2DFunction<double>)
|
||||
INSTANTIATE_PACK(std::map<int,IntervalTabulated2DFunction<double>>)
|
||||
#undef INSTANTIATE_PACK
|
||||
|
||||
} // end namespace Mpi
|
||||
|
@ -23,9 +23,6 @@
|
||||
#include <mpi.h>
|
||||
#endif
|
||||
|
||||
#include <opm/material/common/Tabulated1DFunction.hpp>
|
||||
#include <opm/material/common/IntervalTabulated2DFunction.hpp>
|
||||
#include <opm/material/common/UniformXTabulated2DFunction.hpp>
|
||||
#include <opm/output/eclipse/RestartValue.hpp>
|
||||
#include <opm/output/eclipse/EclipseIO.hpp>
|
||||
#include <opm/output/eclipse/Summary.hpp>
|
||||
@ -257,15 +254,6 @@ std::size_t packSize(const DynamicVector<T>& data, Dune::MPIHelper::MPICommunica
|
||||
template<class T>
|
||||
std::size_t packSize(const DynamicState<T>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const Tabulated1DFunction<Scalar>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const IntervalTabulated2DFunction<Scalar>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
std::size_t packSize(const UniformXTabulated2DFunction<Scalar>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T>
|
||||
std::size_t packSize(const IOrderSet<T>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
@ -358,18 +346,6 @@ template<class T>
|
||||
void pack(const DynamicVector<T>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
void pack(const Tabulated1DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
void pack(const IntervalTabulated2DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
void pack(const UniformXTabulated2DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T>
|
||||
void pack(const IOrderSet<T>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
@ -466,18 +442,6 @@ template<class T>
|
||||
void unpack(DynamicVector<T>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
void unpack(Tabulated1DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
void unpack(IntervalTabulated2DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class Scalar>
|
||||
void unpack(UniformXTabulated2DFunction<Scalar>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T>
|
||||
void unpack(IOrderSet<T>& data, std::vector<char>& buffer,
|
||||
int& position, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
@ -1245,46 +1245,6 @@ BOOST_AUTO_TEST_CASE(TableManager)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TabulatedOneDFunction)
|
||||
{
|
||||
#ifdef HAVE_MPI
|
||||
Opm::Tabulated1DFunction<double> val1(2, std::vector<double>{1.0, 2.0},
|
||||
std::vector<double>{3.0, 4.0});
|
||||
auto val2 = PackUnpack(val1);
|
||||
DO_CHECKS(Tabulated1DFunction<double>)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(IntervalTabulatedTwoDFunction)
|
||||
{
|
||||
#ifdef HAVE_MPI
|
||||
std::vector<double> xPos{1.0, 2.0};
|
||||
std::vector<double> yPos{3.0, 4.0};
|
||||
std::vector<std::vector<double>> samples{{1.0, 2.0}, {3.0, 4.0}};
|
||||
Opm::IntervalTabulated2DFunction<double> val1(xPos, yPos, samples, true, true);
|
||||
auto val2 = PackUnpack(val1);
|
||||
DO_CHECKS(IntervalTabulated2DFunction<double>)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(UniformXTabulatedTwoDFunction)
|
||||
{
|
||||
#ifdef HAVE_MPI
|
||||
std::vector<double> xPos{1.0, 2.0};
|
||||
std::vector<double> yPos{3.0, 4.0};
|
||||
using SampleType = std::vector<std::vector<std::tuple<double,double,double>>>;
|
||||
SampleType samples{{std::make_tuple(1.0, 2.0, 3.0)},
|
||||
{std::make_tuple(4.0, 5.0, 6.0)}};
|
||||
using FFuncType = Opm::UniformXTabulated2DFunction<double>;
|
||||
FFuncType val1(xPos, yPos, samples, FFuncType::Vertical);
|
||||
auto val2 = PackUnpack(val1);
|
||||
DO_CHECKS(UniformXTabulated2DFunction<double>)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(OilVaporizationProperties)
|
||||
{
|
||||
#ifdef HAVE_MPI
|
||||
|
Loading…
Reference in New Issue
Block a user