mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Use std::chrono::system_clock with 1/1000 second resolution
This commit is contained in:
@@ -283,7 +283,7 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator
|
||||
+ packSize(data.extra, comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const std::chrono::system_clock::time_point&, Dune::MPIHelper::MPICommunicator comm)
|
||||
std::size_t packSize(const Opm::time_point&, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::time_t tp;
|
||||
return packSize(tp, comm);
|
||||
@@ -576,10 +576,10 @@ void pack(const RestartValue& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.extra, buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const std::chrono::system_clock::time_point& data, std::vector<char>& buffer, int& position,
|
||||
void pack(const Opm::time_point& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(std::chrono::system_clock::to_time_t(data), buffer, position, comm);
|
||||
pack(Opm::TimeService::to_time_t(data), buffer, position, comm);
|
||||
}
|
||||
|
||||
|
||||
@@ -887,12 +887,12 @@ void unpack(RestartValue& data, std::vector<char>& buffer, int& position,
|
||||
unpack(data.extra, buffer, position, comm);
|
||||
}
|
||||
|
||||
void unpack(std::chrono::system_clock::time_point& data, std::vector<char>& buffer, int& position,
|
||||
void unpack(Opm::time_point& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::time_t tp;
|
||||
unpack(tp, buffer, position, comm);
|
||||
data = std::chrono::system_clock::from_time_t(tp);
|
||||
data = Opm::TimeService::from_time_t(tp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <opm/output/eclipse/EclipseIO.hpp>
|
||||
#include <opm/output/eclipse/Summary.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/State.hpp>
|
||||
#include <opm/common/utility/TimeService.hpp>
|
||||
|
||||
#include <dune/common/parallel/mpihelper.hh>
|
||||
|
||||
@@ -321,7 +322,7 @@ ADD_PACK_PROTOTYPES(data::WellRates)
|
||||
ADD_PACK_PROTOTYPES(RestartKey)
|
||||
ADD_PACK_PROTOTYPES(RestartValue)
|
||||
ADD_PACK_PROTOTYPES(std::string)
|
||||
ADD_PACK_PROTOTYPES(std::chrono::system_clock::time_point)
|
||||
ADD_PACK_PROTOTYPES(Opm::time_point)
|
||||
|
||||
} // end namespace Mpi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user