C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | List of all members
MPI_Type Class Reference

This class is a base class of E-MicromM core package. More...

#include <MPI_Type.h>

Inheritance diagram for MPI_Type:
Inheritance graph
[legend]
Collaboration diagram for MPI_Type:
Collaboration graph
[legend]

Public Member Functions

 MPI_Type (void)
 create
 
virtual ~MPI_Type (void)
 destroy
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class
 
virtual tMemSize getContentsMemorySize () const override
 return the memory size of the included associations More...
 
template<typename T >
tBoolean createContiguousType (const tMPICount &N)
 create a MPI array type of size N More...
 
template<typename T >
tBoolean createConstantStepType (const tMPICount &N, const tMPICount &elementSize, const tMPICount &step)
 create a constant step data type More...
 
tBoolean createConstantOctetStepType (const tMPICount &nElements, const tMPICount &elementsNumber, const tMPIByte &stepInOctets, const tMPIType &oldType)
 create a constant step data type More...
 
template<typename T >
tBoolean createVariableStepType (const tMPICount &nElements, const std::valarray< tMPICount > &elementSizes, const std::valarray< tMPICount > &elementIndices)
 create a variable step data type More...
 
tBoolean createVariableOctetStepType (const tMPICount &nElements, const std::valarray< tMPICount > &elementSizes, const std::valarray< tMPIByte > &elementOctetIndices, const tMPIType &oldType)
 create a variable step data type More...
 
tBoolean createStructType (const tMPICount &nElements, const std::valarray< tMPICount > &elementSizes, const std::valarray< tMPIByte > &elementOctetIndices, const std::valarray< tMPIType > &elementTypes)
 create a structure type More...
 
const tMPIType & getType () const
 get the type More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Static Public Member Functions

template<class T >
static tMPIType GetPrimaryType ()
 get the MPI type of the template type T More...
 
static tMPIType GetPrimaryType (const tString &typeName)
 get the primary MPI type of the template type More...
 
template<typename T >
static tMPIError CreateContiguousType (const tMPICount &N, tMPIType &newType)
 create a MPI array type of size N More...
 
static tMPIError CreateContiguousType (const tMPICount &N, const tMPIType &oldType, tMPIType &newType)
 create a MPI array type of size N More...
 
template<typename T >
static tMPIError CreateConstantStepType (const tMPICount &nElements, const tMPICount &elementSize, const tMPICount &step, tMPIType &newType)
 create a constant step data type More...
 
static tMPIError CreateConstantStepType (const tMPICount &nElements, const tMPICount &elementSize, const tMPICount &step, const tMPIType &oldType, tMPIType &newType)
 create a constant step data type More...
 
static tMPIError CreateConstantOctetStepType (const tMPICount &nElements, const tMPICount &elementsNumber, const tMPIByte &stepInOctets, const tMPIType &oldType, tMPIType &newType)
 create a constant step data type More...
 
template<typename T >
static tMPIError CreateVariableStepType (const tMPICount &nElements, const std::valarray< tMPICount > &elementSizes, const std::valarray< tMPICount > &elementIndices, tMPIType &newType)
 create a variable step data type More...
 
static tMPIError CreateVariableOctetStepType (const tMPICount &nElements, const std::valarray< tMPICount > &elementSizes, const std::valarray< tMPIByte > &elementOctetIndices, const tMPIType &oldType, tMPIType &newType)
 create a variable step data type More...
 
static tMPIError CreateStructType (const tMPICount &nElements, const std::valarray< tMPICount > &elementSizes, const std::valarray< tMPIByte > &elementOctetIndices, const std::valarray< tMPIType > &elementTypes, tMPIType &newType)
 create a structure type More...
 
template<typename T , tUCInt N>
static void CreateFaceTypes (const tUCInt &dim, const std::array< tInteger, N > &Ns, std::array< MPI_Type, N > &faceTypes)
 create a face types of element element of type T More...
 
static tMPIError Resize (const tMPIType dataType, const tMPIByte &lb, const tMPIByte &extent, tMPIType &newDataType)
 resize the type More...
 
static tMPIError Register (tMPIType &type)
 register the type More...
 
