Arcane  v4.1.4.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
DynamicMachineMemoryWindowVariableBase.cc
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/* DynamicMachineMemoryWindowVariableBase.h (C) 2000-2026 */
9/* */
10/* Allocateur mémoire utilisant la classe DynamicMachineMemoryWindowBase. */
11/*---------------------------------------------------------------------------*/
12
13#include "arcane/core/DynamicMachineMemoryWindowVariableBase.h"
14
15#include "arcane/utils/FatalErrorException.h"
16#include "arcane/utils/ITraceMng.h"
17
18#include "arcane/core/IData.h"
19#include "arcane/core/IParallelMng.h"
20#include "arcane/core/DynamicMachineMemoryWindowBase.h"
21#include "arcane/core/IVariable.h"
22
23#include "arcane/core/internal/DynamicMachineMemoryWindowMemoryAllocator.h"
24#include "arcane/core/internal/IDataInternal.h"
25
26#include "arccore/common/AllocatedMemoryInfo.h"
27#include "arccore/base/MemoryView.h"
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32namespace Arcane
33{
34
35/*---------------------------------------------------------------------------*/
36/*---------------------------------------------------------------------------*/
37
40: m_var(var)
41{
42 if (!(m_var->property() & IVariable::PInShMem)) {
43 ARCANE_FATAL("The variable has not PInShMem property");
44 }
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
51segmentView() const
52{
53 const AllocatedMemoryInfo data(m_var->data()->_commonInternal()->numericData()->memoryView().data());
54 return DynamicMachineMemoryWindowMemoryAllocator::segmentView(data);
55}
56
57/*---------------------------------------------------------------------------*/
58/*---------------------------------------------------------------------------*/
59
61segmentView(Int32 rank) const
62{
63 const AllocatedMemoryInfo data(m_var->data()->_commonInternal()->numericData()->memoryView().data());
64 return DynamicMachineMemoryWindowMemoryAllocator::segmentView(data, rank);
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
71machineRanks() const
72{
73 const AllocatedMemoryInfo data(m_var->data()->_commonInternal()->numericData()->memoryView().data());
74 return DynamicMachineMemoryWindowMemoryAllocator::machineRanks(data);
75}
76
77/*---------------------------------------------------------------------------*/
78/*---------------------------------------------------------------------------*/
79
81barrier() const
82{
83 const AllocatedMemoryInfo data(m_var->data()->_commonInternal()->numericData()->memoryView().data());
84 DynamicMachineMemoryWindowMemoryAllocator::barrier(data);
85}
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90} // End namespace Arcane
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
Informations sur une zone mémoire allouée.
Vue constante d'un tableau de type T.
ConstArrayView< Int32 > machineRanks() const
Méthode permettant d'obtenir les rangs qui possèdent un segment dans la fenêtre.
Span< std::byte > segmentView() const
Méthode permettant d'obtenir une vue sur notre segment.
void barrier() const
Méthode permettant d'attendre que tous les processus/threads du noeud appellent cette méthode pour co...
Interface d'une variable.
Definition IVariable.h:39
@ PInShMem
Indique que la variable doit être alloué en mémoire partagée.
Definition IVariable.h:153
Vue d'un tableau d'éléments de type T.
Definition Span.h:633
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int32_t Int32
Type entier signé sur 32 bits.