Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::IDataSynchronizeBuffer Class Referenceabstract

Generic buffer for data synchronization. More...

#include <arcane/impl/IDataSynchronizeBuffer.h>

Inheritance diagram for Arcane::IDataSynchronizeBuffer:
Collaboration diagram for Arcane::IDataSynchronizeBuffer:

Public Member Functions

virtual Int32 nbRank () const =0
 Number of ranks.
virtual Int32 targetRank (Int32 index) const =0
 Target rank of the index-th rank.
virtual bool hasGlobalBuffer () const =0
 Indicates if the buffers are global.
virtual MutableMemoryView globalSendBuffer ()=0
 Send buffer.
virtual MutableMemoryView globalReceiveBuffer ()=0
 Receive buffer.
virtual MutableMemoryView sendBuffer (Int32 index)=0
 Send buffer for the index-th rank.
virtual MutableMemoryView receiveBuffer (Int32 index)=0
 Receive buffer for the index-th rank.
virtual Int64 sendDisplacement (Int32 index) const =0
 Displacement (in bytes) from the start of sendBuffer() for the index-th rank.
virtual Int64 receiveDisplacement (Int32 index) const =0
 Displacement (in bytes) from the start of receiveBuffer() for the index-th rank.
virtual void copyReceiveAsync (Int32 index)=0
 Copies into the data from the receive buffer of the index-th rank.
virtual void copyAllReceive ()
 Copies all data from the receive buffer.
virtual void copySendAsync (Int32 index)=0
 Copies the data of the index-th rank into the send buffer.
virtual void copyAllSend ()
 Copies all data into the send buffer.
virtual Int64 totalSendSize () const =0
 Total size to send in bytes.
virtual Int64 totalReceiveSize () const =0
 Total size to receive in bytes.
virtual void barrier ()=0
 Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished.

Detailed Description

Generic buffer for data synchronization.

This instance contains send and receive buffers and can be used regardless of the data type of the synchronization.

Each buffer is composed of nbRank() parts and each part is associated with a recipient (sendBuffer() or receiveBuffer()).

Before using the buffers, the data values must be copied. The copySendAsync() method allows copying the data values into the send buffer and copyReceiveAsync() allows copying the receive buffer into the data.

Warning
These copyReceiveAsync() and copySendAsync() methods may be asynchronous. It is therefore important to call barrier() before using the copied data to ensure that the transfers are complete.

If hasGlobalBuffer() is true, then the buffers of each part come from a global buffer and it is possible to retrieve it via globalSendBuffer() for sending and globalReceiveBuffer() for receiving. It is also possible in this case to retrieve the displacement of each sub-part via the methods sendDisplacement() or receiveDisplacement().

Definition at line 53 of file IDataSynchronizeBuffer.h.

Member Function Documentation

◆ barrier()

virtual void Arcane::IDataSynchronizeBuffer::barrier ( )
pure virtual

Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished.

Implemented in Arcane::DataSynchronizeBufferBase.

Referenced by copyAllReceive(), and copyAllSend().

Here is the caller graph for this function:

◆ copyAllReceive()

void Arcane::IDataSynchronizeBuffer::copyAllReceive ( )
virtual

Copies all data from the receive buffer.

This call is equivalent to:

for (Int32 i = 0; i < nb_rank; ++i)
virtual void barrier()=0
Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished.
virtual void copySendAsync(Int32 index)=0
Copies the data of the index-th rank into the send buffer.
std::int32_t Int32
Signed integer type of 32 bits.

Definition at line 76 of file DataSynchronizeBuffer.cc.

References barrier(), copyReceiveAsync(), and nbRank().

Referenced by copyReceiveAsync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyAllSend()

void Arcane::IDataSynchronizeBuffer::copyAllSend ( )
virtual

Copies all data into the send buffer.

Definition at line 64 of file DataSynchronizeBuffer.cc.

References barrier(), copySendAsync(), and nbRank().

Referenced by copySendAsync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyReceiveAsync()

virtual void Arcane::IDataSynchronizeBuffer::copyReceiveAsync ( Int32 index)
pure virtual

Copies into the data from the receive buffer of the index-th rank.

Implemented in Arcane::MultiDataSynchronizeBuffer, and Arcane::SingleDataSynchronizeBuffer.

References copyAllReceive().

Referenced by copyAllReceive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copySendAsync()

virtual void Arcane::IDataSynchronizeBuffer::copySendAsync ( Int32 index)
pure virtual

Copies the data of the index-th rank into the send buffer.

This call is equivalent to:

for (Int32 i = 0; i < nb_rank; ++i)
virtual void copyReceiveAsync(Int32 index)=0
Copies into the data from the receive buffer of the index-th rank.

Implemented in Arcane::MultiDataSynchronizeBuffer, and Arcane::SingleDataSynchronizeBuffer.

References copyAllSend().

Referenced by copyAllSend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalReceiveBuffer()

virtual MutableMemoryView Arcane::IDataSynchronizeBuffer::globalReceiveBuffer ( )
pure virtual

Receive buffer.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ globalSendBuffer()

virtual MutableMemoryView Arcane::IDataSynchronizeBuffer::globalSendBuffer ( )
pure virtual

Send buffer.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ hasGlobalBuffer()

virtual bool Arcane::IDataSynchronizeBuffer::hasGlobalBuffer ( ) const
pure virtual

Indicates if the buffers are global.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ nbRank()

virtual Int32 Arcane::IDataSynchronizeBuffer::nbRank ( ) const
pure virtual

Number of ranks.

Implemented in Arcane::DataSynchronizeBufferBase.

Referenced by copyAllReceive(), and copyAllSend().

Here is the caller graph for this function:

◆ receiveBuffer()

virtual MutableMemoryView Arcane::IDataSynchronizeBuffer::receiveBuffer ( Int32 index)
pure virtual

Receive buffer for the index-th rank.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ receiveDisplacement()

virtual Int64 Arcane::IDataSynchronizeBuffer::receiveDisplacement ( Int32 index) const
pure virtual

Displacement (in bytes) from the start of receiveBuffer() for the index-th rank.

This value is only meaningful if hasGlobalBuffer() is true.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ sendBuffer()

virtual MutableMemoryView Arcane::IDataSynchronizeBuffer::sendBuffer ( Int32 index)
pure virtual

Send buffer for the index-th rank.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ sendDisplacement()

virtual Int64 Arcane::IDataSynchronizeBuffer::sendDisplacement ( Int32 index) const
pure virtual

Displacement (in bytes) from the start of sendBuffer() for the index-th rank.

This value is only meaningful if hasGlobalBuffer() is true.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ targetRank()

virtual Int32 Arcane::IDataSynchronizeBuffer::targetRank ( Int32 index) const
pure virtual

Target rank of the index-th rank.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ totalReceiveSize()

virtual Int64 Arcane::IDataSynchronizeBuffer::totalReceiveSize ( ) const
pure virtual

Total size to receive in bytes.

Implemented in Arcane::DataSynchronizeBufferBase.

◆ totalSendSize()

virtual Int64 Arcane::IDataSynchronizeBuffer::totalSendSize ( ) const
pure virtual

Total size to send in bytes.

Implemented in Arcane::DataSynchronizeBufferBase.


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