The Gaudi Framework  v30r2 (9eca68f7)
HLTEventLoopMgr.cpp
Go to the documentation of this file.
1 // FW includes
5 #include "GaudiKernel/DataSvc.h"
10 #include "GaudiKernel/IAlgorithm.h"
14 #include "GaudiKernel/IScheduler.h"
15 #include "GaudiKernel/Memory.h"
17 
18 #include "EventSlot.h"
20 #include "HistogramAgent.h"
21 #include "PrecedenceSvc.h"
22 #include "RetCodeGuard.h"
23 
24 #include <algorithm>
25 #include <chrono>
26 #include <condition_variable>
27 #include <map>
28 #include <sstream>
29 
30 #include "boost/algorithm/string.hpp"
31 #include "boost/thread.hpp"
32 #include "boost/tokenizer.hpp"
33 #include "tbb/task_scheduler_init.h"
34 
36 
37 // Instantiation of a static factory class used by clients to create instances of this service
39 
40 namespace
41 {
42  struct DataObjIDSorter {
43  bool operator()( const DataObjID* a, const DataObjID* b ) { return a->fullKey() < b->fullKey(); }
44  };
45 
46  // Sort a DataObjIDColl in a well-defined, reproducible manner.
47  // Used for making debugging dumps.
48  std::vector<const DataObjID*> sortedDataObjIDColl( const DataObjIDColl& coll )
49  {
51  v.reserve( coll.size() );
52  for ( const DataObjID& id : coll ) v.push_back( &id );
53  std::sort( v.begin(), v.end(), DataObjIDSorter() );
54  return v;
55  }
56 }
57 
59 {
61  if ( !sc.isSuccess() ) {
62  error() << "Failed to initialize Service Base class." << endmsg;
63  return StatusCode::FAILURE;
64  }
65  // Setup access to event data services
66  m_evtDataMgrSvc = serviceLocator()->service<IDataManagerSvc>( "EventDataSvc" );
67  if ( !m_evtDataMgrSvc ) {
68  fatal() << "Error retrieving EventDataSvc interface IDataManagerSvc." << endmsg;
69  return StatusCode::FAILURE;
70  }
71  m_whiteboard = serviceLocator()->service<IHiveWhiteBoard>( "EventDataSvc" );
72  if ( !m_whiteboard ) {
73  fatal() << "Error retrieving EventDataSvc interface IHiveWhiteBoard." << endmsg;
74  return StatusCode::FAILURE;
75  }
76  // Obtain the IProperty of the ApplicationMgr
77  IProperty* appMgrProperty = serviceLocator()->service<IProperty>( "ApplicationMgr" );
78  if ( !appMgrProperty ) {
79  fatal() << "IProperty interface not found in ApplicationMgr." << endmsg;
80  return StatusCode::FAILURE;
81  }
82  // We do not expect a Event Selector necessarily being declared
83  setProperty( appMgrProperty->getProperty( "EvtSel" ) ).ignore();
84 
85  if ( m_evtsel != "NONE" || m_evtsel.length() == 0 ) {
86  m_evtSelector = serviceLocator()->service<IEvtSelector>( "EventSelector" );
87  } else {
88  m_evtSelector = 0;
89  warning() << "Unable to locate service \"EventSelector\" " << endmsg;
90  warning() << "No events will be processed from external input." << endmsg;
91  }
92 
93  // Setup access to histogramming services
94  m_histoDataMgrSvc = serviceLocator()->service<IDataManagerSvc>( "HistogramDataSvc" );
95  if ( !m_histoDataMgrSvc ) {
96  fatal() << "Error retrieving HistogramDataSvc." << endmsg;
97  return sc;
98  }
99  // Setup histogram persistency
100  m_histoPersSvc = serviceLocator()->service<IConversionSvc>( "HistogramPersistencySvc" );
101  if ( !m_histoPersSvc ) {
102  warning() << "Histograms cannot not be saved - though required." << endmsg;
103  return sc;
104  }
105 
106  m_algExecStateSvc = serviceLocator()->service<IAlgExecStateSvc>( "AlgExecStateSvc" );
107  if ( !m_algExecStateSvc ) {
108  fatal() << "Error retrieving AlgExecStateSvc" << endmsg;
109  return StatusCode::FAILURE;
110  }
111 
112  // Get the precedence service
113  m_precSvc = serviceLocator()->service<IPrecedenceSvc>( "PrecedenceSvc" );
114  if ( !m_precSvc ) {
115  fatal() << "Error retrieving PrecedenceSvc" << endmsg;
116  return StatusCode::FAILURE;
117  }
118  const PrecedenceSvc* precSvc = dynamic_cast<const PrecedenceSvc*>( m_precSvc );
119  if ( !precSvc ) {
120  fatal() << "Unable to dcast PrecedenceSvc" << endmsg;
121  return StatusCode::FAILURE;
122  }
123 
124  m_algExecStateSvc = serviceLocator()->service<IAlgExecStateSvc>( "AlgExecStateSvc" );
125  if ( !m_algExecStateSvc ) {
126  fatal() << "Error retrieving AlgExecStateSvc" << endmsg;
127  return StatusCode::FAILURE;
128  }
129 
130  // Get the list of algorithms
131  IAlgResourcePool* algResourcePool = serviceLocator()->service<IAlgResourcePool>( "AlgResourcePool" );
132  if ( !algResourcePool ) {
133  fatal() << "Error retrieving AlgoResourcePool" << endmsg;
134  return StatusCode::FAILURE;
135  }
136  for ( auto alg : algResourcePool->getFlatAlgList() ) {
137  m_algos.push_back( alg );
138  }
139  const unsigned int algsNumber = m_algos.size();
140 
141  /* Dependencies
142  1) Look for handles in algo, if none
143  2) Assume none are required
144  */
145  DataObjIDColl globalInp, globalOutp;
146 
147  // figure out all outputs
149  for ( IAlgorithm* ialgoPtr : m_algos ) {
150  Algorithm* algoPtr = dynamic_cast<Algorithm*>( ialgoPtr );
151  if ( !algoPtr ) {
152  fatal() << "Could not convert IAlgorithm into Algorithm: this will result in a crash." << endmsg;
153  }
154  for ( auto id : algoPtr->outputDataObjs() ) {
155  auto r = globalOutp.insert( id );
156  producers[id] = algoPtr;
157  if ( !r.second ) {
158  warning() << "multiple algorithms declare " << id << " as output! could be a single instance in multiple paths "
159  "though, or control flow may guarantee only one runs...!"
160  << endmsg;
161  }
162  }
163  }
164 
165  // Building and printing Data Dependencies
166  std::vector<DataObjIDColl> algosDependencies;
168  info() << "Data Dependencies for Algorithms:";
169  int n = 0;
170  for ( IAlgorithm* ialgoPtr : m_algos ) {
171  Algorithm* algoPtr = dynamic_cast<Algorithm*>( ialgoPtr );
172  info() << "\n " << algoPtr->name();
173 
174  DataObjIDColl algoDependencies;
175  if ( !algoPtr->inputDataObjs().empty() || !algoPtr->outputDataObjs().empty() ) {
176  for ( const DataObjID* idp : sortedDataObjIDColl( algoPtr->inputDataObjs() ) ) {
177  DataObjID id = *idp;
178  info() << "\n o INPUT " << id;
179  if ( id.key().find( ":" ) != std::string::npos ) {
180  info() << " contains alternatives which require resolution...\n";
181  auto tokens = boost::tokenizer<boost::char_separator<char>>{id.key(), boost::char_separator<char>{":"}};
182  auto itok = std::find_if( tokens.begin(), tokens.end(), [&]( const std::string& t ) {
183  return globalOutp.find( DataObjID{t} ) != globalOutp.end();
184  } );
185  if ( itok != tokens.end() ) {
186  info() << "found matching output for " << *itok << " -- updating scheduler info\n";
187  id.updateKey( *itok );
188  } else {
189  error() << "failed to find alternate in global output list"
190  << " for id: " << id << " in Alg " << algoPtr->name() << endmsg;
191  }
192  }
193  algoDependencies.insert( id );
194  globalInp.insert( id );
195  }
196  for ( const DataObjID* id : sortedDataObjIDColl( algoPtr->outputDataObjs() ) ) {
197  info() << "\n o OUTPUT " << *id;
198  if ( id->key().find( ":" ) != std::string::npos ) {
199  error() << " in Alg " << algoPtr->name() << " alternatives are NOT allowed for outputs! id: " << *id
200  << endmsg;
201  }
202  }
203  } else {
204  info() << "\n none";
205  }
206  algosDependencies.emplace_back( algoDependencies );
207  algo2Index[ialgoPtr] = n;
208  n++;
209  }
210  info() << endmsg;
211 
212  // Check if we have unmet global input dependencies
213  DataObjIDColl unmetDep;
214  for ( auto o : globalInp ) {
215  if ( globalOutp.find( o ) == globalOutp.end() ) {
216  unmetDep.insert( o );
217  }
218  }
219  if ( unmetDep.size() > 0 ) {
220  std::ostringstream ost;
221  for ( const DataObjID* o : sortedDataObjIDColl( unmetDep ) ) {
222  ost << "\n o " << *o << " required by Algorithm: ";
223  for ( size_t i = 0; i < algosDependencies.size(); ++i ) {
224  if ( algosDependencies[i].find( *o ) != algosDependencies[i].end() ) {
225  ost << "\n * " << m_algname_vect[i];
226  }
227  }
228  }
229  fatal() << "The following unmet INPUT dependencies were found:" << ost.str() << endmsg;
230  return StatusCode::FAILURE;
231  } else {
232  info() << "No unmet INPUT data dependencies were found" << endmsg;
233  }
234 
235  // Deal with Event Slots
236  auto messageSvc = serviceLocator()->service<IMessageSvc>( "MessageSvc" );
237  m_eventSlots.assign( m_whiteboard->getNumberOfStores(),
238  EventSlot( algsNumber, precSvc->getRules()->getControlFlowNodeCounter(), messageSvc ) );
239 
240  // Clearly inform about the level of concurrency
241  info() << "Concurrency level information:" << endmsg;
242  info() << " o Number of events slots: " << m_whiteboard->getNumberOfStores() << endmsg;
243  info() << " o TBB thread pool size: " << m_threadPoolSize << endmsg;
244 
245  // rework the flat algo list to respect data dependencies
246  auto start = m_algos.begin();
247  auto end = m_algos.end();
248  auto current = std::partition( start, end, [&algosDependencies, &algo2Index]( const IAlgorithm* algo ) {
249  return algosDependencies[algo2Index[algo]].empty();
250  } );
251 
252  // Repeatedly put in front algos for which input are already fullfilled
253  while ( current != end ) {
254  current = std::partition(
255  current, end, [start, current, &producers, &algosDependencies, &algo2Index]( const IAlgorithm* algo ) {
256  return std::none_of( algosDependencies[algo2Index[algo]].begin(), algosDependencies[algo2Index[algo]].end(),
257  [start, current, &producers]( const DataObjID& id ) {
258  return std::find( start, current, producers[id] ) == current;
259  } );
260  } );
261  }
262 
263  // Fill the containers to convert algo names to index
264  debug() << "Order of algo execution :" << endmsg;
265  m_algname_vect.resize( algsNumber );
266  for ( IAlgorithm* algo : m_algos ) {
267  const std::string& name = algo->name();
268  auto index = precSvc->getRules()->getAlgorithmNode( name )->getAlgoIndex();
269  m_algname_index_map[name] = index;
270  m_algname_vect.at( index ) = name;
271  debug() << " . " << algo->name() << endmsg;
272  }
273 
274  return sc;
275 }
276 
278 {
279  StatusCode sc;
280  // Save Histograms Now
281  if ( m_histoPersSvc ) {
282  HistogramAgent agent;
283  sc = m_histoDataMgrSvc->traverseTree( &agent );
284  if ( sc.isSuccess() ) {
285  const IDataSelector& objects = agent.selectedObjects();
286  // skip /stat entry!
287  sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode s, const auto& i ) {
288  IOpaqueAddress* pAddr = nullptr;
289  StatusCode iret = m_histoPersSvc->createRep( i, pAddr );
290  if ( iret.isSuccess() ) i->registry()->setAddress( pAddr );
291  return s.isFailure() ? s : iret;
292  } );
293  sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode s, const auto& i ) {
294  IRegistry* reg = i->registry();
295  StatusCode iret = m_histoPersSvc->fillRepRefs( reg->address(), i );
296  return s.isFailure() ? s : iret;
297  } );
298  if ( sc.isSuccess() ) {
299  info() << "Histograms converted successfully according to request." << endmsg;
300  } else {
301  error() << "Error while saving Histograms." << endmsg;
302  }
303  } else {
304  error() << "Error while traversing Histogram data store" << endmsg;
305  }
306  }
307 
309  return sc.isFailure() ? sc2.ignore(), sc : sc2;
310 }
311 
312 StatusCode HLTEventLoopMgr::executeEvent( void* createdEvts_IntPtr )
313 {
314  // Leave the interface intact and swallow this C trick.
315  int& createdEvts = *( (int*)createdEvts_IntPtr );
316 
317  std::unique_ptr<EventContext> evtContext = std::make_unique<EventContext>();
318  evtContext->set( createdEvts, m_whiteboard->allocateStore( createdEvts ) );
319  m_algExecStateSvc->reset( *evtContext.get() );
320 
321  StatusCode sc = m_whiteboard->selectStore( evtContext->slot() );
322  if ( sc.isFailure() ) {
323  fatal() << "Slot " << evtContext->slot() << " could not be selected for the WhiteBoard\n"
324  << "Impossible to create event context" << endmsg;
325  return StatusCode::FAILURE;
326  }
327 
328  StatusCode declEvtRootSc = declareEventRootAddress();
329  if ( declEvtRootSc.isFailure() ) { // We ran out of events!
330  createdEvts = -1; // Set created event to a negative value: we finished!
331  return StatusCode::SUCCESS;
332  }
333 
334  // Now add event to the scheduler
335  verbose() << "Adding event " << evtContext->evt() << ", slot " << evtContext->slot() << " to the scheduler" << endmsg;
336 
337  // Event processing slot forced to be the same as the wb slot
338  const unsigned int thisSlotNum = evtContext->slot();
339  m_eventSlots[thisSlotNum].reset( evtContext.get() );
340  // closure to be executed at the end of event
341  auto promote2ExecutedClosure = [this]( std::unique_ptr<EventContext> evtContext ) {
342  this->promoteToExecuted( std::move( evtContext ) );
343  };
344  // tbb task
345  tbb::task* task = new ( tbb::task::allocate_root() ) HLTExecutionTask(
346  m_algos, std::move( evtContext ), serviceLocator(), m_algExecStateSvc, promote2ExecutedClosure );
347  tbb::task::enqueue( *task );
348 
349  if ( msgLevel( MSG::DEBUG ) )
350  debug() << "All algorithms were submitted on event " << evtContext->evt() << " in slot " << thisSlotNum << endmsg;
351 
352  createdEvts++;
353  return StatusCode::SUCCESS;
354 }
355 
357 {
358  // Set the application return code
359  auto appmgr = serviceLocator()->as<IProperty>();
361  error() << "Could not set return code of the application (" << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
362  }
363  return StatusCode::SUCCESS;
364 }
365 
367 {
368  // Calculate runtime
370 
371  // Reset the application return code.
372  auto appmgr = serviceLocator()->as<IProperty>();
374 
375  // create m_evtSelContext used internally in executeEvent and more
376  // precisely in declareEventRootAddress. Cannot be passed through the interface
377  // without breaking other schedulers
378  StatusCode sc = m_evtSelector->createContext( m_evtSelContext );
379  if ( !sc.isSuccess() ) {
380  fatal() << "Can not create the event selector Context." << endmsg;
381  return sc;
382  }
383 
384  // create th tbb thread pool
385  tbb::task_scheduler_init tbbSchedInit( m_threadPoolSize.value() + 1 );
386 
387  int createdEvts = 0;
388  // Run the first event before spilling more than one
389  bool newEvtAllowed = false;
390 
391  info() << "Starting loop on events" << endmsg;
392  auto start_time = Clock::now();
393  while ( maxevt < 0 || m_finishedEvt < (unsigned int)maxevt ) {
394  // if the created events did not reach maxevt, create an event
395  if ( !( ( newEvtAllowed || createdEvts == 0 ) && // Launch the first event alone
396  // The events are not finished with an unlimited number of events
397  createdEvts >= 0 &&
398  // The events are not finished with a limited number of events
399  ( createdEvts < maxevt || maxevt < 0 ) &&
400  // There are still free slots in the whiteboard
401  m_whiteboard->freeSlots() > 0 ) ) {
402 
403  std::unique_lock<std::mutex> lock{m_createEventMutex};
404  using namespace std::chrono_literals;
405  m_createEventCond.wait_for( lock, 1ms, [this, newEvtAllowed, createdEvts, maxevt] {
406  return ( newEvtAllowed || createdEvts == 0 ) && // Launch the first event alone
407  // The events are not finished with an unlimited number of events
408  createdEvts >= 0 &&
409  // The events are not finished with a limited number of events
410  ( createdEvts < maxevt || maxevt < 0 ) &&
411  // There are still free slots in the whiteboard
412  this->m_whiteboard->freeSlots() > 0;
413  } );
414  continue;
415  }
416  if ( 1 == createdEvts ) // reset counter to count from event 1
417  start_time = Clock::now();
418 
419  // TODO can we adapt the interface of executeEvent for a nicer solution?
421  sc = executeEvent( &createdEvts );
422  if ( !sc.isSuccess() ) {
423  return StatusCode::FAILURE;
424  } // else we have an success --> exit loop
425  newEvtAllowed = true;
426  } // end main loop on finished events
427  auto end_time = Clock::now();
428 
429  delete m_evtSelContext;
430  m_evtSelContext = nullptr;
431 
432  constexpr double oneOver1024 = 1. / 1024.;
433  info() << "---> Loop Finished (skipping 1st evt) - "
434  << " WSS " << System::mappedMemory( System::MemoryUnit::kByte ) * oneOver1024 << " total time "
435  << std::chrono::duration_cast<std::chrono::nanoseconds>( end_time - start_time ).count() << endmsg;
436  return StatusCode::SUCCESS;
437 }
438 
440 {
441  IOpaqueAddress* pAddr = nullptr;
442  StatusCode sc = m_evtSelector->next( *m_evtSelContext );
443  if ( sc.isSuccess() ) {
444  // Create root address and assign address to data service
445  sc = m_evtSelector->createAddress( *m_evtSelContext, pAddr );
446  if ( !sc.isSuccess() ) {
447  sc = m_evtSelector->next( *m_evtSelContext );
448  if ( sc.isSuccess() ) {
449  sc = m_evtSelector->createAddress( *m_evtSelContext, pAddr );
450  if ( !sc.isSuccess() ) warning() << "Error creating IOpaqueAddress." << endmsg;
451  }
452  }
453  }
454  if ( !sc.isSuccess() ) {
455  info() << "No more events in event selection " << endmsg;
456  return StatusCode::FAILURE;
457  }
458  sc = m_evtDataMgrSvc->setRoot( "/Event", pAddr );
459  if ( !sc.isSuccess() ) {
460  warning() << "Error declaring event root address." << endmsg;
461  }
462  return StatusCode::SUCCESS;
463 }
464 
471 {
472  fatal() << "*** Event " << eventContext->evt() << " on slot " << eventContext->slot() << " failed! ***" << endmsg;
473  std::ostringstream ost;
474  m_algExecStateSvc->dump( ost, *eventContext );
475  info() << "Dumping Alg Exec State for slot " << eventContext->slot() << ":\n" << ost.str() << endmsg;
476  return StatusCode::FAILURE;
477 }
478 
480 {
481  // Check if the execution failed
482  if ( m_algExecStateSvc->eventStatus( *eventContext ) != EventStatus::Success )
483  eventFailed( eventContext.get() ).ignore();
484  int si = eventContext->slot();
485 
486  if ( msgLevel( MSG::DEBUG ) )
487  debug() << "Event " << eventContext->evt() << " executed in slot " << si << "." << endmsg;
488 
489  // Schedule the cleanup of the event
490  if ( m_algExecStateSvc->eventStatus( *eventContext ) == EventStatus::Success ) {
491  if ( msgLevel( MSG::DEBUG ) )
492  debug() << "Event " << eventContext->evt() << " finished (slot " << si << ")." << endmsg;
493  } else {
494  fatal() << "Failed event detected on " << *eventContext << endmsg;
495  }
496 
497  debug() << "Clearing slot " << si << " (event " << eventContext->evt() << ") of the whiteboard" << endmsg;
498 
499  StatusCode sc = m_whiteboard->clearStore( si );
500  if ( !sc.isSuccess() ) {
501  warning() << "Clear of Event data store failed" << endmsg;
502  }
503  m_eventSlots[si].eventContext = nullptr;
504  sc = m_whiteboard->freeStore( si );
505  if ( !sc.isSuccess() ) {
506  error() << "Whiteboard slot " << eventContext->slot() << " could not be properly cleared";
507  }
508  m_finishedEvt++;
509  m_createEventCond.notify_all();
510 }
511 
513 {
514  bool eventfailed = false;
515  Gaudi::Hive::setCurrentContext( m_evtCtx.get() );
516 
517  const SmartIF<IProperty> appmgr( m_serviceLocator );
518 
519  for ( IAlgorithm* ialg : m_algorithms ) {
520  Algorithm* this_algo = dynamic_cast<Algorithm*>( ialg );
521  if ( !this_algo ) {
522  throw GaudiException( "Cast to Algorithm failed!", "HLTExecutionTask", StatusCode::FAILURE );
523  }
524 
525  // select the appropriate store
526  this_algo->whiteboard()->selectStore( m_evtCtx->valid() ? m_evtCtx->slot() : 0 ).ignore();
527 
529  try {
531  m_aess->algExecState( ialg, *m_evtCtx ).setState( AlgExecState::State::Executing );
532  sc = ialg->sysExecute( *m_evtCtx );
533  if ( UNLIKELY( !sc.isSuccess() ) ) {
534  log() << MSG::WARNING << "Execution of algorithm " << ialg->name() << " failed" << endmsg;
535  eventfailed = true;
536  }
537  rcg.ignore(); // disarm the guard
538  } catch ( const GaudiException& Exception ) {
539  log() << MSG::FATAL << ".executeEvent(): Exception with tag=" << Exception.tag() << " thrown by " << ialg->name()
540  << endmsg << MSG::ERROR << Exception << endmsg;
541  eventfailed = true;
542  } catch ( const std::exception& Exception ) {
543  log() << MSG::FATAL << ".executeEvent(): Standard std::exception thrown by " << ialg->name() << endmsg
544  << MSG::ERROR << Exception.what() << endmsg;
545  eventfailed = true;
546  } catch ( ... ) {
547  log() << MSG::FATAL << ".executeEvent(): UNKNOWN Exception thrown by " << ialg->name() << endmsg;
548  eventfailed = true;
549  }
550 
551  // Commit all DataHandles
552  this_algo->commitHandles();
553 
554  // DP it is important to propagate the failure of an event.
555  // We need to stop execution when this happens so that execute run can
556  // then receive the FAILURE
557  m_aess->algExecState( ialg, *m_evtCtx ).setState( AlgExecState::State::Done, sc );
558  m_aess->updateEventStatus( eventfailed, *m_evtCtx );
559 
560  // in case the algorithm was a filter and the filter did not pass, stop here
561  if ( !this_algo->filterPassed() ) {
562  break;
563  }
564  }
565  // update scheduler state
566  m_promote2ExecutedClosure( std::move( m_evtCtx ) );
568 
569  return nullptr;
570 }
const concurrency::PrecedenceRulesGraph * getRules() const
Precedence rules accessor.
Definition: PrecedenceSvc.h:65
StatusCode setProperty(IProperty *component, const std::string &name, const TYPE &value, const std::string &doc)
simple function to set the property of the given object from the value
Definition: Property.h:1234
#define UNLIKELY(x)
Definition: Kernel.h:128
constexpr static const auto FAILURE
Definition: StatusCode.h:88
StatusCode initialize() override
Definition: Service.cpp:63
const unsigned int & getAlgoIndex() const
Get algorithm index.
T empty(T...args)
Define general base for Gaudi exception.
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
void commitHandles() override
Definition: Algorithm.cpp:960
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:746
void set(const ContextEvt_t &e=0, const ContextID_t &s=INVALID_CONTEXT_ID)
Definition: EventContext.h:44
StatusCode finalize() override
Definition: Service.cpp:173
ContextID_t slot() const
Definition: EventContext.h:40
StatusCode eventFailed(EventContext *eventContext)
Method to check if an event failed and take appropriate actions.
The Event Selector Interface.
Definition: IEvtSelector.h:18
StatusCode finalize() override
implementation of IService::finalize
const DataObjIDColl & outputDataObjs() const override
bool isSuccess() const
Definition: StatusCode.h:287
HistogramAgent base in charge of collecting all the refereces to DataObjects in a transient store tha...
A service to resolve the task execution precedence.
Definition: PrecedenceSvc.h:21
Header file for class GaudiAlgorithm.
Abstract interface for a service that manages tasks&#39; precedence.
T duration_cast(T...args)
T end(T...args)
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
AlgorithmNode * getAlgorithmNode(const std::string &algoName) const
Get the AlgorithmNode from by algorithm name using graph index.
virtual std::list< IAlgorithm * > getFlatAlgList()=0
Get the flat list of algorithms.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
STL class.
bool isFailure() const
Definition: StatusCode.h:139
T partition(T...args)
constexpr int ScheduledStop
Definition: AppReturnCode.h:27
#define DECLARE_COMPONENT(type)
Definition: PluginService.h:33
ContextEvt_t evt() const
Definition: EventContext.h:39
STL class.
The IAlgResourcePool is the interface for managing algorithm instances, in particular if clones of th...
constexpr int UnhandledException
Definition: AppReturnCode.h:29
T push_back(T...args)
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given &#39;slot&#39; for all subsequent calls within the same thread id.
T what(T...args)
Abstract interface for a service that manages the Algorithm execution states.
constexpr static const auto RECOVERABLE
Definition: StatusCode.h:89
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
const DataObjIDColl & inputDataObjs() const override
const std::string & key() const
Definition: DataObjID.h:49
The IMessage is the interface implemented by the message service.
Definition: IMessageSvc.h:38
start
Definition: IOTest.py:99
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
virtual const std::string & tag() const
name tag for the exception, or exception type
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
STL class.
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:51
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
GAUDI_API void setCurrentContext(const EventContext *ctx)
T move(T...args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:87
SmartIF< IHiveWhiteBoard > & whiteboard() const
Definition: Algorithm.cpp:813
T get(T...args)
T insert(T...args)
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:78
T find_if(T...args)
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.
Definition: Memory.cpp:204
T size(T...args)
STL class.
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
StatusCode initialize() override
implementation of IService::initialize
T begin(T...args)
T none_of(T...args)
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:165
bool filterPassed() const override
Did this algorithm pass or fail its filter criterion for the last event?
Definition: Algorithm.cpp:770
Class representing the event slot.
Definition: EventSlot.h:10
string s
Definition: gaudirun.py:253
StatusCode executeEvent(void *par) override
implementation of IEventProcessor::executeEvent(void* par)
GAUDI_API void setCurrentContextEvt(long int evtN)
void promoteToExecuted(std::unique_ptr< EventContext > eventContext)
Algorithm promotion.
void ignore()
Definition: RetCodeGuard.h:13
T sort(T...args)
StatusCode stopRun() override
implementation of IEventProcessor::stopRun()
AttribStringParser::Iterator begin(const AttribStringParser &parser)
T accumulate(T...args)
Opaque address interface definition.
StatusCode declareEventRootAddress()
Declare the root address of the event.
int maxevt
Definition: Bootstrap.cpp:276
constexpr int Success
Definition: AppReturnCode.h:18
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
std::string fullKey() const
Definition: DataObjID.cpp:99
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
constexpr double ms
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:209
unsigned int getControlFlowNodeCounter() const
Get total number of control flow graph nodes.
T reserve(T...args)
T emplace_back(T...args)