Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::SingleDataSynchronizeBuffer Class Reference

IDataSynchronizeBuffer implementation for a single data item. More...

#include <arcane/impl/internal/DataSynchronizeBuffer.h>

Inheritance diagram for Arcane::SingleDataSynchronizeBuffer:
Collaboration diagram for Arcane::SingleDataSynchronizeBuffer:

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.
TraceAccessoroperator= (const TraceAccessor &rhs)
 Copy assignment operator.
virtual ~TraceAccessor ()
 Frees resources.
ITraceMngtraceMng () 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
DataSynchronizeInfom_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< MemoryBufferm_memory
 Buffer containing the concatenated data for sending and receiving.
Ref< IBufferCopierm_buffer_copier

Detailed Description

IDataSynchronizeBuffer implementation for a single data item.

Definition at line 192 of file DataSynchronizeBuffer.h.

Constructor & Destructor Documentation

◆ SingleDataSynchronizeBuffer()

Arcane::SingleDataSynchronizeBuffer::SingleDataSynchronizeBuffer ( ITraceMng * tm,
DataSynchronizeInfo * sync_info,
Ref< IBufferCopier > copier )
inline

Definition at line 198 of file DataSynchronizeBuffer.h.

Member Function Documentation

◆ copyReceiveAsync()

void Arcane::SingleDataSynchronizeBuffer::copyReceiveAsync ( Int32 index)
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.

Here is the call graph for this function:

◆ copySendAsync()

void Arcane::SingleDataSynchronizeBuffer::copySendAsync ( Int32 index)
finalvirtual

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)
void barrier() final
Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished.
void copyReceiveAsync(Int32 index) final
Copies into the data from the receive buffer of the index-th rank.
std::int32_t Int32
Signed integer type of 32 bits.

Implements Arcane::IDataSynchronizeBuffer.

Definition at line 313 of file DataSynchronizeBuffer.cc.

References dataView(), and Arcane::DataSynchronizeBufferBase::m_share_buffer_info.

Here is the call graph for this function:

◆ dataView()

MutableMemoryView Arcane::SingleDataSynchronizeBuffer::dataView ( )
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().

Here is the caller graph for this function:

◆ finalizeSynchronize()

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).

Return values

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().

Here is the call graph for this function:

◆ prepareSynchronize()

void Arcane::SingleDataSynchronizeBuffer::prepareSynchronize ( bool is_compare_sync)
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().

Here is the call graph for this function:

◆ setDataView()

void Arcane::SingleDataSynchronizeBuffer::setDataView ( MutableMemoryView v)
inline

Definition at line 210 of file DataSynchronizeBuffer.h.

Member Data Documentation

◆ m_data_view

MutableMemoryView Arcane::SingleDataSynchronizeBuffer::m_data_view
private

View onto the data variable.

Definition at line 227 of file DataSynchronizeBuffer.h.

Referenced by dataView().

◆ m_datatype_sizes

FixedArray<Int32, 1> Arcane::SingleDataSynchronizeBuffer::m_datatype_sizes
private

Array containing the sizes of the data types.

Definition at line 229 of file DataSynchronizeBuffer.h.

Referenced by prepareSynchronize().


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