static tMPIError Unregister (tMPIType &type)
 unregister the type More...
 
template<typename T >
static tMPIError GetSize (int &mpiSize)
 get the mpi size of a type in octet More...
 
static tMPIError GetSize (const tMPIType &mpiType, int &mpiSize)
 get the mpi size of a type in octets More...
 
static tMPIError GetExtent (const tMPIType &mpiType, tMPIByte &start, tMPIByte &mpiSize)
 get the mpi size (in octet) between the first element (in octet) and the last element of the mpi type may be difference with MPI_Type::GetTypeSize because it take account of holes More...
 
template<typename T >
static tMPIError GetExtent (tMPIByte &start, tMPIByte &mpiSize)
 get the mpi size (in octet) of the element including the alignment More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Additional Inherited Members

- Protected Member Functions inherited from MPI_Object
 MPI_Object (void)
 create
 
virtual ~MPI_Object (void)
 destroy
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

This class is a base class of E-MicromM core package.

Author
Stephane Despreaux
Version
1.0

Member Function Documentation

◆ createConstantOctetStepType()

tBoolean MPI_Type::createConstantOctetStepType ( const tMPICount &  nElements,
const tMPICount &  elementsNumber,
const tMPIByte &  stepInOctets,
const tMPIType &  oldType 
)
inline

create a constant step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementsNumber: number of octets within one element of new type
[in]stepInOctet: number of octets between 2 elements of new type with is not a multiple of oldType
[in]oldType: oldType
Returns
false if failed MXXMXXMXXMXXMXXMMM nElements=5 elementsSize=2 step=3*sizeof(T)

◆ CreateConstantOctetStepType()

static tMPIError MPI_Type::CreateConstantOctetStepType ( const tMPICount &  nElements,
const tMPICount &  elementsNumber,
const tMPIByte &  stepInOctets,
const tMPIType &  oldType,
tMPIType &  newType 
)
inlinestatic

create a constant step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementsNumber: number of octets within one element of new type
[in]stepInOctet: number of octets between 2 elements of new type with is not a multiple of oldType
[in]oldType: oldType
[out]newTypenew type
Returns
an error code type MXXMXXMXXMXXMXXMMM nElements=5 elementsSize=2 step=3*sizeof(T)

◆ createConstantStepType()

template<typename T >
tBoolean MPI_Type::createConstantStepType ( const tMPICount &  N,
const tMPICount &  elementSize,
const tMPICount &  step 
)
inline

create a constant step data type

Template Parameters
T: type of element
Parameters
[in]N: number of elements of new type
[in]elementSize: number of T elements within one element of new type
[in]step: number of T elements between 2 elements of new type
Returns
false if failed MXX MXX MXX MXX MXX MMM nElements=5 elementsSize=2 step=3

◆ CreateConstantStepType() [1/2]

static tMPIError MPI_Type::CreateConstantStepType ( const tMPICount &  nElements,
const tMPICount &  elementSize,
const tMPICount &  step,
const tMPIType &  oldType,
tMPIType &  newType 
)
inlinestatic

create a constant step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSize: number of oldType elements within one element of new type
[in]step: number of oldType elements between 2 elements of new type
[out]newTypenew type
Returns
an error code type MXXMXXMXXMXXMXXMMM nElements=5 elementsSize=2 step=3

◆ CreateConstantStepType() [2/2]

template<typename T >
static tMPIError MPI_Type::CreateConstantStepType ( const tMPICount &  nElements,
const tMPICount &  elementSize,
const tMPICount &  step,
tMPIType &  newType 
)
inlinestatic

create a constant step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSize: number of T elements within one element of new type
[in]step: number of T elements between 2 elements of new type
[out]newTypenew type
Returns
an error code type MXX MXX MXX MXX MXX MMM nElements=5 elementsSize=2 step=3

◆ createContiguousType()

template<typename T >
tBoolean MPI_Type::createContiguousType ( const tMPICount &  N)
inline

create a MPI array type of size N

Template Parameters
T: type of element
Parameters
[in]Nnumber of contiguous elements of type T
Returns
false if failed MXXXMMMMMMMM N=3

◆ CreateContiguousType() [1/2]

