ATLAS Offline Software
HiveAlgBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
15 #ifndef ATHEXHIVE_BASEALG_H
16 #define ATHEXHIVE_BASEALG_H 1
17 
20 #include "GaudiKernel/ServiceHandle.h"
21 #include "GaudiKernel/ICPUCrunchSvc.h"
22 #include "AthExHive/IHiveExSvc.h"
23 
24 #include <string>
25 
26 class HiveAlgBase : public AthAlgorithm {
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();
42 
43  // Handle to HiveExSvc, which accumulates how much time each Alg sleeps
45 
46  // Handle to CPUCrunchSvc, which burns CPU time
48 
49  // 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
HiveAlgBase::~HiveAlgBase
virtual ~HiveAlgBase()
Definition: HiveAlgBase.cxx:21
HiveAlgBase::sleep
unsigned int sleep()
Definition: HiveAlgBase.cxx:42
HiveAlgBase::HiveAlgBase
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition: HiveAlgBase.cxx:12
HiveAlgBase::m_hes
ServiceHandle< IHiveExSvc > m_hes
Definition: HiveAlgBase.h:44
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition: HiveAlgBase.cxx:25
HiveAlgBase::m_time
Gaudi::Property< unsigned int > m_time
Definition: HiveAlgBase.h:54
AthAlgorithm.h
IHiveExSvc.h
Abstract Interface class for HiveExSvc, that accumualtes Algorithm run times by name.
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HiveAlgBase::m_ccs
ServiceHandle< ICPUCrunchSvc > m_ccs
Definition: HiveAlgBase.h:47
HiveAlgBase
Definition: HiveAlgBase.h:26
AthAlgorithm
Definition: AthAlgorithm.h:47
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HiveAlgBase::m_doCrunch
Gaudi::Property< bool > m_doCrunch
Definition: HiveAlgBase.h:55
HiveAlgBase::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition: HiveAlgBase.h:50
HiveAlgBase::isClonable
virtual bool isClonable() const override
Definition: HiveAlgBase.h:34
IAthRNGSvc.h
ServiceHandle< IHiveExSvc >