Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
ITimeStats.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/* ITimeStats.h (C) 2000-2025 */
9/* */
10/* Interface managing execution time statistics. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITIMESTATS_H
13#define ARCANE_CORE_ITIMESTATS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24class Properties;
25class Timer;
26class JSONWriter;
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
44{
45 public:
46
47 // Releases resources.
48 virtual ~ITimeStats() = default;
49
50 public:
51
53 virtual void beginGatherStats() = 0;
55 virtual void endGatherStats() = 0;
56
57 public:
58
59 virtual void beginAction(const String& action_name) = 0;
60 virtual void endAction(const String& action_name, bool print_time) = 0;
61
62 virtual void beginPhase(eTimePhase phase) = 0;
63 virtual void endPhase(eTimePhase phase) = 0;
64
65 public:
66
72 virtual Real elapsedTime(eTimePhase phase) = 0;
73
81 virtual Real elapsedTime(eTimePhase phase, const String& action) = 0;
82
89 virtual void dumpCurrentStats(const String& name) = 0;
90
91 public:
92
100 virtual void dumpStats(std::ostream& ostr, bool is_verbose, Real nb,
101 const String& name, bool use_elapsed_time = false) = 0;
102
112
119 virtual bool isGathering() const = 0;
120
122 virtual void dumpStatsJSON(JSONWriter& writer) = 0;
123
126
132 virtual void notifyNewIterationLoop() = 0;
133 virtual void saveTimeValues(Properties* p) = 0;
134 virtual void mergeTimeValues(Properties* p) = 0;
135
136 /*
137 * \brief Resets the current statistics for an action and its sub-actions
138 *
139 * Resets the statistics for action \a action_name and its
140 * sub-actions. If no action named \a action_name exists, it does nothing.
141 *
142 * This method is reserved for testing and should not be used
143 * outside of this configuration to avoid invalidating the
144 * temporal statistics.
145 */
146 virtual void resetStats(const String& action_name) = 0;
147};
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
152} // End namespace Arcane
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157#endif
Declarations of Arcane's general types.
Interface of the parallelism manager for a subdomain.
Interface managing statistics on execution.
Interface managing execution time statistics.
Definition ITimeStats.h:44
virtual Real elapsedTime(eTimePhase phase)=0
Real elapsed time for phase phase.
virtual void dumpTimeAndMemoryUsage(IParallelMng *pm)=0
Displays the current date and memory consumption.
virtual void dumpCurrentStats(const String &name)=0
Displays statistics for an action.
virtual void endGatherStats()=0
Stops time collection.
virtual void beginGatherStats()=0
Starts time collection.
virtual ITimeMetricCollector * metricCollector()=0
Associated collection interface.
virtual void dumpStats(std::ostream &ostr, bool is_verbose, Real nb, const String &name, bool use_elapsed_time=false)=0
Displays execution time statistics.
virtual bool isGathering() const =0
Indicates if statistics are active.
virtual void notifyNewIterationLoop()=0
Notifies that a new iteration of the calculation loop begins.
virtual Real elapsedTime(eTimePhase phase, const String &action)=0
Elapsed time for a phase of an action.
virtual void dumpStatsJSON(JSONWriter &writer)=0
Serializes the temporal statistics into the writer writer.
List of properties.
Definition Properties.h:65
Management of a timer.
Definition Timer.h:63
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
double Real
Type representing a real number.
eTimePhase
Phase of a temporal action.