static tMPIError MPI_Type::CreateContiguousType ( const tMPICount &  N,
const tMPIType &  oldType,
tMPIType &  newType 
)
inlinestatic

create a MPI array type of size N

Parameters
[in]Nnumber of contiguous elements of type oldType
[in]oldTypeold type
[in]newTypenew type
Returns
an error code type MXXXMMMMMMMM N=3

◆ CreateContiguousType() [2/2]

template<typename T >
static tMPIError MPI_Type::CreateContiguousType ( const tMPICount &  N,
tMPIType &  newType 
)
inlinestatic

create a MPI array type of size N

Template Parameters
T: type of element
Parameters
[in]Nnumber of contiguous elements of type T
[in]newTypenew type
Returns
an error code type MXXXMMMMMMMM N=3

◆ CreateFaceTypes()

template<typename T , tUCInt N>
static void MPI_Type::CreateFaceTypes ( const tUCInt &  dim,
const std::array< tInteger, N > &  Ns,
std::array< MPI_Type, N > &  faceTypes 
)
inlinestatic

create a face types of element element of type T

Template Parameters
T: type of element
N: dimension of space
Parameters
[in]dim: dimension of each elements
[in]Nsnumber of elements per direction
[out]facesTypesreturn the face type per direction

◆ createStructType()

tBoolean MPI_Type::createStructType ( const tMPICount &  nElements,
const std::valarray< tMPICount > &  elementSizes,
const std::valarray< tMPIByte > &  elementOctetIndices,
const std::valarray< tMPIType > &  elementTypes 
)
inline

create a structure type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSizes: number of elements of old type within the i-th element of new type
[in]elementOctetIndicesnumber of octets to reach the i-th elements of new type with is not a multiple of ioldType
[in]elementTypestype of element of the i-the element of new type
Returns
false if failed

◆ CreateStructType()

static tMPIError MPI_Type::CreateStructType ( const tMPICount &  nElements,
const std::valarray< tMPICount > &  elementSizes,
const std::valarray< tMPIByte > &  elementOctetIndices,
const std::valarray< tMPIType > &  elementTypes,
tMPIType &  newType 
)
inlinestatic

create a structure type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSizes: number of elements of old type within the i-th element of new type
[in]elementOctetIndicesnumber of octets to reach the i-th elements of new type with is not a multiple of ioldType
[in]elementTypestype of element of the i-the element of new type
[out]newTypenew type
Returns
an error code type

◆ createVariableOctetStepType()

tBoolean MPI_Type::createVariableOctetStepType ( const tMPICount &  nElements,
const std::valarray< tMPICount > &  elementSizes,
const std::valarray< tMPIByte > &  elementOctetIndices,
const tMPIType &  oldType 
)
inline

create a variable step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSizes: number of elements of old type within the i-th element of new type
[in]elementOctetsIndicesnumber of octets to reach the i-th elements of new type with is not a multiple of ioldType
Returns
false if failed MXXMXXXMMMXMMXXMXXMXXMMMM 0123456789ABCDEFGHIJKLMNO
  • nElements=9
  • elementSizes={2,3,1,2,2,2} -elementIndices={0,4,A,D,G,J}

◆ CreateVariableOctetStepType()

static tMPIError MPI_Type::CreateVariableOctetStepType ( const tMPICount &  nElements,
const std::valarray< tMPICount > &  elementSizes,
const std::valarray< tMPIByte > &  elementOctetIndices,
const tMPIType &  oldType,
tMPIType &  newType 
)
inlinestatic

create a variable step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSizes: number of elements of old type within the i-th element of new type
[in]elementOctetIndicesnumber of octets to reach the i-th elements of new type with is not a multiple of ioldType
[out]newTypenew type
Returns
an error code type MXXMXXXMMMXMMXXMXXMXXMMMM 0123456789ABCDEFGHIJKLMNO
  • nElements=9
  • elementSizes={2,3,1,2,2,2} -elementIndices={0,4,A,D,G,J}

◆ createVariableStepType()

template<typename T >
tBoolean MPI_Type::createVariableStepType ( const tMPICount &  nElements,
const std::valarray< tMPICount > &  elementSizes,
const std::valarray< tMPICount > &  elementIndices 
)
inline

