Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IDataSynchronizeBuffer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IDataSynchronizeBuffer.h (C) 2000-2023 */
9/* */
10/* Interface of a generic buffer for data synchronization. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_IMPL_IDATASYNCHRONIZEBUFFER_H
14#define ARCANE_IMPL_IDATASYNCHRONIZEBUFFER_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
18#include "arcane/utils/ArrayView.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
53class ARCANE_IMPL_EXPORT IDataSynchronizeBuffer
54{
55 public:
56
57 virtual ~IDataSynchronizeBuffer() = default;
58
59 public:
60
62 virtual Int32 nbRank() const = 0;
63
65 virtual Int32 targetRank(Int32 index) const = 0;
66
68 virtual bool hasGlobalBuffer() const = 0;
69
72
75
78
81
88 virtual Int64 sendDisplacement(Int32 index) const = 0;
89
96 virtual Int64 receiveDisplacement(Int32 index) const = 0;
97
99 virtual void copyReceiveAsync(Int32 index) = 0;
100
111 virtual void copyAllReceive();
112
123 virtual void copySendAsync(Int32 index) = 0;
124
128 virtual void copyAllSend();
129
131 virtual Int64 totalSendSize() const = 0;
132
134 virtual Int64 totalReceiveSize() const = 0;
135
137 virtual void barrier() = 0;
138};
139
140/*---------------------------------------------------------------------------*/
141/*---------------------------------------------------------------------------*/
142
143} // namespace Arcane
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148#endif
Generic buffer for data synchronization.
virtual MutableMemoryView sendBuffer(Int32 index)=0
Send buffer for the index-th rank.
virtual void barrier()=0
Waits until the copies (copySendAsync() and copyReceiveAsync()) are finished.
virtual bool hasGlobalBuffer() const =0
Indicates if the buffers are global.
virtual void copyAllSend()
Copies all data into the send buffer.
virtual Int64 totalSendSize() const =0
Total size to send in bytes.
virtual Int64 sendDisplacement(Int32 index) const =0
Displacement (in bytes) from the start of sendBuffer() for the index-th rank.
virtual void copyAllReceive()
Copies all data from the receive buffer.
virtual void copyReceiveAsync(Int32 index)=0
Copies into the data from the receive buffer of the index-th rank.
virtual MutableMemoryView globalReceiveBuffer()=0
Receive buffer.
virtual MutableMemoryView globalSendBuffer()=0
Send buffer.
virtual void copySendAsync(Int32 index)=0
Copies the data of the index-th rank into the send buffer.
virtual MutableMemoryView receiveBuffer(Int32 index)=0
Receive buffer for the index-th rank.
virtual Int32 nbRank() const =0
Number of ranks.
virtual Int32 targetRank(Int32 index) const =0
Target rank of 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 Int64 totalReceiveSize() const =0
Total size to receive in bytes.
Mutable view on a contiguous memory region containing fixed-size elements.
-- 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.