HiveSlimEventLoopMgr Class Reference

#include <GaudiHive/HiveSlimEventLoopMgr.h>

Inheritance diagram for HiveSlimEventLoopMgr:
Collaboration diagram for HiveSlimEventLoopMgr:

Public Member Functions

 HiveSlimEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc)
 Standard Constructor. More...
 
virtual ~HiveSlimEventLoopMgr ()
 Standard Destructor. More...
 
StatusCode getEventRoot (IOpaqueAddress *&refpAddr)
 Create event address using event selector. More...
 
virtual StatusCode initialize ()
 implementation of IService::initialize More...
 
virtual StatusCode reinitialize ()
 implementation of IService::reinitialize More...
 
virtual StatusCode stop ()
 implementation of IService::stop More...
 
virtual StatusCode finalize ()
 implementation of IService::finalize More...
 
virtual StatusCode nextEvent (int maxevt)
 implementation of IService::nextEvent More...
 
virtual StatusCode executeEvent (void *par)
 implementation of IEventProcessor::executeEvent(void* par) More...
 
virtual StatusCode executeRun (int maxevt)
 implementation of IEventProcessor::executeRun() More...
 
virtual StatusCode stopRun ()
 implementation of IEventProcessor::stopRun() More...
 
- Public Member Functions inherited from extends< Service, IEventProcessor >
void * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
 ~extends () override=default
 Virtual destructor. More...
 
- Public Member Functions inherited from Service
const std::stringname () const override
 Retrieve name of the service. More...
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service. More...
 
StatusCode sysStart () override
 Initialize Service. More...
 
StatusCode sysStop () override
 Initialize Service. More...
 
StatusCode sysFinalize () override
 Finalize Service. More...
 
StatusCode sysReinitialize () override
 Re-initialize the Service. More...
 
StatusCode sysRestart () override
 Re-initialize the Service. More...
 
StatusCode setProperty (const Property &p) override
 
StatusCode setProperty (const std::string &s) override
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 
StatusCode getProperty (Property *p) const override
 
const PropertygetProperty (const std::string &name) const override
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 
const std::vector< Property * > & getProperties () const override
 
bool hasProperty (const std::string &name) const override
 
template<class TYPE >
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor. More...
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator. More...
 
StatusCode setProperties ()
 Method for setting declared properties to the values specified for the job. More...
 
template<class T >
StatusCode service (const std::string &name, const T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist. More...
 
template<class T >
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T >
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
template<class T >
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property. More...
 
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...
 
template<class T >
StatusCode declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Private tool. More...
 
template<class T >
StatusCode declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
 Declare used Public tool. More...
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
SmartIF< IMessageSvc > & msgSvc () const
 The standard message service. More...
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream. More...
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts. More...
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS) More...
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL) More...
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR) More...
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING) More...
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG) More...
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE) More...
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO) More...
 
MSG::Level msgLevel () const
 get the output level from the embedded MsgStream More...
 
MSG::Level outputLevel () const __attribute__((deprecated))
 Backward compatibility function for getting the output level. More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from extend_interfaces< Interfaces...>
 ~extend_interfaces () override=default
 Virtual destructor. More...
 

Protected Member Functions

StatusCode clearWBSlot (int evtSlot)
 Clear a slot in the WB. More...
 
StatusCode declareEventRootAddress ()
 Declare the root address of the event. More...
 
StatusCode createEventContext (EventContext *&eventContext, int createdEvents)
 Create event context. More...
 
StatusCode drainScheduler (int &finishedEvents)
 Drain the scheduler from all actions that may be queued. More...
 
- Protected Member Functions inherited from Service
 ~Service () override
 Standard Destructor. More...
 
int outputLevel () const
 get the Service's output level More...
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

SmartIF< IDataManagerSvcm_evtDataMgrSvc
 Reference to the Event Data Service's IDataManagerSvc interface. More...
 
SmartIF< IEvtSelectorm_evtSelector
 Reference to the Event Selector. More...
 
IEvtSelector::Contextm_evtContext
 Event Iterator. More...
 
std::string m_evtsel
 Event selector. More...
 
SmartIF< IDataManagerSvcm_histoDataMgrSvc
 Reference to the Histogram Data Service. More...
 
SmartIF< IConversionSvcm_histoPersSvc
 Reference to the Histogram Persistency Service. More...
 
SmartIF< IHiveWhiteBoardm_whiteboard
 Reference to the Whiteboard. More...
 
SmartIF< IAlgResourcePoolm_algResourcePool
 Reference to the Algorithm resource pool. More...
 
std::string m_histPersName
 Name of the Hist Pers type. More...
 
SmartIF< IPropertym_appMgrProperty
 Property interface of ApplicationMgr. More...
 
bool m_endEventFired
 Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event) More...
 
bool m_warnings
 Flag to disable warning messages when using external input. More...
 