create a variable step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSizes: number of T elements within the i-th element of new type
[in]elementIndicesnumber of T elements to reach the i-th elements of new type
Returns
false if failed MXXMXXXMMMXMMXXMXXMXXMMMM 0123456789ABCDEFGHIJKLMNO
  • nElements=9
  • elementSizes={2,3,1,2,2,2} -elementIndices={0,4,A,D,G,J}

◆ CreateVariableStepType()

template<typename T >
static tMPIError MPI_Type::CreateVariableStepType ( const tMPICount &  nElements,
const std::valarray< tMPICount > &  elementSizes,
const std::valarray< tMPICount > &  elementIndices,
tMPIType &  newType 
)
inlinestatic

create a variable step data type

Template Parameters
T: type of element
Parameters
[in]nElements: number of elements of new type
[in]elementSizes: number of T elements within the i-th element of new type
[in]elementIndicesnumber of T elements to reach the i-th elements of new type
[out]newTypenew type
Returns
an error code type MXXMXXXMMMXMMXXMXXMXXMMMM 0123456789ABCDEFGHIJKLMNO
  • nElements=9
  • elementSizes={2,3,1,2,2,2} -elementIndices={0,4,A,D,G,J}

◆ getContentsMemorySize()

virtual tMemSize MPI_Type::getContentsMemorySize ( ) const
inlineoverridevirtual

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

◆ GetExtent() [1/2]

static tMPIError MPI_Type::GetExtent ( const tMPIType &  mpiType,
tMPIByte &  start,
tMPIByte &  mpiSize 
)
inlinestatic

get the mpi size (in octet) between the first element (in octet) and the last element of the mpi type may be difference with MPI_Type::GetTypeSize because it take account of holes

Parameters
[in]mpiTypetype MPI
[out]start: index of not empty start element in the type
[out]mpiSize: size in octets including empty elements

◆ GetExtent() [2/2]

template<typename T >
static tMPIError MPI_Type::GetExtent ( tMPIByte &  start,
tMPIByte &  mpiSize 
)
inlinestatic

get the mpi size (in octet) of the element including the alignment

Template Parameters
T: type of element
Parameters
[out]start: start of the element in type
[out]mpiSize: size in octets including empty elements

◆ GetPrimaryType() [1/2]

template<class T >
static tMPIType MPI_Type::GetPrimaryType ( )
inlinestatic

get the MPI type of the template type T

Template Parameters
T: type of element
Returns
the MPI type

◆ GetPrimaryType() [2/2]

static tMPIType MPI_Type::GetPrimaryType ( const tString &  typeName)
inlinestatic

get the primary MPI type of the template type

Parameters
[in]typeNamename of the typeT
Returns
the MPI type

◆ GetSize() [1/2]

static tMPIError MPI_Type::GetSize ( const tMPIType &  mpiType,
int &  mpiSize 
)
inlinestatic

get the mpi size of a type in octets

Parameters
[in]mpiTypetype MPI
[out]mpiSize: size in octets

◆ GetSize() [2/2]

template<typename T >
static tMPIError MPI_Type::GetSize ( int &  mpiSize)
inlinestatic

get the mpi size of a type in octet

Template Parameters
T: type of element
Parameters
[out]mpiSize: size in octets

◆ getType()

const tMPIType& MPI_Type::getType ( ) const
inline

get the type

Returns
the type associated to the class

◆ Register()

static tMPIError MPI_Type::Register ( tMPIType &  type)
inlinestatic

register the type

Parameters
[in,out]typetype to create

◆ Resize()

static tMPIError MPI_Type::Resize ( const tMPIType  dataType,
const tMPIByte &  lb,
const tMPIByte &  extent,
tMPIType &  newDataType 
)
inlinestatic

resize the type

Parameters
[in]dataTypedataType to resize
[in]lb: lower bound of the data type
[in]extentnew size in octet of the type
[out]newDataTypenew data type

The size is the same by the extent is reduced

◆ Unregister()

static tMPIError MPI_Type::Unregister ( tMPIType &  type)
inlinestatic

unregister the type

Parameters
[in,out]type: type to free

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