mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for Action::Condition
This commit is contained in:
@@ -1591,6 +1591,16 @@ std::size_t packSize(const Action::Quantity& data,
|
||||
packSize(data.args, comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const Action::Condition& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.lhs, comm) +
|
||||
packSize(data.rhs, comm) +
|
||||
packSize(data.logic, comm) +
|
||||
packSize(data.cmp, comm) +
|
||||
packSize(data.cmp_string, comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@@ -3209,6 +3219,17 @@ void pack(const Action::Quantity& data,
|
||||
pack(data.args, buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const Action::Condition& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.lhs, buffer, position, comm);
|
||||
pack(data.rhs, buffer, position, comm);
|
||||
pack(data.logic, buffer, position, comm);
|
||||
pack(data.cmp, buffer, position, comm);
|
||||
pack(data.cmp_string, buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -5509,6 +5530,16 @@ void unpack(Action::Quantity& data, std::vector<char>& buffer, int& position,
|
||||
unpack(data.args, buffer, position, comm);
|
||||
}
|
||||
|
||||
void unpack(Action::Condition& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
unpack(data.lhs, buffer, position, comm);
|
||||
unpack(data.rhs, buffer, position, comm);
|
||||
unpack(data.logic, buffer, position, comm);
|
||||
unpack(data.cmp, buffer, position, comm);
|
||||
unpack(data.cmp_string, buffer, position, comm);
|
||||
}
|
||||
|
||||
#define INSTANTIATE_PACK_VECTOR(T) \
|
||||
template std::size_t packSize(const std::vector<T>& data, \
|
||||
Dune::MPIHelper::MPICommunicator comm); \
|
||||
|
||||
@@ -67,6 +67,7 @@ class Actdims;
|
||||
namespace Action {
|
||||
class AST;
|
||||
class ASTNode;
|
||||
class Condition;
|
||||
class Quantity;
|
||||
}
|
||||
|
||||
@@ -607,6 +608,7 @@ void unpack(char* str, std::size_t length, std::vector<char>& buffer, int& posit
|
||||
ADD_PACK_PROTOTYPES(Actdims)
|
||||
ADD_PACK_PROTOTYPES(Action::AST)
|
||||
ADD_PACK_PROTOTYPES(Action::ASTNode)
|
||||
ADD_PACK_PROTOTYPES(Action::Condition)
|
||||
ADD_PACK_PROTOTYPES(Action::Quantity)
|
||||
ADD_PACK_PROTOTYPES(Aqudims)
|
||||
ADD_PACK_PROTOTYPES(ColumnSchema)
|
||||
|
||||
Reference in New Issue
Block a user