Arcane  v3.16.7.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MpiMachineMemoryWindowBaseInternal.h
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/* MpiMachineMemoryWindowBaseInternal.h (C) 2000-2025 */
9/* */
10/* Classe permettant de créer une fenêtre mémoire pour un noeud */
11/* de calcul avec MPI. Cette fenêtre sera contigüe pour tous les processus */
12/* d'un même noeud. */
13/*---------------------------------------------------------------------------*/
14
15#ifndef ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPIMACHINEMEMORYWINDOWBASEINTERNAL_H
16#define ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPIMACHINEMEMORYWINDOWBASEINTERNAL_H
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21#include "arccore/collections/Array.h"
22#include "arccore/message_passing/internal/IMachineMemoryWindowBaseInternal.h"
23
24#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::MessagePassing::Mpi
30{
31
32class ARCCORE_MESSAGEPASSINGMPI_EXPORT MpiMachineMemoryWindowBaseInternal
34{
35 public:
36
37 explicit MpiMachineMemoryWindowBaseInternal(Int64 sizeof_segment, Int32 sizeof_type, const MPI_Comm& comm_machine, Int32 comm_machine_rank, Int32 comm_machine_size, ConstArrayView<Int32> machine_ranks);
38
39 ~MpiMachineMemoryWindowBaseInternal() override;
40
41 public:
42
43 Int32 sizeofOneElem() const override;
44
45 Span<std::byte> segment() const override;
46 Span<std::byte> segment(Int32 rank) const override;
47 Span<std::byte> window() const override;
48
49 void resizeSegment(Int64 new_sizeof_segment) override;
50
51 ConstArrayView<Int32> machineRanks() const override;
52
53 void barrier() const override;
54
55 private:
56
57 MPI_Win m_win;
58 Span<std::byte> m_window_span;
59
60 MPI_Win m_win_sizeof_segments;
61 Span<Int64> m_sizeof_segments_span;
62
63 MPI_Win m_win_sum_sizeof_segments;
64 Span<Int64> m_sum_sizeof_segments_span;
65
66 MPI_Comm m_comm_machine;
67 Int32 m_comm_machine_size;
68 Int32 m_comm_machine_rank;
69
70 Int32 m_sizeof_type;
71
72 ConstArrayView<Int32> m_machine_ranks;
73
74 Int64 m_max_sizeof_win;
75 Int64 m_actual_sizeof_win;
76};
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81} // namespace Arcane::MessagePassing::Mpi
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86#endif
Vue constante d'un tableau de type T.
Classe permettant de créer une fenêtre mémoire pour un noeud de calcul.
void barrier() const override
Méthode permettant d'attendre que tous les processus/threads du noeud appellent cette méthode pour co...
void resizeSegment(Int64 new_sizeof_segment) override
Méthode permettant de redimensionner les segments de la fenêtre.
Span< std::byte > window() const override
Méthode permettant d'obtenir une vue sur toute la fenêtre.
ConstArrayView< Int32 > machineRanks() const override
Méthode permettant d'obtenir les rangs qui possèdent un segment dans la fenêtre.
Int32 sizeofOneElem() const override
Méthode permettant d'obtenir la taille d'un élement de la fenêtre.
Span< std::byte > segment() const override
Méthode permettant d'obtenir une vue sur son segment.
Vue d'un tableau d'éléments de type T.
Definition Span.h:513
std::int64_t Int64
Type entier signé sur 64 bits.
std::int32_t Int32
Type entier signé sur 32 bits.