SmartIF< ISchedulerm_schedulerSvc
 A shortcut for the scheduler. More...
 
SmartIF< IIncidentListenerm_abortEventListener
 Instance of the incident listener waiting for AbortEvent. More...
 
std::string m_schedulerName
 Name of the scheduler to be used. More...
 
bool m_scheduledStop
 Scheduled stop of event processing. More...
 
SmartIF< IAppMgrUIm_appMgrUI
 Reference to the IAppMgrUI interface of the application manager. More...
 
SmartIF< IIncidentSvcm_incidentSvc
 Reference to the incident service. More...
 
std::vector< unsigned int > m_eventNumberBlacklist
 List of events to be skipped. The number is the number in the job. More...
 
boost::dynamic_bitset * m_blackListBS
 
- Protected Attributes inherited from Service
IntegerProperty m_outputLevel = MSG::NIL
 Service output level. More...
 
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state. More...
 

Additional Inherited Members

- Public Types inherited from extends< Service, IEventProcessor >
using base_class = extends
 Typedef to this class. More...
 
using extend_interfaces_base = extend_interfaces< Interfaces...>
 Typedef to the base of this class. More...
 
- Public Types inherited from Service
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > Factory
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class = CommonMessaging
 
- Public Types inherited from extend_interfaces< Interfaces...>
using ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids...>::type
 take union of the ext_iids of all Interfaces... More...
 

Detailed Description

Definition at line 25 of file HiveSlimEventLoopMgr.h.

Constructor & Destructor Documentation

HiveSlimEventLoopMgr::HiveSlimEventLoopMgr ( const std::string nam,
ISvcLocator svcLoc 
)

Standard Constructor.

Definition at line 47 of file HiveSlimEventLoopMgr.cpp.

48 : base_class(name, svcLoc), m_appMgrUI(svcLoc)
49 {
51  m_histoPersSvc = 0;
52  m_evtDataMgrSvc = 0;
53  m_whiteboard = 0;
54  m_evtSelector = 0;
55  m_evtContext = 0;
56  m_blackListBS = nullptr;
57 
58  // Declare properties
59  declareProperty("HistogramPersistency", m_histPersName = "");
60  declareProperty("EvtSel", m_evtsel );
61  declareProperty("Warnings",m_warnings=true,
62  "Set this property to false to suppress warning messages");
63  declareProperty("SchedulerName", m_schedulerName="ForwardSchedulerSvc",
64  "Name of the scheduler to be used");
65  declareProperty("EventNumberBlackList", m_eventNumberBlacklist);
66 
67  m_scheduledStop = false;
68 
69 }
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
bool m_scheduledStop
Scheduled stop of event processing.
extends base_class
Typedef to this class.
Definition: extends.h:14
std::string m_histPersName
Name of the Hist Pers type.
std::vector< unsigned int > m_eventNumberBlacklist
List of events to be skipped. The number is the number in the job.
std::string m_evtsel
Event selector.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
bool m_warnings
Flag to disable warning messages when using external input.
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
std::string m_schedulerName
Name of the scheduler to be used.
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
boost::dynamic_bitset * m_blackListBS
IEvtSelector::Context * m_evtContext
Event Iterator.
HiveSlimEventLoopMgr::~HiveSlimEventLoopMgr ( )
virtual

Standard Destructor.

Definition at line 74 of file HiveSlimEventLoopMgr.cpp.

74  {
80  if( m_evtContext ) delete m_evtContext;
81 }
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
virtual unsigned long release()=0
Release Interface instance.
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
IEvtSelector::Context * m_evtContext
Event Iterator.

Member Function Documentation

StatusCode HiveSlimEventLoopMgr::clearWBSlot ( int  evtSlot)
protected

Clear a slot in the WB.

Definition at line 673 of file HiveSlimEventLoopMgr.cpp.

