Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
HybridMachineShMemWinBaseInternalCreator.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/* HybridMachineShMemWinBaseInternalCreator.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of objects of type */
11/* HybridContigMachineShMemWinBaseInternal. An instance of this object must */
12/* be shared by all threads of a process. */
13/*---------------------------------------------------------------------------*/
14
15#ifndef ARCANE_PARALLEL_MPITHREAD_INTERNAL_HYBRIDMACHINESHMEMWINBASEINTERNALCREATOR_H
16#define ARCANE_PARALLEL_MPITHREAD_INTERNAL_HYBRIDMACHINESHMEMWINBASEINTERNALCREATOR_H
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21#include "arcane/utils/Ref.h"
22#include "arcane/utils/UniqueArray.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29class MpiParallelMng;
30
31namespace MessagePassing
32{
36
37 namespace Mpi
38 {
41 } // namespace Mpi
42} // namespace MessagePassing
43} // namespace Arcane
44
45/*---------------------------------------------------------------------------*/
46/*---------------------------------------------------------------------------*/
47
49{
50
51/*---------------------------------------------------------------------------*/
52/*---------------------------------------------------------------------------*/
53
54class HybridMachineShMemWinBaseInternalCreator
55{
56 public:
57
58 HybridMachineShMemWinBaseInternalCreator(Int32 nb_rank_local_proc, IThreadBarrier* barrier);
59 ~HybridMachineShMemWinBaseInternalCreator() = default;
60
61 public:
62
63 void initializeMpiWindowCreator(Int32 my_rank_global, MpiParallelMng* mpi_parallel_mng);
64
65 HybridContigMachineShMemWinBaseInternal* createWindow(Int32 my_rank_global, Int64 sizeof_segment, Int32 sizeof_type, MpiParallelMng* mpi_parallel_mng);
66 HybridMachineShMemWinBaseInternal* createDynamicWindow(Int32 my_rank_global, Int64 sizeof_segment, Int32 sizeof_type, MpiParallelMng* mpi_parallel_mng);
67
68 ConstArrayView<Int32> machineRanks();
69 void machineBarrier(Int32 my_rank_global, MpiParallelMng* mpi_parallel_mng) const;
70
71 private:
72
73 void _buildMachineRanksArray(ConstArrayView<Int32> mpi_machine_ranks);
74
75 private:
76
77 Int32 m_nb_rank_local_proc = 0;
78 Int64 m_sizeof_segment_local_proc = 0;
79 IThreadBarrier* m_barrier = nullptr;
80 UniqueArray<Int32> m_machine_ranks;
81
83 Ref<IContigMachineShMemWinBaseInternal> m_sizeof_sub_segments;
84 Ref<IContigMachineShMemWinBaseInternal> m_sum_sizeof_sub_segments;
85 //-----------
87 UniqueArray<Int64> m_sizeof_resize_segments;
88};
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
91
92} // namespace Arcane::MessagePassing
93
94/*---------------------------------------------------------------------------*/
95/*---------------------------------------------------------------------------*/
96
97#endif
Constant view of an array of type T.
Class allowing the creation of a memory window for a node of computation.
Class based on MpiMachineShMemWinBaseInternal but capable of managing multiple segments per process.
Parallelism manager using MPI.
Reference to an instance.
1D data vector with value semantics (STL style).
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.