Arcane  v3.16.7.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
DynamicMachineMemoryWindowBase.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* DynamicMachineMemoryWindowBase.cc (C) 2000-2025 */
9/* */
10/* Classe permettant de créer des fenêtres mémoires pour un noeud de calcul. */
11/* Les segments de ces fenêtres ne sont pas contigües en mémoire et peuvent */
12/* être redimensionnées. */
13/*---------------------------------------------------------------------------*/
14
15#include "arcane/core/DynamicMachineMemoryWindowBase.h"
16
17#include "arcane/core/IParallelMng.h"
18#include "arcane/core/internal/IParallelMngInternal.h"
19
20#include "arcane/utils/NumericTypes.h"
21#include "arcane/utils/FatalErrorException.h"
22
23#include "arccore/message_passing/internal/IDynamicMachineMemoryWindowBaseInternal.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34DynamicMachineMemoryWindowBase::
35DynamicMachineMemoryWindowBase(IParallelMng* pm, Int64 nb_elem_segment, Int32 sizeof_elem)
36: m_pm_internal(pm->_internalApi())
37, m_node_window_base(m_pm_internal->createDynamicMachineMemoryWindowBase(nb_elem_segment * static_cast<Int64>(sizeof_elem), sizeof_elem))
38, m_sizeof_elem(sizeof_elem)
39{}
40
41/*---------------------------------------------------------------------------*/
42/*---------------------------------------------------------------------------*/
43
44Span<std::byte> DynamicMachineMemoryWindowBase::
45segmentView()
46{
47 return m_node_window_base->segmentView();
48}
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53Span<std::byte> DynamicMachineMemoryWindowBase::
54segmentView(Int32 rank)
55{
56 return m_node_window_base->segmentView(rank);
57}
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
61
62Span<const std::byte> DynamicMachineMemoryWindowBase::
63segmentConstView() const
64{
65 return m_node_window_base->segmentConstView();
66}
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71Span<const std::byte> DynamicMachineMemoryWindowBase::
72segmentConstView(Int32 rank) const
73{
74 return m_node_window_base->segmentConstView(rank);
75}
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
80void DynamicMachineMemoryWindowBase::
81add(Span<const std::byte> elem)
82{
83 return m_node_window_base->add(elem);
84}
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89void DynamicMachineMemoryWindowBase::
90add()
91{
92 return m_node_window_base->add();
93}
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98void DynamicMachineMemoryWindowBase::
99addToAnotherSegment(Int32 rank, Span<const std::byte> elem)
100{
101 m_node_window_base->addToAnotherSegment(rank, elem);
102}
103
104/*---------------------------------------------------------------------------*/
105/*---------------------------------------------------------------------------*/
106
107void DynamicMachineMemoryWindowBase::
108addToAnotherSegment()
109{
110 m_node_window_base->addToAnotherSegment();
111}
112
113/*---------------------------------------------------------------------------*/
114/*---------------------------------------------------------------------------*/
115
116ConstArrayView<Int32> DynamicMachineMemoryWindowBase::
117machineRanks() const
118{
119 return m_node_window_base->machineRanks();
120}
121
122/*---------------------------------------------------------------------------*/
123/*---------------------------------------------------------------------------*/
124
125void DynamicMachineMemoryWindowBase::
126barrier() const
127{
128 m_node_window_base->barrier();
129}
130
131/*---------------------------------------------------------------------------*/
132/*---------------------------------------------------------------------------*/
133
134void DynamicMachineMemoryWindowBase::
135reserve(Int64 new_nb_elem_segment_capacity)
136{
137 m_node_window_base->reserve(new_nb_elem_segment_capacity * static_cast<Int64>(m_sizeof_elem));
138}
139
140/*---------------------------------------------------------------------------*/
141/*---------------------------------------------------------------------------*/
142
143void DynamicMachineMemoryWindowBase::
144reserve()
145{
146 m_node_window_base->reserve();
147}
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
152void DynamicMachineMemoryWindowBase::
153resize(Int64 new_nb_elem_segment)
154{
155 m_node_window_base->resize(new_nb_elem_segment * static_cast<Int64>(m_sizeof_elem));
156}
157
158/*---------------------------------------------------------------------------*/
159/*---------------------------------------------------------------------------*/
160
161void DynamicMachineMemoryWindowBase::
162resize()
163{
164 m_node_window_base->resize();
165}
166
167/*---------------------------------------------------------------------------*/
168/*---------------------------------------------------------------------------*/
169
170void DynamicMachineMemoryWindowBase::
171shrink()
172{
173 m_node_window_base->shrink();
174}
175
176/*---------------------------------------------------------------------------*/
177/*---------------------------------------------------------------------------*/
178
179} // End namespace Arcane
180
181/*---------------------------------------------------------------------------*/
182/*---------------------------------------------------------------------------*/
Interface du gestionnaire de parallélisme pour un sous-domaine.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
std::int32_t Int32
Type entier signé sur 32 bits.