Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ContigMachineShMemWinBase.cc
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.cc (C) 2000-2026 */
9/* */
10/* Class allowing the creation of a shared memory window between */
11/* processes on the same node. */
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15#include "arcane/core/ContigMachineShMemWinBase.h"
16
17#include "arcane/core/IParallelMng.h"
18#include "arcane/core/internal/IParallelMngInternal.h"
19
20#include "arcane/utils/NumericTypes.h"
21
22#include "arccore/message_passing/internal/IContigMachineShMemWinBaseInternal.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
34ContigMachineShMemWinBase(IParallelMng* pm, Int64 nb_elem_segment, Int32 sizeof_elem)
35: m_pm_internal(pm->_internalApi())
36, m_node_window_base(m_pm_internal->createContigMachineShMemWinBase(nb_elem_segment * static_cast<Int64>(sizeof_elem), sizeof_elem))
37, m_sizeof_elem(sizeof_elem)
38{}
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
45{
46 return m_node_window_base->segmentView();
47}
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
54{
55 return m_node_window_base->segmentView(rank);
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
63{
64 return m_node_window_base->windowView();
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
71segmentConstView() const
72{
73 return m_node_window_base->segmentConstView();
74}
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
80segmentConstView(Int32 rank) const
81{
82 return m_node_window_base->segmentConstView(rank);
83}
84
85/*---------------------------------------------------------------------------*/
86/*---------------------------------------------------------------------------*/
87
89windowConstView() const
90{
91 return m_node_window_base->windowConstView();
92}
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
98resizeSegment(Integer new_nb_elem)
99{
100 m_node_window_base->resizeSegment(new_nb_elem * static_cast<Int64>(m_sizeof_elem));
101}
102
103/*---------------------------------------------------------------------------*/
104/*---------------------------------------------------------------------------*/
105
107machineRanks() const
108{
109 return m_node_window_base->machineRanks();
110}
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
114
116barrier() const
117{
118 m_node_window_base->barrier();
119}
120
121/*---------------------------------------------------------------------------*/
122/*---------------------------------------------------------------------------*/
123
124} // End namespace Arcane
125
126/*---------------------------------------------------------------------------*/
127/*---------------------------------------------------------------------------*/
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.
View of an array of elements of type T.
Definition Span.h:635
-- 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.