Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IEntryPoint.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/* IEntryPoint.h (C) 2000-2025 */
9/* */
10/* Interface of a module entry point. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IENTRYPOINT_H
13#define ARCANE_CORE_IENTRYPOINT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/Timer.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25class IModule;
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*!
31 * \brief Interface of a module entry point.
32 * \ingroup Module
33 */
34class ARCANE_CORE_EXPORT IEntryPoint
35{
36 public:
37
38 /*! @name Call point
39 Where the entry point is used.
40 */
41 //@{
42 //! called during the calculation loop
43 static const char* const WComputeLoop;
44 //! called for module construction
45 static const char* const WBuild;
46 //! called during initialization
47 static const char* const WInit;
48 //! called during continuation initialization
49 static const char* const WContinueInit;
50 //! called during new case initialization
51 static const char* const WStartInit;
52 //! called to restore variables during a rollback
53 static const char* const WRestore;
54 //! called after a mesh change
55 static const char* const WOnMeshChanged;
56 //! called after mesh refinement
57 static const char* const WOnMeshRefinement;
58 //!< called upon code termination.
59 static const char* const WExit;
60 //@}
61
62 /*!
63 * \brief Properties of an entry point.
64 */
65 enum
66 {
67 PNone = 0, //!< No properties
68 /*!
69 * \brief Automatically loaded at the beginning.
70 * This means that a module possessing an entry point with this
71 * property will always be loaded, and the entry point will be added
72 * to the list of entry points executing at the beginning of the time loop.
73 */
75 /*!
76 * \brief Automatically loaded at the end.
77 * This means that a module possessing an entry point with this
78 * property will always be loaded, and the entry point will be added
79 * to the list of entry points executing at the end of the time loop.
80 */
82 };
83
84 public:
85
86 virtual ~IEntryPoint() = default; //!< Releases resources
87
88 public:
89
90 //! Returns the name of the entry point.
91 virtual String name() const = 0;
92
93 //! Full name (with the module) of the entry point. This name is unique.
94 virtual String fullName() const = 0;
95
96 public:
97
98 //! Returns the main manager
99 ARCANE_DEPRECATED_REASON("Y2022: Do not use this method. Try to get 'ISubDomain' from another way")
100 virtual ISubDomain* subDomain() const = 0;
101
102 //! Returns the module associated with the entry point
103 virtual IModule* module() const = 0;
104
105 //! Calls the entry point
106 virtual void executeEntryPoint() = 0;
107
108 /*!
109 * \brief Total CPU consumption spent in this entry point (in milliseconds).
110 *
111 * \note since version 3.6 of Arcane, this method returns the same value
112 * as totalElapsedTime().
113 */
114 virtual Real totalCPUTime() const = 0;
115
116 /*!
117 * \brief CPU consumption of the last iteration (in milliseconds).
118 *
119 * \note since version 3.6 of Arcane, this method returns the same value
120 * as lastElapsedTime().
121 */
122 virtual Real lastCPUTime() const = 0;
123
124 //! Elapsed execution time (clock time) in this entry point (in milliseconds)
125 virtual Real totalElapsedTime() const = 0;
126
127 //! Elapsed execution time (clock time) of the last iteration (in milliseconds).
128 virtual Real lastElapsedTime() const = 0;
129
130 /*!
131 * \brief Returns totalElapsedTime().
132 * \deprecated Use totalElapsedTime() instead
133 */
134 ARCANE_DEPRECATED_REASON("Y2022: Use totalElapsedTime() instead")
135 virtual Real totalTime(Timer::eTimerType) const = 0;
136
137 /*!
138 * \brief Returns lastElapsedTime().
139 * \deprecated Use lastElapsedTime() instead
140 */
141 ARCANE_DEPRECATED_REASON("Y2022: Use lastElapsedTime() instead")
142 virtual Real lastTime(Timer::eTimerType) const = 0;
143
144 //! Returns the number of times the entry point has been executed
145 virtual Integer nbCall() const = 0;
146
147 //! Returns where the entry point is called.
148 virtual String where() const = 0;
149
150 //! Returns the properties of the entry point.
151 virtual int property() const = 0;
152};
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157} // End namespace Arcane
158
159/*---------------------------------------------------------------------------*/
160/*---------------------------------------------------------------------------*/
161
162#endif
Declarations of Arcane's general types.
Interface of a module entry point.
Definition IEntryPoint.h:35
virtual Real lastTime(Timer::eTimerType) const =0
Returns lastElapsedTime().
virtual Real totalTime(Timer::eTimerType) const =0
Returns totalElapsedTime().
virtual void executeEntryPoint()=0
Calls the entry point.
virtual Real totalElapsedTime() const =0
Elapsed execution time (clock time) in this entry point (in milliseconds).
static const char *const WComputeLoop
called during the calculation loop
Definition IEntryPoint.h:43
static const char *const WBuild
called for module construction
Definition IEntryPoint.h:45
virtual Real lastElapsedTime() const =0
Elapsed execution time (clock time) of the last iteration (in milliseconds).
virtual Real lastCPUTime() const =0
CPU consumption of the last iteration (in milliseconds).
virtual ISubDomain * subDomain() const =0
Returns the main manager.
static const char *const WStartInit
called during new case initialization
Definition IEntryPoint.h:51
static const char *const WRestore
called to restore variables during a rollback
Definition IEntryPoint.h:53
virtual Integer nbCall() const =0
Returns the number of times the entry point has been executed.
static const char *const WOnMeshRefinement
called after mesh refinement
Definition IEntryPoint.h:57
virtual String fullName() const =0
Full name (with the module) of the entry point. This name is unique.
@ PNone
No properties.
Definition IEntryPoint.h:67
@ PAutoLoadEnd
Automatically loaded at the end. This means that a module possessing an entry point with this propert...
Definition IEntryPoint.h:81
@ PAutoLoadBegin
Automatically loaded at the beginning. This means that a module possessing an entry point with this p...
Definition IEntryPoint.h:74
virtual int property() const =0
Returns the properties of the entry point.
virtual Real totalCPUTime() const =0
Total CPU consumption spent in this entry point (in milliseconds).
static const char *const WOnMeshChanged
called after a mesh change
Definition IEntryPoint.h:55
static const char *const WContinueInit
called during continuation initialization
Definition IEntryPoint.h:49
virtual String where() const =0
Returns where the entry point is called.
static const char *const WInit
called during initialization
Definition IEntryPoint.h:47
virtual IModule * module() const =0
Returns the module associated with the entry point.
virtual String name() const =0
Returns the name of the entry point.
virtual ~IEntryPoint()=default
Releases resources.
Interface of a module.
Definition IModule.h:40
Interface of the subdomain manager.
Definition ISubDomain.h:75
Management of a timer.
Definition Timer.h:63
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.