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