Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MpiContigMachineShMemWinBaseInternal.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/* MpiContigMachineShMemWinBaseInternal.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of a memory window for a computing node with */
11/* MPI. This window will be contiguous for all processes on the same node. */
12/*---------------------------------------------------------------------------*/
13
14#ifndef ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPICONTIGMACHINESHMEMWINBASEINTERNAL_H
15#define ARCCORE_MESSAGEPASSINGMPI_INTERNAL_MPICONTIGMACHINESHMEMWINBASEINTERNAL_H
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20#include "arccore/collections/Array.h"
21#include "arccore/message_passing/internal/IContigMachineShMemWinBaseInternal.h"
22
23#include "arccore/message_passing_mpi/MessagePassingMpiGlobal.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane::MessagePassing::Mpi
29{
30
31class ARCCORE_MESSAGEPASSINGMPI_EXPORT MpiContigMachineShMemWinBaseInternal
33{
34 public:
35
36 explicit MpiContigMachineShMemWinBaseInternal(Int64 sizeof_segment, Int32 sizeof_type, const MPI_Comm& comm_machine, Int32 comm_machine_rank, Int32 comm_machine_size, ConstArrayView<Int32> machine_ranks);
37
38 ~MpiContigMachineShMemWinBaseInternal() override;
39
40 public:
41
42 Int32 sizeofOneElem() const override;
43
45 Span<std::byte> segmentView(Int32 rank) override;
46 Span<std::byte> windowView() override;
47
49 Span<const std::byte> segmentConstView(Int32 rank) const override;
51
52 void resizeSegment(Int64 new_sizeof_segment) override;
53
54 ConstArrayView<Int32> machineRanks() const override;
55
56 void barrier() const override;
57
58 private:
59
60 MPI_Win m_win;
61 Span<std::byte> m_window_span;
62
63 MPI_Win m_win_sizeof_segments;
64 SmallSpan<Int64> m_sizeof_segments_span;
65
66 MPI_Win m_win_sum_sizeof_segments;
67 SmallSpan<Int64> m_sum_sizeof_segments_span;
68
69 MPI_Comm m_comm_machine;
70 Int32 m_comm_machine_size = 0;
71 Int32 m_comm_machine_rank = 0;
72
73 Int32 m_sizeof_type = 0;
74
75 ConstArrayView<Int32> m_machine_ranks;
76
77 Int64 m_max_sizeof_win = 0;
78 Int64 m_actual_sizeof_win = 0;
79};
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84} // namespace Arcane::MessagePassing::Mpi
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89#endif
Constant view of an array of type T.
Class allowing the creation of a memory window for a node of computation.
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.
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.
ConstArrayView< Int32 > machineRanks() const override
Method allowing the retrieval of the ranks that possess a segment in the window.
Span< const std::byte > windowConstView() const 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.
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
std::int64_t Int64
Signed integer type of 64 bits.
std::int32_t Int32
Signed integer type of 32 bits.