| The Gaudi Framework v27r1

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

- File List
- File Members

ParallelSequentialSchedulerSvc.cpp
Go to the documentation of this file.
1 // Framework includes
2 #include "GaudiKernel/SvcFactory.h"
3 #include "GaudiKernel/IAlgorithm.h"
4 #include "GaudiKernel/Algorithm.h" // will be IAlgorithm if context getter promoted to interface
5 #include "GaudiKernel/IProperty.h"
6 #include "GaudiKernel/AppReturnCode.h"
7 #include "GaudiKernel/CommonMessaging.h"
8 #include "GaudiKernel/IDataManagerSvc.h"
9
10 #include "GaudiKernel/ThreadLocalContext.h"
11 #include "GaudiKernel/DataHandleHolderVisitor.h"
12
13 // C++
14 #include <list>
15 #include <thread>
16
17 // Local
18 #include "ParallelSequentialSchedulerSvc.h"
19 #include "AlgResourcePool.h"
20 #include "RetCodeGuard.h"
21
22 // Instantiation of a static factory class used by clients to create instances of this service
23 DECLARE_SERVICE_FACTORY(ParallelSequentialSchedulerSvc)
24
25 //===========================================================================
26 // Infrastructure methods
27
28 ParallelSequentialSchedulerSvc::ParallelSequentialSchedulerSvc(const std::string& name, ISvcLocator* svcLoc):
29 base_class(name,svcLoc) {
30
31 declareProperty("UseTopAlgList", m_useTopAlgList = false);
32 declareProperty("ThreadPoolSize", m_threadPoolSize = -1);
33 declareProperty("WhiteboardSvc", m_whiteboardSvcName = "EventDataSvc");
34
35 }
36
37 //---------------------------------------------------------------------------
38 ParallelSequentialSchedulerSvc::~ParallelSequentialSchedulerSvc(){}
39 //---------------------------------------------------------------------------
40
41 StatusCode ParallelSequentialSchedulerSvc::initialize(){
42
43 // Initialise mother class (read properties, ...)
44 StatusCode sc(Service::initialize());
45 if (!sc.isSuccess())
46 warning () << "Base class could not be initialized" << endmsg;
47
48 // Get the algo resource pool
49 m_algResourcePool = serviceLocator()->service("AlgResourcePool");
50 if (!m_algResourcePool.isValid()){
51 error() << "Error retrieving AlgResourcePool" << endmsg;
52 return StatusCode::FAILURE;
53 }
54
55 // Get the list of algorithms
56 m_algList = m_useTopAlgList ? m_algResourcePool->getTopAlgList() : m_algResourcePool->getFlatAlgList();
57 info() << "Found " << m_algList.size() << " algorithms" << endmsg;
58
59 // Get Whiteboard
60 m_whiteboard = serviceLocator()->service(m_whiteboardSvcName);
61 if (!m_whiteboard.isValid())
62 fatal() << "Error retrieving EventDataSvc interface IHiveWhiteBoard." << endmsg;
63
64 // Check the MaxEventsInFlight parameters and react
65 // Deprecated for the moment
66 size_t numberOfWBSlots = m_whiteboard->getNumberOfStores();
67
68 // Set the number of free slots
69 m_freeSlots=numberOfWBSlots;
70
71 info() << "Allowing " << m_freeSlots << " events in flight" << endmsg;
72
73 if(m_threadPoolSize == -1)
74 m_threadPoolSize = numberOfWBSlots;
75
76 debug() << "Initialising a TBB thread pool of size " << m_threadPoolSize << endmsg;
77 m_tbb_sched.reset(new tbb::task_scheduler_init(m_threadPoolSize));
78
79 // Fill the containers to convert algo names to index
80 m_algname_index_map.reserve(m_algList.size());
81 m_algname_vect.reserve(m_algList.size());
82 unsigned int index=0;
83 for (IAlgorithm* algo : m_algList){
84 const std::string& name = algo->name();
85 m_algname_index_map[name]=index;
86 m_algname_vect.emplace_back(name);
87 index++;
88 }
89
90 //initialize control flow manager
91 const AlgResourcePool* algPool = dynamic_cast<const AlgResourcePool*>(m_algResourcePool.get());
92
93 m_controlFlow.initialize(algPool->getExecutionFlowGraph(), m_algname_index_map);
94
95 const unsigned int algosDependenciesSize=0;
96 info() << "Algodependecies size is " << algosDependenciesSize << endmsg;
97
98 //get algorithm dependencies
99 /* Dependencies
100 0) Read deps from config file
101 1) Look for handles in algo, if none
102 2) Assume none are required
103 */
104 if (algosDependenciesSize == 0){
105 // Get the event root from the IDataManagerSvc interface of the WhiteBoard
106 SmartIF<IDataManagerSvc> dataMgrSvc (m_whiteboard);
107 std::string rootInTESName(dataMgrSvc->rootName());
108 if ("" != rootInTESName && '/'!=rootInTESName[rootInTESName.size()-1]){
109 rootInTESName = rootInTESName+"/";
110 }
111
112 for (IAlgorithm* ialgoPtr : m_algList){
113 Algorithm* algoPtr = dynamic_cast<Algorithm*> (ialgoPtr);
114 if (nullptr == algoPtr){
115 fatal() << "Could not convert IAlgorithm into Algorithm: this will result in a crash." << endmsg;
116 }
117
118 std::vector<Gaudi::DataHandle*> algoHandles(algoPtr->inputHandles());
119 DataObjIDColl algoDependencies;
120 if (!algoHandles.empty()){
121 info() << "Algorithm " << algoPtr->name() << " data dependencies:" << endmsg;
122
123 DataObjIDColl inputObjs, outputObjs;
124 DHHVisitor avis(inputObjs, outputObjs);
125
126 algoPtr->acceptDHVisitor( &avis );
127
128 for (auto id : inputObjs) {
129 const std::string& productName = rootInTESName + id.key();
130 info() << " o Input dep for " << productName << endmsg;
131 algoDependencies.insert(id);
132 }
133
134
135 } else {
136 info() << "Algorithm " << algoPtr->name() << " has no data dependencies."
137 << endmsg;
138 }
139
140 }
141 }
142
143 return StatusCode::SUCCESS;
144
145 }
146 //---------------------------------------------------------------------------
147
148 StatusCode ParallelSequentialSchedulerSvc::finalize(){
149 m_tbb_sched.reset();
150
151 StatusCode sc(Service::finalize());
152 if (!sc.isSuccess())
153 warning () << "Base class could not be finalized" << endmsg;
154 return sc;
155 }
156
160 StatusCode ParallelSequentialSchedulerSvc::pushNewEvent(EventContext* eventContext){
161 std::vector<EventContext*> eventContexts;
162 eventContexts.push_back(eventContext);
163 eventContext->setFail(false);
164 return pushNewEvents(eventContexts);
165 }
166
167 StatusCode ParallelSequentialSchedulerSvc::pushNewEvents(std::vector<EventContext*>& eventContexts){
168
169 for(auto evt : eventContexts){
170 if(m_freeSlots.load() > 0){
171 //only one thread executes scheduler --> m_freeSlots can only grow if other thread finishes
172 m_freeSlots--;
173
174 debug() << "Enqueuing event " << evt->evt() << " @ " << evt->slot() << endmsg;
175
176 tbb::task* t = new( tbb::task::allocate_root() )
177 SequentialTask(serviceLocator(), evt, this, m_algResourcePool);
178 tbb::task::enqueue( *t);
179 } else {
180 return StatusCode::FAILURE;
181 }
182 }
183
184 return StatusCode::SUCCESS;
185
186 }
187
188 //---------------------------------------------------------------------------
192 StatusCode ParallelSequentialSchedulerSvc::popFinishedEvent(EventContext*& eventContext){
193
194 m_finishedEvents.pop(eventContext);
195 debug() << "Popped slot " << eventContext->slot() << "(event "
196 << eventContext->evt() << ")" << endmsg;
197 m_freeSlots++;
198 return StatusCode::SUCCESS;
199 }
200
201 //---------------------------------------------------------------------------
205 StatusCode ParallelSequentialSchedulerSvc::tryPopFinishedEvent(EventContext*& eventContext){
206 if (m_finishedEvents.try_pop(eventContext)){
207 debug() << "Try Pop successful slot " << eventContext->slot()
208 << "(event " << eventContext->evt() << ")" << endmsg;
209 m_freeSlots++;
210 return StatusCode::SUCCESS;
211 }
212 return StatusCode::FAILURE;
213 }
214
215 //---------------------------------------------------------------------------
216
220 unsigned int ParallelSequentialSchedulerSvc::freeSlots(){return m_freeSlots;}
221
222 //---------------------------------------------------------------------------
223
224 tbb::task* SequentialTask::execute() {
225
226 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
227 const SmartIF<IProperty> appmgr(m_serviceLocator);
228 SmartIF<IMessageSvc> messageSvc (m_serviceLocator);
229 MsgStream log(messageSvc, "SequentialAlgoExecutionTask");
230 log.activate();
231
232 StatusCode sc;
233
234 //initialize control algorithm states and decisions
235 AlgsExecutionStates algStates(m_scheduler->m_algList.size(), messageSvc);
236 const AlgResourcePool* algPool = dynamic_cast<const AlgResourcePool*>(m_scheduler->m_algResourcePool.get());
237 std::vector<int> nodeDecisions(algPool->getExecutionFlowGraph()->getControlFlowNodeCounter(), -1);
238
239 m_scheduler->m_controlFlow.updateEventState(algStates, nodeDecisions);
240 m_scheduler->m_controlFlow.promoteToControlReadyState(algStates, nodeDecisions);
241
242 //initialize data flow manager
243 //DataFlowManager dataFlow(m_scheduler->m_algosDependencies);
244
245 //intitialize context
246 // m_eventContext->m_thread_id = pthread_self();
247 bool eventFailed = false;
248 Gaudi::Hive::setCurrentContextId(m_eventContext->slot());
249
250 // loop while algorithms are controlFlowReady and event has not failed
251 while(!eventFailed && algStates.algsPresent(AlgsExecutionStates::State::CONTROLREADY) ){
252
253 //std::cout << "[" << m_eventContext->evt() << "] algorithms left" << std::endl;
254
255 //std::for_each(m_scheduler->m_algList.begin(), m_scheduler->m_algList.end(),
256
257 //[&] (IAlgorithm* ialgorithm) {
258 for(auto it = algStates.begin(AlgsExecutionStates::State::CONTROLREADY); it != algStates.end(AlgsExecutionStates::State::CONTROLREADY); ++it){
259
260 uint algIndex = *it;
261
262 std::string algName = m_scheduler->m_algname_vect[algIndex];
263
264 //promote algorithm to data ready
265 algStates.updateState(algIndex,AlgsExecutionStates::DATAREADY);
266
267 //std::cout << "Running algorithm [" << algIndex << "] " << ialgorithm->name() << " for event " << m_eventContext->evt() << std::endl;
268 log << MSG::DEBUG << "Running algorithm [" << algIndex << "] " << algName << " for event " << m_eventContext->evt() << endmsg;
269
270 IAlgorithm* ialgoPtr=nullptr;
271 sc = m_algPool->acquireAlgorithm(algName,ialgoPtr, true); //blocking call
272
273 if(sc.isFailure() || ialgoPtr == nullptr){
274 log << MSG::ERROR << "Could not acquire algorithm " << algName << endmsg;
275 m_eventContext->setFail(true);
276 } else { // we got an algorithm
277
278 //promote algorithm to scheduled
279 algStates.updateState(algIndex,AlgsExecutionStates::SCHEDULED);
280
281 Algorithm* algoPtr = dynamic_cast<Algorithm*> (ialgoPtr); // DP: expose the setter of the context?
282 algoPtr->setContext(m_eventContext);
283
284 // Call the execute() method
285 try {
286 RetCodeGuard rcg(appmgr, Gaudi::ReturnCode::UnhandledException);
287 sc = algoPtr->sysExecute();
288 if (UNLIKELY(!sc.isSuccess())) {
289 log << MSG::WARNING << "Execution of algorithm " << algName << " failed" << endmsg;
290 eventFailed = true;
291 }
292 rcg.ignore(); // disarm the guard
293 } catch ( const GaudiException& Exception ) {
294 log << MSG::ERROR << ".executeEvent(): Exception with tag=" << Exception.tag()
295 << " thrown by " << algName << endmsg;
296 log << MSG::ERROR << Exception << endmsg;
297 } catch ( const std::exception& Exception ) {
298 log << MSG::FATAL << ".executeEvent(): Standard std::exception thrown by "
299 << algName << endmsg;
300 log << MSG::ERROR << Exception.what() << endmsg;
301 } catch(...) {
302 log << MSG::FATAL << ".executeEvent(): UNKNOWN Exception thrown by "
303 << algName << endmsg;
304 }
305
306 if(sc.isFailure()){
307 eventFailed = true;
308 }
309
310 //std::cout << "Algorithm [" << algIndex << "] " << ialgorithm->name() << " for event " << m_eventContext->evt()
311 // << (eventFailed ? " failed" : " succeeded") << std::endl;
312 log << MSG::DEBUG << "Algorithm [" << algIndex << "] " << algName << " for event " << m_eventContext->evt()
313 << (eventFailed ? " failed" : " succeded") << endmsg;
314
315 AlgsExecutionStates::State state;
316 if (ialgoPtr->filterPassed()){
317 state = AlgsExecutionStates::State::EVTACCEPTED;
318 } else {
319 state = AlgsExecutionStates::State::EVTREJECTED;
320 }
321
322 //std::cout << "Algorithm [" << algIndex << "] " << ialgorithm->name() << " for event " << m_eventContext->evt()
323 // << (ialgoPtr->filterPassed() ? " passed" : " rejected") << std::endl;
324 log << MSG::DEBUG << "Algorithm [" << algIndex << "] " << algName << " for event " << m_eventContext->evt()
325 << (ialgoPtr->filterPassed() ? " passed" : " rejected") << endmsg;
326
327 sc = m_algPool->releaseAlgorithm(algName,ialgoPtr);
328
329 algStates.updateState(algIndex,state);
330
331 //just for debug: look at products -- not thread safe
332 // Update the catalog: some new products may be there
333 /*m_scheduler->m_whiteboard->selectStore(m_eventContext->slot()).ignore();
334
335 // update prods in the dataflow
336 // DP: Handles could be used. Just update what the algo wrote
337 std::vector<std::string> new_products;
338 m_scheduler->m_whiteboard->getNewDataObjects(new_products).ignore();
339 for (const auto& new_product : new_products)
340 std::cout << "Found in WB: " << new_product << std::endl;
341 //dataFlow.updateDataObjectsCatalog(new_products);*/
342 }
343
344 }
345 //);
346
347 m_scheduler->m_controlFlow.updateEventState(algStates, nodeDecisions);
348 m_scheduler->m_controlFlow.promoteToControlReadyState(algStates, nodeDecisions);
349
350 if(eventFailed){
351 m_eventContext->setFail(eventFailed);
352 //std::cout << "ERROR: " << "event " << m_eventContext->evt() << " failed" << std::endl;
353 break;
354 }
355
356 if(!algStates.algsPresent(AlgsExecutionStates::State::CONTROLREADY) && !algStates.allAlgsExecuted()){
357 //std::cout << "WARNING: " << " not all algorithms executed for event " << m_eventContext->evt() << std::endl;
358
359 /*std::for_each(m_scheduler->m_algList.begin(), m_scheduler->m_algList.end(),
360
361 [&] (IAlgorithm* ialgorithm) {
362 uint algIndex = m_scheduler->m_algname_index_map[ialgorithm->name()];
363
364 if(AlgsExecutionStates::State::SCHEDULED >= algStates.algorithmState(algIndex))
365 std::cout << "Event [" << m_eventContext->evt() << "] algorithm " << ialgorithm->name()
366 << " NOT executed" << std::endl;
367
368 });*/
369 }
370 }
371
372 m_scheduler->m_finishedEvents.push(m_eventContext);
373
374 return nullptr;
375
376 }
compareRootHistos.state
tuple state
Definition: compareRootHistos.py:348
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
ParallelSequentialSchedulerSvc::m_algList
std::list< IAlgorithm * > m_algList
Cache the list of algs to be executed.
Definition: ParallelSequentialSchedulerSvc.h:78
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
Algorithm.h
SmartIF< IDataManagerSvc >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
IAlgResourcePool::acquireAlgorithm
virtual StatusCode acquireAlgorithm(const std::string &name, IAlgorithm *&algo, bool blocking=false)=0
Acquire a certain algorithm using its name.
SequentialTask::execute
virtual tbb::task * execute()
Definition: ParallelSequentialSchedulerSvc.cpp:224
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
RetCodeGuard
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition: ISvcLocator.h:25
concurrency::ExecutionFlowManager::updateEventState
void updateEventState(AlgsExecutionStates &algo_states, std::vector< int > &node_decisions) const
Update the state of algorithms to controlready, where possible.
Definition: ExecutionFlowManager.cpp:95
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:193
Gaudi::Hive::setCurrentContextId
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
Definition: ThreadLocalContext.cpp:21
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:41
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
IAlgorithm.h
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
ThreadLocalContext.h
MSG::DEBUG
Definition: IMessageSvc.h:18
ParallelSequentialSchedulerSvc.h
ParallelSequentialSchedulerSvc::m_tbb_sched
std::unique_ptr< tbb::task_scheduler_init > m_tbb_sched
Definition: ParallelSequentialSchedulerSvc.h:100
SequentialTask::m_scheduler
SmartIF< ParallelSequentialSchedulerSvc > m_scheduler
Definition: ParallelSequentialSchedulerSvc.h:133
SequentialTask::m_eventContext
EventContext * m_eventContext
Definition: ParallelSequentialSchedulerSvc.h:132
std
STL namespace.
ParallelSequentialSchedulerSvc::m_finishedEvents
tbb::concurrent_bounded_queue< EventContext * > m_finishedEvents
Queue of finished events.
Definition: ParallelSequentialSchedulerSvc.h:81
IHiveWhiteBoard::getNumberOfStores
virtual size_t getNumberOfStores()=0
Get the number of 'slots'.
IAlgResourcePool::getFlatAlgList
virtual std::list< IAlgorithm * > getFlatAlgList()=0
Get the flat list of algorithms.
merge_files.sc
int sc
Definition: merge_files.py:167
AlgResourcePool
The AlgResourcePool is a concrete implementation of the IAlgResourcePool interface.
Definition: AlgResourcePool.h:34
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
AlgsExecutionStates::SCHEDULED
Definition: AlgsExecutionStates.h:36
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
ParallelSequentialSchedulerSvc::pushNewEvent
virtual StatusCode pushNewEvent(EventContext *eventContext)
Make an event available to the scheduler.
Definition: ParallelSequentialSchedulerSvc.cpp:160
Algorithm::setContext
void setContext(EventContext *context)
set the context
Definition: Algorithm.h:574
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
std::string
STL class.
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition: AppReturnCode.h:27
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
MSG::FATAL
Definition: IMessageSvc.h:22
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
ParallelSequentialSchedulerSvc::m_useTopAlgList
bool m_useTopAlgList
Decide if the top alglist or its flat version has to be used.
Definition: ParallelSequentialSchedulerSvc.h:75
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
SvcFactory.h
ParallelSequentialSchedulerSvc::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
A shortcut to the whiteboard.
Definition: ParallelSequentialSchedulerSvc.h:88
ParallelSequentialSchedulerSvc::m_threadPoolSize
int m_threadPoolSize
Size of the threadpool initialised by TBB; a value of -1 gives TBB the freedom to choose...
Definition: ParallelSequentialSchedulerSvc.h:97
IDataManagerSvc.h
IAlgResourcePool::getTopAlgList
virtual std::list< IAlgorithm * > getTopAlgList()=0
Get top list of algorithms.
AlgsExecutionStates
The AlgsExecutionStates encodes the state machine for the execution of algorithms within a single eve...
Definition: AlgsExecutionStates.h:28
SequentialTask::m_algPool
SmartIF< IAlgResourcePool > m_algPool
Definition: ParallelSequentialSchedulerSvc.h:134
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
concurrency::ExecutionFlowManager::promoteToControlReadyState
void promoteToControlReadyState(AlgsExecutionStates &algo_states, std::vector< int > &node_decisions, const int &slotNum=-1) const
XXX: CF tests.
Definition: ExecutionFlowManager.cpp:109
ParallelSequentialSchedulerSvc::pushNewEvents
virtual StatusCode pushNewEvents(std::vector< EventContext * > &eventContexts)
Definition: ParallelSequentialSchedulerSvc.cpp:167
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Algorithm::sysExecute
StatusCode sysExecute() override
The actions to be performed by the algorithm on an event.
Definition: Algorithm.cpp:567
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
CommonMessaging.h
EventContext::setFail
void setFail(const bool &b=true)
Definition: EventContext.h:65
ParallelSequentialSchedulerSvc::m_whiteboardSvcName
std::string m_whiteboardSvcName
The whiteboard name.
Definition: ParallelSequentialSchedulerSvc.h:91
DHHVisitor
Definition: DataHandleHolderVisitor.h:9
ParallelSequentialSchedulerSvc::m_freeSlots
std::atomic_int m_freeSlots
Atomic to account for asyncronous updates by the scheduler wrt the rest.
Definition: ParallelSequentialSchedulerSvc.h:85
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::unordered_set< DataObjID, DataObjID_Hasher >
std::unique_ptr::reset
T reset(T...args)
ParallelSequentialSchedulerSvc::freeSlots
virtual unsigned int freeSlots()
Get free slots number.
Definition: ParallelSequentialSchedulerSvc.cpp:220
DataHandleHolderVisitor.h
AlgResourcePool::getExecutionFlowGraph
virtual concurrency::ExecutionFlowGraph * getExecutionFlowGraph() const
Definition: AlgResourcePool.h:61
DECLARE_SERVICE_FACTORY
#define DECLARE_SERVICE_FACTORY(x)
Definition: Service.h:361
ParallelSequentialSchedulerSvc::~ParallelSequentialSchedulerSvc
~ParallelSequentialSchedulerSvc()
Destructor.
Definition: ParallelSequentialSchedulerSvc.cpp:38
std::exception
STL class.
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
IDataManagerSvc::rootName
virtual const std::string & rootName() const =0
Get Name of root Event.
IAlgorithm::filterPassed
virtual bool filterPassed() const =0
Did this algorithm pass or fail its filter criterion for the last event?
AppReturnCode.h
std::vector::insert
T insert(T...args)
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:74
std::list::size
T size(T...args)
IProperty.h
RetCodeGuard.h
std::vector< Gaudi::DataHandle * >
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:127
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
Algorithm::acceptDHVisitor
virtual void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: Algorithm.cpp:226
AlgsExecutionStates::DATAREADY
Definition: AlgsExecutionStates.h:35
CommonMessaging
Definition: CommonMessaging.h:58
SequentialTask::m_serviceLocator
SmartIF< ISvcLocator > m_serviceLocator
Definition: ParallelSequentialSchedulerSvc.h:131
MSG::ERROR
Definition: IMessageSvc.h:21
ParallelSequentialSchedulerSvc::finalize
virtual StatusCode finalize()
Finalise.
Definition: ParallelSequentialSchedulerSvc.cpp:148
RetCodeGuard::ignore
void ignore()
Definition: RetCodeGuard.h:13
MSG::WARNING
Definition: IMessageSvc.h:20
AlgResourcePool.h
MsgStream::activate
void activate()
Activate MsgStream.
Definition: MsgStream.h:120
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
concurrency::ExecutionFlowManager::initialize
StatusCode initialize(ExecutionFlowGraph *CFGraph, const std::unordered_map< std::string, unsigned int > &algname_index_map)
Initialize the control flow manager It greps the topalg list and the index map for the algo names...
Definition: ExecutionFlowManager.cpp:6
AlgsExecutionStates::State
State
Execution states of the algorithms.
Definition: AlgsExecutionStates.h:32
IAlgResourcePool::releaseAlgorithm
virtual StatusCode releaseAlgorithm(const std::string &name, IAlgorithm *&algo)=0
Release a certain algorithm.
ParallelSequentialSchedulerSvc::m_algname_vect
std::vector< std::string > m_algname_vect
Vector to bookkeep the information necessary to the index2name conversion.
Definition: ParallelSequentialSchedulerSvc.h:106
ParallelSequentialSchedulerSvc::m_controlFlow
concurrency::ExecutionFlowManager m_controlFlow
Definition: ParallelSequentialSchedulerSvc.h:103
ParallelSequentialSchedulerSvc
This SchedulerSvc implements the IScheduler interface.
Definition: ParallelSequentialSchedulerSvc.h:41
ParallelSequentialSchedulerSvc::SequentialTask
friend class SequentialTask
Definition: ParallelSequentialSchedulerSvc.h:112
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
ParallelSequentialSchedulerSvc::initialize
virtual StatusCode initialize()
Initialise.
Definition: ParallelSequentialSchedulerSvc.cpp:41
ParallelSequentialSchedulerSvc::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Cache for the algorithm resource pool.
Definition: ParallelSequentialSchedulerSvc.h:94
ParallelSequentialSchedulerSvc::m_algname_index_map
std::unordered_map< std::string, unsigned int > m_algname_index_map
Map to bookkeep the information necessary to the name2index conversion.
Definition: ParallelSequentialSchedulerSvc.h:109
ParallelSequentialSchedulerSvc::tryPopFinishedEvent
virtual StatusCode tryPopFinishedEvent(EventContext *&eventContext)
Try to fetch an event from the scheduler.
Definition: ParallelSequentialSchedulerSvc.cpp:205
std::unordered_map::reserve
T reserve(T...args)
Algorithm::inputHandles
virtual std::vector< Gaudi::DataHandle * > inputHandles() const override
Definition: Algorithm.h:587
ParallelSequentialSchedulerSvc::popFinishedEvent
virtual StatusCode popFinishedEvent(EventContext *&eventContext)
Blocks until an event is availble.
Definition: ParallelSequentialSchedulerSvc.cpp:192
std::vector::emplace_back
T emplace_back(T...args)