673  {
674  StatusCode sc = m_whiteboard->clearStore(evtSlot);
675  if( !sc.isSuccess() ) {
676  warning() << "Clear of Event data store failed" << endmsg;
677  }
678  return m_whiteboard->freeStore(evtSlot);
679 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
virtual StatusCode clearStore(size_t partitionIndex)=0
Clear an given 'slot'.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode freeStore(size_t partitionIndex)=0
Free a store partition.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode HiveSlimEventLoopMgr::createEventContext ( EventContext *&  eventContext,
int  createdEvents 
)
protected

Create event context.

Definition at line 594 of file HiveSlimEventLoopMgr.cpp.

594  {
595  evtContext = new EventContext;
596 
597  evtContext->set(createdEvts, m_whiteboard->allocateStore(createdEvts));
598 
599  StatusCode sc = m_whiteboard->selectStore(evtContext->slot());
600  if (sc.isFailure()){
601  warning() << "Slot " << evtContext->slot()
602  << " could not be selected for the WhiteBoard" << endmsg;
603  }
604  return sc;
605 }
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given 'slot' for all subsequent calls within the same thread id.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual size_t allocateStore(int evtnumber)=0
Allocate a store partition for new event.
void set(const ContextEvt_t &e=0, const ContextID_t &s=INVALID_CONTEXT_ID, const bool f=false)
Definition: EventContext.h:47
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode HiveSlimEventLoopMgr::declareEventRootAddress ( )
protected

Declare the root address of the event.

Definition at line 566 of file HiveSlimEventLoopMgr.cpp.

566  {
567 
568  StatusCode sc;
569  if( m_evtContext ) {
570  //---This is the "event iterator" context from EventSelector
571  IOpaqueAddress* pAddr = 0;
572  sc = getEventRoot(pAddr);
573  if( !sc.isSuccess() ) {
574  info() << "No more events in event selection " << endmsg;
575  return StatusCode::FAILURE;
576  }
577  sc = m_evtDataMgrSvc->setRoot ("/Event", pAddr);
578  if( !sc.isSuccess() ) {
579  warning() << "Error declaring event root address." << endmsg;
580  }
581  }
582  else {
583  //---In case of no event selector----------------
584  sc = m_evtDataMgrSvc->setRoot ("/Event", new DataObject());
585  if( !sc.isSuccess() ) {
586  warning() << "Error declaring event root DataObject" << endmsg;
587  }
588  }
589  return StatusCode::SUCCESS;
590 }
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
Opaque address interface definition.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IEvtSelector::Context * m_evtContext
Event Iterator.
StatusCode HiveSlimEventLoopMgr::drainScheduler ( int &  finishedEvents)
protected

Drain the scheduler from all actions that may be queued.

Definition at line 609 of file HiveSlimEventLoopMgr.cpp.

609  {
610 
612 
613  // maybe we can do better
614  std::vector<EventContext*> finishedEvtContexts;
615 
616  EventContext* finishedEvtContext(nullptr);
617 
618  // Here we wait not to loose cpu resources
619  debug() << "Waiting for a context" << endmsg;
620  sc = m_schedulerSvc->popFinishedEvent(finishedEvtContext);
621 
622  // We got past it: cache the pointer
623  if (sc.isSuccess()){
624  debug() << "Context obtained" << endmsg;
625  } else{
626  // A problem occurred.
627  debug() << "Context not obtained: a problem in the scheduling?" << endmsg;
628 // return StatusCode::FAILURE;
629  }
630  finishedEvtContexts.push_back(finishedEvtContext);
631 
632  // Let's see if we can pop other event contexts
633  while (m_schedulerSvc->tryPopFinishedEvent(finishedEvtContext).isSuccess()){
634  finishedEvtContexts.push_back(finishedEvtContext);
635  }
636 
637  // Now we flush them
638  StatusCode finalSC;
639  for (auto& thisFinishedEvtContext : finishedEvtContexts){
640  if (nullptr == thisFinishedEvtContext){
641  error() << "Detected nullptr ctxt before clearing WB!"<< endmsg;
642  finalSC = StatusCode::FAILURE;
643  continue;
644  }
645  if (thisFinishedEvtContext->evtFail()){
646  fatal() << "Failed event detected"<< endmsg;
647  finalSC = StatusCode::FAILURE;
648  }
649 
650  m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing));
651  m_incidentSvc->fireIncident(Incident(name(),IncidentType::EndEvent));
652 
653  debug() << "Clearing slot " << thisFinishedEvtContext->slot()
654  << " (event " << thisFinishedEvtContext->evt()
655  << ") of the whiteboard" << endmsg;
656 
657  StatusCode sc = clearWBSlot(thisFinishedEvtContext->slot());
658  if (!sc.isSuccess())
659  error() << "Whiteboard slot " << thisFinishedEvtContext->slot()
660  << " could not be properly cleared";
661 
662 
663  delete thisFinishedEvtContext;
664 
665  finishedEvts++;
666 
667  }
668  return finalSC;
669 }
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
T push_back(T...args)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
virtual StatusCode tryPopFinishedEvent(EventContext *&eventContext)=0
Try to retrieve a finished event from the scheduler.
Base class for all Incidents (computing events).
Definition: Incident.h:17
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
virtual StatusCode popFinishedEvent(EventContext *&eventContext)=0
Retrieve a finished event from the scheduler.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode HiveSlimEventLoopMgr::executeEvent ( void *  par)
virtual

implementation of IEventProcessor::executeEvent(void* par)

Definition at line 334 of file HiveSlimEventLoopMgr.cpp.

