mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for Action::AST
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Edit/EDITNNC.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ActionAST.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/ASTNode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp>
|
||||
@@ -1576,6 +1577,12 @@ std::size_t packSize(const Action::ASTNode& data,
|
||||
packSize(data.childrens(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const Action::AST& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.getCondition(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@@ -3179,6 +3186,13 @@ void pack(const Action::ASTNode& data,
|
||||
pack(data.childrens(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const Action::AST& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.getCondition(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -5464,6 +5478,14 @@ void unpack(Action::ASTNode& data, std::vector<char>& buffer, int& position,
|
||||
data = Action::ASTNode(token, func_type, func, argList, number, children);
|
||||
}
|
||||
|
||||
void unpack(Action::AST& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::shared_ptr<Action::ASTNode> condition;
|
||||
unpack(condition, buffer, position, comm);
|
||||
data = Action::AST(condition);
|
||||
}
|
||||
|
||||
#define INSTANTIATE_PACK_VECTOR(T) \
|
||||
template std::size_t packSize(const std::vector<T>& data, \
|
||||
Dune::MPIHelper::MPICommunicator comm); \
|
||||
|
||||
Reference in New Issue
Block a user