Arcane  v3.14.10.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
Stat.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* Stat.h (C) 2000-2023 */
9/* */
10/* Statistiques sur le parallélisme. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSING_STAT_H
13#define ARCCORE_MESSAGEPASSING_STAT_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing/IStat.h"
18
19#include "arccore/base/String.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29/*!
30 * \internal
31 * \brief Ensemble de données statistiques pour le profiling.
32 *
33 * Cette classe est interne à Arccore.
34 */
35class ARCCORE_MESSAGEPASSING_EXPORT StatData
36{
37 //! DEPRECATED
38 using OneStatMap = std::map<String, OneStat*>;
39
40 public:
41
42 StatData() = default;
43
44 ARCCORE_DEPRECATED_REASON("Y2023: use mergeData() for each OneStat instead")
45 explicit StatData(const OneStatMap& os_map);
46
47 const StatCollection& stats() const { return m_stat_col; }
48
49 void resetCurrentStat();
50
51 void mergeData(OneStat one_stat);
52 void mergeAllData(const StatData& all_stat);
53
54 ARCCORE_DEPRECATED_REASON("Y2023: Use mergeAllData(const StatData&) instead")
55 void mergeAllData(const OneStatMap& all_stat);
56
57 private:
58
59 StatCollection m_stat_col;
60};
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64/*!
65 * \internal
66 * \brief Gestionnaire de statistiques sur le parallélisme.
67 *
68 * Cette classe est interne à Arccore.
69 */
70class ARCCORE_MESSAGEPASSING_EXPORT Stat
71: public IStat
72{
73 public:
74
75 //! DEPRECATED
76 using OneStatMap = std::map<String, OneStat*>;
77
78 public:
79
80 typedef std::pair<String, OneStat*> OneStatValue;
81
82 public:
83
84 //! Libère les ressources.
85 ~Stat() override;
86
87 public:
88
89 void add(const String& name, double elapsed_time, Int64 msg_size) override;
90 void enable(bool is_enabled) override { m_is_enabled = is_enabled; }
91
92 void print(std::ostream& o);
93
94 ARCCORE_DEPRECATED_2019("Use statList() instead")
95 const OneStatMap& stats() const override { return m_list; }
96
97 ARCCORE_DEPRECATED_REASON("Y2023: Use statList() instead")
98 const StatData& getData() const { return m_data; }
99
100 const StatCollection& statList() const override;
101
102 void resetCurrentStat() override;
103
104 private:
105
106 bool m_is_enabled = true;
107 OneStatMap m_list;
108 StatData m_data;
109
110 private:
111
112 OneStat* _find(const String& name);
113};
114
115/*---------------------------------------------------------------------------*/
116/*---------------------------------------------------------------------------*/
117
118} // namespace Arccore::MessagePassing
119
120/*---------------------------------------------------------------------------*/
121/*---------------------------------------------------------------------------*/
122
123#endif
void enable(bool is_enabled) override
Active ou désactive les statistiques.
Definition Stat.h:90
std::map< String, OneStat * > OneStatMap
DEPRECATED.
Definition Stat.h:76
Chaîne de caractères unicode.
Espace de nommage contenant les types et déclarations qui gèrent le mécanisme de parallélisme par éch...
std::int64_t Int64
Type entier signé sur 64 bits.