mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: handle all sets in eclmpiserializer
thus we can remove support in MPIPacker
This commit is contained in:
@@ -109,30 +109,6 @@ std::size_t packSize(const std::tuple<Ts...>& data, Opm::Parallel::MPIComm comm)
|
||||
return pack_size_tuple_entry(data, comm);
|
||||
}
|
||||
|
||||
template<class T, class H, class KE, class A>
|
||||
std::size_t packSize(const std::unordered_set<T,H,KE,A>& data,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
std::size_t totalSize = packSize(data.size(), comm);
|
||||
for (const auto& entry : data)
|
||||
{
|
||||
totalSize += packSize(entry, comm);
|
||||
}
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
template<class K, class C, class A>
|
||||
std::size_t packSize(const std::set<K,C,A>& data,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
std::size_t totalSize = packSize(data.size(), comm);
|
||||
for (const auto& entry : data)
|
||||
{
|
||||
totalSize += packSize(entry, comm);
|
||||
}
|
||||
return totalSize;
|
||||
}
|
||||
|
||||
std::size_t packSize(const char* str, Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
#if HAVE_MPI
|
||||
@@ -252,32 +228,6 @@ void pack(const std::vector<T, A>& data, std::vector<char>& buffer, int& positio
|
||||
pack(entry, buffer, position, comm);
|
||||
}
|
||||
|
||||
template<class K, class C, class A>
|
||||
void pack(const std::set<K,C,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
pack(data.size(), buffer, position, comm);
|
||||
|
||||
for (const auto& entry : data)
|
||||
{
|
||||
pack(entry, buffer, position, comm);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, class H, class KE, class A>
|
||||
void pack(const std::unordered_set<T,H,KE,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
pack(data.size(), buffer, position, comm);
|
||||
|
||||
for (const auto& entry : data)
|
||||
{
|
||||
pack(entry, buffer, position, comm);
|
||||
}
|
||||
}
|
||||
|
||||
template<class A>
|
||||
void pack(const std::vector<bool,A>& data, std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
@@ -446,38 +396,6 @@ void unpack(std::tuple<Ts...>& data, std::vector<char>& buffer,
|
||||
unpack_tuple_entry(data, buffer, position, comm);
|
||||
}
|
||||
|
||||
template<class K, class C, class A>
|
||||
void unpack(std::set<K,C,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
std::size_t size = 0;
|
||||
unpack(size, buffer, position, comm);
|
||||
|
||||
for (;size>0; size--)
|
||||
{
|
||||
K entry;
|
||||
unpack(entry, buffer, position, comm);
|
||||
data.insert(entry);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T, class H, class KE, class A>
|
||||
void unpack(std::unordered_set<T,H,KE,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
std::size_t size=0;
|
||||
unpack(size, buffer, position, comm);
|
||||
|
||||
for (;size>0; size--)
|
||||
{
|
||||
T entry;
|
||||
unpack(entry, buffer, position, comm);
|
||||
data.insert(entry);
|
||||
}
|
||||
}
|
||||
|
||||
void unpack(char* str, std::size_t length, std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
@@ -571,8 +489,6 @@ INSTANTIATE_PACK(unsigned int)
|
||||
INSTANTIATE_PACK(unsigned long int)
|
||||
INSTANTIATE_PACK(unsigned long long int)
|
||||
INSTANTIATE_PACK(std::pair<double, double>)
|
||||
INSTANTIATE_PACK(std::unordered_set<std::string>)
|
||||
INSTANTIATE_PACK(std::set<std::string>)
|
||||
INSTANTIATE_PACK(std::bitset<4>)
|
||||
|
||||
|
||||
|
||||
@@ -26,11 +26,9 @@
|
||||
|
||||
#include <bitset>
|
||||
#include <cstddef>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <typeinfo>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
|
||||
namespace Opm
|
||||
@@ -83,14 +81,6 @@ std::size_t packSize(const std::pair<T1,T2>& data, Opm::Parallel::MPIComm comm);
|
||||
template<class T, class A>
|
||||
std::size_t packSize(const std::vector<T,A>& data, Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class K, class C, class A>
|
||||
std::size_t packSize(const std::set<K,C,A>& data,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class T, class H, class KE, class A>
|
||||
std::size_t packSize(const std::unordered_set<T,H,KE,A>& data,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class A>
|
||||
std::size_t packSize(const std::vector<bool,A>& data, Opm::Parallel::MPIComm comm);
|
||||
|
||||
@@ -161,16 +151,6 @@ template<class... Ts>
|
||||
void pack(const std::tuple<Ts...>& data, std::vector<char>& buffer,
|
||||
int& position, Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class K, class C, class A>
|
||||
void pack(const std::set<K,C,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class T, class H, class KE, class A>
|
||||
void pack(const std::unordered_set<T,H,KE,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
void pack(const char* str, std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
@@ -238,16 +218,6 @@ template<class... Ts>
|
||||
void unpack(std::tuple<Ts...>& data, std::vector<char>& buffer,
|
||||
int& position, Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class K, class C, class A>
|
||||
void unpack(std::set<K,C,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
template<class T, class H, class KE, class A>
|
||||
void unpack(std::unordered_set<T,H,KE,A>& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
void unpack(char* str, std::size_t length, std::vector<char>& buffer, int& position,
|
||||
Opm::Parallel::MPIComm comm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user