334  {
335 
336  // Leave the interface intact and swallow this C trick.
337  int& createdEvts = *((int*)createdEvts_IntPtr);
338 
339  EventContext* evtContext(nullptr);
340 
341  // Check if event number is in blacklist
342  if(LIKELY(m_blackListBS != nullptr)){ //we are processing a finite number of events, use bitset blacklist
343  if(m_blackListBS->test(createdEvts)){
344  verbose() << "Event " << createdEvts << " on black list" << endmsg;
346  }
348 
349  verbose() << "Event " << createdEvts << " on black list" << endmsg;
351  }
352 
353  if ( createEventContext(evtContext,createdEvts).isFailure() ){
354  fatal() << "Impossible to create event context" << endmsg;
355  return StatusCode::FAILURE;
356  }
357 
358  verbose() << "Beginning to process event " << createdEvts << endmsg;
359 
360  // An incident may schedule a stop, in which case is better to exit before the actual execution.
361  // DP have to find out who shoots this
362 /* if ( m_scheduledStop ) {
363  always() << "Terminating event processing loop due to a stop scheduled by an incident listener" << endmsg;
364  return StatusCode::SUCCESS;
365  }*/
366 
367 
368  StatusCode declEvtRootSc = declareEventRootAddress();
369  if (declEvtRootSc.isFailure()) { // We ran out of events!
370  createdEvts = -1; // Set created event to a negative value: we finished!
371  return StatusCode::SUCCESS;
372  }
373 
374  // Fire BeginEvent "Incident"
375  m_incidentSvc->fireIncident(Incident(name(),IncidentType::BeginEvent));
376 
377  // Now add event to the scheduler
378  verbose() << "Adding event " << evtContext->evt()
379  << ", slot " << evtContext->slot()
380  << " to the scheduler" << endmsg;
381 
382  m_incidentSvc->fireIncident(Incident(name(), IncidentType::BeginProcessing));
383 
384  StatusCode addEventStatus = m_schedulerSvc->pushNewEvent(evtContext);
385 
386  // If this fails, we need to wait for something to complete
387  if (!addEventStatus.isSuccess()){
388  fatal() << "An event processing slot should be now free in the scheduler, but it appears not to be the case." << endmsg;
389  }
390 
391  createdEvts++;
392  return StatusCode::SUCCESS;
393 
394 }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
StatusCode declareEventRootAddress()
Declare the root address of the event.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
T binary_search(T...args)
T end(T...args)
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::vector< unsigned int > m_eventNumberBlacklist
List of events to be skipped. The number is the number in the job.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
StatusCode createEventContext(EventContext *&eventContext, int createdEvents)
Create event context.
virtual StatusCode pushNewEvent(EventContext *eventContext)=0
Make an event available to the scheduler.
#define LIKELY(x)
Definition: Kernel.h:125
T begin(T...args)
Base class for all Incidents (computing events).
Definition: Incident.h:17
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
boost::dynamic_bitset * m_blackListBS
StatusCode HiveSlimEventLoopMgr::executeRun ( int  maxevt)
virtual

implementation of IEventProcessor::executeRun()

Definition at line 399 of file HiveSlimEventLoopMgr.cpp.

