Arcane  v4.1.9.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MachineShMemWinMemoryAllocator.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/* MachineShMemWinMemoryAllocator.h (C) 2000-2026 */
9/* */
10/* Allocateur mémoire utilisant la classe MachineShMemWinBase. */
11/*---------------------------------------------------------------------------*/
12
13#ifndef ARCANE_CORE_INTERNAL_MACHINESHMEMWINMEMORYALLOCATOR_H
14#define ARCANE_CORE_INTERNAL_MACHINESHMEMWINMEMORYALLOCATOR_H
15
16/*---------------------------------------------------------------------------*/
17/*---------------------------------------------------------------------------*/
18
20
21#include "arccore/common/IMemoryAllocator.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37class ARCANE_CORE_EXPORT MachineShMemWinMemoryAllocator
38: public IMemoryAllocator
39{
40
41 public:
42
43 explicit MachineShMemWinMemoryAllocator(IParallelMng* pm);
44
45 public:
46
47 bool hasRealloc(MemoryAllocationArgs) const override { return true; }
48 AllocatedMemoryInfo allocate(MemoryAllocationArgs, Int64 new_size) override;
49 AllocatedMemoryInfo reallocate(MemoryAllocationArgs, AllocatedMemoryInfo current_ptr, Int64 new_size) override;
50 void deallocate(MemoryAllocationArgs, AllocatedMemoryInfo ptr) override;
51 Int64 adjustedCapacity(MemoryAllocationArgs, Int64 wanted_capacity, Int64) const override
52 {
53 return wanted_capacity;
54 }
56 {
57 return 0;
58 }
59 bool isCollective() const override
60 {
61 return true;
62 }
63
64 public:
65
66 static ConstArrayView<Int32> machineRanks(AllocatedMemoryInfo ptr);
67 static void barrier(AllocatedMemoryInfo ptr);
68 static Span<std::byte> segmentView(AllocatedMemoryInfo ptr);
69 static Span<std::byte> segmentView(AllocatedMemoryInfo ptr, Int32 rank);
70
71 private:
72
73 static MachineShMemWinBase* _windowBase(AllocatedMemoryInfo ptr);
74
75 private:
76
77 IParallelMng* m_pm;
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83} // End namespace Arcane
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
88#endif
Déclarations des types généraux de Arcane.
Informations sur une zone mémoire allouée.
Vue constante d'un tableau de type T.
Interface d'un allocateur pour la mémoire.
Interface du gestionnaire de parallélisme pour un sous-domaine.
Classe permettant de créer une fenêtre mémoire partagée entre les sous-domaines d'un même noeud.
bool isCollective() const override
Indique si les appels à l'allocateur doivent être effectués collectivement.
bool hasRealloc(MemoryAllocationArgs) const override
Indique si l'allocateur supporte la sémantique de realloc.
size_t guaranteedAlignment(MemoryAllocationArgs) const override
Valeur de l'alignement garanti par l'allocateur.
Int64 adjustedCapacity(MemoryAllocationArgs, Int64 wanted_capacity, Int64) const override
Ajuste la capacité suivant la taille d'élément.
Classe contenant des informations pour spécialiser les allocations.
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::int64_t Int64
Type entier signé sur 64 bits.
std::int32_t Int32
Type entier signé sur 32 bits.