Base class for the IDataSynchronizeBuffer implementation. More...
#include <arcane/impl/internal/DataSynchronizeBuffer.h>
Classes | |
| class | BufferInfo |
| Buffer for one synchronization element (send, receive, or comparison). More... | |
Public Member Functions | |
| Int32 | nbRank () const final |
| Number of ranks. | |
| Int32 | targetRank (Int32 index) const final |
| Target rank of the index-th rank. | |
| bool | hasGlobalBuffer () const final |
| Indicates if the buffers are global. | |
| MutableMemoryView | receiveBuffer (Int32 index) final |
| Receive buffer for the index-th rank. | |
| MutableMemoryView | sendBuffer (Int32 index) final |
| Send buffer for the index-th rank. | |
| Int64 | receiveDisplacement (Int32 index) const final |
| Displacement (in bytes) from the start of receiveBuffer() for the index-th rank. | |
| Int64 | sendDisplacement (Int32 index) const final |
| Displacement (in bytes) from the start of sendBuffer() for the index-th rank. | |
| MutableMemoryView | globalReceiveBuffer () final |
| Receive buffer. | |
| MutableMemoryView | globalSendBuffer () final |
| Send buffer. | |
| Int64 | totalReceiveSize () const final |
| Total size to receive in bytes. | |
| Int64 | totalSendSize () const final |
| Total size to send in bytes. | |
| void | barrier () final |
| Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished. | |
| DataSynchronizeBufferBase (DataSynchronizeInfo *sync_info, Ref< IBufferCopier > copier) | |
| bool | isCompareSynchronizedValues () const |
| Indicates whether values are compared before/after synchronization. | |
| void | setSynchronizeBuffer (Ref< MemoryBuffer > v) |
| virtual void | prepareSynchronize (bool is_compare_sync)=0 |
| Prepares the synchronization. | |
| Public Member Functions inherited from Arcane::IDataSynchronizeBuffer | |
| 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. | |
Protected Member Functions | |
| void | _allocateBuffers () |
| Calculates and allocates the buffers necessary for sends and receives for 1D variable synchronizations. | |
| void | _compute (ConstArrayView< Int32 > datatype_sizes) |
| Computes the information for the synchronization. | |
Protected Attributes | |
| DataSynchronizeInfo * | m_sync_info = nullptr |
| BufferInfo | m_ghost_buffer_info |
| Buffer for all data of ghost entities used for reception. | |
| BufferInfo | m_share_buffer_info |
| Buffer for all data of shared entities used for sending. | |
| BufferInfo | m_compare_sync_buffer_info |
| Buffer for testing if synchronization modified the values of ghost cells. | |
| Int32 | m_nb_rank = 0 |
| bool | m_is_compare_sync_values = false |
| Ref< MemoryBuffer > | m_memory |
| Buffer containing the concatenated data for sending and receiving. | |
| Ref< IBufferCopier > | m_buffer_copier |
Base class for the IDataSynchronizeBuffer implementation.
This implementation uses a single memory buffer to manage the three parts of the synchronization: the send buffer, the receive buffer, and the buffer for comparing if the synchronization modified values (the latter is optional). Each buffer is then divided into N parts, called sub-buffers, where N is the number of ranks communicating. Finally, each sub-buffer is itself divided into P parts, where P is the number of data items to communicate.
Definition at line 52 of file DataSynchronizeBuffer.h.
| Arcane::DataSynchronizeBufferBase::DataSynchronizeBufferBase | ( | DataSynchronizeInfo * | sync_info, |
| Ref< IBufferCopier > | copier ) |
Definition at line 209 of file DataSynchronizeBuffer.cc.
|
protected |
Calculates and allocates the buffers necessary for sends and receives for 1D variable synchronizations.
_compute() must be called beforehand to calculate the sizes and offsets for each buffer.
Definition at line 266 of file DataSynchronizeBuffer.cc.
References m_compare_sync_buffer_info, m_ghost_buffer_info, m_memory, m_share_buffer_info, Arcane::makeMutableMemoryView(), and Arcane::Span< T, Extent >::subspan().
Referenced by _compute(), and prepareSynchronize().
|
protected |
Computes the information for the synchronization.
Calculates and allocates the buffers necessary for sends and receives for 1D variable synchronizations.
Definition at line 241 of file DataSynchronizeBuffer.cc.
References _allocateBuffers(), m_compare_sync_buffer_info, m_ghost_buffer_info, and m_share_buffer_info.
Referenced by prepareSynchronize(), Arcane::MultiDataSynchronizeBuffer::prepareSynchronize(), and Arcane::SingleDataSynchronizeBuffer::prepareSynchronize().
|
finalvirtual |
Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 228 of file DataSynchronizeBuffer.cc.
|
inlinefinalvirtual |
Receive buffer.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 124 of file DataSynchronizeBuffer.h.
References m_ghost_buffer_info.
|
inlinefinalvirtual |
Send buffer.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 125 of file DataSynchronizeBuffer.h.
References m_share_buffer_info.
|
inlinefinalvirtual |
Indicates if the buffers are global.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 116 of file DataSynchronizeBuffer.h.
|
inline |
Indicates whether values are compared before/after synchronization.
Definition at line 139 of file DataSynchronizeBuffer.h.
References isCompareSynchronizedValues().
Referenced by isCompareSynchronizedValues().
|
inlinefinalvirtual |
Number of ranks.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 114 of file DataSynchronizeBuffer.h.
Referenced by Arcane::SingleDataSynchronizeBuffer::prepareSynchronize().
|
pure virtual |
Prepares the synchronization.
Prepares the synchronization and allocates buffers if necessary.
If is_compare_sync is true, the values of ghost entities are compared after synchronization with their value before synchronization.
setSynchronizeBuffer() must be called at least once before calling this method to position the allocated memory area.
Implemented in Arcane::MultiDataSynchronizeBuffer, and Arcane::SingleDataSynchronizeBuffer.
References _allocateBuffers(), and _compute().
|
inlinefinalvirtual |
Receive buffer for the index-th rank.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 118 of file DataSynchronizeBuffer.h.
References m_ghost_buffer_info.
|
inlinefinalvirtual |
Displacement (in bytes) from the start of receiveBuffer() for the index-th rank.
This value is only meaningful if hasGlobalBuffer() is true.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 121 of file DataSynchronizeBuffer.h.
References m_ghost_buffer_info.
|
inlinefinalvirtual |
Send buffer for the index-th rank.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 119 of file DataSynchronizeBuffer.h.
References m_share_buffer_info.
Displacement (in bytes) from the start of sendBuffer() for the index-th rank.
This value is only meaningful if hasGlobalBuffer() is true.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 122 of file DataSynchronizeBuffer.h.
References m_share_buffer_info.
|
inline |
Definition at line 141 of file DataSynchronizeBuffer.h.
Target rank of the index-th rank.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 219 of file DataSynchronizeBuffer.cc.
|
inlinefinalvirtual |
Total size to receive in bytes.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 127 of file DataSynchronizeBuffer.h.
References m_ghost_buffer_info.
|
inlinefinalvirtual |
Total size to send in bytes.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 128 of file DataSynchronizeBuffer.h.
References m_share_buffer_info.
|
protected |
Definition at line 183 of file DataSynchronizeBuffer.h.
|
protected |
Buffer for testing if synchronization modified the values of ghost cells.
Definition at line 173 of file DataSynchronizeBuffer.h.
Referenced by _allocateBuffers(), _compute(), Arcane::SingleDataSynchronizeBuffer::finalizeSynchronize(), and Arcane::SingleDataSynchronizeBuffer::prepareSynchronize().
|
protected |
Buffer for all data of ghost entities used for reception.
Definition at line 169 of file DataSynchronizeBuffer.h.
Referenced by _allocateBuffers(), _compute(), Arcane::MultiDataSynchronizeBuffer::copyReceiveAsync(), Arcane::SingleDataSynchronizeBuffer::copyReceiveAsync(), Arcane::MultiDataSynchronizeBuffer::copySendAsync(), Arcane::SingleDataSynchronizeBuffer::finalizeSynchronize(), globalReceiveBuffer(), receiveBuffer(), receiveDisplacement(), and totalReceiveSize().
|
protected |
Definition at line 178 of file DataSynchronizeBuffer.h.
|
protected |
Buffer containing the concatenated data for sending and receiving.
Definition at line 181 of file DataSynchronizeBuffer.h.
Referenced by _allocateBuffers().
|
protected |
Definition at line 177 of file DataSynchronizeBuffer.h.
|
protected |
Buffer for all data of shared entities used for sending.
Definition at line 171 of file DataSynchronizeBuffer.h.
Referenced by _allocateBuffers(), _compute(), Arcane::MultiDataSynchronizeBuffer::copySendAsync(), Arcane::SingleDataSynchronizeBuffer::copySendAsync(), globalSendBuffer(), sendBuffer(), sendDisplacement(), and totalSendSize().
|
protected |
Definition at line 167 of file DataSynchronizeBuffer.h.