mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2297 from joakim-hove/serialize-timemap
Use (std::vector<std::time_t>&) constructor when serialing TimeMap
This commit is contained in:
commit
7e629fdcc8
@ -611,9 +611,7 @@ std::size_t packSize(const SimulationConfig& data, Dune::MPIHelper::MPICommunica
|
|||||||
|
|
||||||
std::size_t packSize(const TimeMap& data, Dune::MPIHelper::MPICommunicator comm)
|
std::size_t packSize(const TimeMap& data, Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
return packSize(data.timeList(), comm) +
|
return packSize(data.timeList(), comm);
|
||||||
packSize(data.firstTimeStepMonths(), comm) +
|
|
||||||
packSize(data.firstTimeStepYears(), comm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator comm)
|
std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator comm)
|
||||||
@ -1923,13 +1921,6 @@ std::size_t packSize(const TimeStampUTC& data,
|
|||||||
packSize(data.microseconds(), comm);
|
packSize(data.microseconds(), comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t packSize(const TimeMap::StepData& data,
|
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
|
||||||
{
|
|
||||||
return packSize(data.stepnumber, comm) +
|
|
||||||
packSize(data.timestamp, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::size_t packSize(const EclHysterConfig& data,
|
std::size_t packSize(const EclHysterConfig& data,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
@ -2449,8 +2440,6 @@ void pack(const TimeMap& data, std::vector<char>& buffer, int& position,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
pack(data.timeList(), buffer, position, comm);
|
pack(data.timeList(), buffer, position, comm);
|
||||||
pack(data.firstTimeStepMonths(), buffer, position, comm);
|
|
||||||
pack(data.firstTimeStepYears(), buffer, position, comm);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pack(const RestartConfig& data, std::vector<char>& buffer, int& position,
|
void pack(const RestartConfig& data, std::vector<char>& buffer, int& position,
|
||||||
@ -3831,14 +3820,6 @@ void pack(const TimeStampUTC& data,
|
|||||||
pack(data.microseconds(), buffer, position, comm);
|
pack(data.microseconds(), buffer, position, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pack(const TimeMap::StepData& data,
|
|
||||||
std::vector<char>& buffer, int& position,
|
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
|
||||||
{
|
|
||||||
pack(data.stepnumber, buffer, position, comm);
|
|
||||||
pack(data.timestamp, buffer, position, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
void pack(const EclHysterConfig& data,
|
void pack(const EclHysterConfig& data,
|
||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
@ -4496,13 +4477,9 @@ void unpack(TimeMap& data, std::vector<char>& buffer, int& position,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
std::vector<std::time_t> timeList;
|
std::vector<std::time_t> timeList;
|
||||||
std::vector<TimeMap::StepData> firstStepMonths;
|
|
||||||
std::vector<TimeMap::StepData> firstStepYears;
|
|
||||||
unpack(timeList, buffer, position, comm);
|
unpack(timeList, buffer, position, comm);
|
||||||
unpack(firstStepMonths, buffer, position, comm);
|
|
||||||
unpack(firstStepYears, buffer, position, comm);
|
|
||||||
|
|
||||||
data = TimeMap(timeList, firstStepMonths, firstStepYears);
|
data = TimeMap(timeList);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpack(RestartConfig& data, std::vector<char>& buffer, int& position,
|
void unpack(RestartConfig& data, std::vector<char>& buffer, int& position,
|
||||||
@ -6594,13 +6571,6 @@ void unpack(TimeStampUTC& data,
|
|||||||
data = TimeStampUTC(ymd, hour, minutes, seconds, usec);
|
data = TimeStampUTC(ymd, hour, minutes, seconds, usec);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpack(TimeMap::StepData& data,
|
|
||||||
std::vector<char>& buffer, int& position,
|
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
|
||||||
{
|
|
||||||
unpack(data.stepnumber, buffer, position, comm);
|
|
||||||
unpack(data.timestamp, buffer, position, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
void unpack(EclHysterConfig& data,
|
void unpack(EclHysterConfig& data,
|
||||||
std::vector<char>& buffer, int& position,
|
std::vector<char>& buffer, int& position,
|
||||||
|
@ -746,7 +746,6 @@ ADD_PACK_PROTOTYPES(TableManager)
|
|||||||
ADD_PACK_PROTOTYPES(TableSchema)
|
ADD_PACK_PROTOTYPES(TableSchema)
|
||||||
ADD_PACK_PROTOTYPES(ThresholdPressure)
|
ADD_PACK_PROTOTYPES(ThresholdPressure)
|
||||||
ADD_PACK_PROTOTYPES(TimeMap)
|
ADD_PACK_PROTOTYPES(TimeMap)
|
||||||
ADD_PACK_PROTOTYPES(TimeMap::StepData)
|
|
||||||
ADD_PACK_PROTOTYPES(TimeStampUTC)
|
ADD_PACK_PROTOTYPES(TimeStampUTC)
|
||||||
ADD_PACK_PROTOTYPES(TransMult)
|
ADD_PACK_PROTOTYPES(TransMult)
|
||||||
ADD_PACK_PROTOTYPES(Tuning)
|
ADD_PACK_PROTOTYPES(Tuning)
|
||||||
|
@ -223,9 +223,7 @@ Opm::FoamData getFoamData()
|
|||||||
|
|
||||||
Opm::TimeMap getTimeMap()
|
Opm::TimeMap getTimeMap()
|
||||||
{
|
{
|
||||||
return Opm::TimeMap({123},
|
return Opm::TimeMap({123});
|
||||||
{{1, Opm::TimeStampUTC(123)}},
|
|
||||||
{{2, Opm::TimeStampUTC(456)}});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Opm::PvtgTable getPvtgTable()
|
Opm::PvtgTable getPvtgTable()
|
||||||
@ -789,16 +787,6 @@ BOOST_AUTO_TEST_CASE(RestartSchedule)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(StepData)
|
|
||||||
{
|
|
||||||
#if HAVE_MPI
|
|
||||||
Opm::TimeMap::StepData val1{1, Opm::TimeStampUTC(123456)};
|
|
||||||
auto val2 = PackUnpack(val1);
|
|
||||||
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
|
|
||||||
BOOST_CHECK(val1 == std::get<0>(val2));
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(TimeMap)
|
BOOST_AUTO_TEST_CASE(TimeMap)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user