Arcane  v4.1.5.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MpiContigMachineShMemWinBaseInternal.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/* MpiContigMachineShMemWinBaseInternal.h (C) 2000-2026 */
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_MPICONTIGMACHINESHMEMWINBASEINTERNAL_H
16#define ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPICONTIGMACHINESHMEMWINBASEINTERNAL_H
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21#include "arccore/collections/Array.h"
22#include "arccore/message_passing/internal/IContigMachineShMemWinBaseInternal.h"
23
24#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane::MessagePassing::Mpi
30{
31
32class ARCCORE_MESSAGEPASSINGMPI_EXPORT MpiContigMachineShMemWinBaseInternal
34{
35 public:
36
37 explicit MpiContigMachineShMemWinBaseInternal(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 ~MpiContigMachineShMemWinBaseInternal() override;
40
41 public:
42
43 Int32 sizeofOneElem() const override;
44
46 Span<std::byte> segmentView(Int32 rank) override;
47 Span<std::byte> windowView() override;
48
50 Span<const std::byte> segmentConstView(Int32 rank) const override;
52
53 void resizeSegment(Int64 new_sizeof_segment) override;
54
55 ConstArrayView<Int32> machineRanks() const override;
56
57 void barrier() const override;
58
59 private:
60
61 MPI_Win m_win;
62 Span<std::byte> m_window_span;
63
64 MPI_Win m_win_sizeof_segments;
65 SmallSpan<Int64> m_sizeof_segments_span;
66
67 MPI_Win m_win_sum_sizeof_segments;
68 SmallSpan<Int64> m_sum_sizeof_segments_span;
69
70 MPI_Comm m_comm_machine;
71 Int32 m_comm_machine_size = 0;
72 Int32 m_comm_machine_rank = 0;
73
74 Int32 m_sizeof_type = 0;
75
76 ConstArrayView<Int32> m_machine_ranks;
77
78 Int64 m_max_sizeof_win = 0;
79 Int64 m_actual_sizeof_win = 0;
80};
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
85} // namespace Arcane::MessagePassing::Mpi
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90#endif
Vue constante d'un tableau de type T.
Classe permettant de créer une fenêtre mémoire pour un noeud de calcul.
Span< const std::byte > segmentConstView() const override
Méthode permettant d'obtenir une vue sur son segment.
Span< std::byte > windowView() override
Méthode permettant d'obtenir une vue sur toute la fenêtre.
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 > segmentView() override
Méthode permettant d'obtenir une vue sur son segment.
ConstArrayView< Int32 > machineRanks() const override
Méthode permettant d'obtenir les rangs qui possèdent un segment dans la fenêtre.
Span< const std::byte > windowConstView() const override
Méthode permettant d'obtenir une vue sur toute la fenêtre.
Int32 sizeofOneElem() const override
Méthode permettant d'obtenir la taille d'un élement de la fenêtre.
Vue d'un tableau d'éléments de type T.
Definition Span.h:801
Vue d'un tableau d'éléments de type T.
Definition Span.h:633
std::int64_t Int64
Type entier signé sur 64 bits.
std::int32_t Int32
Type entier signé sur 32 bits.