ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
HiveAlgBase.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
13
14
15
#ifndef ATHEXHIVE_BASEALG_H
16
#define ATHEXHIVE_BASEALG_H
17
18
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
19
#include "
AthenaKernel/IAthRNGSvc.h
"
20
#include "GaudiKernel/ServiceHandle.h"
21
#include "GaudiKernel/ICPUCrunchSvc.h"
22
#include "
AthExHive/IHiveExSvc.h
"
23
24
#include <string>
25
26
class
HiveAlgBase
:
public
AthReentrantAlgorithm
{
27
28
public
:
29
30
HiveAlgBase
(
const
std::string& name, ISvcLocator* pSvcLocator);
31
virtual
~HiveAlgBase
();
32
33
// make Algs clonable
34
virtual
bool
isClonable
()
const override
{
return
true
; }
35
36
virtual
StatusCode
initialize
()
override
;
37
38
protected
:
39
40
// cause Alg to sleep for time defined by "Time" Property
41
unsigned
int
sleep
(
const
EventContext& ctx)
const
;
42
43
// Handle to HiveExSvc, which accumulates how much time each Alg sleeps
44
ServiceHandle<IHiveExSvc>
m_hes
{
this
,
"HiveExSvc"
,
"HiveExSvc"
,
"Handle to HiveExSvc"
};
45
46
// Handle to CPUCrunchSvc, which burns CPU time
47
ServiceHandle<ICPUCrunchSvc>
m_ccs
{
this
,
"CPUCrunchSvc"
,
"CPUCrunchSvc"
,
"Handle to CPUCrunchSvc"
};
48
49
// Handle to random number service
50
ServiceHandle<IAthRNGSvc>
m_rngSvc
{
this
,
"AthRNGSvc"
,
"AthRNGSvc"
,
"Handle to random number service"
};
51
52
private
:
53
54
Gaudi::Property<unsigned int>
m_time
{
this
,
"Time"
, 0,
"default alg sleep time in ms"
};
55
Gaudi::Property<bool>
m_doCrunch
{
this
,
"Crunch"
,
false
,
"Crunch instead of Sleep"
};
56
57
58
};
59
#endif
AthReentrantAlgorithm.h
IAthRNGSvc.h
IHiveExSvc.h
Abstract Interface class for HiveExSvc, that accumualtes Algorithm run times by name.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
HiveAlgBase::m_time
Gaudi::Property< unsigned int > m_time
Definition
HiveAlgBase.h:54
HiveAlgBase::HiveAlgBase
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgBase.cxx:12
HiveAlgBase::sleep
unsigned int sleep(const EventContext &ctx) const
Definition
HiveAlgBase.cxx:40
HiveAlgBase::m_ccs
ServiceHandle< ICPUCrunchSvc > m_ccs
Definition
HiveAlgBase.h:47
HiveAlgBase::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition
HiveAlgBase.h:50
HiveAlgBase::m_hes
ServiceHandle< IHiveExSvc > m_hes
Definition
HiveAlgBase.h:44
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition
HiveAlgBase.cxx:23
HiveAlgBase::~HiveAlgBase
virtual ~HiveAlgBase()
HiveAlgBase::m_doCrunch
Gaudi::Property< bool > m_doCrunch
Definition
HiveAlgBase.h:55
HiveAlgBase::isClonable
virtual bool isClonable() const override
Specify if the algorithm is clonable.
Definition
HiveAlgBase.h:34
ServiceHandle
Definition
ClusterMakerTool.h:36
Generated on
for ATLAS Offline Software by
1.17.0