14#include "arcane/materials/EnumeratorTracer.h"
16#include "arcane/utils/IPerformanceCounterService.h"
17#include "arcane/utils/Profiling.h"
18#include "arcane/utils/PlatformUtils.h"
19#include "arcane/utils/ForLoopTraceInfo.h"
21#include "arcane/materials/MatItemEnumerator.h"
38EnumeratorTracer(ITraceMng* tm, Ref<IPerformanceCounterService> perf_service)
40, m_perf_counter(perf_service)
55void EnumeratorTracer::
56_beginLoop(EnumeratorTraceInfo& eti)
59 m_perf_counter->getCounters(eti.counters(),
false);
60 eti.setBeginTime(platform::getRealTimeNS());
66void EnumeratorTracer::
67_endLoop(EnumeratorTraceInfo& eti)
69 m_perf_counter->getCounters(eti.counters(),
true);
70 const TraceInfo* ti = eti.traceInfo();
71 ForLoopTraceInfo loop_trace_info;
73 loop_trace_info = ForLoopTraceInfo(*ti);
74 ForLoopOneExecStat exec_stat;
75 exec_stat.setBeginTime(eti.beginTime());
76 exec_stat.setEndTime(platform::getRealTimeNS());
77 ProfilingRegistry::_threadLocalForLoopInstance()->merge(exec_stat, loop_trace_info);
83void EnumeratorTracer::
84enterEnumerator(
const ComponentEnumerator& e, EnumeratorTraceInfo& eti)
87 const TraceInfo* ti = eti.traceInfo();
88 if (ti && m_is_verbose)
89 info() <<
"Enum size=" << e.m_size <<
" where=" << *ti;
95void EnumeratorTracer::
96exitEnumerator(
const ComponentEnumerator&, EnumeratorTraceInfo& eti)
100 info() <<
"EndLoop: Component counters=" << eti.counters();
106void EnumeratorTracer::
107enterEnumerator(
const MatEnumerator&,EnumeratorTraceInfo& eti)
115void EnumeratorTracer::
116exitEnumerator(
const MatEnumerator&,EnumeratorTraceInfo& eti)
124void EnumeratorTracer::
125enterEnumerator(
const EnvEnumerator&,EnumeratorTraceInfo& eti)
133void EnumeratorTracer::
134exitEnumerator(
const EnvEnumerator&,EnumeratorTraceInfo& eti)
142void EnumeratorTracer::
143enterEnumerator(
const ComponentCellEnumerator& e,EnumeratorTraceInfo& eti)
145 ++m_nb_call_component_cell;
146 m_nb_loop_component_cell += e.m_size;
147 const TraceInfo* ti = eti.traceInfo();
148 if (ti && m_is_verbose)
149 info() <<
"ComponentCell size=" << e.m_size <<
" where=" << *ti;
156void EnumeratorTracer::
157exitEnumerator(
const ComponentCellEnumerator&, EnumeratorTraceInfo& eti)
161 info() <<
"EndLoop: ComponentCell counters=" << eti.counters();
167void EnumeratorTracer::
168enterEnumerator(
const AllEnvCellEnumerator& e,EnumeratorTraceInfo& eti)
170 ++m_nb_call_all_env_cell;
171 m_nb_loop_all_env_cell += e.m_size;
173 const TraceInfo* ti = eti.traceInfo();
174 if (ti && m_is_verbose)
175 info() <<
"ComponentCell size=" << e.m_size <<
" where=" << *ti;
182void EnumeratorTracer::
183exitEnumerator(
const AllEnvCellEnumerator&,EnumeratorTraceInfo& eti)
187 info() <<
"EndLoop: AllEnvCell counters=" << eti.counters();
193void EnumeratorTracer::
194enterEnumerator(
const CellComponentCellEnumerator& e,EnumeratorTraceInfo& eti)
196 ++m_nb_call_cell_component_cell;
197 m_nb_loop_cell_component_cell += e.m_size;
204void EnumeratorTracer::
205exitEnumerator(
const CellComponentCellEnumerator&,EnumeratorTraceInfo& eti)
213void EnumeratorTracer::
214enterEnumerator(
const ComponentPartSimdCellEnumerator&,EnumeratorTraceInfo& eti)
222void EnumeratorTracer::
223exitEnumerator(
const ComponentPartSimdCellEnumerator&,EnumeratorTraceInfo& eti)
231void EnumeratorTracer::
232enterEnumerator(
const ComponentPartCellEnumerator&,EnumeratorTraceInfo& eti)
240void EnumeratorTracer::
241exitEnumerator(
const ComponentPartCellEnumerator&,EnumeratorTraceInfo& eti)
249void EnumeratorTracer::
252 info() <<
"ENUMERATOR_TRACER_DUMP_STATS nb_call=" << m_nb_call;
253 info() <<
" nb_call_all_env_cell=" << m_nb_call_all_env_cell
254 <<
" nb_loop_all_env_cell=" << m_nb_loop_all_env_cell
255 <<
" ratio=" << (
Real)m_nb_loop_all_env_cell / (Real)(m_nb_call_all_env_cell+1);
256 info() <<
" nb_call_component_cell=" << m_nb_call_component_cell
257 <<
" nb_loop_component_cell=" << m_nb_loop_component_cell
258 <<
" ratio=" << (
Real)m_nb_loop_component_cell / (Real)(m_nb_call_component_cell+1);
259 info() <<
" nb_call_cell_component_cell=" << m_nb_call_cell_component_cell
260 <<
" nb_loop_cell_component_cell=" << m_nb_loop_cell_component_cell
261 <<
" ratio=" << (
Real)m_nb_loop_cell_component_cell / (Real)(m_nb_call_cell_component_cell+1);
Active toujours les traces dans les parties Arcane concernant les matériaux.
double Real
Type représentant un réel.