From 64e943176b32a1ea69acd2f0de93c1d6d085e120 Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Thu, 16 Jan 2020 12:27:39 +0100 Subject: [PATCH] fixed: do not handle EquilRecord as POD valgrind is not happy --- opm/simulators/utils/ParallelRestart.cpp | 55 +++++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/opm/simulators/utils/ParallelRestart.cpp b/opm/simulators/utils/ParallelRestart.cpp index bb66c1e1c..470a4c637 100644 --- a/opm/simulators/utils/ParallelRestart.cpp +++ b/opm/simulators/utils/ParallelRestart.cpp @@ -448,7 +448,6 @@ HANDLE_AS_POD(data::Segment) HANDLE_AS_POD(DENSITYRecord) HANDLE_AS_POD(EclHysterConfig) HANDLE_AS_POD(Eqldims) -HANDLE_AS_POD(EquilRecord) HANDLE_AS_POD(FoamData) HANDLE_AS_POD(GuideRateConfig::GroupTarget); HANDLE_AS_POD(GuideRateConfig::WellTarget); @@ -1860,6 +1859,20 @@ std::size_t packSize(const SummaryConfig& data, packSize(data.getSmryKwds(), comm); } +std::size_t packSize(const EquilRecord& data, + Dune::MPIHelper::MPICommunicator comm) +{ + return packSize(data.datumDepth(), comm) + + packSize(data.datumDepthPressure(), comm) + + packSize(data.waterOilContactDepth(), comm) + + packSize(data.waterOilContactCapillaryPressure(), comm) + + packSize(data.gasOilContactDepth(), comm) + + packSize(data.gasOilContactCapillaryPressure(), comm) + + packSize(data.liveOilInitConstantRs(), comm) + + packSize(data.wetGasInitConstantRv(), comm) + + packSize(data.initializationTargetAccuracy(), comm); +} + ////// pack routines template @@ -3602,8 +3615,21 @@ void pack(const SummaryConfig& data, pack(data.getShortKwds(), buffer, position, comm); pack(data.getSmryKwds(), buffer, position, comm); } - +void pack(const EquilRecord& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + pack(data.datumDepth(), buffer, position, comm); + pack(data.datumDepthPressure(), buffer, position, comm); + pack(data.waterOilContactDepth(), buffer, position, comm); + pack(data.waterOilContactCapillaryPressure(), buffer, position, comm); + pack(data.gasOilContactDepth(), buffer, position, comm); + pack(data.gasOilContactCapillaryPressure(), buffer, position, comm); + pack(data.liveOilInitConstantRs(), buffer, position, comm); + pack(data.wetGasInitConstantRv(), buffer, position, comm); + pack(data.initializationTargetAccuracy(), buffer, position, comm); +} /// unpack routines @@ -6115,6 +6141,31 @@ void unpack(SummaryConfig& data, data = SummaryConfig(kwds, shortKwds, smryKwds); } +void unpack(EquilRecord& data, + std::vector& buffer, int& position, + Dune::MPIHelper::MPICommunicator comm) +{ + double datumDepth, datumDepthPressure, waterOilContactDepth; + double waterOilContactCapillaryPressure, gasOilContactDepth; + double gasOilContactCapillaryPressure; + bool liveOilInitConstantRs, wetGasInitConstantRv; + int initializationTargetAccuracy; + + unpack(datumDepth, buffer, position, comm); + unpack(datumDepthPressure, buffer, position, comm); + unpack(waterOilContactDepth, buffer, position, comm); + unpack(waterOilContactCapillaryPressure, buffer, position, comm); + unpack(gasOilContactDepth, buffer, position, comm); + unpack(gasOilContactCapillaryPressure, buffer, position, comm); + unpack(liveOilInitConstantRs, buffer, position, comm); + unpack(wetGasInitConstantRv, buffer, position, comm); + unpack(initializationTargetAccuracy, buffer, position, comm); + data = EquilRecord(datumDepth, datumDepthPressure, waterOilContactDepth, + waterOilContactCapillaryPressure, gasOilContactDepth, + gasOilContactCapillaryPressure, liveOilInitConstantRs, + wetGasInitConstantRv, initializationTargetAccuracy); +} + #define INSTANTIATE_PACK_VECTOR(T) \ template std::size_t packSize(const std::vector& data, \ Dune::MPIHelper::MPICommunicator comm); \