1 #ifndef GAUDIHIVE_AVALANCHESCHEDULERSVC_H 2 #define GAUDIHIVE_AVALANCHESCHEDULERSVC_H 24 #include <unordered_map> 28 #include "tbb/concurrent_queue.h" 104 using extends::extends;
141 this,
"ThreadPoolSize", -1,
142 "Size of the threadpool initialised by TBB; a value of -1 gives TBB the freedom to choose"};
146 "Maximum number of simultaneous I/O-bound algorithms"};
148 this,
"SimulateExecution",
false,
149 "Flag to perform single-pass simulation of execution flow before the actual execution"};
151 "The following modes are currently available: PCE, COD, DRE, E"};
153 "Dump intra-event concurrency dynamics to csv file"};
155 "Turn on preemptive way of scheduling of I/O-bound algorithms"};
160 "Attribute unmet input dependencies to this DataLoader Algorithm"};
165 "Show the INPUT and OUTPUT data dependencies of Algorithms"};
168 "Show the configuration of DataFlow between Algorithms"};
171 "Show the configuration of all Algorithms and Sequences"};
272 #endif // GAUDIHIVE_AVALANCHESCHEDULERSVC_H Gaudi::Property< bool > m_showDataFlow
StatusCode tryPopFinishedEvent(EventContext *&eventContext) override
Try to fetch an event from the scheduler.
Gaudi::Property< std::string > m_whiteboardSvcName
unsigned int m_IOBoundAlgosInFlight
Number of algorithms presently in flight.
SmartIF< IPrecedenceSvc > m_precSvc
A shortcut to the Precedence Service.
std::vector< unsigned int > m_actionsCounts
Bookkeeping of the number of actions in flight per slot.
Implementation of property with value of concrete type.
Gaudi::Property< bool > m_dumpIntraEventDynamics
Gaudi::Property< bool > m_showDataDeps
StatusCode initialize() override
Initialise.
void dumpSchedulerState(int iSlot)
Dump the state of the scheduler.
void activate()
Activate scheduler.
Gaudi::Property< std::string > m_useDataLoader
Gaudi::Property< std::string > m_optimizationMode
This class represents an entry point to all the event specific data.
unsigned int algname2index(const std::string &algoname)
Convert a name to an integer.
std::atomic< ActivationState > m_isActive
Flag to track if the scheduler is active or not.
std::unordered_map< std::string, unsigned int > m_algname_index_map
Map to bookkeep the information necessary to the name2index conversion.
Gaudi::Property< bool > m_checkDeps
Gaudi::Property< bool > m_useIOBoundAlgScheduler
std::atomic_int m_freeSlots
Atomic to account for asyncronous updates by the scheduler wrt the rest.
virtual StatusCode scheduleEventView(EventContext const *sourceContext, std::string const &nodeName, EventContext *viewContext) override
Method to inform the scheduler about event views.
StatusCode pushNewEvents(std::vector< EventContext * > &eventContexts) override
unsigned int m_algosInFlight
Number of algorithms presently in flight.
SmartIF< IAlgResourcePool > m_algResourcePool
Cache for the algorithm resource pool.
StatusCode promoteToScheduled(unsigned int iAlgo, int si, EventContext *)
Algorithm promotion.
StatusCode updateStates(int si=-1, int algo_index=-1, EventContext *=nullptr)
Loop on algorithm in the slots and promote them to successive states (-1 for algo_index means skippin...
StatusCode popFinishedEvent(EventContext *&eventContext) override
Blocks until an event is available.
Gaudi::Property< bool > m_showControlFlow
This class is used for returning status codes from appropriate routines.
SmartIF< IHiveWhiteBoard > m_whiteboard
A shortcut to the whiteboard.
tbb::concurrent_bounded_queue< EventContext * > m_finishedEvents
Queue of finished events.
std::vector< std::string > m_algname_vect
Vector to bookkeep the information necessary to the index2name conversion.
Gaudi::Property< std::string > m_IOBoundAlgSchedulerSvcName
StatusCode finalize() override
Finalise.
~AvalancheSchedulerSvc() override=default
Destructor.
Gaudi::Property< int > m_threadPoolSize
SmartIF< IThreadPoolSvc > m_threadPoolSvc
SmartIF< IAccelerator > m_IOBoundAlgScheduler
A shortcut to IO-bound algorithm scheduler.
The IAlgorithm is the interface implemented by the Algorithm base class.
State
Execution states of the algorithms.
StatusCode promoteToAsyncScheduled(unsigned int iAlgo, int si, EventContext *)
StatusCode promoteToFinished(unsigned int iAlgo, int si)
StatusCode pushNewEvent(EventContext *eventContext) override
Make an event available to the scheduler.
Gaudi::Property< bool > m_simulateExecution
Base class used to extend a class implementing other interfaces.
Gaudi::Property< bool > m_enableCondSvc
const std::string & index2algname(unsigned int index)
Convert an integer to a name.
Class representing the event slot.
size_t m_maxAlgosInFlight
StatusCode promoteToExecuted(unsigned int iAlgo, int si, IAlgorithm *algo, EventContext *)
The call to this method is triggered only from within the AlgoExecutionTask.
SmartIF< ICondSvc > m_condSvc
A shortcut to service for Conditions handling.
void eventFailed(EventContext *eventContext)
Method to execute if an event failed.
unsigned int freeSlots() override
Get free slots number.
std::vector< EventSlot > m_eventSlots
Vector of events slots.
StatusCode promoteToAsyncExecuted(unsigned int iAlgo, int si, IAlgorithm *algo, EventContext *)
The call to this method is triggered only from within the IOBoundAlgTask.
StatusCode deactivate()
Deactivate scheduler.
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Algorithm execution state manager.
Gaudi::Property< unsigned int > m_maxIOBoundAlgosInFlight
size_t m_maxEventsInFlight
tbb::concurrent_bounded_queue< action > m_actionsQueue
Queue where closures are stored and picked for execution.
bool isStalled(const EventSlot &) const
Check if scheduling in a particular slot is in a stall.
std::thread m_thread
The thread in which the activate function runs.