Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MachineShMemWinBase.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/* MachineShMemWinBase.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of memory windows for a computing node. */
11/* The segments of these windows are not contiguous in memory and can */
12/* be resized. */
13/*---------------------------------------------------------------------------*/
14#ifndef ARCANE_CORE_MACHINESHMEMWINBASE_H
15#define ARCANE_CORE_MACHINESHMEMWINBASE_H
16/*---------------------------------------------------------------------------*/
17/*---------------------------------------------------------------------------*/
18
20#include "arcane/utils/Ref.h"
21
22#include "arccore/base/Span.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33class IParallelMng;
35namespace MessagePassing
36{
38}
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
52class ARCANE_CORE_EXPORT MachineShMemWinBase
53{
54
55 public:
56
64 MachineShMemWinBase(IParallelMng* pm, Int64 sizeof_segment, Int32 sizeof_elem);
65
66 public:
67
77
82 void barrier() const;
83
92
103
112
123
138 void add(Span<const std::byte> elem);
149 void add();
150
170
181 void addToAnotherSegment();
182
205 void reserve(Int64 new_nb_elem_segment_capacity);
206
215 void reserve();
216
231 void resize(Int64 new_nb_elem_segment);
232
241 void resize();
242
249 void shrink();
250
251 private:
252
253 IParallelMngInternal* m_pm_internal;
255 Int32 m_sizeof_elem;
256};
257
258/*---------------------------------------------------------------------------*/
259/*---------------------------------------------------------------------------*/
260
261} // End namespace Arcane
262
263/*---------------------------------------------------------------------------*/
264/*---------------------------------------------------------------------------*/
265
266#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.
Internal part of IParallelMng.
Interface of the parallelism manager for a subdomain.
void reserve(Int64 new_nb_elem_segment_capacity)
Method to reserve memory space in our segment.
void barrier() const
Method to wait until all processes/threads on the node call this method to continue execution.
MachineShMemWinBase(IParallelMng *pm, Int64 sizeof_segment, Int32 sizeof_elem)
Constructor.
Span< const std::byte > segmentConstView() const
Method to obtain a view of our segment.
void resize(Int64 new_nb_elem_segment)
Method to resize our segment.
void shrink()
Method to reduce the reserved memory space for the segments to the minimum necessary.
void addToAnotherSegment(Int32 rank, Span< const std::byte > elem)
Method to add elements into the segment of another subdomain.
ConstArrayView< Int32 > machineRanks() const
Method to obtain the ranks that possess a segment in the window.
void add(Span< const std::byte > elem)
Method to add elements into our segment.
Span< std::byte > segmentView()
Method to obtain a view of our segment.
Class allowing the creation of memory windows for a computing node.
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.
std::int32_t Int32
Signed integer type of 32 bits.