mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-22 17:26:27 -06:00
Merge pull request #5598 from akva2/sca_mark_unpack_buffer_const
MPIPacker: mark buffer const in unpacker functions
This commit is contained in:
commit
ec15bad996
@ -63,7 +63,7 @@ pack(const std::bitset<Size>& data,
|
||||
template<std::size_t Size>
|
||||
void Packing<false,std::bitset<Size>>::
|
||||
unpack(std::bitset<Size>& data,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position,
|
||||
Parallel::MPIComm comm)
|
||||
{
|
||||
@ -99,7 +99,7 @@ pack(const std::string& data,
|
||||
|
||||
void Packing<false,std::string>::
|
||||
unpack(std::string& data,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position,
|
||||
Opm::Parallel::MPIComm comm)
|
||||
{
|
||||
@ -133,7 +133,7 @@ pack(const time_point& data,
|
||||
|
||||
void Packing<false,time_point>::
|
||||
unpack(time_point& data,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position,
|
||||
Parallel::MPIComm comm)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ struct Packing
|
||||
{
|
||||
static std::size_t packSize(const T&, Parallel::MPIComm);
|
||||
static void pack(const T&, std::vector<char>&, std::size_t&, Parallel::MPIComm);
|
||||
static void unpack(T&, std::vector<char>&, std::size_t&, Parallel::MPIComm);
|
||||
static void unpack(T&, const std::vector<char>&, std::size_t&, Parallel::MPIComm);
|
||||
};
|
||||
|
||||
//! \brief Packaging for pod data.
|
||||
@ -109,7 +109,7 @@ struct Packing<true,T>
|
||||
//! \param position Position in buffer to use
|
||||
//! \param comm The communicator to use
|
||||
static void unpack(T& data,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position,
|
||||
Parallel::MPIComm comm)
|
||||
{
|
||||
@ -124,7 +124,7 @@ struct Packing<true,T>
|
||||
//! \param comm The communicator to use
|
||||
static void unpack(T* data,
|
||||
std::size_t n,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position,
|
||||
Parallel::MPIComm comm)
|
||||
{
|
||||
@ -151,7 +151,7 @@ struct Packing<false,T>
|
||||
static_assert(!std::is_same_v<T,T>, "Packing not supported for type");
|
||||
}
|
||||
|
||||
static void unpack(T&, std::vector<char>&, std::size_t&,
|
||||
static void unpack(T&, const std::vector<char>&, std::size_t&,
|
||||
Parallel::MPIComm)
|
||||
{
|
||||
static_assert(!std::is_same_v<T,T>, "Packing not supported for type");
|
||||
@ -164,7 +164,8 @@ struct Packing<false,std::bitset<Size>>
|
||||
{
|
||||
static std::size_t packSize(const std::bitset<Size>&, Opm::Parallel::MPIComm);
|
||||
static void pack(const std::bitset<Size>&, std::vector<char>&, std::size_t&, Opm::Parallel::MPIComm);
|
||||
static void unpack(std::bitset<Size>&, std::vector<char>&, std::size_t&, Opm::Parallel::MPIComm);
|
||||
static void unpack(std::bitset<Size>&, const std::vector<char>&,
|
||||
std::size_t&, Opm::Parallel::MPIComm);
|
||||
};
|
||||
|
||||
#define ADD_PACK_SPECIALIZATION(T) \
|
||||
@ -173,7 +174,7 @@ struct Packing<false,std::bitset<Size>>
|
||||
{ \
|
||||
static std::size_t packSize(const T&, Parallel::MPIComm); \
|
||||
static void pack(const T&, std::vector<char>&, std::size_t&, Parallel::MPIComm); \
|
||||
static void unpack(T&, std::vector<char>&, std::size_t&, Parallel::MPIComm); \
|
||||
static void unpack(T&, const std::vector<char>&, std::size_t&, Parallel::MPIComm); \
|
||||
};
|
||||
|
||||
ADD_PACK_SPECIALIZATION(std::string)
|
||||
@ -248,7 +249,7 @@ struct Packer
|
||||
//! \param position Position in buffer to use
|
||||
template<class T>
|
||||
void unpack(T& data,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position) const
|
||||
{
|
||||
detail::Packing<std::is_pod_v<T>,T>::unpack(data, buffer, position, m_comm);
|
||||
@ -263,7 +264,7 @@ struct Packer
|
||||
template<class T>
|
||||
void unpack(T* data,
|
||||
std::size_t n,
|
||||
std::vector<char>& buffer,
|
||||
const std::vector<char>& buffer,
|
||||
std::size_t& position) const
|
||||
{
|
||||
static_assert(std::is_pod_v<T>, "Array packing not supported for non-pod data");
|
||||
|
@ -41,7 +41,7 @@ pack(const boost::gregorian::date& data,
|
||||
|
||||
void Packing<false,boost::gregorian::date>::
|
||||
unpack(boost::gregorian::date& data,
|
||||
std::vector<char>& buffer, std::size_t& position)
|
||||
const std::vector<char>& buffer, std::size_t& position)
|
||||
{
|
||||
std::string date;
|
||||
Packing<false,std::string>::unpack(date, buffer, position);
|
||||
|
@ -38,7 +38,7 @@ struct Packing<false,boost::gregorian::date>
|
||||
std::vector<char>& buffer, std::size_t& position);
|
||||
|
||||
static void unpack(boost::gregorian::date& data,
|
||||
std::vector<char>& buffer, std::size_t& position);
|
||||
const std::vector<char>& buffer, std::size_t& position);
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user