OpenM++ runtime library (libopenm)
openm::MpiPacked Class Reference

wrapper class around of MPI_Pack and MPI_Unpack More...

#include <msgMpiPacked.h>

Static Public Member Functions

template<typename TVal >
static void pack (TVal i_value, int i_packedSize, void *io_packedData, int &io_packPos)
 MPI_Pack value of primitive type into data buffer at i_packPos position. More...
 
template<typename TVal >
static TVal unpack (int i_packedSize, void *i_packedData, int &io_packPos)
 MPI_Unpack value of primitive type from data buffer at i_packPos position and return the value. More...
 
static void pack (const string &i_value, int i_packedSize, void *io_packedData, int &io_packPos)
 MPI_Pack string into data buffer at i_packPos position. More...
 
static string unpackStr (int i_packedSize, void *i_packedData, int &io_packPos)
 MPI_Unpack string from data buffer at i_packPos position and return the string. More...
 
static unique_ptr< uint8_t[]> packArray (const type_info &i_type, size_t i_size, void *i_valueArr)
 return an MPI_Pack'ed copy of source array. More...
 
static unique_ptr< uint8_t[]> packArray (size_t i_size, const string *i_valueArr)
 return an MPI_Pack'ed copy of source string array. More...
 
static void unpackArray (int i_packedSize, void *i_packedData, size_t i_size, string *io_valueArr)
 unpack MPI_Pack'ed string array from i_packedData into supplied io_valueArr. More...
 
static int packedSize (const type_info &i_type, size_t i_size)
 return MPI pack size for array of specified primitive type values. More...
 
static int packedSize (size_t i_size, const string *i_valueArr)
 return MPI pack size of string array. More...
 
static int packedSize (const type_info &i_type)
 return MPI pack size for specified primitive type. More...
 
static int packedSize (const string &i_value)
 return MPI pack size for string value. More...
 
static MPI_Datatype toMpiType (const type_info &i_type)
 return MPI type corresponding to source primitive type. More...
 

Detailed Description

wrapper class around of MPI_Pack and MPI_Unpack

Member Function Documentation

◆ pack() [1/2]

void MpiPacked::pack ( const string &  i_value,
int  i_packedSize,
void *  io_packedData,
int &  io_packPos 
)
static

MPI_Pack string into data buffer at i_packPos position.

Parameters
[in]i_valuestring to be packed
[in]i_packedSizetotal size in bytes of io_packedData buffer
[in,out]io_packedDatadestination buffer to pack MPI message
[in,out]io_packPoscurrent position in io_packedData buffer

◆ pack() [2/2]

template<typename TVal >
static void openm::MpiPacked::pack ( TVal  i_value,
int  i_packedSize,
void *  io_packedData,
int &  io_packPos 
)
inlinestatic

MPI_Pack value of primitive type into data buffer at i_packPos position.

Template Parameters
TValtype of i_value to be packed.
Parameters
[in]i_valuevalue of primitive type to be packed
[in]i_packedSizetotal size in bytes of io_packedData buffer
[in,out]io_packedDatabuffer to pack MPI message
[in,out]io_packPoscurrent position in io_packedData buffer

◆ packArray() [1/2]

unique_ptr< uint8_t[]> MpiPacked::packArray ( const type_info &  i_type,
size_t  i_size,
void *  i_valueArr 
)
static

return an MPI_Pack'ed copy of source array.

Parameters
[in]i_typevalue type
[in]i_sizesize of array
[in]i_valueArrarray of values to be packed

◆ packArray() [2/2]

unique_ptr< uint8_t[]> MpiPacked::packArray ( size_t  i_size,
const string *  i_valueArr 
)
static

return an MPI_Pack'ed copy of source string array.

Parameters
[in]i_typevalue type
[in]i_sizesize of array (row count)
[in]i_valueArrarray of strings to be packed

◆ packedSize() [1/4]

int MpiPacked::packedSize ( const string &  i_value)
static

return MPI pack size for string value.

Parameters
[in]i_valuestring to be packed

◆ packedSize() [2/4]

int MpiPacked::packedSize ( const type_info &  i_type)
static

return MPI pack size for specified primitive type.

Parameters
[in]i_typetype of value to be packed

◆ packedSize() [3/4]

int MpiPacked::packedSize ( const type_info &  i_type,
size_t  i_size 
)
static

return MPI pack size for array of specified primitive type values.

Parameters
[in]i_typevalue type
[in]i_sizesize of array

◆ packedSize() [4/4]

int MpiPacked::packedSize ( size_t  i_size,
const string *  i_valueArr 
)
static

return MPI pack size of string array.

Parameters
[in]i_typevalue type
[in]i_sizesize of array
[in]i_valueArrarray of string[i_size]

◆ toMpiType()

MPI_Datatype MpiPacked::toMpiType ( const type_info &  i_type)
static

return MPI type corresponding to source primitive type.

return MPI_Datatype corresponding to source primitive type.

Parameters
[in]i_typesource primitive type

◆ unpack()

template<typename TVal >
static TVal openm::MpiPacked::unpack ( int  i_packedSize,
void *  i_packedData,
int &  io_packPos 
)
inlinestatic

MPI_Unpack value of primitive type from data buffer at i_packPos position and return the value.

Template Parameters
TValtype of value to be unpacked.
Parameters
[in]i_packedSizetotal size in bytes of i_packedData buffer
[in]i_packedDatasource MPI message buffer to unpack
[in,out]io_packPoscurrent position in i_packedData buffer

◆ unpackArray()

void MpiPacked::unpackArray ( int  i_packedSize,
void *  i_packedData,
size_t  i_size,
string *  io_valueArr 
)
static

unpack MPI_Pack'ed string array from i_packedData into supplied io_valueArr.

Parameters
[in]i_packedSizetotal size in bytes of i_packedData buffer
[in]i_packedDatasource MPI message buffer to unpack: i_packedData[i_packedSize]
[in]i_sizesize of array (row count)
[in,out]io_valueArrsupplied array of string[i_size] to unpack results

◆ unpackStr()

string MpiPacked::unpackStr ( int  i_packedSize,
void *  i_packedData,
int &  io_packPos 
)
static

MPI_Unpack string from data buffer at i_packPos position and return the string.

Parameters
[in]i_packedSizetotal size in bytes of i_packedData buffer
[in]i_packedDatasource MPI message buffer to unpack
[in,out]io_packPoscurrent position in i_packedData buffer

The documentation for this class was generated from the following files: