ATLAS Offline Software
PerfMonTestCpuCruncherAlg.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // PerfMonTestCpuCruncherAlg.h
8 // Header file for class PerfMonTest::CpuCruncherAlg
9 // Author: S.Binet<binet@cern.ch>, A. S. Mete<amete@cern.ch>
11 #ifndef PERFMONTESTS_PERFMONTESTCPUCRUNCHERALG_H
12 #define PERFMONTESTS_PERFMONTESTCPUCRUNCHERALG_H
13 
14 // STL includes
15 #include <string>
16 #include <random>
17 
18 // FrameWork includes
20 #include "GaudiKernel/ServiceHandle.h"
21 
22 namespace PerfMonTest {
23 
25 {
26 
28  // Public methods:
30  public:
31 
32  // Copy constructor:
33 
35  CpuCruncherAlg( const std::string& name, ISvcLocator* pSvcLocator );
36 
38  virtual ~CpuCruncherAlg();
39 
40  // Assignment operator:
41  //CpuCruncherAlg &operator=(const CpuCruncherAlg &alg);
42 
43  // Athena algorithm's Hooks
44  virtual StatusCode initialize();
45  virtual StatusCode execute();
46  virtual StatusCode finalize();
47 
48  // Perform math operations to burn CPU for a number of iterations
49  double burn(unsigned long nIterations);
50 
52  // Private data:
54  private:
55 
58 
61 
63  float m_rmsCpuTime;
64 
66  std::default_random_engine m_random;
67  std::normal_distribution<double> m_distribution;
68 
69 };
70 
71 } //> end namespace PerfMonTest
72 
73 #endif //> PERFMONTESTS_PERFMONTESTCPUCRUNCHERALG_H
PerfMonTest::CpuCruncherAlg
Definition: PerfMonTestCpuCruncherAlg.h:25
PerfMonTest::CpuCruncherAlg::finalize
virtual StatusCode finalize()
Definition: PerfMonTestCpuCruncherAlg.cxx:74
PerfMonTest::CpuCruncherAlg::initialize
virtual StatusCode initialize()
Definition: PerfMonTestCpuCruncherAlg.cxx:59
PerfMonTest::CpuCruncherAlg::burn
double burn(unsigned long nIterations)
Definition: PerfMonTestCpuCruncherAlg.cxx:105
AthAlgorithm.h
PerfMonTest::CpuCruncherAlg::m_meanCpuTime
float m_meanCpuTime
Property to setup the mean (in ms) of CPU time to consume.
Definition: PerfMonTestCpuCruncherAlg.h:60
PerfMonTest::CpuCruncherAlg::m_distribution
std::normal_distribution< double > m_distribution
Definition: PerfMonTestCpuCruncherAlg.h:67
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PerfMonTest::CpuCruncherAlg::CpuCruncherAlg
CpuCruncherAlg()
Default constructor:
PerfMonTest::CpuCruncherAlg::execute
virtual StatusCode execute()
Definition: PerfMonTestCpuCruncherAlg.cxx:80
PerfMonTest
PerfMonTestPolyVectorAlg.h Example for the memory optimization tutorial.
Definition: Control/PerformanceMonitoring/PerfMonTests/src/Hit.h:7
AthAlgorithm
Definition: AthAlgorithm.h:47
PerfMonTest::CpuCruncherAlg::m_rmsCpuTime
float m_rmsCpuTime
Property to setup the RMS (in ms) of CPU time to consume.
Definition: PerfMonTestCpuCruncherAlg.h:63
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PerfMonTest::CpuCruncherAlg::~CpuCruncherAlg
virtual ~CpuCruncherAlg()
Destructor:
Definition: PerfMonTestCpuCruncherAlg.cxx:52
PerfMonTest::CpuCruncherAlg::m_random
std::default_random_engine m_random
Random number setup.
Definition: PerfMonTestCpuCruncherAlg.h:66