Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
SharedMemoryContigMachineShMemWinBaseInternal.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/* SharedMemoryContigMachineShMemWinBaseInternal.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of a memory window for all subdomains in */
11/* shared memory. */
12/*---------------------------------------------------------------------------*/
13
14#ifndef ARCANE_PARALLEL_THREAD_INTERNAL_SHAREDMEMORYCONTIGMACHINESHMEMWINBASEINTERNAL_H
15#define ARCANE_PARALLEL_THREAD_INTERNAL_SHAREDMEMORYCONTIGMACHINESHMEMWINBASEINTERNAL_H
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20#include "arccore/message_passing/internal/IContigMachineShMemWinBaseInternal.h"
21
23#include "arcane/utils/Ref.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
34class ARCANE_THREAD_EXPORT SharedMemoryContigMachineShMemWinBaseInternal
36{
37 public:
38
39 SharedMemoryContigMachineShMemWinBaseInternal(Int32 my_rank, Int32 nb_rank, ConstArrayView<Int32> ranks, Int32 sizeof_type, Ref<UniqueArray<std::byte>> window, Ref<UniqueArray<Int64>> sizeof_segments, Ref<UniqueArray<Int64>> sum_sizeof_segments, Int64 sizeof_window, IThreadBarrier* barrier);
40
41 ~SharedMemoryContigMachineShMemWinBaseInternal() override = default;
42
43 public:
44
45 Int32 sizeofOneElem() const override;
46
48 Span<std::byte> segmentView(Int32 rank) override;
49 Span<std::byte> windowView() override;
50
52 Span<const std::byte> segmentConstView(Int32 rank) const override;
54
55 void resizeSegment(Int64 new_sizeof_segment) override;
56
57 ConstArrayView<Int32> machineRanks() const override;
58
59 void barrier() const override;
60
61 private:
62
63 Int32 m_my_rank = 0;
64 Int32 m_nb_rank = 0;
65 Int32 m_sizeof_type = 0;
66 Int64 m_actual_sizeof_win = 0;
67 Int64 m_max_sizeof_win = 0;
69
70 Span<std::byte> m_window_span;
72
73 Ref<UniqueArray<Int64>> m_sizeof_segments;
74 SmallSpan<Int64> m_sizeof_segments_span;
75
76 Ref<UniqueArray<Int64>> m_sum_sizeof_segments;
77 SmallSpan<Int64> m_sum_sizeof_segments_span;
78
79 IThreadBarrier* m_barrier = nullptr;
80};
81
82/*---------------------------------------------------------------------------*/
83/*---------------------------------------------------------------------------*/
84
85} // namespace Arcane::MessagePassing
86
87/*---------------------------------------------------------------------------*/
88/*---------------------------------------------------------------------------*/
89
90#endif
Declarations of Arcane's general types.
Constant view of an array of type T.
Class allowing the creation of a memory window for a node of computation.
void resizeSegment(Int64 new_sizeof_segment) override
Method allowing the resizing of the window segments.
Span< std::byte > segmentView() override
Method allowing the retrieval of a view of its segment.
Span< const std::byte > windowConstView() const override
Method allowing the retrieval of a view of the entire window.
Span< const std::byte > segmentConstView() const override
Method allowing the retrieval of a view of its segment.
Span< std::byte > windowView() override
Method allowing the retrieval of a view of the entire window.
ConstArrayView< Int32 > machineRanks() const override
Method allowing the retrieval of the ranks that possess a segment in the window.
void barrier() const override
Method allowing waiting until all processes/threads of the node call this method to continue executio...
Int32 sizeofOneElem() const override
Method allowing the retrieval of the size of an element in the window.
Reference to an instance.
View of an array of elements of type T.
Definition Span.h:805
View of an array of elements of type T.
Definition Span.h:635
1D data vector with value semantics (STL style).
Declarations of types and methods used by message exchange mechanisms.
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.