Arcane  v3.16.7.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MpiAllInOneMachineMemoryWindowBase.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/* MpiAllInOneMachineMemoryWindowBase.h (C) 2000-2025 */
9/* */
10/* Classe permettant de créer une fenêtre mémoire pour un noeud */
11/* de calcul avec MPI. Chaque section de processus contiendra le MPI_Win. */
12/*---------------------------------------------------------------------------*/
13
14#ifndef ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPIALLINONEMACHINEMEMORYWINDOWBASE_H
15#define ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPIALLINONEMACHINEMEMORYWINDOWBASE_H
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
21#include "arccore/base/FatalErrorException.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane::MessagePassing::Mpi
27{
28
29class ARCCORE_MESSAGEPASSINGMPI_EXPORT MpiAllInOneMachineMemoryWindowBase
30{
31 public:
32
33 explicit MpiAllInOneMachineMemoryWindowBase(void* node_window, MPI_Aint offset, const MPI_Comm& comm, Int32 my_node_rank);
34
35 ~MpiAllInOneMachineMemoryWindowBase();
36
37 public:
38
39 Integer sizeofOneElem() const;
40
41 Integer sizeSegment() const;
42 Integer sizeSegment(Int32 rank) const;
43
44 void* data() const;
45 void* data(Int32 rank) const;
46
47 std::pair<Integer, void*> sizeAndDataSegment() const;
48 std::pair<Integer, void*> sizeAndDataSegment(Int32 rank) const;
49
50 private:
51
52 void* m_node_window;
53 MPI_Win* m_win;
54 MPI_Aint m_nb_elem_local;
55 MPI_Aint m_offset;
56 MPI_Comm m_comm;
57 Int32 m_my_rank;
58 Integer m_size_type;
59};
60
61/*---------------------------------------------------------------------------*/
62/*---------------------------------------------------------------------------*/
63
64} // namespace Arcane::MessagePassing::Mpi
65
66/*---------------------------------------------------------------------------*/
67/*---------------------------------------------------------------------------*/
68
69#endif
Int32 Integer
Type représentant un entier.
std::int32_t Int32
Type entier signé sur 32 bits.