Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
SharedMemoryMachineShMemWinBaseInternalCreator.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/* SharedMemoryMachineShMemWinBaseInternalCreator.h (C) 2000-2026 */
9/* */
10/* Class allowing the creation of objects of type */
11/* SharedMemoryContigMachineShMemWinBaseInternal. An instance of this object */
12/* must be shared by all threads. */
13/*---------------------------------------------------------------------------*/
14
15#ifndef ARCANE_PARALLEL_THREAD_INTERNAL_SHAREDMEMORYMACHINESHMEMWINBASEINTERNALCREATOR_H
16#define ARCANE_PARALLEL_THREAD_INTERNAL_SHAREDMEMORYMACHINESHMEMWINBASEINTERNALCREATOR_H
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
22#include "arcane/utils/UniqueArray.h"
23#include "arcane/utils/Ref.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
33
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40class SharedMemoryMachineShMemWinBaseInternalCreator
41{
42 public:
43
44 SharedMemoryMachineShMemWinBaseInternalCreator(Int32 nb_rank, IThreadBarrier* barrier);
45 ~SharedMemoryMachineShMemWinBaseInternalCreator() = default;
46
47 public:
48
49 SharedMemoryContigMachineShMemWinBaseInternal* createWindow(Int32 my_rank, Int64 sizeof_segment, Int32 sizeof_type);
50 SharedMemoryMachineShMemWinBaseInternal* createDynamicWindow(Int32 my_rank, Int64 sizeof_segment, Int32 sizeof_type);
51 ConstArrayView<Int32> machineRanks() const;
52 void machineBarrier() const;
53
54 private:
55
56 Int32 m_nb_rank = 0;
57 Int64 m_sizeof_window = 0;
58 UniqueArray<Int32> m_ranks;
59 IThreadBarrier* m_barrier = nullptr;
60
62 Ref<UniqueArray<Int64>> m_sizeof_segments;
63 Ref<UniqueArray<Int64>> m_sum_sizeof_segments;
64 //-------
66 Ref<UniqueArray<Int32>> m_target_segments;
67};
68
69/*---------------------------------------------------------------------------*/
70/*---------------------------------------------------------------------------*/
71
72} // namespace Arcane::MessagePassing
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77#endif
Declarations of Arcane's general types.
Constant view of an array of type T.
Reference to an instance.
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.