Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
SequentialParallelSuperMng.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/* SequentialParallelSuperMng.h (C) 2000-2020 */
9/* */
10/* Sequential parallelism supervisor. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_IMPL_SEQUENTIALPARALLELSUPERMNGR_H
13#define ARCANE_IMPL_SEQUENTIALPARALLELSUPERMNGR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18#include "arcane/utils/ScopedPtr.h"
19
20#include "arcane/core/AbstractService.h"
21#include "arcane/core/ParallelSuperMngDispatcher.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
31
37class ARCANE_IMPL_EXPORT SequentialParallelSuperMng
38: public AbstractService
39, public ParallelSuperMngDispatcher
40{
41 public:
42
43 // Constructs a sequential supervisor linked to the supervisor
44 explicit SequentialParallelSuperMng(const ServiceBuildInfo& sbi);
45 SequentialParallelSuperMng(const ServiceBuildInfo& sbi, Parallel::Communicator comm);
46 ~SequentialParallelSuperMng() override;
47
48 void build() override;
49 void initialize() override;
50 IApplication* application() const override { return m_application; }
51 IThreadMng* threadMng() const override { return m_thread_mng; }
52 bool isParallel() const override { return false; }
53 Int32 commRank() const override { return 0; }
54 Int32 commSize() const override { return 0; }
55 Int32 traceRank() const override { return 0; }
56 void* getMPICommunicator() override { return m_communicator.communicatorAddress(); }
57 MP::Communicator communicator() const override { return m_communicator; }
58 bool isMasterIO() const override { return true; }
59 Integer masterIORank() const override { return 0; }
60 Integer nbLocalSubDomain() override { return 1; }
61 void barrier() override {}
62
63 Ref<IParallelMng> internalCreateWorldParallelMng(Int32 local_rank) override;
64 void tryAbort() override;
65
66 private:
67
69 IThreadMng* m_thread_mng;
70 ITimerMng* m_timer_mng;
71 ScopedPtrT<ITimerMng> m_owned_timer_mng;
72 MP::Communicator m_communicator;
73};
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
78} // End namespace Arcane
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83#endif
AbstractService(const ServiceBuildInfo &)
Constructor from a ServiceBuildInfo.
Application interface.
Interface of a thread manager.
Definition IThreadMng.h:32
Interface of a timer manager.
Definition ITimerMng.h:50
Communicator for message exchange.
Reference to an instance.
Encapsulation of an automatically destructing pointer.
Definition ScopedPtr.h:44
void initialize() override
Initializes the instance.
Integer nbLocalSubDomain() override
Number of subdomains to create locally.
void barrier() override
Parallelism manager for all allocated resources.
void * getMPICommunicator() override
Address of the MPI communicator associated with this manager.
MP::Communicator communicator() const override
MPI communicator associated with this manager.
Integer masterIORank() const override
Rank of the instance managing input/output (for which isMasterIO() is true).
Int32 commSize() const override
Returns the total number of processes used.
void build() override
Build-level construction of the service.
bool isParallel() const override
Returns true if the execution is parallel.
bool isMasterIO() const override
Returns true if the instance is a master I/O manager.
IApplication * m_application
Associated supervisor.
IApplication * application() const override
Returns the main manager.
Int32 commRank() const override
Returns the process number (between 0 and nbProcess()-1).
IThreadMng * threadMng() const override
Thread manager.
Int32 traceRank() const override
Rank of this instance for traces.
Structure containing the information to create a service.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.