add mpi serialization for Action::AST

This commit is contained in:
Arne Morten Kvarving
2019-12-17 15:44:42 +01:00
parent 2d682a0838
commit 2a16051d84
3 changed files with 40 additions and 0 deletions

View File

@@ -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); \