399  {
400  StatusCode sc;
401  bool eventfailed = false;
402 
403  if(maxevt > 0){ //finite number of events to process
404  const unsigned int umaxevt = static_cast<unsigned int>(maxevt);
405  m_blackListBS = new boost::dynamic_bitset<>(maxevt); //all initialized to zero
406  for(unsigned int i = 0; i < m_eventNumberBlacklist.size() && m_eventNumberBlacklist[i] <= umaxevt; ++i ){ //black list is sorted in init
408  }
409  }
410 
411  sc = m_algResourcePool->beginRun();
412  if (sc.isFailure())
413  eventfailed=true;
414 
415  // Call now the nextEvent(...)
416  sc = nextEvent(maxevt);
417  if (!sc.isSuccess())
418  eventfailed = true;
419 
420  sc = m_algResourcePool->endRun();
421  if (sc.isFailure())
422  eventfailed=true;
423 
424  if(m_blackListBS != nullptr)
425  delete m_blackListBS;
426 
427  if (eventfailed)
428  return StatusCode::FAILURE;
429  else
430  return StatusCode::SUCCESS;
431 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
std::vector< unsigned int > m_eventNumberBlacklist
List of events to be skipped. The number is the number in the job.
virtual StatusCode endRun()=0
End Run.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode nextEvent(int maxevt)
implementation of IService::nextEvent
T size(T...args)
virtual StatusCode beginRun()=0
Begin Run.
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
list i
Definition: ana.py:128
boost::dynamic_bitset * m_blackListBS
StatusCode HiveSlimEventLoopMgr::finalize ( )
virtual

implementation of IService::finalize

Definition at line 260 of file HiveSlimEventLoopMgr.cpp.

260  {
261 
262  StatusCode scRet;
264 
265  if (sc.isFailure()) {
266  scRet = StatusCode::FAILURE;
267  error() << "Problems finalizing Service base class" << endmsg;
268  }
269 
270  // Save Histograms Now
271  if ( m_histoPersSvc != 0 ) {
272  HistogramAgent agent;
273  sc = m_histoDataMgrSvc->traverseTree( &agent );
274  if( sc.isSuccess() ) {
275  IDataSelector* objects = agent.selectedObjects();
276  // skip /stat entry!
277  if ( objects->size() > 0 ) {
278  IDataSelector::iterator i;
279  for ( i = objects->begin(); i != objects->end(); i++ ) {
280  IOpaqueAddress* pAddr = 0;
281  StatusCode iret = m_histoPersSvc->createRep(*i, pAddr);
282  if ( iret.isSuccess() ) {
283  (*i)->registry()->setAddress(pAddr);
284  }
285  else {
286  sc = iret;
287  }
288  }
289  for ( i = objects->begin(); i != objects->end(); i++ ) {
290  IRegistry* reg = (*i)->registry();
291  StatusCode iret = m_histoPersSvc->fillRepRefs(reg->address(), *i);
292  if ( !iret.isSuccess() ) {
293  sc = iret;
294  }
295  }
296  }
297  if ( sc.isSuccess() ) {
298  info() << "Histograms converted successfully according to request." << endmsg;
299  }
300  else {
301  error() << "Error while saving Histograms." << endmsg;
302  }
303  }
304  else {
305  error() << "Error while traversing Histogram data store" << endmsg;
306  }
307  }
308 
309  scRet=sc;
310 
311  // Release event selector context
312  if ( m_evtSelector && m_evtContext ) {
314  m_evtContext = 0;
315  }
316 
317  m_incidentSvc = 0; // release
318  m_appMgrUI = 0; // release
319 
320  // Release all interfaces...
321  m_histoDataMgrSvc = 0;
322  m_histoPersSvc = 0;
323 
324  m_evtSelector = 0;
325  m_whiteboard = 0;
326  m_evtDataMgrSvc = 0;
327 
328  return scRet;
329 }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
StatusCode finalize() override
Definition: Service.cpp:193
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
HistogramAgent base in charge of collecting all the refereces to DataObjects in a transient store tha...
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
T end(T...args)
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
T size(T...args)
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
T begin(T...args)
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Opaque address interface definition.
void ignore() const
Definition: StatusCode.h:108
list i
Definition: ana.py:128
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IEvtSelector::Context * m_evtContext
Event Iterator.
StatusCode HiveSlimEventLoopMgr::getEventRoot ( IOpaqueAddress *&  refpAddr)

Create event address using event selector.

Definition at line 544 of file HiveSlimEventLoopMgr.cpp.

544  {
545  refpAddr = 0;
547  if ( !sc.isSuccess() ) {
548  return sc;
549  }
550  // Create root address and assign address to data service
551  sc = m_evtSelector->createAddress(*m_evtContext,refpAddr);
552  if( !sc.isSuccess() ) {
554  if ( sc.isSuccess() ) {
555  sc = m_evtSelector->createAddress(*m_evtContext,refpAddr);
556  if ( !sc.isSuccess() ) {
557  warning() << "Error creating IOpaqueAddress." << endmsg;
558  }
559  }
560  }
561  return sc;
562 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode next(Context &c) const =0
Fetch the next event or the first event if it will be use soon after the creation of the context...
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
virtual StatusCode createAddress(const Context &c, IOpaqueAddress *&iop) const =0
Create an IOpaqueAddress object from the event fetched.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IEvtSelector::Context * m_evtContext
Event Iterator.
StatusCode HiveSlimEventLoopMgr::initialize ( )
virtual

implementation of IService::initialize

Definition at line 86 of file HiveSlimEventLoopMgr.cpp.

86  {
87 
88  if ( !m_appMgrUI.isValid() ) {
89  return StatusCode::FAILURE;
90  }
91 
93  if ( !sc.isSuccess() ) {
94  error() << "Failed to initialize Service Base class." << endmsg;
95  return StatusCode::FAILURE;
96  }
97 
98  // Get the references to the services that are needed by the ApplicationMgr itself
99  m_incidentSvc = serviceLocator()->service("IncidentSvc");
100  if( !m_incidentSvc.isValid() ) {
101  fatal() << "Error retrieving IncidentSvc." << endmsg;
102  return StatusCode::FAILURE;
103  }
104 
105  // Setup access to event data services
106  m_evtDataMgrSvc = serviceLocator()->service("EventDataSvc");
107  if( !m_evtDataMgrSvc.isValid() ) {
108  fatal() << "Error retrieving EventDataSvc interface IDataManagerSvc." << endmsg;
109  return StatusCode::FAILURE;
110  }
111  m_whiteboard = serviceLocator()->service("EventDataSvc");
112  if( !m_whiteboard.isValid() ) {
113  fatal() << "Error retrieving EventDataSvc interface IHiveWhiteBoard." << endmsg;
114  return StatusCode::FAILURE;
115  }
117  if ( !m_schedulerSvc.isValid()){
118  fatal() << "Error retrieving SchedulerSvc interface ISchedulerSvc." << endmsg;
119  return StatusCode::FAILURE;
120  }
121  // Obtain the IProperty of the ApplicationMgr
123  if ( ! m_appMgrProperty.isValid() ) {
124  fatal() << "IProperty interface not found in ApplicationMgr." << endmsg;
125  return StatusCode::FAILURE;
126  }
127 
128  // We do not expect a Event Selector necessarily being declared
129  setProperty(m_appMgrProperty->getProperty("EvtSel")).ignore();
130 
131  if( m_evtsel != "NONE" || m_evtsel.length() == 0) {
132  m_evtSelector = serviceLocator()->service("EventSelector");
133  if( m_evtSelector.isValid() ) {
134  // Setup Event Selector
136  if( !sc.isSuccess() ) {
137  fatal() << "Can not create the event selector Context." << endmsg;
138  return sc;
139  }
140  }
141  else {
142  fatal() << "EventSelector not found." << endmsg;
143  return sc;
144  }
145  }
146  else {
147  m_evtSelector = 0;
148  m_evtContext = 0;
149  if ( m_warnings ) {
150  warning() << "Unable to locate service \"EventSelector\" " << endmsg;
151  warning() << "No events will be processed from external input." << endmsg;
152  }
153  }
154 
155  // Setup access to histogramming services
156  m_histoDataMgrSvc = serviceLocator()->service("HistogramDataSvc");
157  if( !m_histoDataMgrSvc.isValid() ) {
158  fatal() << "Error retrieving HistogramDataSvc." << endmsg;
159  return sc;
160  }
161  // Setup histogram persistency
162  m_histoPersSvc = serviceLocator()->service("HistogramPersistencySvc");
163  if( !m_histoPersSvc.isValid() ) {
164  warning() << "Histograms cannot not be saved - though required." << endmsg;
165  return sc;
166  }
167 
168  // Setup algorithm resource pool
169  m_algResourcePool = serviceLocator()->service("AlgResourcePool");
170  if( !m_algResourcePool.isValid() ) {
171  fatal() << "Error retrieving AlgResourcePool" << endmsg;
172  return StatusCode::FAILURE;
173  }
174 
176  info() << "Found " << m_eventNumberBlacklist.size() << " events in black list" << endmsg;
177 
178  return StatusCode::SUCCESS;
179 }
StatusCode initialize() override
Definition: Service.cpp:68
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
T end(T...args)
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
std::vector< unsigned int > m_eventNumberBlacklist
List of events to be skipped. The number is the number in the job.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
std::string m_evtsel
Event selector.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
bool m_warnings
Flag to disable warning messages when using external input.
T length(T...args)
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
T begin(T...args)
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
T sort(T...args)
std::string m_schedulerName
Name of the scheduler to be used.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IEvtSelector::Context * m_evtContext
Event Iterator.
StatusCode HiveSlimEventLoopMgr::nextEvent ( int  maxevt)
virtual

implementation of IService::nextEvent

Definition at line 454 of file HiveSlimEventLoopMgr.cpp.

454  {
455 
456  // Calculate runtime
459 
460  // Reset the application return code.
462 
463  int finishedEvts =0;
464  int createdEvts =0;
465  int skippedEvts = 0;
466  info() << "Starting loop on events" << endmsg;
467  // Loop until the finished events did not reach the maxevt number
468  bool loop_ended = false;
469  // Run the first event before spilling more than one
470  bool newEvtAllowed = false ;
471 
472  constexpr double oneOver1204 = 1./1024.;
473 
474  uint iteration = 0;
475  time_point start_time = Clock::now();
476  while ( !loop_ended and (maxevt < 0 or (finishedEvts+skippedEvts) < maxevt)){
477  debug() << "work loop iteration " << iteration++ << endmsg;
478  // if the created events did not reach maxevt, create an event
479  if ((newEvtAllowed or createdEvts == 0 ) && // Launch the first event alone
480  createdEvts >= 0 && // The events are not finished with an unlimited number of events
481  (createdEvts < maxevt or maxevt<0) && // The events are not finished with a limited number of events
482  m_schedulerSvc->freeSlots()>0){ // There are still free slots in the scheduler
483 
484  if (1==createdEvts) // reset counter to count from event 1
485  start_time = Clock::now();
486 
487  debug() << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
488 // DP remove to remove the syscalls...
489 // if (0!=createdEvts){
490 // info() << "Event Number = " << createdEvts
491 // << " WSS (MB) = " << System::mappedMemory(System::MemoryUnit::kByte)*oneOver1204
492 // << " Time (s) = " << secsFromStart(start_time) << endmsg;
493 // }
494 
495  //TODO can we adapt the interface of executeEvent for a nicer solution?
497  while(!sc.isSuccess() //we haven't created an event yet
498  && (createdEvts < maxevt or maxevt<0)){ //redunant check for maxEvts, can we do better?
499  sc = executeEvent(&createdEvts);
500 
501  if (sc.isRecoverable()){ //we skipped an event
502 
503  //this is all to skip the event
504  size_t slot = m_whiteboard->allocateStore(createdEvts); //we need a new store, not to change the previous event
505  m_whiteboard->selectStore(slot);
506  declareEventRootAddress(); //actually skip over the event
507  m_whiteboard->freeStore(slot); // delete the store
508 
509  ++createdEvts;
510  ++skippedEvts;
511  } else if (sc.isRecoverable()){ //exit immediatly
512  return StatusCode::FAILURE;
513  } // else we have an success --> exit loop
514  }
515 
516  } // end if condition createdEvts < maxevt
517  else{
518  // all the events were created but not all finished or the slots were
519  // all busy: the scheduler should finish its job
520 
521  debug() << "Draining the scheduler" << endmsg;
522 
523  // Pull out of the scheduler the finished events
524  if (drainScheduler(finishedEvts).isFailure()){
525  loop_ended = true;
526  }
527  newEvtAllowed = true;
528  }
529  } // end main loop on finished events
530  time_point end_time = Clock::now();
531 
532  info() << "---> Loop Finished (skipping 1st evt) - "
533  << " WSS " << System::mappedMemory(System::MemoryUnit::kByte)*oneOver1204
534  << " total time " << std::chrono::duration_cast < std::chrono::nanoseconds > (end_time - start_time).count() <<endmsg;
535  info() << skippedEvts << " events were SKIPed" << endmsg;
536 
537  return StatusCode::SUCCESS;
538 
539 }
virtual StatusCode executeEvent(void *par)
implementation of IEventProcessor::executeEvent(void* par)
StatusCode declareEventRootAddress()
Declare the root address of the event.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
StatusCode drainScheduler(int &finishedEvents)
Drain the scheduler from all actions that may be queued.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
T duration_cast(T...args)
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given 'slot' for all subsequent calls within the same thread id.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool isRecoverable() const
Definition: StatusCode.h:87
std::chrono::high_resolution_clock Clock
Definition: ITimelineSvc.h:11
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
T count(T...args)
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.
Definition: Memory.cpp:180
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
virtual size_t allocateStore(int evtnumber)=0
Allocate a store partition for new event.
Clock::time_point time_point
Definition: ITimelineSvc.h:12
virtual StatusCode freeStore(size_t partitionIndex)=0
Free a store partition.
void ignore() const
Definition: StatusCode.h:108
constexpr int Success
Definition: AppReturnCode.h:16
virtual unsigned int freeSlots()=0
Get the free event processing slots.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
StatusCode HiveSlimEventLoopMgr::reinitialize ( )
virtual

implementation of IService::reinitialize

Definition at line 183 of file HiveSlimEventLoopMgr.cpp.

183  {
184 
185 
186  // Check to see whether a new Event Selector has been specified
188  if( m_evtsel != "NONE" || m_evtsel.length() == 0) {
189  SmartIF<IService> theSvc(serviceLocator()->service("EventSelector"));
190  SmartIF<IEvtSelector> theEvtSel(theSvc);
191  StatusCode sc;
192  if( theEvtSel.isValid() && ( theEvtSel.get() != m_evtSelector.get() ) ) {
193  // Setup Event Selector
194  if ( m_evtSelector.get() && m_evtContext ) {
195  // Need to release context before switching to new event selector
197  m_evtContext = 0;
198  }
199  m_evtSelector = theEvtSel;
200  if (theSvc->FSMState() == Gaudi::StateMachine::INITIALIZED) {
201  sc = theSvc->reinitialize();
202  if( !sc.isSuccess() ) {
203  error() << "Failure Reinitializing EventSelector "
204  << theSvc->name( ) << endmsg;
205  return sc;
206  }
207  }
208  else {
209  sc = theSvc->sysInitialize();
210  if( !sc.isSuccess() ) {
211  error() << "Failure Initializing EventSelector "
212  << theSvc->name( ) << endmsg;
213  return sc;
214  }
215  }
217  if( !sc.isSuccess() ) {
218  error() << "Can not create Context " << theSvc->name( ) << endmsg;
219  return sc;
220  }
221 
222  }
223  else if ( m_evtSelector.isValid() ) {
224  if ( m_evtContext ) {
226  m_evtContext = 0;
227  }
229  if( !sc.isSuccess() ) {
230  error() << "Can not create Context " << theSvc->name( ) << endmsg;
231  return sc;
232  }
233  }
234  }
235  else if ( m_evtSelector.isValid() && m_evtContext ) {
237  m_evtSelector = 0;
238  m_evtContext = 0;
239  }
240  return StatusCode::SUCCESS;
241 }
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
std::string m_evtsel
Event selector.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
T length(T...args)
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:144
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
IEvtSelector::Context * m_evtContext
Event Iterator.
StatusCode HiveSlimEventLoopMgr::stop ( )
virtual

implementation of IService::stop

Definition at line 247 of file HiveSlimEventLoopMgr.cpp.

247  {
248  if ( ! m_endEventFired ) {
249  // Fire pending EndEvent incident
250  m_incidentSvc->fireIncident(Incident(name(),IncidentType::EndEvent));
251  m_endEventFired = true;
252  }
253  return StatusCode::SUCCESS;
254 }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
Base class for all Incidents (computing events).
Definition: Incident.h:17
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event) ...
StatusCode HiveSlimEventLoopMgr::stopRun ( )
virtual

implementation of IEventProcessor::stopRun()

Definition at line 436 of file HiveSlimEventLoopMgr.cpp.

436  {
437  // Set the application return code
440  error() << "Could not set return code of the application ("
442  }
443  m_scheduledStop = true;
444  return StatusCode::SUCCESS;
445 }
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
bool m_scheduledStop
Scheduled stop of event processing.
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

