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

This class is a class to send / receive unblocking message from one to core to one core. More...

#include <MPI_CoreToCoreIMessage.h>

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

Public Member Functions

 MPI_CoreToCoreIMessage ()
 create
 
virtual ~MPI_CoreToCoreIMessage (void)
 destroy
 
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) override
 none blocking of 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) override
 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) override
 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) override
 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) override
 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) override
 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) override
 receiving a data with flag to dstCore More...
 
virtual void exchange (const MPI_Environment &env, const tMPICoreId &dstCore, std::valarray< T > &data, const tMPITag &tag) override
 receiving a data with flag to dstCore More...
 
virtual int wait () override
 wait the end of the message
 
virtual void getElementsNumber (tMPICount &nElements) override
 get the number of element of the message More...
 
virtual tBoolean isFinished () override
 return true if the communication is finihed
 
- 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< SelfClassNew ()
 create an unique instance of the class This More...
 
static void Send (const MPI_Environment &env, const tMPICoreId &dstCore, const T &data, const tMPITag &tag, tMPIRequest &request)
 none blocking of sending a data with flag to dstCore More...
 
static void Send (const MPI_Environment &env, const tMPICoreId &dstCore, const T *data, const tMPICount &nData, const tMPITag &tag, tMPIRequest &request)
 none blocking of sending a data with flag to dstCore More...
 
static void Send (const MPI_Environment &env, const tMPICoreId &dstCore, const std::valarray< T > &data, const tMPITag &tag, tMPIRequest &request)
 none blocking of sending a data with flag to dstCore More...
 
static void Send (const MPI_Environment &env, const tMPICoreId &dstCore, const T *data, const tMPICount &nData, const tMPIType &dataType, const tMPITag &tag, tMPIRequest &request)
 blocking send a data with tag to dstCore More...
 
static tBoolean Receive (const MPI_Environment &env, const tMPICoreId &srcCore, T &data, const tMPITag &tag, tMPIRequest &request)
 blocking receive a data with tag from source core More...
 
static tBoolean Receive (const MPI_Environment &env, const tMPICoreId &srcCore, std::valarray< T > &data, const tMPITag &tag, tMPIRequest &request)
 receive a data with tag from source core More...
 
static void Receive (const MPI_Environment &env, const tMPICoreId &srcCore, T *buffer, const tMPICount &nData, const tMPITag &tag, tMPIRequest &request)
 blocking receive a data with tag from srcCore More...
 
static void Receive (const MPI_Environment &env, const tMPICoreId &dstCore, T *buffer, const tMPICount &nData, const tMPIType &dataType, const tMPITag &tag, tMPIRequest &request)
 blocking send a data with tag to dstCore More...
 
static void SendNReceive (const MPI_Environment &env, const tMPICoreId &dstCore, const tMPICoreId &srcCore, const T &sentData, const tMPITag &sentTag, T &receivedData, const tMPITag &receivedTag, tMPIRequest requests[2])
 blocking swapping a data with tag to dst Core and receive a data from src core More...
 
static void SendNReceive (const MPI_Environment &env, const tMPICoreId &dstCore, const T *sentData, const int &nSentData, const tMPITag &sentTag, T *receivedData, const int &nReceivedData, const tMPITag &receivedTag, tMPIRequest requests[2])
 blocking swapping a data with tag to dst Core and receive a data from src core More...
 
static 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, tMPIRequest requests[2])
 blocking swapping a data with tag to dst Core and receive a data from src core More...
 
static 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, tMPIRequest requests[2])
 receiving a data with flag to dstCore More...
 
static void SendNReceive (const MPI_Environment &env, const tMPICoreId &dstCore, const T *sentData, const tMPICount &nSentData, const tMPIType &sentDataType, const tMPITag &sentTag, T *receivedData, const tMPICount &nReceivedData, const tMPIType &receivedDataType, const tMPITag &receivedTag, tMPIRequest requests[2])
 receiving a data with flag to dstCore More...
 
- Static Public Member Functions inherited from MPI_CoreToCoreMessage< T >
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...
 

Additional Inherited Members

- Protected Member Functions inherited from MPI_CoreToCoreMessage< T >
 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_CoreToCoreIMessage< T >

This class is a class to send / receive unblocking message from one to core to one core.

Template Parameters
T: type of message to exchange

Member Function Documentation

◆ exchange()

template<typename T >
virtual void MPI_CoreToCoreIMessage< T >::exchange ( const MPI_Environment env,
const tMPICoreId &  dstCore,
std::valarray< T > &  data,
const tMPITag &  tag 
)
inlineoverridevirtual

receiving a data with flag to dstCore

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

Implements MPI_CoreToCoreMessage< T >.

◆ getContentsMemorySize()

template<typename T >
virtual tMemSize MPI_CoreToCoreIMessage< 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 MPI_CoreToCoreMessage< T >.

◆ getElementsNumber()

template<typename T >
virtual void MPI_CoreToCoreIMessage< T >::getElementsNumber ( tMPICount &  nElements)
inlineoverridevirtual

get the number of element of the message

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

Implements MPI_CoreToCoreMessage< T >.

◆ New()

template<typename T >
static CORE_UniquePointer<SelfClass> MPI_CoreToCoreIMessage< T >::New ( )
inlinestatic

create an unique instance of the class This

Returns
a new unique instance of the class This

◆ receive() [1/2]

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

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

Implements MPI_CoreToCoreMessage< T >.

◆ Receive() [1/4]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::Receive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
T *  buffer,
const tMPICount &  nData,
const tMPIType &  dataType,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

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
[out]request: request to get the status of the message

