Opm::Mpi::Packer Struct Reference

Struct handling packing of serialization for MPI communication. More...

#include <MPIPacker.hpp>

Public Member Functions

 Packer (Parallel::Communication comm)
 Constructor. More...
 
template<class T >
std::size_t packSize (const T &data) const
 Calculates the pack size for a variable. More...
 
template<class T >
std::size_t packSize (const T *data, std::size_t n) const
 Calculates the pack size for an array. More...
 
template<class T >
void pack (const T &data, std::vector< char > &buffer, int &position) const
 Pack a variable. More...
 
template<class T >
void pack (const T *data, std::size_t n, std::vector< char > &buffer, int &position) const
 Pack an array. More...
 
template<class T >
void unpack (T &data, std::vector< char > &buffer, int &position) const
 Unpack a variable. More...
 
template<class T >
void unpack (T *data, std::size_t n, std::vector< char > &buffer, int &position) const
 Unpack an array. More...
 

Detailed Description

Struct handling packing of serialization for MPI communication.

Constructor & Destructor Documentation

◆ Packer()

Opm::Mpi::Packer::Packer ( Parallel::Communication  comm)
inline

Constructor.

Parameters
commThe communicator to use

Member Function Documentation

◆ pack() [1/2]

template<class T >
void Opm::Mpi::Packer::pack ( const T &  data,
std::vector< char > &  buffer,
int &  position 
) const
inline

Pack a variable.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe variable to pack
bufferBuffer to pack into
positionPosition in buffer to use

References pack().

Referenced by pack().

◆ pack() [2/2]

template<class T >
void Opm::Mpi::Packer::pack ( const T *  data,
std::size_t  n,
std::vector< char > &  buffer,
int &  position 
) const
inline

Pack an array.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe array to pack
nLength of array
bufferBuffer to pack into
positionPosition in buffer to use

References Opm::Mpi::detail::Packing< pod, T >::pack().

◆ packSize() [1/2]

template<class T >
std::size_t Opm::Mpi::Packer::packSize ( const T &  data) const
inline

Calculates the pack size for a variable.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe data to pack

References packSize().

Referenced by packSize().

◆ packSize() [2/2]

template<class T >
std::size_t Opm::Mpi::Packer::packSize ( const T *  data,
std::size_t  n 
) const
inline

Calculates the pack size for an array.

Template Parameters
TThe type of the data to be packed
Parameters
dataThe array to pack
nLength of array

References Opm::Mpi::detail::Packing< pod, T >::packSize().

◆ unpack() [1/2]

template<class T >
void Opm::Mpi::Packer::unpack ( T &  data,
std::vector< char > &  buffer,
int &  position 
) const
inline

Unpack a variable.

Template Parameters
TThe type of the data to be unpacked
Parameters
dataThe variable to unpack
bufferBuffer to unpack from
positionPosition in buffer to use

References unpack().

Referenced by unpack().

◆ unpack() [2/2]

template<class T >
void Opm::Mpi::Packer::unpack ( T *  data,
std::size_t  n,
std::vector< char > &  buffer,
int &  position 
) const
inline

Unpack an array.

Template Parameters
TThe type of the data to be unpacked
Parameters
dataThe array to unpack
nLength of array
bufferBuffer to unpack from
positionPosition in buffer to use

References Opm::Mpi::detail::Packing< pod, T >::unpack().


The documentation for this struct was generated from the following file: