mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for UDQParams
This commit is contained in:
@@ -399,6 +399,15 @@ std::size_t packSize(const EndpointScaling& data, Dune::MPIHelper::MPICommunicat
|
||||
return packSize(data.getBits(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const UDQParams& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.reseed(), comm) +
|
||||
packSize(data.rand_seed(), comm) +
|
||||
packSize(data.range(), comm) +
|
||||
packSize(data.undefinedValue(), comm) +
|
||||
packSize(data.cmpEpsilon(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@@ -786,6 +795,16 @@ void pack(const EndpointScaling& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.getBits(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const UDQParams& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.reseed(), buffer, position, comm);
|
||||
pack(data.rand_seed(), buffer, position, comm);
|
||||
pack(data.range(), buffer, position, comm);
|
||||
pack(data.undefinedValue(), buffer, position, comm);
|
||||
pack(data.cmpEpsilon(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -1261,6 +1280,21 @@ void unpack(EndpointScaling& data, std::vector<char>& buffer, int& position,
|
||||
data = EndpointScaling(std::bitset<4>(bits));
|
||||
}
|
||||
|
||||
void unpack(UDQParams& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
bool reseed;
|
||||
int rand_seed;
|
||||
double range, undefVal, cmp_eps;
|
||||
|
||||
unpack(reseed, buffer, position, comm);
|
||||
unpack(rand_seed, buffer, position, comm);
|
||||
unpack(range, buffer, position, comm);
|
||||
unpack(undefVal, buffer, position, comm);
|
||||
unpack(cmp_eps, buffer, position, comm);
|
||||
data = UDQParams(reseed, rand_seed, range, undefVal, cmp_eps);
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
||||
@@ -62,6 +62,7 @@ class TableColumn;
|
||||
class TableContainer;
|
||||
class TableSchema;
|
||||
class ThresholdPressure;
|
||||
class UDQParams;
|
||||
class Welldims;
|
||||
class WellSegmentDims;
|
||||
|
||||
@@ -274,6 +275,7 @@ ADD_PACK_PROTOTYPES(TableSchema)
|
||||
ADD_PACK_PROTOTYPES(ThresholdPressure)
|
||||
ADD_PACK_PROTOTYPES(TimeMap)
|
||||
ADD_PACK_PROTOTYPES(TimeMap::StepData)
|
||||
ADD_PACK_PROTOTYPES(UDQParams)
|
||||
ADD_PACK_PROTOTYPES(Welldims)
|
||||
ADD_PACK_PROTOTYPES(WellSegmentDims)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user