Member Data Documentation

SmartIF< IIncidentListener > HiveSlimEventLoopMgr::m_abortEventListener
protected

Instance of the incident listener waiting for AbortEvent.

Definition at line 65 of file HiveSlimEventLoopMgr.h.

SmartIF<IAlgResourcePool> HiveSlimEventLoopMgr::m_algResourcePool
protected

Reference to the Algorithm resource pool.

Definition at line 44 of file HiveSlimEventLoopMgr.h.

SmartIF<IProperty> HiveSlimEventLoopMgr::m_appMgrProperty
protected

Property interface of ApplicationMgr.

Definition at line 48 of file HiveSlimEventLoopMgr.h.

SmartIF<IAppMgrUI> HiveSlimEventLoopMgr::m_appMgrUI
protected

Reference to the IAppMgrUI interface of the application manager.

Definition at line 71 of file HiveSlimEventLoopMgr.h.

boost::dynamic_bitset* HiveSlimEventLoopMgr::m_blackListBS
protected

Definition at line 79 of file HiveSlimEventLoopMgr.h.

bool HiveSlimEventLoopMgr::m_endEventFired
protected

Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event)

Definition at line 51 of file HiveSlimEventLoopMgr.h.

std::vector<unsigned int> HiveSlimEventLoopMgr::m_eventNumberBlacklist
protected

