Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
TimeMetric.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* TimeMetric.h (C) 2000-2020 */
9/* */
10/* Classes gérant les métriques temporelles. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/trace/TimeMetric.h"
15#include "arccore/trace/ITimeMetricCollector.h"
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20namespace Arccore
21{
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace
27{
28inline TimeMetricAction _build(ITimeMetricCollector* c,TimeMetricPhase p)
29{
30 if (c)
31 return TimeMetricAction(c,TimeMetricActionBuildInfo(String(),(int)p));
32 return TimeMetricAction();
33}
34}
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
39void StandardPhaseTimeMetrics::
40initialize(ITimeMetricCollector* collector)
41{
42 if (!collector)
43 return;
44 m_message_passing_phase = _build(collector,TimeMetricPhase::MessagePassing);
45 m_input_output_phase = _build(collector,TimeMetricPhase::InputOutput);
46 m_computation_phase = _build(collector,TimeMetricPhase::Computation);
47}
48
49/*---------------------------------------------------------------------------*/
50/*---------------------------------------------------------------------------*/
51
52TimeMetricAction
53timeMetricPhaseMessagePassing(ITimeMetricCollector* c)
54{
55 return _build(c,TimeMetricPhase::MessagePassing);
56}
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
60
61TimeMetricAction
62timeMetricPhaseInputOutput(ITimeMetricCollector* c)
63{
64 return _build(c,TimeMetricPhase::InputOutput);
65}
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70TimeMetricAction
71timeMetricPhaseComputation(ITimeMetricCollector* c)
72{
73 return _build(c,TimeMetricPhase::Computation);
74}
75
76/*---------------------------------------------------------------------------*/
77/*---------------------------------------------------------------------------*/
78
79} // End namespace Arccore
80
81/*---------------------------------------------------------------------------*/
82/*---------------------------------------------------------------------------*/
Espace de nom de Arccore.
Definition ArcaneTypes.h:24
TimeMetricPhase
Catégories standards pour les phases temporelles.
Definition TimeMetric.h:35