IDataSynchronizeBuffer implementation for a single data item. More...
#include <arcane/impl/internal/DataSynchronizeBuffer.h>
Public Member Functions | |
| SingleDataSynchronizeBuffer (ITraceMng *tm, DataSynchronizeInfo *sync_info, Ref< IBufferCopier > copier) | |
| void | copyReceiveAsync (Int32 index) final |
| Copies into the data from the receive buffer of the index-th rank. | |
| void | copySendAsync (Int32 index) final |
| Copies the data of the index-th rank into the send buffer. | |
| void | setDataView (MutableMemoryView v) |
| MutableMemoryView | dataView () |
| Memory area containing the values of the data to be synchronized. | |
| void | prepareSynchronize (bool is_compare_sync) override |
| Prepares the synchronization. | |
| DataSynchronizeResult | finalizeSynchronize () |
| Finalizes the synchronization. | |
| Public Member Functions inherited from Arcane::TraceAccessor | |
| TraceAccessor (ITraceMng *m) | |
| Constructs an accessor via the trace manager m. | |
| TraceAccessor (const TraceAccessor &rhs) | |
| Copy constructor. | |
| TraceAccessor & | operator= (const TraceAccessor &rhs) |
| Copy assignment operator. | |
| virtual | ~TraceAccessor () |
| Frees resources. | |
| ITraceMng * | traceMng () const |
| Trace manager. | |
| TraceMessage | info () const |
| Flow for an information message. | |
| TraceMessage | pinfo () const |
| Flow for a parallel information message. | |
| TraceMessage | info (char category) const |
| Flow for an information message of a given category. | |
| TraceMessage | pinfo (char category) const |
| Flow for a parallel information message of a given category. | |
| TraceMessage | info (bool v) const |
| Flow for an information message. | |
| TraceMessage | warning () const |
| Flow for a warning message. | |
| TraceMessage | pwarning () const |
| TraceMessage | error () const |
| Flow for an error message. | |
| TraceMessage | perror () const |
| TraceMessage | log () const |
| Flow for a log message. | |
| TraceMessage | plog () const |
| Flow for a log message. | |
| TraceMessage | logdate () const |
| Flow for a log message preceded by the date. | |
| TraceMessage | fatal () const |
| Flow for a fatal error message. | |
| TraceMessage | pfatal () const |
| Flow for a parallel fatal error message. | |
| TraceMessageDbg | debug (Trace::eDebugLevel=Trace::Medium) const |
| Flow for a debug message. | |
| Trace::eDebugLevel | configDbgLevel () const |
| Debug level of the configuration file. | |
| TraceMessage | info (Int32 verbose_level) const |
| Flow for an information message of a given level. | |
| TraceMessage | linfo () const |
| Flow for an information message with the local information level of this instance. | |
| TraceMessage | linfo (Int32 relative_level) const |
| Flow for an information message with the local information level of this instance. | |
| void | fatalMessage (const StandaloneTraceMessage &o) const |
| Public Member Functions inherited from Arcane::DataSynchronizeBufferBase | |
| 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) |
| Public Member Functions inherited from Arcane::IDataSynchronizeBuffer | |
| virtual void | copyAllReceive () |
| Copies all data from the receive buffer. | |
| virtual void | copyAllSend () |
| Copies all data into the send buffer. | |
Private Attributes | |
| MutableMemoryView | m_data_view |
| View onto the data variable. | |
| FixedArray< Int32, 1 > | m_datatype_sizes |
| Array containing the sizes of the data types. | |
Additional Inherited Members | |
| Protected Member Functions inherited from Arcane::TraceAccessor | |
| void | _setLocalVerboseLevel (Int32 v) |
| Int32 | _localVerboseLevel () const |
| Protected Member Functions inherited from Arcane::DataSynchronizeBufferBase | |
| 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 inherited from Arcane::DataSynchronizeBufferBase | |
| 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 |
IDataSynchronizeBuffer implementation for a single data item.
Definition at line 192 of file DataSynchronizeBuffer.h.
|
inline |
Definition at line 198 of file DataSynchronizeBuffer.h.
|
finalvirtual |
Copies into the data from the receive buffer of the index-th rank.
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 298 of file DataSynchronizeBuffer.cc.
References dataView(), and Arcane::DataSynchronizeBufferBase::m_ghost_buffer_info.
|
finalvirtual |
Copies the data of the index-th rank into the send buffer.
This call is equivalent to:
Implements Arcane::IDataSynchronizeBuffer.
Definition at line 313 of file DataSynchronizeBuffer.cc.
References dataView(), and Arcane::DataSynchronizeBufferBase::m_share_buffer_info.
|
inline |
Memory area containing the values of the data to be synchronized.
Definition at line 216 of file DataSynchronizeBuffer.h.
References m_data_view.
Referenced by copyReceiveAsync(), copySendAsync(), and prepareSynchronize().
| DataSynchronizeResult Arcane::SingleDataSynchronizeBuffer::finalizeSynchronize | ( | ) |
Finalizes the synchronization.
Compares the values before/after synchronization.
It is enough to compare bit by bit the receive buffer with the one containing the values before synchronization (m_check_sync_buffer).
a true if there are differences.
Definition at line 359 of file DataSynchronizeBuffer.cc.
References ARCANE_FATAL, Arcane::ConstMemoryView::bytes(), Arcane::SpanImpl< T, SizeType, Extent >::data(), Arcane::Different, Arcane::DataSynchronizeBufferBase::m_compare_sync_buffer_info, Arcane::DataSynchronizeBufferBase::m_ghost_buffer_info, Arcane::Same, and Arcane::SpanImpl< T, SizeType, Extent >::size().
|
overridevirtual |
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.
Implements Arcane::DataSynchronizeBufferBase.
Definition at line 327 of file DataSynchronizeBuffer.cc.
References Arcane::DataSynchronizeBufferBase::_compute(), dataView(), Arcane::DataSynchronizeBufferBase::m_compare_sync_buffer_info, m_datatype_sizes, and Arcane::DataSynchronizeBufferBase::nbRank().
|
inline |
Definition at line 210 of file DataSynchronizeBuffer.h.
|
private |
View onto the data variable.
Definition at line 227 of file DataSynchronizeBuffer.h.
Referenced by dataView().
|
private |
Array containing the sizes of the data types.
Definition at line 229 of file DataSynchronizeBuffer.h.
Referenced by prepareSynchronize().