12#ifndef ARCANE_IMPL_TIMESTATS_H
13#define ARCANE_IMPL_TIMESTATS_H
17#include "arcane/utils/List.h"
18#include "arcane/utils/TraceAccessor.h"
19#include "arcane/utils/FixedArray.h"
21#include "arcane/core/ITimeStats.h"
58 static const Integer TC_Local = 0;
59 static const Integer TC_Cumulative = 1;
65 TimeValue(
Real real_time,
Real virtual_time)
67 m_time[TT_Real][TC_Local] = real_time;
68 m_time[TT_Virtual][TC_Local] = virtual_time;
76 void add(
const TimeValue& phase)
79 m_time[i][TC_Local] += phase.m_time[i][TC_Local];
93 : TimeValue(real_time, virtual_time)
96 PhaseValue() =
default;
110 TimeStats(
const TimeStats& rhs) =
delete;
111 TimeStats& operator=(
const TimeStats& rhs) =
delete;
112 ~TimeStats()
override;
121 void beginAction(
const String& action_name)
override;
122 void endAction(
const String& action_name,
bool print_time)
override;
123 void beginPhase(
eTimePhase phase_type)
override;
124 void endPhase(
eTimePhase phase_type)
override;
134 const String& name,
bool use_elapsed_time)
override;
149 void resetStats(
const String& name)
override;
154 Timer* m_virtual_timer =
nullptr;
155 Timer* m_real_timer =
nullptr;
156 bool m_is_gathering =
false;
162 Action* m_main_action =
nullptr;
163 Action* m_current_action =
nullptr;
164 std::stack<eTimePhase> m_phases_type;
165 bool m_need_compute_elapsed_time =
false;
166 std::ostringstream m_full_stats_str;
167 bool m_full_stats =
false;
175 void _checkGathering();
176 void _computeCumulativeTimes();
177 void _dumpCumulativeTime(std::ostream& ostr,
Action& action,
eTimePhase tp, eTimeType tt);
178 void _dumpAllPhases(std::ostream& ostr,
Action& action, eTimeType tt,
int tc,
Real nb);
Interface of the parallelism manager for a subdomain.
Interface managing statistics on execution.
Interface managing execution time statistics.
Interface of a timer manager.
Implementation of a collection of elements in vector form.
Unicode character string.
Real elapsedTime(eTimePhase phase) override
Real elapsed time for phase phase.
void dumpStats(std::ostream &ostr, bool is_verbose, Real nb, const String &name, bool use_elapsed_time) override
Displays execution time statistics.
void endGatherStats() override
Stops time collection.
void dumpCurrentStats(const String &action) override
Displays statistics for an action.
ActionSeries * m_previous_action_series
Statistics on previous executions.
bool isGathering() const override
Indicates if statistics are active.
void dumpStatsJSON(JSONWriter &writer) override
Serializes the temporal statistics into the writer writer.
ITimeMetricCollector * metricCollector() override
Associated collection interface.
void notifyNewIterationLoop() override
Notifies that a new iteration of the calculation loop begins.
static const Integer NB_TIME_TYPE
Number of eTimeType values.
void beginGatherStats() override
Starts time collection.
ActionSeries * m_current_action_series
Statistics on current execution.
void dumpTimeAndMemoryUsage(IParallelMng *pm) override
Displays the current date and memory consumption.
TraceAccessor(ITraceMng *m)
Constructs an accessor via the trace manager m.
-- 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.
eTimePhase
Phase of a temporal action.