| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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/IRunable.h"
9 #include "GaudiKernel/Service.h"
10 #include "GaudiKernel/IAccelerator.h"
11 #include "GaudiKernel/IAlgTask.h"
12
13 // External libs
14 #include "tbb/concurrent_queue.h"
15
16 //---------------------------------------------------------------------------
17
25 class IOBoundAlgSchedulerSvc: public extends1<Service, IAccelerator> {
26 public:
28 IOBoundAlgSchedulerSvc( const std::string& name, ISvcLocator* svc );
29
31 ~IOBoundAlgSchedulerSvc() override;
32
34 StatusCode initialize() override;
35
37 StatusCode finalize() override;
38
40 StatusCode push(IAlgTask& task) override;
41
42 private:
43
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
68 #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:28
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:26
IOBoundAlgSchedulerSvc::deactivate
StatusCode deactivate()
Deactivate scheduler.
Definition: IOBoundAlgSchedulerSvc.cpp:106
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:80
IOBoundAlgSchedulerSvc::push
StatusCode push(IAlgTask &task) override
Add an algorithm to local queue to run on accelerator.
Definition: IOBoundAlgSchedulerSvc.cpp:123
IOBoundAlgSchedulerSvc::finalize
StatusCode finalize() override
Finalise.
Definition: IOBoundAlgSchedulerSvc.cpp:57
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.