Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
PapiPerformanceService.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/* PapiPerformanceService.h (C) 2000-2023 */
9/* */
10/* Informations de performances utilisant PAPI. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_STD_PAPIPERFORMANCESERVICE_H
13#define ARCANE_STD_PAPIPERFORMANCESERVICE_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/IProfilingService.h"
18
19#include "arcane/AbstractService.h"
20
21#include <papi.h>
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26namespace Arcane
27{
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
35: public AbstractService
36, public IProfilingService
37{
38 public:
39
41 ~PapiPerformanceService() override;
42
43 public:
44
45 void initialize() override;
46 bool isInitialized() const override { return m_is_initialized; }
47 void startProfiling() override;
48 void switchEvent() override;
49 void stopProfiling() override;
50 void printInfos(bool dump_file) override;
51 void getInfos(Int64Array&) override;
52 void dumpJSON(JSONWriter& writer) override;
53 void reset() override;
54 ITimerMng* timerMng() override;
55
56 private:
57
58 int m_period = 0;
59 int m_event_set = 0;
60 bool m_only_flops = false;
61 bool m_is_running = false;
62 bool m_is_initialized = false;
63 ITimerMng* m_timer_mng = nullptr;
64 IApplication* m_application = nullptr;
65
66 private:
67
68 void _printFlops();
69 bool _addEvent(int event_code,int event_index);
70 static void arcane_papi_handler(int EventSet, void *address,
71 long_long overflow_vector, void *context);
72};
73
74/*---------------------------------------------------------------------------*/
75/*---------------------------------------------------------------------------*/
76
77} // End namespace Arcane
78
79/*---------------------------------------------------------------------------*/
80/*---------------------------------------------------------------------------*/
81
82#endif
Classe de base d'un service.
Tableau d'items de types quelconques.
Interface de l'application.
Interface d'un service de profiling.
Interface d'un gestionnaire de timer.
Definition ITimerMng.h:53
Ecrivain au format JSON.
Definition JSONWriter.h:33
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Service de profiling utilisant la bibliothèque PAPI.
void printInfos(bool dump_file) override
Affiche les infos de profiling.
void stopProfiling() override
Stoppe le profiling.
void dumpJSON(JSONWriter &writer) override
Ecrit les infos de profiling dans l'écrivain writer.
void reset() override
Remet à zéro les compteurs.
void initialize() override
Initialise le service de profiling.
void startProfiling() override
Démarre un profiling.
bool isInitialized() const override
Indique si initialize() a déjà été appelé
ITimerMng * timerMng() override
Timer utilisant les fonctionnalités de ce service si elles existent. Peut être nul.
Structure contenant les informations pour créer un service.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-