| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

IOBoundAlgSchedulerSvc.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_IOBOUNDALGSCHEDULERSVC_H
2 #define GAUDIHIVE_IOBOUNDALGSCHEDULERSVC_H
3
4 #include <functional>
5 #include <thread>
6
7 // Framework include files
8 #include "GaudiKernel/IAccelerator.h"
9 #include "GaudiKernel/IAlgTask.h"
10 #include "GaudiKernel/IRunable.h"
11 #include "GaudiKernel/Service.h"
12
13 // External libs
14 #include "tbb/concurrent_queue.h"
15
16 //---------------------------------------------------------------------------
17
25 class IOBoundAlgSchedulerSvc : public extends1<Service, IAccelerator>
26 {
27 public:
29 IOBoundAlgSchedulerSvc( const std::string& name, ISvcLocator* svc );
30
32 ~IOBoundAlgSchedulerSvc() override;
33
35 StatusCode initialize() override;
36
38 StatusCode finalize() override;
39
41 StatusCode push( IAlgTask& task ) override;
42
43 private:
44 // Utils and shortcuts ----------------------------------------------------
45
47 void activate();
48
50 StatusCode deactivate();
51
53 bool m_isActive;
54
56 std::thread m_thread;
57
58 // Actions management -----------------------------------------------------
59
60 typedef std::function<StatusCode()> action;
62 // typedef std::shared_ptr<action> actionPtr;
64 tbb::concurrent_bounded_queue<action> m_actionsQueue;
65 };
66
67 #endif // GAUDIHIVE_IOBOUNDALGSCHEDULERSVC_H
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
std::function< StatusCode()>
IAlgTask.h
IRunable.h
IOBoundAlgSchedulerSvc::m_isActive
bool m_isActive
Flag to track if the scheduler is active or not.
Definition: IOBoundAlgSchedulerSvc.h:53
IOBoundAlgSchedulerSvc::m_thread
std::thread m_thread
The thread in which the activate function runs.
Definition: IOBoundAlgSchedulerSvc.h:56
IOBoundAlgSchedulerSvc::~IOBoundAlgSchedulerSvc
~IOBoundAlgSchedulerSvc() override
Destructor.
Definition: IOBoundAlgSchedulerSvc.cpp:30
IOBoundAlgSchedulerSvc::action
std::function< StatusCode()> action
Definition: IOBoundAlgSchedulerSvc.h:60
IOBoundAlgSchedulerSvc::initialize
StatusCode initialize() override
Initialise.
Definition: IOBoundAlgSchedulerSvc.cpp:37
std::string
STL class.
Service.h
IAlgTask
General interface for a wrapper around Gaudi algorithm.
Definition: IAlgTask.h:15
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
IOBoundAlgSchedulerSvc::deactivate
StatusCode deactivate()
Deactivate scheduler.
Definition: IOBoundAlgSchedulerSvc.cpp:103
IOBoundAlgSchedulerSvc::IOBoundAlgSchedulerSvc
IOBoundAlgSchedulerSvc(const std::string &name, ISvcLocator *svc)
Constructor.
Definition: IOBoundAlgSchedulerSvc.cpp:24
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
IOBoundAlgSchedulerSvc::activate
void activate()
Activate scheduler.
Definition: IOBoundAlgSchedulerSvc.cpp:76
IOBoundAlgSchedulerSvc::push
StatusCode push(IAlgTask &task) override
Add an algorithm to local queue to run on accelerator.
Definition: IOBoundAlgSchedulerSvc.cpp:121
IOBoundAlgSchedulerSvc::finalize
StatusCode finalize() override
Finalise.
Definition: IOBoundAlgSchedulerSvc.cpp:55
IOBoundAlgSchedulerSvc
Please refer to the full documentation of the methods for more details.
Definition: IOBoundAlgSchedulerSvc.h:25
IOBoundAlgSchedulerSvc::m_actionsQueue
tbb::concurrent_bounded_queue< action > m_actionsQueue
This is done since the copy of the lambda storage is too expensive.
Definition: IOBoundAlgSchedulerSvc.h:64
IAccelerator.h
std::thread
STL class.