Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ArcaneDirectExecution.cc
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/* ArcaneDirectExecution.cc (C) 2000-2011 */
9/* */
10/* Direct execution service. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15
16#include "arcane/core/ISubDomain.h"
17#include "arcane/core/IDirectExecution.h"
18
19#include "arcane/std/ArcaneDirectExecution_axl.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
33class ArcaneDirectExecution
35{
36 public:
37
38 ArcaneDirectExecution(const ServiceBuildInfo& sb)
40 , m_parallel_mng(0)
41 {
42 sb.subDomain()->setDirectExecution(this);
43 }
44 virtual ~ArcaneDirectExecution() {}
45
46 public:
47
48 virtual void build() {}
49 virtual void initialize() {}
50 virtual void execute()
51 {
52 Integer nb_tool = options()->tool().size();
53 for (Integer i = 0; i < nb_tool; ++i)
54 options()->tool()[i]->execute();
55 }
56 virtual bool isActive() const
57 {
58 Integer nb_tool = options()->tool().size();
59 info() << "** NB_TOOL2=" << nb_tool;
60 return options()->tool().size() != 0;
61 }
62 virtual void setParallelMng(IParallelMng* pm)
63 {
64 m_parallel_mng = pm;
65 }
66
67 public:
68
69 IParallelMng* parallelMng() const { return m_parallel_mng; }
70
71 private:
72
73 IParallelMng* m_parallel_mng;
74};
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79ARCANE_REGISTER_SERVICE_ARCANEDIRECTEXECUTION(ArcaneDirectExecution, ArcaneDirectExecution);
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
83
84} // namespace Arcane
85
86/*---------------------------------------------------------------------------*/
87/*---------------------------------------------------------------------------*/
ArcaneArcaneDirectExecutionObject(const Arcane::ServiceBuildInfo &sbi)
Constructeur.
CaseOptionsArcaneDirectExecution * options() const
Options du jeu de données du service.
virtual void execute()
Executes the service operation.
virtual void setParallelMng(IParallelMng *pm)
Positions the associated parallelism manager. This method must be called before execute().
virtual void build()
Build-level construction of the service.
virtual bool isActive() const
True if the service is active.
Interface of the parallelism manager for a subdomain.
virtual void setDirectExecution(IDirectExecution *v)=0
Sets the direct execution service.
ISubDomain * subDomain() const
Access to the associated ISubDomain.
Structure containing the information to create a service.
TraceMessage info() const
Flow for an information message.
constexpr Integer size() const noexcept
Returns the size of the array.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.