Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
HybridContigMachineShMemWinBaseInternal.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/* HybridContigMachineShMemWinBaseInternal.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of a memory window for all sub-domains in */
11/* shared memory of processes on the same node. */
12/*---------------------------------------------------------------------------*/
13
14#ifndef ARCANE_PARALLEL_MPITHREAD_INTERNAL_HYBRIDCONTIGMACHINESHMEMWINBASEINTERNAL_H
15#define ARCANE_PARALLEL_MPITHREAD_INTERNAL_HYBRIDCONTIGMACHINESHMEMWINBASEINTERNAL_H
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20#include "arcane/utils/Ref.h"
21
22#include "arccore/message_passing/internal/IContigMachineShMemWinBaseInternal.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
33class HybridContigMachineShMemWinBaseInternal
35{
36 public:
37
38 HybridContigMachineShMemWinBaseInternal(Int32 my_rank_mpi, Int32 my_rank_local_proc, Int32 nb_rank_local_proc, ConstArrayView<Int32> ranks, Int32 sizeof_type, Ref<IContigMachineShMemWinBaseInternal> nb_elem, Ref<IContigMachineShMemWinBaseInternal> sum_nb_elem, Ref<IContigMachineShMemWinBaseInternal> mpi_window, IThreadBarrier* barrier);
39
40 ~HybridContigMachineShMemWinBaseInternal() override = default;
41
42 public:
43
44 Int32 sizeofOneElem() const override;
45
47 Span<std::byte> segmentView(Int32 rank) override;
48 Span<std::byte> windowView() override;
49
51 Span<const std::byte> segmentConstView(Int32 rank) const override;
53
54 void resizeSegment(Int64 new_sizeof_segment) override;
55
56 ConstArrayView<Int32> machineRanks() const override;
57
58 void barrier() const override;
59
60 private:
61
62 Int32 m_my_rank_local_proc = 0;
63 Int32 m_nb_rank_local_proc = 0;
64 Int32 m_my_rank_mpi = 0;
65 ConstArrayView<Int32> m_machine_ranks;
66 Int32 m_sizeof_type = 0;
68 Ref<IContigMachineShMemWinBaseInternal> m_sizeof_sub_segments_global;
69 Ref<IContigMachineShMemWinBaseInternal> m_sum_sizeof_sub_segments_global;
70 Span<Int64> m_sizeof_sub_segments_local_proc;
71 Span<Int64> m_sum_sizeof_sub_segments_local_proc;
72 IThreadBarrier* m_thread_barrier = nullptr;
73};
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78} // namespace Arcane::MessagePassing
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83#endif
Constant view of an array of type T.
void barrier() const override
Method allowing waiting until all processes/threads of the node call this method to continue executio...
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< std::byte > windowView() override
Method allowing the retrieval of a view of the entire window.
Int32 sizeofOneElem() const override
Method allowing the retrieval of the size of an element in the window.
ConstArrayView< Int32 > machineRanks() const override
Method allowing the retrieval of the ranks that possess a segment in the window.
Span< const std::byte > segmentConstView() const override
Method allowing the retrieval of a view of its segment.
Class allowing the creation of a memory window for a node of computation.
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.
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.