13#ifndef ARCANE_IMPL_DATASYNCHRONIZEBUFFER_H
14#define ARCANE_IMPL_DATASYNCHRONIZEBUFFER_H
18#include "arcane/utils/MemoryView.h"
19#include "arcane/utils/Array.h"
20#include "arcane/utils/Array2.h"
21#include "arcane/utils/SmallArray.h"
22#include "arcane/utils/TraceAccessor.h"
24#include "arcane/impl/IDataSynchronizeBuffer.h"
25#include "arcane/utils/FixedArray.h"
52class ARCANE_IMPL_EXPORT DataSynchronizeBufferBase
86 void checkValid()
const
130 void barrier() final;
178 bool m_is_compare_sync_values =
false;
192class ARCANE_IMPL_EXPORT SingleDataSynchronizeBuffer
194,
public DataSynchronizeBufferBase
200 , DataSynchronizeBufferBase(sync_info, copier)
217 void prepareSynchronize(
bool is_compare_sync)
override;
238class ARCANE_IMPL_EXPORT MultiDataSynchronizeBuffer
240,
public DataSynchronizeBufferBase
248 , DataSynchronizeBufferBase(sync_info, copier)
258 void setNbData(
Int32 nb_data)
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
Constant view of an array of type T.
Buffer for one synchronization element (send, receive, or comparison).
Int64 totalSize() const
Total size in bytes of the global buffer.
Int64 m_total_size
Total size (in bytes) of the buffer.
SmallArray< Int64 > m_local_buffer_size
Size (in bytes) of each local buffer.
MutableMemoryView m_memory_view
View onto the memory area of the buffer.
ConstArrayView< Int32 > m_datatype_sizes
Size (in bytes) of the type of each data item.
UniqueArray2< Int64 > m_displacements
Offset (in bytes) in globalBuffer() for each data item.
MutableMemoryView globalBuffer() const
Global buffer.
Base class for the IDataSynchronizeBuffer implementation.
Int64 receiveDisplacement(Int32 index) const final
Displacement (in bytes) from the start of receiveBuffer() for the index-th rank.
void _allocateBuffers()
Calculates and allocates the buffers necessary for sends and receives for 1D variable synchronization...
bool isCompareSynchronizedValues() const
Indicates whether values are compared before/after synchronization.
BufferInfo m_compare_sync_buffer_info
Buffer for testing if synchronization modified the values of ghost cells.
Int32 nbRank() const final
Number of ranks.
Int64 sendDisplacement(Int32 index) const final
Displacement (in bytes) from the start of sendBuffer() for the index-th rank.
BufferInfo m_share_buffer_info
Buffer for all data of shared entities used for sending.
MutableMemoryView globalReceiveBuffer() final
Receive buffer.
Int64 totalSendSize() const final
Total size to send in bytes.
MutableMemoryView globalSendBuffer() final
Send buffer.
MutableMemoryView receiveBuffer(Int32 index) final
Receive buffer for the index-th rank.
virtual void prepareSynchronize(bool is_compare_sync)=0
Prepares the synchronization.
Int64 totalReceiveSize() const final
Total size to receive in bytes.
void _compute(ConstArrayView< Int32 > datatype_sizes)
Computes the information for the synchronization.
BufferInfo m_ghost_buffer_info
Buffer for all data of ghost entities used for reception.
Ref< MemoryBuffer > m_memory
Buffer containing the concatenated data for sending and receiving.
MutableMemoryView sendBuffer(Int32 index) final
Send buffer for the index-th rank.
bool hasGlobalBuffer() const final
Indicates if the buffers are global.
Information for sending (share) or receiving (ghost) messages.
Information necessary to synchronize entities across a group.
Information about the result of a synchronization.
Interface for copying elements between two regions with indexing.
Generic buffer for data synchronization.
Management of a memory buffer.
SmallArray< Int32 > m_datatype_sizes
Array containing the sizes of the data types.
void prepareSynchronize(bool is_compare_sync) override
void copyReceiveAsync(Int32 rank_index) final
Copies into the data from the receive buffer of the index-th rank.
SmallArray< MutableMemoryView > m_data_views
View onto the data variables.
void copySendAsync(Int32 rank_index) final
Copies the data of the index-th rank into the send buffer.
Mutable view on a contiguous memory region containing fixed-size elements.
constexpr Int32 datatypeSize() const
Size of the associated data type (1 by default).
Reference to an instance.
MutableMemoryView m_data_view
View onto the data variable.
FixedArray< Int32, 1 > m_datatype_sizes
Array containing the sizes of the data types.
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.
MutableMemoryView dataView()
Memory area containing the values of the data to be synchronized.
1D data array with pre-allocated stack buffer.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
2D data vector with value semantics (STL style).
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.