◆ receive() [2/2]

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

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]tag: tag of the data

Implements MPI_CoreToCoreMessage< T >.

◆ Receive() [2/4]

template<typename T >
static tBoolean MPI_CoreToCoreIMessage< T >::Receive ( const MPI_Environment env,
const tMPICoreId &  srcCore,
std::valarray< T > &  data,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

receive a data with tag from source core

Parameters
[in]envenvironment of the source Core
[in]srcCoreid of the source core
[out]datadata to receive
[in]tagtag of the data
[out]request: request of the communication to get status

◆ Receive() [3/4]

template<typename T >
static tBoolean MPI_CoreToCoreIMessage< T >::Receive ( const MPI_Environment env,
const tMPICoreId &  srcCore,
T &  data,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

blocking receive a data with tag from source core

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

◆ Receive() [4/4]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::Receive ( const MPI_Environment env,
const tMPICoreId &  srcCore,
T *  buffer,
const tMPICount &  nData,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

blocking receive a data with tag from srcCore

Parameters
[in]envenvironment of the source Core
[in]srcCoreid of the source core
[out]buffer: adress of the buffer to resize ndata of size(T)
[in]nDatanumber of data of type T to receive
[in]tagtag of the data
[out]requestrequest to get the status of the message

◆ send() [1/2]

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

none blocking of 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]nDatanumber of data of type T to send
[in]flagflag of the data

Implements MPI_CoreToCoreMessage< T >.

◆ Send() [1/4]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::Send ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const std::valarray< T > &  data,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

none blocking of 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]tagtag of the message
[out]request: request of the message

◆ Send() [2/4]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::Send ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const T &  data,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

none blocking of 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]nDatanumber of data to send
[in]tagtagof the message
[out]request: request of the message

◆ Send() [3/4]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::Send ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const T *  data,
const tMPICount &  nData,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

none blocking of 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]nDatanumber of data of type T to send
[in]tagtagof the message
[out]request: request of the message

◆ send() [2/2]

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

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

Implements MPI_CoreToCoreMessage< T >.

◆ Send() [4/4]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::Send ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const T *  data,
const tMPICount &  nData,
const tMPIType &  dataType,
const tMPITag &  tag,
tMPIRequest &  request 
)
inlinestatic

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

◆ SendNReceive() [1/5]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::SendNReceive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const T *  sentData,
const int &  nSentData,
const tMPITag &  sentTag,
T *  receivedData,
const int &  nReceivedData,
const tMPITag &  receivedTag,
tMPIRequest  requests[2] 
)
inlinestatic

blocking swapping a data with tag to dst Core and receive a data from src core

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the destination/source core of the send/received data from/to current core
[in]sentDatadata to send
[in]nSentDatanumber of data to send
[in]sentTagtag of the data
[in]receivedDatadata to send
[in]nReceivedDatanumber of data to send
[in]receivedTagtag of the data
[out]requests: requests of the status of the messages

◆ SendNReceive() [2/5]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::SendNReceive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const T *  sentData,
const tMPICount &  nSentData,
const tMPIType &  sentDataType,
const tMPITag &  sentTag,
T *  receivedData,
const tMPICount &  nReceivedData,
const tMPIType &  receivedDataType,
const tMPITag &  receivedTag,
tMPIRequest  requests[2] 
)
inlinestatic

receiving a data with flag to dstCore

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the dst/src core to/from the sent/received data from/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
[out]requests: requests for getting the status of the messages

◆ sendNReceive() [1/3]

template<typename T >
virtual void MPI_CoreToCoreIMessage< 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 
)
inlineoverridevirtual

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

Implements MPI_CoreToCoreMessage< T >.

◆ SendNReceive() [3/5]

template<typename T >
static void MPI_CoreToCoreIMessage< 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,
tMPIRequest  requests[2] 
)
inlinestatic

blocking swapping a data with tag to dst Core and receive a data from src core

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the destination/source core of the send/received data from/to current core
[in]sentDatadata to send
[in]nSentDatanumber of data to send
[in]sentTagtag of the data
[in]receivedDatadata to send
[in]nReceivedDatanumber of data to send
[in]receivedTagtag of the data
[out]requests: requests of the status of the messages

◆ sendNReceive() [2/3]

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

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

Implements MPI_CoreToCoreMessage< T >.

◆ SendNReceive() [4/5]

template<typename T >
static void MPI_CoreToCoreIMessage< T >::SendNReceive ( const MPI_Environment env,
const tMPICoreId &  dstCore,
const tMPICoreId &  srcCore,
const T &  sentData,
const tMPITag &  sentTag,
T &  receivedData,
const tMPITag &  receivedTag,
tMPIRequest  requests[2] 
)
inlinestatic

blocking swapping a data with tag to dst Core and receive a data from src core

Parameters
[in]envenvironment of the destination Core
[in]dstCoreid of the destination core of the send data from current core
[in]srcCoreid of the source core of the received data to current core
[in]sentDatadata to send
[in]sentTagtag of the data
[in]receivedDatadata to send
[in]receivedTagtag of the data
[out]requests: requests of the status of the messages

◆ sendNReceive() [3/3]

template<typename T >
virtual void MPI_CoreToCoreIMessage< 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 
)
inlineoverridevirtual

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

Implements MPI_CoreToCoreMessage< T >.

◆ SendNReceive() [5/5]

template<typename T >
static void MPI_CoreToCoreIMessage< 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,
tMPIRequest  requests[2] 
)
inlinestatic

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]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
[out]requests: requests for getting the status of the message

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