The Gaudi Framework
master (9f3f8895)
Toggle main menu visibility
Loading...
Searching...
No Matches
CPUCrunchSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 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
#pragma once
12
13
#include <
GaudiKernel/ClassID.h
>
14
#include <
GaudiKernel/Service.h
>
15
#include <
GaudiKernel/StatusCode.h
>
16
17
#include <
GaudiKernel/ICPUCrunchSvc.h
>
18
#include <chrono>
19
#include <string>
20
#include <vector>
21
22
class
CPUCrunchSvc
:
public
extends
<Service, ICPUCrunchSvc> {
23
24
public
:
25
CPUCrunchSvc
(
const
std::string&
name
,
ISvcLocator
* svc );
26
27
public
:
28
virtual
StatusCode
initialize
()
override
;
29
30
public
:
31
// number of seconds to CPUCrunch
32
std::chrono::milliseconds
crunch_for
(
const
std::chrono::milliseconds& crunchtime )
const override
;
33
34
private
:
35
void
calibrate
();
36
unsigned
int
getNCaliIters
( std::chrono::microseconds runtime )
const
;
37
void
findPrimes
(
unsigned
int
)
const
;
38
39
std::vector<unsigned int>
m_times_vect
;
40
41
Gaudi::Property<std::vector<unsigned int>
>
m_niters_vect
{
42
this
,
"NIterationsVect"
, {},
"Number of iterations for the calibration."
};
43
Gaudi::Property<bool>
m_shortCalib
{
this
,
"shortCalib"
,
false
,
"Enable coarse grained calibration"
};
44
Gaudi::Property<unsigned int>
m_minCalibTime
{
this
,
"minCalibTime"
, 0,
45
"Minimum number of milliseconds to do calibration"
};
46
Gaudi::Property<int>
m_numCalibRuns
{
this
,
"numCalibRuns"
, 1,
"Number of times to do calibration run"
};
47
Gaudi::Property<float>
m_corrFact
{
this
,
"calibCorrectionFactor"
, 1.,
48
"Calibration correction factor to take into account things like turbo boost"
};
49
};
ClassID.h
ICPUCrunchSvc.h
Service.h
StatusCode.h
CPUCrunchSvc::calibrate
void calibrate()
Definition
CPUCrunchSvc.cpp:58
CPUCrunchSvc::m_times_vect
std::vector< unsigned int > m_times_vect
Definition
CPUCrunchSvc.h:39
CPUCrunchSvc::initialize
virtual StatusCode initialize() override
Definition
CPUCrunchSvc.cpp:39
CPUCrunchSvc::m_numCalibRuns
Gaudi::Property< int > m_numCalibRuns
Definition
CPUCrunchSvc.h:46
CPUCrunchSvc::m_shortCalib
Gaudi::Property< bool > m_shortCalib
Definition
CPUCrunchSvc.h:43
CPUCrunchSvc::CPUCrunchSvc
CPUCrunchSvc(const std::string &name, ISvcLocator *svc)
Definition
CPUCrunchSvc.cpp:35
CPUCrunchSvc::m_niters_vect
Gaudi::Property< std::vector< unsigned int > > m_niters_vect
Definition
CPUCrunchSvc.h:41
CPUCrunchSvc::findPrimes
void findPrimes(unsigned int) const
Definition
CPUCrunchSvc.cpp:158
CPUCrunchSvc::m_corrFact
Gaudi::Property< float > m_corrFact
Definition
CPUCrunchSvc.h:47
CPUCrunchSvc::m_minCalibTime
Gaudi::Property< unsigned int > m_minCalibTime
Definition
CPUCrunchSvc.h:44
CPUCrunchSvc::crunch_for
std::chrono::milliseconds crunch_for(const std::chrono::milliseconds &crunchtime) const override
Definition
CPUCrunchSvc.cpp:210
CPUCrunchSvc::getNCaliIters
unsigned int getNCaliIters(std::chrono::microseconds runtime) const
Definition
CPUCrunchSvc.cpp:120
Gaudi::Property
Implementation of property with value of concrete type.
Definition
Property.h:35
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition
Service.cpp:333
StatusCode
This class is used for returning status codes from appropriate routines.
Definition
StatusCode.h:64
extends
Base class used to extend a class implementing other interfaces.
Definition
extends.h:19
GaudiSvc
src
CPUCrunchSvc
CPUCrunchSvc.h
Generated on
for The Gaudi Framework by
1.17.0