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

This class describes a message status & request. More...

#include <MPI_MessageData.h>

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

Public Member Functions

virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual tMemSize getContentsMemorySize () const
 return the memory size of the included associations More...
 
void clear ()
 clear the data of the message
 
void update (const MPI_Environment &env, const tMPICoreId &sourceCore, const tMPITag &tag)
 update the data of the message More...
 
void update (const MPI_Environment &env, const tMPITag &tag)
 update the data of the message More...
 
void update (const MPI_Environment &env)
 update the data of the message More...
 
tMPIRequest & request ()
 return the request of the message
 
tBoolean isAvaliable () const
 return if the mesage is valiable
 
tMPICoreId getSourceCore () const
 get the source core of the mesasage
 
tMPICoreId getTag () const
 get the tag of the message
 
template<typename T >
tBoolean getCount (tMPICount &nElements)
 get the number of elements of the message More...
 
tBoolean isFinished ()
 return true if the message has been received
 
const tBoolean & isUsed ()
 return true if the message is obsolete
 
void setIsUsed (const tBoolean &b)
 turn the message into obsolete state More...
 
tBoolean wait ()
 wait for the message is received
 
- 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

static CORE_UniquePointer< MPI_MessageDataNew ()
 create an unique instance of the class This More...
 
static void WaitAll (std::valarray< MPI_MessageData > &messages)
 wait for all the messages are received 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...
 

Protected Member Functions

 MPI_MessageData ()
 create a root environment
 
virtual ~MPI_MessageData (void)
 destroy
 
- 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 describes a message status & request.

Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ getContentsMemorySize()

virtual tMemSize MPI_MessageData::getContentsMemorySize ( ) const
inlinevirtual

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.

◆ getCount()

template<typename T >
tBoolean MPI_MessageData::getCount ( tMPICount &  nElements)
inline

get the number of elements of the message

Template Parameters
T: type of the leemnt of the message
Parameters
[out]nElementsnumber of elements of the message

◆ getMemorySize()

virtual tMemSize MPI_MessageData::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Object.

◆ New()

static CORE_UniquePointer<MPI_MessageData> MPI_MessageData::New ( )
inlinestatic

create an unique instance of the class This

Returns
a new unique instance of the class This

◆ setIsUsed()

void MPI_MessageData::setIsUsed ( const tBoolean &  b)
inline

turn the message into obsolete state

Parameters
[in]b: obsolete state

◆ update() [1/3]

void MPI_MessageData::update ( const MPI_Environment env)
inline

update the data of the message

Parameters
[in]envenvironment of the core to communicate

◆ update() [2/3]

void MPI_MessageData::update ( const MPI_Environment env,
const tMPICoreId &  sourceCore,
const tMPITag &  tag 
)
inline

update the data of the message

Parameters
[in]envenvironment of the core to communicate
[n]sourceCore: source core of the message
[in]tag: tag of the message

◆ update() [3/3]

void MPI_MessageData::update ( const MPI_Environment env,
const tMPITag &  tag 
)
inline

update the data of the message

Parameters
[in]envenvironment of the core to communicate
[in]tag: tag of the message

◆ WaitAll()

static void MPI_MessageData::WaitAll ( std::valarray< MPI_MessageData > &  messages)
inlinestatic

wait for all the messages are received

Parameters
[out]messages: messages to commnicate

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