Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CPUCrunchSvc.h
Go to the documentation of this file.
1 #ifndef GAUDISVC_CPUCRUNCHSVC_H
2 #define GAUDISVC_CPUCRUNCHSVC_H 1
3 
4 #include "GaudiKernel/ClassID.h"
5 #include "GaudiKernel/Service.h"
7 
9 #include <chrono>
10 #include <string>
11 #include <vector>
12 
13 class CPUCrunchSvc : public extends<Service, ICPUCrunchSvc> {
14 
15 public:
16  CPUCrunchSvc( const std::string& name, ISvcLocator* svc );
17 
18 public:
19  virtual StatusCode initialize() override;
20 
21 public:
22  // number of seconds to CPUCrunch
23  std::chrono::milliseconds crunch_for( const std::chrono::milliseconds& crunchtime ) const override;
24 
25 private:
26  void calibrate();
27  unsigned int getNCaliIters( std::chrono::microseconds runtime ) const;
28  void findPrimes( unsigned int ) const;
29 
31 
33  this, "NIterationsVect", {}, "Number of iterations for the calibration."};
34  Gaudi::Property<bool> m_shortCalib{this, "shortCalib", false, "Enable coarse grained calibration"};
36  "Minimum number of milliseconds to do calibration"};
37  Gaudi::Property<int> m_numCalibRuns{this, "numCalibRuns", 1, "Number of times to do calibration run"};
38  Gaudi::Property<float> m_corrFact{this, "calibCorrectionFactor", 1.,
39  "Calibration correction factor to take into account things like turbo boost"};
40 };
41 
42 #endif
unsigned int getNCaliIters(std::chrono::microseconds runtime) const
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:274
Gaudi::Property< unsigned int > m_minCalibTime
Definition: CPUCrunchSvc.h:35
Implementation of property with value of concrete type.
Definition: Property.h:352
void findPrimes(unsigned int) const
STL class.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Gaudi::Property< bool > m_shortCalib
Definition: CPUCrunchSvc.h:34
Gaudi::Property< float > m_corrFact
Definition: CPUCrunchSvc.h:38
void calibrate()
Gaudi::Property< int > m_numCalibRuns
Definition: CPUCrunchSvc.h:37
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
virtual StatusCode initialize() override
std::vector< unsigned int > m_times_vect
Definition: CPUCrunchSvc.h:30
CPUCrunchSvc(const std::string &name, ISvcLocator *svc)
std::chrono::milliseconds crunch_for(const std::chrono::milliseconds &crunchtime) const override
Gaudi::Property< std::vector< unsigned int > > m_niters_vect
Definition: CPUCrunchSvc.h:32