mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for std::array
This commit is contained in:
parent
c6e2db1f69
commit
34a55ed381
@ -271,6 +271,12 @@ std::size_t packSize(const std::unordered_map<T1,T2,H,P,A>& data, Dune::MPIHelpe
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
template<class T, std::size_t N>
|
||||
std::size_t packSize(const std::array<T,N>& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return N*packSize(data[0], comm);
|
||||
}
|
||||
|
||||
HANDLE_AS_POD(Actdims)
|
||||
HANDLE_AS_POD(Aqudims)
|
||||
HANDLE_AS_POD(data::Connection)
|
||||
@ -1486,6 +1492,14 @@ void pack(const std::unordered_set<T,H,KE,A>& data,
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, size_t N>
|
||||
void pack(const std::array<T,N>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
for (const T& entry : data)
|
||||
pack(entry, buffer, position, comm);
|
||||
}
|
||||
|
||||
template<class A>
|
||||
void pack(const std::vector<bool,A>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
@ -2931,6 +2945,14 @@ void unpack(std::unordered_set<T,H,KE,A>& data,
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, size_t N>
|
||||
void unpack(std::array<T,N>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
for (T& entry : data)
|
||||
unpack(entry, buffer, position, comm);
|
||||
}
|
||||
|
||||
template<class Key, class Value>
|
||||
void unpack(OrderedMap<Key,Value>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
|
@ -184,6 +184,9 @@ template<class T>
|
||||
std::size_t packSize(const std::shared_ptr<T>& data,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T, std::size_t N>
|
||||
std::size_t packSize(const std::array<T,N>& data, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
std::size_t packSize(const char* str, Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
std::size_t packSize(const std::string& str, Dune::MPIHelper::MPICommunicator comm);
|
||||
@ -313,6 +316,10 @@ template<class T>
|
||||
void pack(const std::shared_ptr<T>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T, size_t N>
|
||||
void pack(const std::array<T,N>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T1, class T2, class C, class A>
|
||||
void pack(const std::map<T1,T2,C,A>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
@ -463,6 +470,10 @@ template<class T>
|
||||
void unpack(std::shared_ptr<T>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T, size_t N>
|
||||
void unpack(std::array<T,N>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
||||
template<class T1, class T2, class C, class A>
|
||||
void unpack(std::map<T1,T2,C,A>& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm);
|
||||
|
Loading…
Reference in New Issue
Block a user