Arcane  v4.1.5.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
50 Int64 adjustedCapacity(MemoryAllocationArgs, Int64 wanted_capacity, Int64) const override
51 {
52 return wanted_capacity;
53 }
55 {
56 return 0;
57 }
58
59 public:
60
61 static ConstArrayView<Int32> machineRanks(AllocatedMemoryInfo ptr);
62 static void barrier(AllocatedMemoryInfo ptr);
63 static Span<std::byte> segmentView(AllocatedMemoryInfo ptr);
64 static Span<std::byte> segmentView(AllocatedMemoryInfo ptr, Int32 rank);
65
66 private:
67
68 static MachineShMemWinBase* _windowBase(AllocatedMemoryInfo ptr);
69
70 private:
71
72 IParallelMng* m_pm;
73};
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78} // End namespace Arcane
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83#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.
AllocatedMemoryInfo reallocate(MemoryAllocationArgs, AllocatedMemoryInfo current_ptr, Int64 new_size) override
Réalloue de la mémoire pour new_size octets et retourne le pointeur.
void deallocate(MemoryAllocationArgs, AllocatedMemoryInfo ptr) override
Libère la mémoire dont l'adresse de base est ptr.
size_t guaranteedAlignment(MemoryAllocationArgs) const override
Valeur de l'alignement garanti par l'allocateur.
AllocatedMemoryInfo allocate(MemoryAllocationArgs, Int64 new_size) override
Alloue de la mémoire pour new_size octets et retourne le pointeur.
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.