List of events to be skipped. The number is the number in the job.

Definition at line 76 of file HiveSlimEventLoopMgr.h.

IEvtSelector::Context* HiveSlimEventLoopMgr::m_evtContext
protected

Event Iterator.

Definition at line 34 of file HiveSlimEventLoopMgr.h.

SmartIF<IDataManagerSvc> HiveSlimEventLoopMgr::m_evtDataMgrSvc
protected

Reference to the Event Data Service's IDataManagerSvc interface.

Definition at line 30 of file HiveSlimEventLoopMgr.h.

std::string HiveSlimEventLoopMgr::m_evtsel
protected

Event selector.

Definition at line 36 of file HiveSlimEventLoopMgr.h.

SmartIF<IEvtSelector> HiveSlimEventLoopMgr::m_evtSelector
protected

Reference to the Event Selector.

Definition at line 32 of file HiveSlimEventLoopMgr.h.

SmartIF<IDataManagerSvc> HiveSlimEventLoopMgr::m_histoDataMgrSvc
protected

Reference to the Histogram Data Service.

Definition at line 38 of file HiveSlimEventLoopMgr.h.

SmartIF<IConversionSvc> HiveSlimEventLoopMgr::m_histoPersSvc
protected

Reference to the Histogram Persistency Service.

Definition at line 40 of file HiveSlimEventLoopMgr.h.

