ATLAS Offline Software
PerfMonTestCpuCruncherAlg.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2025 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:
32 
33  // Athena algorithm's Hooks
34  virtual StatusCode initialize() override;
35  virtual StatusCode execute() override;
36 
37  // Perform math operations to burn CPU for a number of iterations
38  double burn(unsigned long nIterations);
39 
41  // Private data:
43  private:
44 
46  Gaudi::Property<float> m_meanCpuTime{this, "MeanCpu", 100., "Mean (in ms) of CPU time to consume."};
47 
49  Gaudi::Property<float> m_rmsCpuTime{this, "RmsCpu", 5., "RMS (in ms) of CPU time to consume."};
50 
52  std::default_random_engine m_random;
53  std::normal_distribution<double> m_distribution;
54 
55 };
56 
57 } //> end namespace PerfMonTest
58 
59 #endif //> PERFMONTESTS_PERFMONTESTCPUCRUNCHERALG_H
PerfMonTest::CpuCruncherAlg::execute
virtual StatusCode execute() override
Definition: PerfMonTestCpuCruncherAlg.cxx:40
PerfMonTest::CpuCruncherAlg
Definition: PerfMonTestCpuCruncherAlg.h:25
PerfMonTest::CpuCruncherAlg::burn
double burn(unsigned long nIterations)
Definition: PerfMonTestCpuCruncherAlg.cxx:65
AthAlgorithm.h
PerfMonTest::CpuCruncherAlg::m_rmsCpuTime
Gaudi::Property< float > m_rmsCpuTime
Property to setup the RMS (in ms) of CPU time to consume.
Definition: PerfMonTestCpuCruncherAlg.h:49
PerfMonTest::CpuCruncherAlg::m_distribution
std::normal_distribution< double > m_distribution
Definition: PerfMonTestCpuCruncherAlg.h:53
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PerfMonTest::CpuCruncherAlg::m_meanCpuTime
Gaudi::Property< float > m_meanCpuTime
Property to setup the mean (in ms) of CPU time to consume.
Definition: PerfMonTestCpuCruncherAlg.h:46
PerfMonTest
PerfMonTestPolyVectorAlg.h Example for the memory optimization tutorial.
Definition: Control/PerformanceMonitoring/PerfMonTests/src/Hit.h:7
AthAlgorithm
Definition: AthAlgorithm.h:47
PerfMonTest::CpuCruncherAlg::initialize
virtual StatusCode initialize() override
Definition: PerfMonTestCpuCruncherAlg.cxx:24
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
PerfMonTest::CpuCruncherAlg::m_random
std::default_random_engine m_random
Random number setup.
Definition: PerfMonTestCpuCruncherAlg.h:52