ATLAS Offline Software
Loading...
Searching...
No Matches
PerfMonTestCpuCruncherAlg.h
Go to the documentation of this file.
1
2
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
22namespace 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
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
virtual StatusCode execute() override
Gaudi::Property< float > m_rmsCpuTime
Property to setup the RMS (in ms) of CPU time to consume.
double burn(unsigned long nIterations)
std::default_random_engine m_random
Random number setup.
std::normal_distribution< double > m_distribution
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Property< float > m_meanCpuTime
Property to setup the mean (in ms) of CPU time to consume.
virtual StatusCode initialize() override
PerfMonTestPolyVectorAlg.h Example for the memory optimization tutorial.