mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: remove optional support in MPIPacker
handled by the serializer
This commit is contained in:
parent
053dfc7ce5
commit
c6beb479d3
@ -68,17 +68,6 @@ std::size_t packSize(const std::pair<T1,T2>& data, Opm::Parallel::MPIComm comm)
|
|||||||
return packSize(data.first, comm) + packSize(data.second, comm);
|
return packSize(data.first, comm) + packSize(data.second, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
|
||||||
std::size_t packSize(const std::optional<T>& data, Opm::Parallel::MPIComm comm)
|
|
||||||
{
|
|
||||||
bool has_value = data.has_value();
|
|
||||||
std::size_t pack_size = packSize(has_value, comm);
|
|
||||||
if (has_value)
|
|
||||||
pack_size += packSize(*data, comm);
|
|
||||||
return pack_size;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
std::size_t packSize(const std::vector<T,A>& data, Opm::Parallel::MPIComm comm)
|
std::size_t packSize(const std::vector<T,A>& data, Opm::Parallel::MPIComm comm)
|
||||||
{
|
{
|
||||||
@ -275,17 +264,6 @@ void pack(const std::pair<T1,T2>& data, std::vector<char>& buffer, int& position
|
|||||||
pack(data.second, buffer, position, comm);
|
pack(data.second, buffer, position, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void pack(const std::optional<T>& data, std::vector<char>& buffer, int& position,
|
|
||||||
Opm::Parallel::MPIComm comm)
|
|
||||||
{
|
|
||||||
bool has_value = data.has_value();
|
|
||||||
pack(has_value, buffer, position, comm);
|
|
||||||
if (has_value)
|
|
||||||
pack(*data, buffer, position, comm);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
void pack(const std::vector<T, A>& data, std::vector<char>& buffer, int& position,
|
void pack(const std::vector<T, A>& data, std::vector<char>& buffer, int& position,
|
||||||
Opm::Parallel::MPIComm comm)
|
Opm::Parallel::MPIComm comm)
|
||||||
@ -473,21 +451,6 @@ void unpack(std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
|
|||||||
unpack(data.second, buffer, position, comm);
|
unpack(data.second, buffer, position, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void unpack(std::optional<T>&data, std::vector<char>& buffer, int& position,
|
|
||||||
Opm::Parallel::MPIComm comm)
|
|
||||||
{
|
|
||||||
bool has_value;
|
|
||||||
unpack(has_value, buffer, position, comm);
|
|
||||||
if (has_value) {
|
|
||||||
T val;
|
|
||||||
unpack(val, buffer, position, comm);
|
|
||||||
data = std::optional<T>(val);
|
|
||||||
} else
|
|
||||||
data.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
||||||
Opm::Parallel::MPIComm comm)
|
Opm::Parallel::MPIComm comm)
|
||||||
@ -714,10 +677,7 @@ INSTANTIATE_PACK(std::array<int,3>)
|
|||||||
INSTANTIATE_PACK(std::array<double,4>)
|
INSTANTIATE_PACK(std::array<double,4>)
|
||||||
INSTANTIATE_PACK(std::array<double,5>)
|
INSTANTIATE_PACK(std::array<double,5>)
|
||||||
INSTANTIATE_PACK(std::map<std::pair<int,int>,std::pair<bool,double>>)
|
INSTANTIATE_PACK(std::map<std::pair<int,int>,std::pair<bool,double>>)
|
||||||
INSTANTIATE_PACK(std::optional<double>)
|
|
||||||
INSTANTIATE_PACK(std::optional<std::string>)
|
|
||||||
INSTANTIATE_PACK(std::pair<double, double>)
|
INSTANTIATE_PACK(std::pair<double, double>)
|
||||||
INSTANTIATE_PACK(std::optional<std::pair<double,double>>)
|
|
||||||
INSTANTIATE_PACK(std::map<std::string,std::vector<int>>)
|
INSTANTIATE_PACK(std::map<std::string,std::vector<int>>)
|
||||||
INSTANTIATE_PACK(std::map<std::string,std::map<std::pair<int,int>,int>>)
|
INSTANTIATE_PACK(std::map<std::string,std::map<std::pair<int,int>,int>>)
|
||||||
INSTANTIATE_PACK(std::map<std::string,int>)
|
INSTANTIATE_PACK(std::map<std::string,int>)
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include <bitset>
|
#include <bitset>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <optional>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -83,9 +82,6 @@ std::size_t packSize(const T& data, Opm::Parallel::MPIComm comm)
|
|||||||
template<class T1, class T2>
|
template<class T1, class T2>
|
||||||
std::size_t packSize(const std::pair<T1,T2>& data, Opm::Parallel::MPIComm comm);
|
std::size_t packSize(const std::pair<T1,T2>& data, Opm::Parallel::MPIComm comm);
|
||||||
|
|
||||||
template<class T>
|
|
||||||
std::size_t packSize(const std::optional<T>& data, Opm::Parallel::MPIComm comm);
|
|
||||||
|
|
||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
std::size_t packSize(const std::vector<T,A>& data, Opm::Parallel::MPIComm comm);
|
std::size_t packSize(const std::vector<T,A>& data, Opm::Parallel::MPIComm comm);
|
||||||
|
|
||||||
@ -164,10 +160,6 @@ template<class T1, class T2>
|
|||||||
void pack(const std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
|
void pack(const std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
|
||||||
Opm::Parallel::MPIComm comm);
|
Opm::Parallel::MPIComm comm);
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void pack(const std::optional<T>& data, std::vector<char>& buffer, int& position,
|
|
||||||
Opm::Parallel::MPIComm comm);
|
|
||||||
|
|
||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
void pack(const std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
void pack(const std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
||||||
Opm::Parallel::MPIComm comm);
|
Opm::Parallel::MPIComm comm);
|
||||||
@ -257,10 +249,6 @@ template<class T1, class T2>
|
|||||||
void unpack(std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
|
void unpack(std::pair<T1,T2>& data, std::vector<char>& buffer, int& position,
|
||||||
Opm::Parallel::MPIComm comm);
|
Opm::Parallel::MPIComm comm);
|
||||||
|
|
||||||
template<class T>
|
|
||||||
void unpack(std::optional<T>& data, std::vector<char>& buffer, int& position,
|
|
||||||
Opm::Parallel::MPIComm comm);
|
|
||||||
|
|
||||||
template<class T, class A>
|
template<class T, class A>
|
||||||
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
void unpack(std::vector<T,A>& data, std::vector<char>& buffer, int& position,
|
||||||
Opm::Parallel::MPIComm comm);
|
Opm::Parallel::MPIComm comm);
|
||||||
|
Loading…
Reference in New Issue
Block a user