C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
MPI_CoreToCoreMessage< T > Class Template Referenceabstract

This class is a interface class to send / receive message with primitive type T from one to core to one core. More...

#include <MPI_CoreToCoreMessage.h>

Inheritance diagram for MPI_CoreToCoreMessage< T >:
Inheritance graph
[legend]
Collaboration diagram for MPI_CoreToCoreMessage< T >:
Collaboration graph
[legend]

Public Member Functions

virtual tMemSize getMemorySize () const override
 return the memory size of the class
 
virtual tMemSize getContentsMemorySize () const override
 return nthe memory size of the included associations More...
 
virtual void send (const MPI_Environment &env, const tMPICoreId &dstCore, const std::valarray< T > &data, const tMPITag &tag)=0
 sending a data with flag to dstCore More...
 
virtual void send (const MPI_Environment &env, const tMPICoreId &dstCore, const T *data, const tMPICount &nData, const tMPIType &dataType, const tMPITag &tag)=0
 blocking send a data with tag to dstCore More...
 
virtual void receive (const MPI_Environment &env, const tMPICoreId &srcCore, std::valarray< T > &data, const tMPITag &tag)=0
 receiving a data with flag to dstCore More...
 
virtual void receive (const MPI_Environment &env, const tMPICoreId &dstCore, T *buffer, const tMPICount &nData, const tMPIType &dataType, const tMPITag &tag)=0
 blocking send a data with tag to dstCore More...
 
virtual void sendNReceive (const MPI_Environment &env, const tMPICoreId &dstCore, const tMPICoreId &srcCore, const T &sentData, const tMPITag &sentTag, T &receivedData, const tMPITag &receivedTag)=0
 receiving a data with flag to dstCore More...
 
virtual void sendNReceive (const MPI_Environment &env, const tMPICoreId &dstCore, const tMPICoreId &srcCore, const std::valarray< T > &sentData, const tMPITag &sentTag, std::valarray< T > &receivedData, const tMPITag &receivedTag)=0
 receiving a data with flag to dstCore More...
 
virtual void sendNReceive (const MPI_Environment &env, const tMPICoreId &dstCore, const tMPICoreId &srcCore, const T *sentData, const tMPICount &nSentData, const tMPIType &sentDataType, const tMPITag &sentTag, T *receivedData, const tMPICount &nReceivedData, const tMPIType &receivedDataType, const tMPITag &receivedTag)=0
 receiving a data with flag to dstCore More...
 
virtual void exchange (const MPI_Environment &env, const tMPICoreId &srcCore, std::valarray< T > &data, const tMPITag &tag)=0
 receiving a data with flag to dstCore More...
 
virtual void getElementsNumber (tMPICount &nElements)=0
 get the number of element of the message More...
 
virtual int wait ()=0
 wait the end of the message communications
 
virtual tBoolean isFinished ()=0
 test if the message communication is finished
 
- 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 tULLInt WaitAllMessages (const std::vector< CORE_UniquePointer< MPI_CoreToCoreMessage< T >>> &messages)
 wait for the end of communication of all messages 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_CoreToCoreMessage ()
 create
 
virtual ~MPI_CoreToCoreMessage (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

template<typename T>
class MPI_CoreToCoreMessage< T >

This class is a interface class to send / receive message with primitive type T from one to core to one core.

Template Parameters
T: type of message to exchange
Author
Stephane Despreaux
Version
2.0

Member Function Documentation

◆ exchange()

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::exchange ( const MPI_Environment env,
const tMPICoreId &  srcCore,
std::valarray< T > &  data,
const tMPITag &  tag 
)
pure virtual

receiving a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]srcCoreid of the source core
[in]datadata to receive
[in]taftagof the data

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ getContentsMemorySize()

template<typename T >
virtual tMemSize MPI_CoreToCoreMessage< T >::getContentsMemorySize ( ) const
inlineoverridevirtual

return nthe 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.

Reimplemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ getElementsNumber()

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::getElementsNumber ( tMPICount &  nElements)
pure virtual

get the number of element of the message

Parameters
[out]nElements: number of elemet of type T

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ receive() [1/2]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::receive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
T *  buffer,
const tMPICount &  nData,
const tMPIType &  dataType,
const tMPITag &  tag 
)
pure virtual

blocking send a data with tag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the destination core
[in]bufferadress of the buffet to receive data
[in]nDatanumber of dataType to receive
[in]dataTypedata type
[in]tagtag of the data

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ receive() [2/2]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::receive ( const MPI_Environment env,
const tMPICoreId &  srcCore,
std::valarray< T > &  data,
const tMPITag &  tag 
)
pure virtual

receiving a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]srcCoreid of the source core
[in]datadata to receive
[in]tagtag of the data

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ send() [1/2]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::send ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const std::valarray< T > &  data,
const tMPITag &  tag 
)
pure virtual

sending a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the destination core
[in]datadata to send
[in]tag: tag of the sending message

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ send() [2/2]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::send ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const T *  data,
const tMPICount &  nData,
const tMPIType &  dataType,
const tMPITag &  tag 
)
pure virtual

blocking send a data with tag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the destination core
[in]buffer: buffer of the data
[in]nDatanumber of data of type dataType to send
[in]tagtag of the data

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ sendNReceive() [1/3]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::sendNReceive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const tMPICoreId &  srcCore,
const std::valarray< T > &  sentData,
const tMPITag &  sentTag,
std::valarray< T > &  receivedData,
const tMPITag &  receivedTag 
)
pure virtual

receiving a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the dst Core of the sent data
[in]srcCoreid of the src Core of the received data
[in]sentDatadata to sent
[in]sentTagtag of thesent message
[in]receivedDatadata to receive
[in]receiveTagtag of the received message

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ sendNReceive() [2/3]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::sendNReceive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const tMPICoreId &  srcCore,
const T &  sentData,
const tMPITag &  sentTag,
T &  receivedData,
const tMPITag &  receivedTag 
)
pure virtual

receiving a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the dst Core of the sent data
[in]srcCoreid of the src Core of the received data
[in]sentDatadata to sent
[in]sentTagtag of thesent message
[in]receivedDatadata to receive
[in]receivedTagtag of the received message

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ sendNReceive() [3/3]

template<typename T >
virtual void MPI_CoreToCoreMessage< T >::sendNReceive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const tMPICoreId &  srcCore,
const T *  sentData,
const tMPICount &  nSentData,
const tMPIType &  sentDataType,
const tMPITag &  sentTag,
T *  receivedData,
const tMPICount &  nReceivedData,
const tMPIType &  receivedDataType,
const tMPITag &  receivedTag 
)
pure virtual

receiving a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the dst core to the sent data from current core
[in]srcCoreid of the src core from the received data to current core
[in]sentDatadata to sent
[in]nSentDatanumber of data to sent
[in]sentDataTypetype of data to sent
[in]sentTagtag of thesent message
[in]receivedDatadata to receive
[in]nReceivedDatanumber of data to receive
[in]receivedDataTypetype of data to receive
[in]receivedTagtag of the received message

Implemented in MPI_CoreToCoreWMessage< T >, and MPI_CoreToCoreIMessage< T >.

◆ WaitAllMessages()

template<typename T >
static tULLInt MPI_CoreToCoreMessage< T >::WaitAllMessages ( const std::vector< CORE_UniquePointer< MPI_CoreToCoreMessage< T >>> &  messages)
inlinestatic

wait for the end of communication of all messages

Parameters
[in]messages: list of messages
Returns
the cpu time of waiting in seconds

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