Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v38r0 (2143aa4c)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
SequencerTimerTool.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #ifndef SEQUENCERTIMERTOOL_H
12 #define SEQUENCERTIMERTOOL_H 1
13 
14 // Include files
15 // from Gaudi
18 
19 // local
20 #include "TimerForSequencer.h"
21 
35 class SequencerTimerTool : public GaudiHistoTool, virtual public ISequencerTimerTool {
36 
37 public:
41 
42 public:
45 
47  StatusCode initialize() override;
48 
50  StatusCode finalize() override;
51 
53  int addTimer( const std::string& name ) override;
54 
56  void increaseIndent() override { m_indent += 1; }
57 
59  void decreaseIndent() override { m_indent = std::max( m_indent - 1, 0 ); }
60 
62  void start( int index ) override { m_timerList[index].start(); }
63 
65  double stop( int index ) override { return m_timerList[index].stop(); }
66 
68  double lastTime( int index ) override { return m_timerList[index].lastTime(); }
69 
71  const std::string& name( int index ) override { return m_timerList[index].name(); }
72 
74  int indexByName( const std::string& name ) override;
75 
77  bool globalTiming() override { return m_globalTiming; };
78 
80  void saveHistograms() override;
81 
82 private:
83  Gaudi::Property<int> m_shots{ this, "Shots", 3500000, "number of shots for CPU normalization" };
84  Gaudi::Property<bool> m_normalised{ this, "Normalised", false, "normalise the time to a nominal PIII" };
85  Gaudi::Property<bool> m_globalTiming{ this, "GlobalTiming", false };
87  "number of characters to be used in algorithm name column" };
88 
89  int m_indent = 0;
91  double m_normFactor = 0.001;
92  double m_speedRatio = 0;
93 };
94 #endif // SEQUENCERTIMERTOOL_H
SequencerTimerTool::m_globalTiming
Gaudi::Property< bool > m_globalTiming
Definition: SequencerTimerTool.h:85
SequencerTimerTool::initialize
StatusCode initialize() override
initialize method, to compute the normalization factor
Definition: SequencerTimerTool.cpp:46
GaudiHistoTool
Definition: GaudiHistoTool.h:49
std::string
STL class.
SequencerTimerTool::stop
double stop(int index) override
stop the counter, return the elapsed time
Definition: SequencerTimerTool.h:65
SequencerTimerTool::m_headerSize
Gaudi::Property< std::string::size_type > m_headerSize
Definition: SequencerTimerTool.h:86
std::vector< TimerForSequencer >
SequencerTimerTool::indexByName
int indexByName(const std::string &name) override
returns the index of the counter with that name, or -1
Definition: SequencerTimerTool.cpp:94
IAlgTool::start
virtual StatusCode start()=0
Start (from INITIALIZED to RUNNING).
SequencerTimerTool::addTimer
int addTimer(const std::string &name) override
add a timer entry with the specified name
Definition: SequencerTimerTool.cpp:130
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
GaudiHistoTool.h
ISequencerTimerTool
Definition: ISequencerTimerTool.h:24
SequencerTimerTool::m_indent
int m_indent
Amount of indentation.
Definition: SequencerTimerTool.h:89
StatusCode
Definition: StatusCode.h:65
SequencerTimerTool::m_speedRatio
double m_speedRatio
Definition: SequencerTimerTool.h:92
TimerForSequencer.h
SequencerTimerTool::SequencerTimerTool
SequencerTimerTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: SequencerTimerTool.cpp:36
SequencerTimerTool::lastTime
double lastTime(int index) override
returns the last time
Definition: SequencerTimerTool.h:68
SequencerTimerTool::saveHistograms
void saveHistograms() override
prepares and saves the timing histograms
Definition: SequencerTimerTool.cpp:109
SequencerTimerTool::m_timerList
std::vector< TimerForSequencer > m_timerList
Definition: SequencerTimerTool.h:90
IAlgTool::type
virtual const std::string & type() const =0
The type of an AlgTool, meaning the concrete AlgTool class.
SequencerTimerTool::m_normFactor
double m_normFactor
Factor to convert to standard CPU (1 GHz PIII)
Definition: SequencerTimerTool.h:91
IAlgTool::stop
virtual StatusCode stop()=0
Stop (from RUNNING to INITIALIZED).
IAlgTool::parent
virtual const IInterface * parent() const =0
The parent of the concrete AlgTool.
SequencerTimerTool
Definition: SequencerTimerTool.h:35
SequencerTimerTool::increaseIndent
void increaseIndent() override
Increase the indentation of the name.
Definition: SequencerTimerTool.h:56
SequencerTimerTool::decreaseIndent
void decreaseIndent() override
Decrease the indentation of the name.
Definition: SequencerTimerTool.h:59
IInterface
Definition: IInterface.h:237
ISequencerTimerTool.h
std::max
T max(T... args)
SequencerTimerTool::m_normalised
Gaudi::Property< bool > m_normalised
Definition: SequencerTimerTool.h:84
SequencerTimerTool::globalTiming
bool globalTiming() override
returns the flag telling that global timing is wanted
Definition: SequencerTimerTool.h:77
SequencerTimerTool::finalize
StatusCode finalize() override
finalize method, to print the time summary table
Definition: SequencerTimerTool.cpp:71
SequencerTimerTool::start
void start(int index) override
start the counter, i.e.
Definition: SequencerTimerTool.h:62
SequencerTimerTool::name
const std::string & name(int index) override
returns the name of the counter
Definition: SequencerTimerTool.h:71
SequencerTimerTool::m_shots
Gaudi::Property< int > m_shots
Definition: SequencerTimerTool.h:83
Gaudi::Property< int >
Gaudi::ParticleProperties::index
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
Definition: IParticlePropertySvc.cpp:39