Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ContigMachineShMemWinBase.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/* ContigMachineShMemWinBase.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of a shared memory window between the */
11/* processes of the same node. */
12/*---------------------------------------------------------------------------*/
13#ifndef ARCANE_CORE_CONTIGMACHINESHMEMWINBASE_H
14#define ARCANE_CORE_CONTIGMACHINESHMEMWINBASE_H
15/*---------------------------------------------------------------------------*/
16/*---------------------------------------------------------------------------*/
17
19#include "arcane/utils/Ref.h"
20
21#include "arccore/base/Span.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
32class IParallelMng;
33class IParallelMngInternal;
35{
36 class IContigMachineShMemWinBaseInternal;
37}
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42/*!
43 * \brief Class allowing the creation of a shared memory window between the
44 * subdomains of the same node.
45 * The segments of this window will be contiguous in memory.
46 */
47class ARCANE_CORE_EXPORT ContigMachineShMemWinBase
48{
49
50 public:
51
52 /*!
53 * \brief Constructor.
54 * \param pm The ParallelMng containing the node's processes.
55 * \param sizeof_segment The size of the segment for this subdomain (in bytes).
56 * \param sizeof_elem The size of an element (in bytes).
57 */
58 ContigMachineShMemWinBase(IParallelMng* pm, Int64 sizeof_segment, Int32 sizeof_elem);
59
60 public:
61
62 /*!
63 * \brief Method allowing retrieval of a view on our window segment
64 * memory.
65 *
66 * \return A view.
67 */
69
70 /*!
71 * \brief Method allowing retrieval of a view on the window segment
72 * memory of another subdomain of the node.
73 *
74 * \param rank The rank of the subdomain.
75 * \return A view.
76 */
78
79 /*!
80 * \brief Method allowing retrieval of a view on the entire memory window.
81 *
82 * \return A view.
83 */
85
86 /*!
87 * \brief Method allowing retrieval of a constant view on our segment
88 * memory window.
89 *
90 * \return A constant view.
91 */
93
94 /*!
95 * \brief Method allowing retrieval of a constant view on the segment of
96 * memory window of another subdomain of the node.
97 *
98 * \param rank The rank of the subdomain.
99 * \return A constant view.
100 */
102
103 /*!
104 * \brief Method allowing retrieval of a constant view on the entire window
105 * memory.
106 *
107 * \return A constant view.
108 */
110
111 /*!
112 * \brief Method allowing resizing of the window segments.
113 * Collective call.
114 *
115 * The total size of the window must be less than or equal to the original size.
116 *
117 * \param new_size The new size of our segment (in bytes).
118 */
119 void resizeSegment(Integer new_size);
120
121 /*!
122 * \brief Method allowing retrieval of the ranks that possess a segment
123 * in the window.
124 *
125 * The order of the processes in the returned view corresponds to the order of
126 * segments in the window.
127 *
128 * \return A view containing the rank IDs.
129 */
131
132 /*!
133 * \brief Method allowing waiting until all processes/threads
134 * of the node call this method to continue execution.
135 */
136 void barrier() const;
137
138 private:
139
140 IParallelMngInternal* m_pm_internal;
142 Int32 m_sizeof_elem;
143};
144
145/*---------------------------------------------------------------------------*/
146/*---------------------------------------------------------------------------*/
147
148} // End namespace Arcane
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
152
153#endif
Declarations of Arcane's general types.
Types and functions associated with the classes SpanImpl, SmallSpan and Span.
Constant view of an array of type T.
Span< const std::byte > windowConstView() const
Method allowing retrieval of a constant view on the entire window memory.
ContigMachineShMemWinBase(IParallelMng *pm, Int64 sizeof_segment, Int32 sizeof_elem)
Constructor.
void resizeSegment(Integer new_size)
Method allowing resizing of the window segments. Collective call.
void barrier() const
Method allowing waiting until all processes/threads of the node call this method to continue executio...
Span< std::byte > segmentView()
Method allowing retrieval of a view on our window segment memory.
ConstArrayView< Int32 > machineRanks() const
Method allowing retrieval of the ranks that possess a segment in the window.
Span< const std::byte > segmentConstView() const
Method allowing retrieval of a constant view on our segment memory window.
Span< std::byte > windowView()
Method allowing retrieval of a view on the entire memory window.
Interface of the parallelism manager for a subdomain.
Reference to an instance.
View of an array of elements of type T.
Definition Span.h:635
Declarations of types and methods used by message exchange mechanisms.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.