mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for MessageLimits
This commit is contained in:
@@ -892,6 +892,12 @@ std::size_t packSize(const Events& data,
|
|||||||
return packSize(data.events(), comm);
|
return packSize(data.events(), comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::size_t packSize(const MessageLimits& data,
|
||||||
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
|
{
|
||||||
|
return packSize(data.getLimits(), comm);
|
||||||
|
}
|
||||||
|
|
||||||
////// pack routines
|
////// pack routines
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@@ -1794,6 +1800,12 @@ void pack(const Events& data,
|
|||||||
pack(data.events(), buffer, position, comm);
|
pack(data.events(), buffer, position, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pack(const MessageLimits& data,
|
||||||
|
std::vector<char>& buffer, int& position,
|
||||||
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
|
{
|
||||||
|
pack(data.getLimits(), buffer, position, comm);
|
||||||
|
}
|
||||||
/// unpack routines
|
/// unpack routines
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
@@ -3003,6 +3015,14 @@ void unpack(Events& data,
|
|||||||
data = Events(events);
|
data = Events(events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unpack(MessageLimits& data,
|
||||||
|
std::vector<char>& buffer, int& position,
|
||||||
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
|
{
|
||||||
|
DynamicState<MLimits> limits;
|
||||||
|
unpack(limits, buffer, position, comm);
|
||||||
|
data = MessageLimits(limits);
|
||||||
|
}
|
||||||
} // end namespace Mpi
|
} // end namespace Mpi
|
||||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||||
|
|||||||
@@ -71,6 +71,7 @@ class FoamData;
|
|||||||
class InitConfig;
|
class InitConfig;
|
||||||
class IOConfig;
|
class IOConfig;
|
||||||
class JFunc;
|
class JFunc;
|
||||||
|
class MessageLimits;
|
||||||
class MLimits;
|
class MLimits;
|
||||||
class NNC;
|
class NNC;
|
||||||
struct NNCdata;
|
struct NNCdata;
|
||||||
@@ -523,6 +524,7 @@ ADD_PACK_PROTOTYPES(Eqldims)
|
|||||||
ADD_PACK_PROTOTYPES(InitConfig)
|
ADD_PACK_PROTOTYPES(InitConfig)
|
||||||
ADD_PACK_PROTOTYPES(IOConfig)
|
ADD_PACK_PROTOTYPES(IOConfig)
|
||||||
ADD_PACK_PROTOTYPES(JFunc)
|
ADD_PACK_PROTOTYPES(JFunc)
|
||||||
|
ADD_PACK_PROTOTYPES(MessageLimits)
|
||||||
ADD_PACK_PROTOTYPES(MLimits)
|
ADD_PACK_PROTOTYPES(MLimits)
|
||||||
ADD_PACK_PROTOTYPES(NNC)
|
ADD_PACK_PROTOTYPES(NNC)
|
||||||
ADD_PACK_PROTOTYPES(NNCdata)
|
ADD_PACK_PROTOTYPES(NNCdata)
|
||||||
|
|||||||
@@ -1210,6 +1210,18 @@ BOOST_AUTO_TEST_CASE(MLimits)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(MessageLimits)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_MPI
|
||||||
|
std::vector<Opm::MLimits> limits{Opm::MLimits{1,2,3,4,5,6,7,8,9,10,11,12}};
|
||||||
|
Opm::MessageLimits val1(Opm::DynamicState<Opm::MLimits>(limits,2));
|
||||||
|
auto val2 = PackUnpack(val1);
|
||||||
|
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
|
||||||
|
BOOST_CHECK(val1 == std::get<0>(val2));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool init_unit_test_func()
|
bool init_unit_test_func()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user