std::string HiveSlimEventLoopMgr::m_histPersName
protected

Name of the Hist Pers type.

Definition at line 46 of file HiveSlimEventLoopMgr.h.

SmartIF<IIncidentSvc> HiveSlimEventLoopMgr::m_incidentSvc
protected

Reference to the incident service.

Definition at line 73 of file HiveSlimEventLoopMgr.h.

bool HiveSlimEventLoopMgr::m_scheduledStop
protected

Scheduled stop of event processing.

Definition at line 69 of file HiveSlimEventLoopMgr.h.

std::string HiveSlimEventLoopMgr::m_schedulerName
protected

Name of the scheduler to be used.

Definition at line 67 of file HiveSlimEventLoopMgr.h.

SmartIF<IScheduler> HiveSlimEventLoopMgr::m_schedulerSvc
protected

A shortcut for the scheduler.

Definition at line 55 of file HiveSlimEventLoopMgr.h.

bool HiveSlimEventLoopMgr::m_warnings
protected

Flag to disable warning messages when using external input.

Definition at line 53 of file HiveSlimEventLoopMgr.h.

SmartIF<IHiveWhiteBoard> HiveSlimEventLoopMgr::m_whiteboard
protected

Reference to the Whiteboard.

Definition at line 42 of file HiveSlimEventLoopMgr.h.


The documentation for this class was generated from the following files: