Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
SharedMemoryParallelSuperMng.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/* SharedMemoryParallelSuperMng.h (C) 2000-2020 */
9/* */
10/* Implementation of 'IParallelSuperMng' shared memory mode. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_PARALLEL_THREAD_SHAREDMEMORYPARALLELSUPERMNG_H
13#define ARCANE_PARALLEL_THREAD_SHAREDMEMORYPARALLELSUPERMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IParallelSuperMng.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
26}
27
29{
30
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
39class ARCANE_THREAD_EXPORT SharedMemoryParallelSuperMng
40: public IParallelSuperMng
41{
42 public:
43
44 explicit SharedMemoryParallelSuperMng(const ServiceBuildInfo& sbi);
45 SharedMemoryParallelSuperMng(const ServiceBuildInfo& sbi, Parallel::Communicator communicator,
46 bool has_mpi_init);
47 ~SharedMemoryParallelSuperMng() override;
48
49 void initialize() override;
50 void build() override;
51
52 IApplication* application() const override { return m_application; }
53 IThreadMng* threadMng() const override;
54 bool isParallel() const override { return m_is_parallel; }
55 Int32 commRank() const override { return 0; }
56 Int32 commSize() const override { return 0; }
57 Int32 traceRank() const override { return 0; }
58 void* getMPICommunicator() override { return m_communicator.communicatorAddress(); }
59 Parallel::Communicator communicator() const override { return m_communicator; }
60 Ref<IParallelMng> internalCreateWorldParallelMng(Int32 local_rank) override;
61 void tryAbort() override;
62 bool isMasterIO() const override { return commRank() == 0; }
63 Int32 masterIORank() const override { return 0; }
64 Int32 nbLocalSubDomain() override;
65 void barrier() override {}
66
67 public:
68
69 void broadcast(ByteArrayView send_buf, Int32 rank) override;
70 void broadcast(Int32ArrayView send_buf, Int32 rank) override;
71 void broadcast(Int64ArrayView send_buf, Int32 rank) override;
72 void broadcast(RealArrayView send_buf, Int32 rank) override;
73
74 public:
75
77 Parallel::IStat* m_stat;
79 SharedMemoryParallelMngContainer* m_container = nullptr;
80 Ref<IParallelMngContainerFactory> m_builder_factory;
81 Ref<IParallelMngContainer> m_main_builder;
82 Parallel::Communicator m_communicator;
83 bool m_has_mpi_init = false;
84};
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
88
89} // End namespace Arcane::MessagePassing
90
91/*---------------------------------------------------------------------------*/
92/*---------------------------------------------------------------------------*/
93
94#endif
File containing declarations concerning the message passing model.
Application interface.
Abstract class of the parallelism supervisor.
Interface of a thread manager.
Definition IThreadMng.h:32
Communicator for message exchange.
Container for shared memory message manager information.
void build() override
Constructs the instance members.
Int32 commSize() const override
Returns the total number of processes used.
void barrier() override
Parallelism manager for all allocated resources.
void * getMPICommunicator() override
Address of the MPI communicator associated with this manager.
Parallel::Communicator communicator() const override
MPI communicator associated with this manager.
Int32 commRank() const override
Returns the process number (between 0 and nbProcess()-1).
bool isMasterIO() const override
Returns true if the instance is a master I/O manager.
bool isParallel() const override
Returns true if the execution is parallel.
Int32 masterIORank() const override
Rank of the instance managing input/output (for which isMasterIO() is true).
IApplication * application() const override
Returns the main manager.
Int32 traceRank() const override
Rank of this instance for traces.
Reference to an instance.
Structure containing the information to create a service.
Declarations of types and methods used by message exchange mechanisms.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ArrayView< Int64 > Int64ArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:451
ArrayView< Byte > ByteArrayView
C equivalent of a 1D array of characters.
Definition UtilsTypes.h:447
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:453
ArrayView< Real > RealArrayView
C equivalent of a 1D array of reals.
Definition UtilsTypes.h:459
std::int32_t Int32
Signed integer type of 32 bits.