Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MachineShMemWinVariableBase.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/* MachineShMemWinVariableBase.h (C) 2000-2026 */
9/* */
10/* Base classes allowing the exploitation of the MachineShMemWinVariable */
11/* pointed to the shared memory variable zone. */
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_CORE_INTERNAL_MACHINESHMEMWINVARIABLEBASE_H
14#define ARCANE_CORE_INTERNAL_MACHINESHMEMWINVARIABLEBASE_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
19
20#include "arcane/utils/UniqueArray.h"
21#include "arcane/utils/FixedArray.h"
22#include "arcane/utils/HashTableMap2.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
40class ARCANE_CORE_EXPORT MachineShMemWinVariableBase
41{
42
43 public:
44
50
51 public:
52
62
67 void barrier() const;
68
79
85 void updateVariable(Int64 nb_elem_dim1, Int64 sizeof_elem);
86
87 protected:
88
89 IVariable* m_var = nullptr;
90 IParallelMng* m_pm = nullptr;
91
92 ConstArrayView<Int32> m_machine_ranks;
93
94 // <world_rank, size_bytes>
96};
97
98/*---------------------------------------------------------------------------*/
99/*---------------------------------------------------------------------------*/
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
114class ARCANE_CORE_EXPORT MachineShMemWinVariable2DBase
116{
117
118 public:
119
125
126 public:
127
134 void updateVariable(Int64 nb_elem_dim1, Int64 nb_elem_dim2, Int64 sizeof_elem);
135
136 Int64 nbElemDim1(const Int32 rank) const { return m_nb_elem_dim1.at(rank); }
137 Int64 nbElemDim2(const Int32 rank) const { return m_nb_elem_dim2.at(rank); }
138
139 private:
140
141 // <world_rank, size_nb_elems>
144};
145
146/*---------------------------------------------------------------------------*/
147/*---------------------------------------------------------------------------*/
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
163class ARCANE_CORE_EXPORT MachineShMemWinVariableMDBase
165{
166
167 public:
168
174
175 public:
176
183 void updateVariable(Int64 nb_elem_dim1, Int32 nb_elem_dim2, Int64 sizeof_elem);
184
185 Int64 nbElemDim1(const Int32 rank) const { return m_nb_elem_dim1.at(rank); }
186 ArrayShape arrayShape() const;
187
188 private:
189
190 // <world_rank, size_nb_elems>
192};
193
194/*---------------------------------------------------------------------------*/
195/*---------------------------------------------------------------------------*/
196
197} // End namespace Arcane
198
199/*---------------------------------------------------------------------------*/
200/*---------------------------------------------------------------------------*/
201
202#endif
Declarations of Arcane's general types.
Array shape.
Definition ArrayShape.h:42
Constant view of an array of type T.
Interface of the parallelism manager for a subdomain.
Interface of a variable.
Definition IVariable.h:40
MachineShMemWinVariable2DBase(IVariable *var)
Constructor.
void updateVariable(Int64 nb_elem_dim1, Int64 nb_elem_dim2, Int64 sizeof_elem)
Span< std::byte > segmentView(Int32 rank) const
Method allowing retrieval of a view on the segment of another sub-domain of the node.
MachineShMemWinVariableBase(IVariable *var)
Constructor.
void barrier() const
Method allowing waiting until all processes/threads of the node call this method to continue executio...
ConstArrayView< Int32 > machineRanks() const
Method allowing retrieval of the ranks that possess a segment in the window.
void updateVariable(Int64 nb_elem_dim1, Int64 sizeof_elem)
void updateVariable(Int64 nb_elem_dim1, Int32 nb_elem_dim2, Int64 sizeof_elem)
MachineShMemWinVariableMDBase(IVariable *var)
Constructor.
View of an array of elements of type T.
Definition Span.h:635
Implementation of std::unordered_map.
-- 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.