The Gaudi Framework  master (d98a2936)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
HiveSlimEventLoopMgr.cpp
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // Local includes
12 #include "HiveSlimEventLoopMgr.h"
13 #include "HistogramAgent.h"
14 #include <GaudiKernel/StatusCode.h>
15 
16 // Framework includes
18 #include <GaudiKernel/DataObject.h>
19 #include <GaudiKernel/DataSvc.h>
21 #include <GaudiKernel/Incident.h>
22 
23 // External libraries
24 #include <chrono>
25 
26 // Instantiation of a static factory class used by clients to create instances of this service
28 
29 #define ON_DEBUG if ( msgLevel( MSG::DEBUG ) )
30 #define DEBUG_MSG ON_DEBUG debug()
31 
32 #define ON_VERBOSE if ( msgLevel( MSG::VERBOSE ) )
33 #define VERBOSE_MSG ON_VERBOSE verbose()
34 
35 //--------------------------------------------------------------------------------------------
36 // Standard Destructor
37 //--------------------------------------------------------------------------------------------
39 
40 //--------------------------------------------------------------------------------------------
41 // implementation of IAppMgrUI::initialize
42 //--------------------------------------------------------------------------------------------
45  if ( !sc.isSuccess() ) {
46  error() << "Failed to initialize Service Base class." << endmsg;
47  return StatusCode::FAILURE;
48  }
49 
50  // Get the references to the services that are needed by the ApplicationMgr itself
51  m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
52  if ( !m_incidentSvc ) {
53  fatal() << "Error retrieving IncidentSvc." << endmsg;
54  return StatusCode::FAILURE;
55  }
56 
57  // Setup access to event data services
58  m_evtDataMgrSvc = serviceLocator()->service( "EventDataSvc" );
59  if ( !m_evtDataMgrSvc ) {
60  fatal() << "Error retrieving EventDataSvc interface IDataManagerSvc." << endmsg;
61  return StatusCode::FAILURE;
62  }
63  m_whiteboard = serviceLocator()->service( "EventDataSvc" );
64  if ( !m_whiteboard ) {
65  fatal() << "Error retrieving EventDataSvc interface IHiveWhiteBoard." << endmsg;
66  return StatusCode::FAILURE;
67  }
69  if ( !m_schedulerSvc ) {
70  fatal() << "Error retrieving SchedulerSvc interface IScheduler." << endmsg;
71  return StatusCode::FAILURE;
72  }
73  // Obtain the IProperty of the ApplicationMgr
75  if ( !m_appMgrProperty ) {
76  fatal() << "IProperty interface not found in ApplicationMgr." << endmsg;
77  return StatusCode::FAILURE;
78  }
79 
80  // We do not expect a Event Selector necessarily being declared
81  setProperty( m_appMgrProperty->getProperty( "EvtSel" ) ).ignore();
82 
83  if ( m_evtsel != "NONE" || m_evtsel.length() == 0 ) {
84  m_evtSelector = serviceLocator()->service( "EventSelector" );
85  if ( m_evtSelector ) {
86  // Setup Event Selector
87  sc = m_evtSelector->createContext( m_evtContext );
88  if ( !sc.isSuccess() ) {
89  fatal() << "Can not create the event selector Context." << endmsg;
90  return sc;
91  }
92  } else {
93  fatal() << "EventSelector not found." << endmsg;
94  return sc;
95  }
96  } else {
97  m_evtSelector = 0;
98  m_evtContext = 0;
99  info() << "\"EventSelector\" disabled: no events will be processed from external input." << endmsg;
100  }
101 
102  setProperty( m_appMgrProperty->getProperty( "HistogramPersistency" ) ).ignore();
103  if ( m_histPersName != "NONE" && !m_histPersName.empty() ) {
104  // Setup access to histogramming services
105  m_histoDataMgrSvc = serviceLocator()->service( "HistogramDataSvc" );
106  if ( !m_histoDataMgrSvc ) {
107  fatal() << "Error retrieving HistogramDataSvc." << endmsg;
108  return StatusCode::FAILURE;
109  }
110  // Setup histogram persistency
111  m_histoPersSvc = serviceLocator()->service( "HistogramPersistencySvc" );
112  if ( !m_histoPersSvc ) { warning() << "Histograms cannot not be saved - though required." << endmsg; }
113  }
114 
115  // Setup algorithm resource pool
116  m_algResourcePool = serviceLocator()->service( "AlgResourcePool" );
117  if ( !m_algResourcePool ) {
118  fatal() << "Error retrieving AlgResourcePool" << endmsg;
119  return StatusCode::FAILURE;
120  }
121 
122  m_algExecStateSvc = serviceLocator()->service( "AlgExecStateSvc" );
123  if ( !m_algExecStateSvc ) {
124  fatal() << "Error retrieving AlgExecStateSvc" << endmsg;
125  return StatusCode::FAILURE;
126  }
127 
128  std::sort( m_eventNumberBlacklist.begin(), m_eventNumberBlacklist.end() );
129  info() << "Found " << m_eventNumberBlacklist.size() << " events in black list" << endmsg;
130 
131  return StatusCode::SUCCESS;
132 }
133 //--------------------------------------------------------------------------------------------
134 // implementation of IService::reinitialize
135 //--------------------------------------------------------------------------------------------
137 
138  // Check to see whether a new Event Selector has been specified
139  setProperty( m_appMgrProperty->getProperty( "EvtSel" ) ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
140  if ( m_evtsel != "NONE" || m_evtsel.empty() ) {
141  auto theSvc = serviceLocator()->service( "EventSelector" );
142  auto theEvtSel = theSvc.as<IEvtSelector>();
143  StatusCode sc;
144  if ( theEvtSel && ( theEvtSel.get() != m_evtSelector.get() ) ) {
145  // Setup Event Selector
146  if ( m_evtSelector.get() && m_evtContext ) {
147  // Need to release context before switching to new event selector
148  m_evtSelector->releaseContext( m_evtContext ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
149  m_evtContext = nullptr;
150  }
151  m_evtSelector = theEvtSel;
152  if ( theSvc->FSMState() == Gaudi::StateMachine::INITIALIZED ) {
153  sc = theSvc->reinitialize();
154  if ( !sc.isSuccess() ) {
155  error() << "Failure Reinitializing EventSelector " << theSvc->name() << endmsg;
156  return sc;
157  }
158  } else {
159  sc = theSvc->sysInitialize();
160  if ( !sc.isSuccess() ) {
161  error() << "Failure Initializing EventSelector " << theSvc->name() << endmsg;
162  return sc;
163  }
164  }
165  sc = m_evtSelector->createContext( m_evtContext );
166  if ( !sc.isSuccess() ) {
167  error() << "Can not create Context " << theSvc->name() << endmsg;
168  return sc;
169  }
170 
171  } else if ( m_evtSelector ) {
172  if ( m_evtContext ) {
173  m_evtSelector->releaseContext( m_evtContext ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
174  m_evtContext = nullptr;
175  }
176  sc = m_evtSelector->createContext( m_evtContext );
177  if ( !sc.isSuccess() ) {
178  error() << "Can not create Context " << theSvc->name() << endmsg;
179  return sc;
180  }
181  }
182  } else if ( m_evtSelector && m_evtContext ) {
183  m_evtSelector->releaseContext( m_evtContext ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
184  m_evtSelector = nullptr;
185  m_evtContext = nullptr;
186  }
187  return StatusCode::SUCCESS;
188 }
189 
190 //--------------------------------------------------------------------------------------------
191 // implementation of IService::stop
192 //--------------------------------------------------------------------------------------------
193 // Removed call to MinimalEventLoopMgr!
195  if ( !m_endEventFired ) {
196  // Fire pending EndEvent incident
197  m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndEvent ) );
198  m_endEventFired = true;
199  }
200  return StatusCode::SUCCESS;
201 }
202 
203 //--------------------------------------------------------------------------------------------
204 // implementation of IAppMgrUI::finalize
205 //--------------------------------------------------------------------------------------------
206 // Removed call to MinimalEventLoopMgr!
208 
209  StatusCode scRet;
211 
212  if ( sc.isFailure() ) {
213  scRet = StatusCode::FAILURE;
214  error() << "Problems finalizing Service base class" << endmsg;
215  }
216 
217  // Save Histograms Now
218  if ( m_histoPersSvc ) {
219  HistogramAgent agent;
220  sc = m_histoDataMgrSvc->traverseTree( &agent );
221  if ( sc.isSuccess() ) {
222  const IDataSelector& objects = agent.selectedObjects();
223  // skip /stat entry!
224  sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode s, const auto& i ) {
225  IOpaqueAddress* pAddr = nullptr;
226  StatusCode iret = m_histoPersSvc->createRep( i, pAddr );
227  if ( iret.isSuccess() ) i->registry()->setAddress( pAddr );
228  return s.isFailure() ? s : iret;
229  } );
230  sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode s, const auto& i ) {
231  IRegistry* reg = i->registry();
232  StatusCode iret = m_histoPersSvc->fillRepRefs( reg->address(), i );
233  return s.isFailure() ? s : iret;
234  } );
235  if ( sc.isSuccess() ) {
236  info() << "Histograms converted successfully according to request." << endmsg;
237  } else {
238  error() << "Error while saving Histograms." << endmsg;
239  }
240  } else {
241  error() << "Error while traversing Histogram data store" << endmsg;
242  }
243  }
244 
245  scRet = sc;
246 
247  // Release event selector context
248  if ( m_evtSelector && m_evtContext ) {
249  m_evtSelector->releaseContext( m_evtContext ).ignore();
250  m_evtContext = nullptr;
251  }
252 
254 
255  // Release all interfaces...
258 
262 
263  return scRet;
264 }
265 
266 //--------------------------------------------------------------------------------------------
267 // implementation of executeEvent(void* par)
268 //--------------------------------------------------------------------------------------------
270 
272 
273  // Check if event number is in blacklist
274  if ( m_blackListBS != nullptr ) { // we are processing a finite number of events, use bitset blacklist
275  if ( m_blackListBS->test( ctx.evt() ) ) {
276  VERBOSE_MSG << "Event " << ctx.evt() << " on black list" << endmsg;
277  m_whiteboard->freeStore( ctx.slot() ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
279  }
280  } else if ( std::binary_search( m_eventNumberBlacklist.begin(), m_eventNumberBlacklist.end(), ctx.evt() ) ) {
281  VERBOSE_MSG << "Event " << ctx.evt() << " on black list" << endmsg;
282  m_whiteboard->freeStore( ctx.slot() ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
284  }
285 
286  VERBOSE_MSG << "Beginning to process event " << ctx.evt() << endmsg;
287 
288  // An incident may schedule a stop, in which case is better to exit before the actual execution.
289  if ( m_scheduledStop ) {
290  always() << "Terminating event processing loop due to a stop scheduled by an incident listener" << endmsg;
291  return StatusCode::SUCCESS;
292  }
293 
294  // Fire BeginEvent "Incident"
295  m_incidentSvc->fireIncident( std::make_unique<Incident>( name(), IncidentType::BeginEvent, ctx ) );
296 
297  // Now add event to the scheduler
298  VERBOSE_MSG << "Adding event " << ctx.evt() << ", slot " << ctx.slot() << " to the scheduler" << endmsg;
299 
300  m_incidentSvc->fireIncident( std::make_unique<Incident>( name(), IncidentType::BeginProcessing, ctx ) );
301 
302  StatusCode addEventStatus = m_schedulerSvc->pushNewEvent( new EventContext{ std::move( ctx ) } );
303 
304  // If this fails, we need to wait for something to complete
305  if ( !addEventStatus.isSuccess() ) {
306  fatal() << "An event processing slot should be now free in the scheduler, but it appears not to be the case."
307  << endmsg;
308  }
309 
310  return StatusCode::SUCCESS;
311 }
312 
313 //--------------------------------------------------------------------------------------------
314 // implementation of IEventProcessing::executeRun
315 //--------------------------------------------------------------------------------------------
317  StatusCode sc;
318  bool eventfailed = false;
319 
320  if ( maxevt > 0 ) { // finite number of events to process
321  const unsigned int umaxevt = static_cast<unsigned int>( maxevt );
322  m_blackListBS = std::make_unique<boost::dynamic_bitset<>>( maxevt ); // all initialized to zero
323  for ( unsigned int i = 0; i < m_eventNumberBlacklist.size() && m_eventNumberBlacklist[i] <= umaxevt;
324  ++i ) { // black list is sorted in init
325  m_blackListBS->set( m_eventNumberBlacklist[i], true );
326  }
327  }
328 
329  // Call now the nextEvent(...)
330  sc = nextEvent( maxevt );
331  if ( sc.isFailure() ) eventfailed = true;
332 
333  m_blackListBS.reset( nullptr );
334 
335  return eventfailed ? StatusCode::FAILURE : StatusCode::SUCCESS;
336 }
337 
338 //--------------------------------------------------------------------------------------------
339 // Implementation of IEventProcessor::stopRun()
340 //--------------------------------------------------------------------------------------------
342  // Set the application return code
343  auto appmgr = serviceLocator()->as<IProperty>();
345  error() << "Could not set return code of the application (" << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
346  }
347  m_scheduledStop = true;
348  return StatusCode::SUCCESS;
349 }
350 
351 //--------------------------------------------------------------------------------------------
352 // implementation of IAppMgrUI::nextEvent
353 //--------------------------------------------------------------------------------------------
354 // Here the loop on the events takes place.
355 // This is also the natural place to put the preparation of the algorithms
356 // contexts, which contain the event specific data.
357 #include <GaudiKernel/Memory.h>
359 
360  // Calculate runtime
361  using Clock = std::chrono::high_resolution_clock;
362 
363  // Reset the application return code.
365 
366  int finishedEvts = 0;
367  int createdEvts = 0;
368  int skippedEvts = 0;
369  info() << "Starting loop on events" << endmsg;
370  // Loop until the finished events did not reach the maxevt number
371  bool loop_ended = false;
372  // Run the first event before spilling more than one
373  bool newEvtAllowed = false;
374 
375  constexpr double oneOver1024 = 1. / 1024.;
376 
377  uint iteration = 0;
378  auto start_time = Clock::now();
379  StatusCode finalSC;
380  while ( !loop_ended && ( maxevt < 0 || ( finishedEvts + skippedEvts ) < maxevt ) ) {
381  DEBUG_MSG << "work loop iteration " << iteration++ << endmsg;
382  // if the created events did not reach maxevt, create an event
383  if ( ( newEvtAllowed || createdEvts == 0 ) && // Launch the first event alone
384  createdEvts >= 0 && // The events are not finished with an unlimited number of events
385  ( createdEvts < maxevt || maxevt < 0 ) && // The events are not finished with a limited number of events
386  m_schedulerSvc->freeSlots() > 0 && // There are still free slots in the scheduler
387  m_whiteboard->freeSlots() > 0 && // There are still free slots in the whiteboard
388  !m_scheduledStop // There is not a scheduled stop
389  ) {
390 
391  if ( 1 == createdEvts ) // reset counter to count from event 1
392  start_time = Clock::now();
393 
394  DEBUG_MSG << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
395  // DP remove to remove the syscalls...
396  // if (0!=createdEvts){
397  // info() << "Event Number = " << createdEvts
398  // << " WSS (MB) = " << System::mappedMemory(System::MemoryUnit::kByte)*oneOver1024
399  // << " Time (s) = " << secsFromStart(start_time) << endmsg;
400  // }
401 
402  // TODO can we adapt the interface of executeEvent for a nicer solution?
404  while ( !sc.isSuccess() // we haven't created an event yet
405  && ( createdEvts < maxevt || maxevt < 0 ) ) { // redunant check for maxEvts, can we do better?
406  {
407  auto ctx = createEventContext();
408  if ( !ctx.valid() ) {
409  createdEvts = -1;
410  break; // invalid context means end of loop
411  }
412  sc = executeEvent( std::move( ctx ) );
413  }
414  if ( sc.isRecoverable() ) { // we skipped an event
415  ++skippedEvts;
416  } else if ( sc.isFailure() ) { // exit immediatly
417  return sc;
418  } // else we have an success --> exit loop
419  ++createdEvts;
420  }
421 
422  } // end if condition createdEvts < maxevt
423  else {
424  // all the events were created but not all finished or the slots were
425  // all busy: the scheduler should finish its job
426 
427  DEBUG_MSG << "Draining the scheduler" << endmsg;
428 
429  // Pull out of the scheduler the finished events
430  if ( drainScheduler( finishedEvts ).isFailure() ) {
431  loop_ended = true;
432  finalSC = StatusCode::FAILURE;
433  }
434  newEvtAllowed = true;
435  }
436  } // end main loop on finished events
437  auto end_time = Clock::now();
438 
439  info() << "---> Loop Finished (skipping 1st evt) - "
440  << " WSS " << System::mappedMemory( System::MemoryUnit::kByte ) * oneOver1024 << " total time "
441  << std::chrono::duration_cast<std::chrono::nanoseconds>( end_time - start_time ).count() << endmsg;
442  info() << skippedEvts << " events were SKIPed" << endmsg;
443 
444  return finalSC;
445 }
446 
447 //---------------------------------------------------------------------------
448 
451  refpAddr = nullptr;
452  StatusCode sc = m_evtSelector->next( *m_evtContext );
453  if ( sc.isFailure() ) return sc;
454  // Create root address and assign address to data service
455  sc = m_evtSelector->createAddress( *m_evtContext, refpAddr );
456  if ( sc.isSuccess() ) return sc;
457  sc = m_evtSelector->next( *m_evtContext );
458  if ( sc.isFailure() ) return sc;
459  sc = m_evtSelector->createAddress( *m_evtContext, refpAddr );
460  if ( !sc.isSuccess() ) warning() << "Error creating IOpaqueAddress." << endmsg;
461  return sc;
462 }
463 
464 //---------------------------------------------------------------------------
465 
467  StatusCode sc;
468  if ( m_evtContext ) {
469  //---This is the "event iterator" context from EventSelector
470  IOpaqueAddress* pAddr = nullptr;
471  sc = getEventRoot( pAddr );
472  if ( !sc.isSuccess() ) {
473  info() << "No more events in event selection " << endmsg;
474  return StatusCode::FAILURE;
475  }
476  sc = m_evtDataMgrSvc->setRoot( "/Event", pAddr );
477  if ( !sc.isSuccess() ) { warning() << "Error declaring event root address." << endmsg; }
478  } else {
479  //---In case of no event selector----------------
480  sc = m_evtDataMgrSvc->setRoot( "/Event", new DataObject() );
481  if ( !sc.isSuccess() ) { warning() << "Error declaring event root DataObject" << endmsg; }
482  }
483  return StatusCode::SUCCESS;
484 }
485 
486 //---------------------------------------------------------------------------
487 
489  EventContext ctx{ m_nevt, m_whiteboard->allocateStore( m_nevt ) };
490  ++m_nevt;
491 
492  StatusCode sc = m_whiteboard->selectStore( ctx.slot() );
493  if ( sc.isFailure() ) {
494  throw GaudiException( "Slot " + std::to_string( ctx.slot() ) + " could not be selected for the WhiteBoard", name(),
495  sc );
496  }
497  if ( declareEventRootAddress().isFailure() ) { // We ran out of events!
498  // invalid context terminates the loop
499  return EventContext{};
500  }
501  return ctx;
502 }
503 
504 //---------------------------------------------------------------------------
505 
507 
509 
510  // maybe we can do better
511  std::vector<EventContext*> finishedEvtContexts;
512 
513  EventContext* finishedEvtContext( nullptr );
514 
515  // Here we wait not to loose cpu resources
516  DEBUG_MSG << "Waiting for a context" << endmsg;
517  sc = m_schedulerSvc->popFinishedEvent( finishedEvtContext );
518 
519  // We got past it: cache the pointer
520  DEBUG_MSG << "Context " << ( sc.isSuccess() ? "obtained" : "not obtained: a problem in the scheduling?" ) << endmsg;
521  finishedEvtContexts.push_back( finishedEvtContext );
522 
523  // Let's see if we can pop other event contexts
524  while ( m_schedulerSvc->tryPopFinishedEvent( finishedEvtContext ).isSuccess() ) {
525  finishedEvtContexts.push_back( finishedEvtContext );
526  }
527 
528  // Now we flush them
529  StatusCode finalSC;
530  for ( auto& thisFinishedEvtContext : finishedEvtContexts ) {
531  if ( !thisFinishedEvtContext ) {
532  error() << "Detected nullptr ctxt before clearing WB!" << endmsg;
533  finalSC = StatusCode::FAILURE;
534  continue;
535  }
536  if ( m_algExecStateSvc->eventStatus( *thisFinishedEvtContext ) != EventStatus::Success ) {
537  ( m_abortOnFailure ? fatal() : error() ) << "Failed event detected on " << thisFinishedEvtContext << endmsg;
538  if ( m_abortOnFailure ) finalSC = StatusCode::FAILURE;
539  }
540  // shouldn't these incidents move to the forward scheduler?
541  // If we want to consume incidents with an algorithm at the end of the graph
542  // we need to add this to forward scheduler lambda action,
543  // otherwise we have to do this serially on this thread!
544  m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndProcessing, *thisFinishedEvtContext ) );
545  m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndEvent, *thisFinishedEvtContext ) );
546 
547  DEBUG_MSG << "Clearing slot " << thisFinishedEvtContext->slot() << " (event " << thisFinishedEvtContext->evt()
548  << ") of the whiteboard" << endmsg;
549 
550  StatusCode sc = clearWBSlot( thisFinishedEvtContext->slot() );
551  if ( !sc.isSuccess() )
552  error() << "Whiteboard slot " << thisFinishedEvtContext->slot() << " could not be properly cleared";
553 
554  delete thisFinishedEvtContext;
555 
556  ++finishedEvts;
557  }
558  return finalSC;
559 }
560 
561 //---------------------------------------------------------------------------
562 
564  StatusCode sc = m_whiteboard->clearStore( evtSlot );
565  if ( !sc.isSuccess() ) warning() << "Clear of Event data store failed" << endmsg;
566  return m_whiteboard->freeStore( evtSlot );
567 }
568 //---------------------------------------------------------------------------
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:25
HiveSlimEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveSlimEventLoopMgr.h:59
HiveSlimEventLoopMgr::m_abortOnFailure
Gaudi::Property< bool > m_abortOnFailure
Definition: HiveSlimEventLoopMgr.h:40
IDataSelector
std::vector< DataObject * > IDataSelector
This is only a placeholder to allow me compiling until the responsible guy does his work!...
Definition: IDataSelector.h:15
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:82
StatusCode::isRecoverable
bool isRecoverable() const
Definition: StatusCode.h:318
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:118
HiveSlimEventLoopMgr::m_schedulerSvc
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
Definition: HiveSlimEventLoopMgr.h:64
HiveSlimEventLoopMgr::m_eventNumberBlacklist
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
Definition: HiveSlimEventLoopMgr.h:39
AppReturnCode.h
HiveSlimEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: HiveSlimEventLoopMgr.cpp:136
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
HiveSlimEventLoopMgr::clearWBSlot
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
Definition: HiveSlimEventLoopMgr.cpp:563
gaudirun.s
string s
Definition: gaudirun.py:346
IOpaqueAddress
Definition: IOpaqueAddress.h:28
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p)
Set the property from a property.
Definition: IProperty.h:38
HiveSlimEventLoopMgr::m_endEventFired
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event)
Definition: HiveSlimEventLoopMgr.h:62
GaudiException
Definition: GaudiException.h:29
HiveSlimEventLoopMgr::m_histPersName
Gaudi::Property< std::string > m_histPersName
Definition: HiveSlimEventLoopMgr.h:34
Memory.h
IEvtSelector
Definition: IEvtSelector.h:26
HiveSlimEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveSlimEventLoopMgr.h:43
EventStatus::Success
@ Success
Definition: IAlgExecStateSvc.h:75
VERBOSE_MSG
#define VERBOSE_MSG
Definition: HiveSlimEventLoopMgr.cpp:33
HiveSlimEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: HiveSlimEventLoopMgr.cpp:207
HiveSlimEventLoopMgr::createEventContext
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
Definition: HiveSlimEventLoopMgr.cpp:488
IRegistry
Definition: IRegistry.h:29
HiveSlimEventLoopMgr::m_nevt
EventContext::ContextEvt_t m_nevt
Definition: HiveSlimEventLoopMgr.h:81
HiveSlimEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: HiveSlimEventLoopMgr.cpp:194
StatusCode.h
HiveSlimEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveSlimEventLoopMgr.h:55
HiveSlimEventLoopMgr::~HiveSlimEventLoopMgr
~HiveSlimEventLoopMgr() override
Definition: HiveSlimEventLoopMgr.cpp:38
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:223
HistogramAgent::selectedObjects
const IDataSelector & selectedObjects() const
Return the set of selected DataObjects.
Definition: HistogramAgent.h:32
HistogramAgent
Definition: HistogramAgent.h:27
IProperty
Definition: IProperty.h:32
Gaudi::Utils::begin
AttribStringParser::Iterator begin(const AttribStringParser &parser)
Definition: AttribStringParser.h:135
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
Service::name
const std::string & name() const override
Retrieve name of the service
Definition: Service.cpp:333
StatusCode
Definition: StatusCode.h:64
HiveSlimEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveSlimEventLoopMgr.h:49
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:58
HiveSlimEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun()
Definition: HiveSlimEventLoopMgr.cpp:316
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:34
HiveSlimEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: HiveSlimEventLoopMgr.h:76
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:198
HiveSlimEventLoopMgr.h
DEBUG_MSG
#define DEBUG_MSG
Definition: HiveSlimEventLoopMgr.cpp:30
HiveSlimEventLoopMgr
Definition: HiveSlimEventLoopMgr.h:31
HiveSlimEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: HiveSlimEventLoopMgr.h:74
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
HiveSlimEventLoopMgr::drainScheduler
StatusCode drainScheduler(int &finishedEvents)
Drain the scheduler from all actions that may be queued.
Definition: HiveSlimEventLoopMgr.cpp:506
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
HiveSlimEventLoopMgr::stopRun
StatusCode stopRun() override
implementation of IEventProcessor::stopRun()
Definition: HiveSlimEventLoopMgr.cpp:341
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
HiveSlimEventLoopMgr::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
Definition: HiveSlimEventLoopMgr.h:53
HiveSlimEventLoopMgr::executeEvent
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
Definition: HiveSlimEventLoopMgr.cpp:269
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:99
DataObject.h
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
HiveSlimEventLoopMgr::m_blackListBS
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
Definition: HiveSlimEventLoopMgr.h:79
EventContext.h
HiveSlimEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveSlimEventLoopMgr.h:47
DECLARE_COMPONENT
#define DECLARE_COMPONENT(type)
Definition: PluginServiceV1.h:45
HiveSlimEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent
Definition: HiveSlimEventLoopMgr.cpp:358
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:24
HiveSlimEventLoopMgr::m_algExecStateSvc
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
Definition: HiveSlimEventLoopMgr.h:57
System::kByte
@ kByte
Definition: Memory.h:50
EventContext
Definition: EventContext.h:34
HiveSlimEventLoopMgr::declareEventRootAddress
StatusCode declareEventRootAddress()
Declare the root address of the event.
Definition: HiveSlimEventLoopMgr.cpp:466
System::mappedMemory
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.
Definition: Memory.cpp:172
HiveSlimEventLoopMgr::m_schedulerName
Gaudi::Property< std::string > m_schedulerName
Definition: HiveSlimEventLoopMgr.h:36
HiveSlimEventLoopMgr::getEventRoot
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
Definition: HiveSlimEventLoopMgr.cpp:450
HiveSlimEventLoopMgr::initialize
StatusCode initialize() override
implementation of IService::initialize
Definition: HiveSlimEventLoopMgr.cpp:43
IOTest.end
end
Definition: IOTest.py:125
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:100
HiveSlimEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveSlimEventLoopMgr.h:51
HiveSlimEventLoopMgr::m_evtsel
Gaudi::Property< std::string > m_evtsel
Definition: HiveSlimEventLoopMgr.h:35
StatusCode::RECOVERABLE
constexpr static const auto RECOVERABLE
Definition: StatusCode.h:101
Incident.h
Incident
Definition: Incident.h:24
DataSvc.h
Gaudi::Accumulators::accumulate
void accumulate(Counter &counter, const Container &container, Fun f=Identity{})
A helper function for accumulating data from a container into a counter This is internally using buff...
Definition: Accumulators.h:1227
HistogramAgent.h
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator
Definition: Service.cpp:336
HiveSlimEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveSlimEventLoopMgr.h:45