1 #ifndef GAUDIHIVE_PARALLELSEQUENTIALSCHEDULERSVC_H
2 #define GAUDIHIVE_PARALLELSEQUENTIALSCHEDULERSVC_H
5 #include "GaudiKernel/IScheduler.h"
6 #include "GaudiKernel/IRunable.h"
7 #include "GaudiKernel/Service.h"
8 #include "GaudiKernel/IAlgResourcePool.h"
9 #include "GaudiKernel/CommonMessaging.h"
10 #include "GaudiKernel/EventContext.h"
19 #include <unordered_map>
24 #include "tbb/concurrent_queue.h"
26 #include "tbb/task_scheduler_init.h"
139 #endif // GAUDIHIVE_PARALLELSEQUENTIALSCHEDULERSVC_H
std::list< IAlgorithm * > m_algList
Cache the list of algs to be executed.
virtual tbb::task * execute()
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
ParallelSequentialSchedulerSvc(const std::string &name, ISvcLocator *svc)
Constructor.
std::unique_ptr< tbb::task_scheduler_init > m_tbb_sched
SmartIF< ParallelSequentialSchedulerSvc > m_scheduler
EventContext * m_eventContext
tbb::concurrent_bounded_queue< EventContext * > m_finishedEvents
Queue of finished events.
SequentialTask(ISvcLocator *svcLocator, EventContext *eventContext, ParallelSequentialSchedulerSvc *scheduler, IAlgResourcePool *algPool)
This class represents an entry point to all the event specific data.
virtual StatusCode pushNewEvent(EventContext *eventContext)
Make an event available to the scheduler.
The IAlgResourcePool is the interface for managing algorithm instances, in particular if clones of th...
bool m_useTopAlgList
Decide if the top alglist or its flat version has to be used.
SmartIF< IHiveWhiteBoard > m_whiteboard
A shortcut to the whiteboard.
int m_threadPoolSize
Size of the threadpool initialised by TBB; a value of -1 gives TBB the freedom to choose...
SmartIF< IAlgResourcePool > m_algPool
GAUDI_API ISvcLocator * svcLocator()
Manage the execution flow using an execution flow graph Once initialized, the graph is const and can ...
virtual StatusCode pushNewEvents(std::vector< EventContext * > &eventContexts)
This class is used for returning status codes from appropriate routines.
std::string m_whiteboardSvcName
The whiteboard name.
std::atomic_int m_freeSlots
Atomic to account for asyncronous updates by the scheduler wrt the rest.
virtual unsigned int freeSlots()
Get free slots number.
~ParallelSequentialSchedulerSvc()
Destructor.
Base class used to extend a class implementing other interfaces.
SmartIF< ISvcLocator > m_serviceLocator
virtual StatusCode finalize()
Finalise.
std::vector< std::string > m_algname_vect
Vector to bookkeep the information necessary to the index2name conversion.
concurrency::ExecutionFlowManager m_controlFlow
This SchedulerSvc implements the IScheduler interface.
virtual StatusCode initialize()
Initialise.
SmartIF< IAlgResourcePool > m_algResourcePool
Cache for the algorithm resource pool.
std::unordered_map< std::string, unsigned int > m_algname_index_map
Map to bookkeep the information necessary to the name2index conversion.
virtual StatusCode tryPopFinishedEvent(EventContext *&eventContext)
Try to fetch an event from the scheduler.
std::vector< std::vector< std::string > > m_algosDependencies
Ugly, will disappear when the deps are declared only within the C++ code of the algos.
virtual StatusCode popFinishedEvent(EventContext *&eventContext)
Blocks until an event is availble.