The Gaudi Framework  v33r1 (b1225454)
HiveSlimEventLoopMgr Class Reference

#include <GaudiHive/HiveSlimEventLoopMgr.h>

Inheritance diagram for HiveSlimEventLoopMgr:
Collaboration diagram for HiveSlimEventLoopMgr:

Public Member Functions

 ~HiveSlimEventLoopMgr () override
 
StatusCode getEventRoot (IOpaqueAddress *&refpAddr)
 Create event address using event selector. More...
 
StatusCode initialize () override
 implementation of IService::initialize More...
 
StatusCode reinitialize () override
 implementation of IService::reinitialize More...
 
StatusCode stop () override
 implementation of IService::stop More...
 
StatusCode finalize () override
 implementation of IService::finalize More...
 
StatusCode nextEvent (int maxevt) override
 implementation of IService::nextEvent More...
 
EventContext createEventContext () override
 implementation of IEventProcessor::createEventContext() More...
 
StatusCode executeEvent (EventContext &&ctx) override
 implementation of IEventProcessor::executeEvent(EventContext&&) More...
 
StatusCode executeRun (int maxevt) override
 implementation of IEventProcessor::executeRun() More...
 
StatusCode stopRun () override
 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...
 
- 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...
 
 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 >
StatusCode declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
 Declare used 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 PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p) override
 set the property form another property More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const std::string &n, const std::string &v) override
 set the property from name and the value More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (const std::string &name) const override
 get the property by name More...
 
StatusCode getProperty (const std::string &n, std::string &v) const override
 convert the property to the string More...
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties More...
 
bool hasProperty (const std::string &name) const override
 Return true if we have a property with the given name. More...
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream) More...
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream More...
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor. More...
 
const 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...
 

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 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 PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBaseproperty (const std::string &name) const
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches. More...
 
MSG::Level resetMessaging ()
 Reinitialize internal states. More...
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream. More...
 

Protected Attributes

Gaudi::Property< std::stringm_histPersName {this, "HistogramPersistency", "", ""}
 
Gaudi::Property< std::stringm_evtsel {this, "EvtSel", "", ""}
 
Gaudi::Property< bool > m_warnings {this, "Warnings", true, "Set this property to false to suppress warning messages"}
 
Gaudi::Property< std::stringm_schedulerName
 
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist {this, "EventNumberBlackList", {}, ""}
 
Gaudi::Property< bool > m_abortOnFailure {this, "AbortOnFailure", true, "Abort job on event failure"}
 
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 = nullptr
 Event Iterator. 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...
 
SmartIF< IAlgExecStateSvcm_algExecStateSvc
 Reference to the AlgExecStateSvc. More...
 
SmartIF< IPropertym_appMgrProperty
 Property interface of ApplicationMgr. More...
 
bool m_endEventFired = false
 Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event) More...
 
SmartIF< ISchedulerm_schedulerSvc
 A shortcut for the scheduler. More...
 
SmartIF< IIncidentListenerm_abortEventListener
 Instance of the incident listener waiting for AbortEvent. More...
 
bool m_scheduledStop = false
 Scheduled stop of event processing. More...
 
SmartIF< IIncidentSvcm_incidentSvc
 Reference to the incident service. More...
 
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
 
EventContext::ContextEvt_t m_nevt {0}
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state. More...
 
Gaudi::Property< int > m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
 
Gaudi::Property< bool > m_auditInit {this, "AuditServices", false, " unused"}
 
Gaudi::Property< bool > m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
 
Gaudi::Property< bool > m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
 
Gaudi::Property< bool > m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
 
Gaudi::Property< bool > m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
 
Gaudi::Property< bool > m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
 
Gaudi::Property< bool > m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service. 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
using Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
 Typedef used to refer to this class from derived classes, as in. More...
 
- 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 32 of file HiveSlimEventLoopMgr.h.

Constructor & Destructor Documentation

◆ ~HiveSlimEventLoopMgr()

HiveSlimEventLoopMgr::~HiveSlimEventLoopMgr ( )
override

Definition at line 37 of file HiveSlimEventLoopMgr.cpp.

37 { delete m_evtContext; }
IEvtSelector::Context * m_evtContext
Event Iterator.

Member Function Documentation

◆ clearWBSlot()

StatusCode HiveSlimEventLoopMgr::clearWBSlot ( int  evtSlot)
protected

Clear a slot in the WB.

Definition at line 560 of file HiveSlimEventLoopMgr.cpp.

560  {
561  StatusCode sc = m_whiteboard->clearStore( evtSlot );
562  if ( !sc.isSuccess() ) warning() << "Clear of Event data store failed" << endmsg;
563  return m_whiteboard->freeStore( evtSlot );
564 }
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
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:61
bool isSuccess() const
Definition: StatusCode.h:365
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:202

◆ createEventContext()

EventContext HiveSlimEventLoopMgr::createEventContext ( )
override

implementation of IEventProcessor::createEventContext()

Definition at line 485 of file HiveSlimEventLoopMgr.cpp.

485  {
487  ++m_nevt;
488 
489  StatusCode sc = m_whiteboard->selectStore( ctx.slot() );
490  if ( sc.isFailure() ) {
491  throw GaudiException( "Slot " + std::to_string( ctx.slot() ) + " could not be selected for the WhiteBoard", name(),
492  sc );
493  }
494  if ( declareEventRootAddress().isFailure() ) { // We ran out of events!
495  // invalid context terminates the loop
496  return EventContext{};
497  }
498  return ctx;
499 }
Define general base for Gaudi exception.
StatusCode declareEventRootAddress()
Declare the root address of the event.
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
T to_string(T... args)
This class represents an entry point to all the event specific data.
Definition: EventContext.h:34
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
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:61
virtual size_t allocateStore(int evtnumber)=0
Allocate a store partition for new event.
bool isFailure() const
Definition: StatusCode.h:145
EventContext::ContextEvt_t m_nevt

◆ declareEventRootAddress()

StatusCode HiveSlimEventLoopMgr::declareEventRootAddress ( )
protected

Declare the root address of the event.

Definition at line 463 of file HiveSlimEventLoopMgr.cpp.

463  {
464  StatusCode sc;
465  if ( m_evtContext ) {
466  //---This is the "event iterator" context from EventSelector
467  IOpaqueAddress* pAddr = nullptr;
468  sc = getEventRoot( pAddr );
469  if ( !sc.isSuccess() ) {
470  info() << "No more events in event selection " << endmsg;
471  return StatusCode::FAILURE;
472  }
473  sc = m_evtDataMgrSvc->setRoot( "/Event", pAddr );
474  if ( !sc.isSuccess() ) { warning() << "Error declaring event root address." << endmsg; }
475  } else {
476  //---In case of no event selector----------------
477  sc = m_evtDataMgrSvc->setRoot( "/Event", new DataObject() );
478  if ( !sc.isSuccess() ) { warning() << "Error declaring event root DataObject" << endmsg; }
479  }
480  return StatusCode::SUCCESS;
481 }
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
bool isSuccess() const
Definition: StatusCode.h:365
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Opaque address interface definition.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
IEvtSelector::Context * m_evtContext
Event Iterator.

◆ drainScheduler()

StatusCode HiveSlimEventLoopMgr::drainScheduler ( int &  finishedEvents)
protected

Drain the scheduler from all actions that may be queued.

Definition at line 503 of file HiveSlimEventLoopMgr.cpp.

503  {
504 
506 
507  // maybe we can do better
508  std::vector<EventContext*> finishedEvtContexts;
509 
510  EventContext* finishedEvtContext( nullptr );
511 
512  // Here we wait not to loose cpu resources
513  DEBUG_MSG << "Waiting for a context" << endmsg;
514  sc = m_schedulerSvc->popFinishedEvent( finishedEvtContext );
515 
516  // We got past it: cache the pointer
517  DEBUG_MSG << "Context " << ( sc.isSuccess() ? "obtained" : "not obtained: a problem in the scheduling?" ) << endmsg;
518  finishedEvtContexts.push_back( finishedEvtContext );
519 
520  // Let's see if we can pop other event contexts
521  while ( m_schedulerSvc->tryPopFinishedEvent( finishedEvtContext ).isSuccess() ) {
522  finishedEvtContexts.push_back( finishedEvtContext );
523  }
524 
525  // Now we flush them
526  StatusCode finalSC;
527  for ( auto& thisFinishedEvtContext : finishedEvtContexts ) {
528  if ( !thisFinishedEvtContext ) {
529  error() << "Detected nullptr ctxt before clearing WB!" << endmsg;
530  finalSC = StatusCode::FAILURE;
531  continue;
532  }
533  if ( m_algExecStateSvc->eventStatus( *thisFinishedEvtContext ) != EventStatus::Success ) {
534  ( m_abortOnFailure ? fatal() : error() ) << "Failed event detected on " << thisFinishedEvtContext << endmsg;
535  if ( m_abortOnFailure ) finalSC = StatusCode::FAILURE;
536  }
537  // shouldn't these incidents move to the forward scheduler?
538  // If we want to consume incidents with an algorithm at the end of the graph
539  // we need to add this to forward scheduler lambda action,
540  // otherwise we have to do this serially on this thread!
541  m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndProcessing, *thisFinishedEvtContext ) );
542  m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndEvent, *thisFinishedEvtContext ) );
543 
544  DEBUG_MSG << "Clearing slot " << thisFinishedEvtContext->slot() << " (event " << thisFinishedEvtContext->evt()
545  << ") of the whiteboard" << endmsg;
546 
547  StatusCode sc = clearWBSlot( thisFinishedEvtContext->slot() );
548  if ( !sc.isSuccess() )
549  error() << "Whiteboard slot " << thisFinishedEvtContext->slot() << " could not be properly cleared";
550 
551  delete thisFinishedEvtContext;
552 
553  ++finishedEvts;
554  }
555  return finalSC;
556 }
#define DEBUG_MSG
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Gaudi::Property< bool > m_abortOnFailure
virtual const EventStatus::Status & eventStatus(const EventContext &ctx) const =0
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
This class represents an entry point to all the event specific data.
Definition: EventContext.h:34
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
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:61
bool isSuccess() const
Definition: StatusCode.h:365
STL class.
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
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:27
constexpr static const auto FAILURE
Definition: StatusCode.h:101
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:202

◆ executeEvent()

StatusCode HiveSlimEventLoopMgr::executeEvent ( EventContext &&  ctx)
override

implementation of IEventProcessor::executeEvent(EventContext&&)

Definition at line 271 of file HiveSlimEventLoopMgr.cpp.

271  {
272 
274 
275  // Check if event number is in blacklist
276  if ( LIKELY( m_blackListBS != nullptr ) ) { // we are processing a finite number of events, use bitset blacklist
277  if ( m_blackListBS->test( ctx.evt() ) ) {
278  VERBOSE_MSG << "Event " << ctx.evt() << " on black list" << endmsg;
279  m_whiteboard->freeStore( ctx.slot() ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
281  }
282  } else if ( std::binary_search( m_eventNumberBlacklist.begin(), m_eventNumberBlacklist.end(), ctx.evt() ) ) {
283  VERBOSE_MSG << "Event " << ctx.evt() << " on black list" << endmsg;
284  m_whiteboard->freeStore( ctx.slot() ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
286  }
287 
288  VERBOSE_MSG << "Beginning to process event " << ctx.evt() << endmsg;
289 
290  // An incident may schedule a stop, in which case is better to exit before the actual execution.
291  // DP have to find out who shoots this
292  /* if ( m_scheduledStop ) {
293  always() << "Terminating event processing loop due to a stop scheduled by an incident listener" << endmsg;
294  return StatusCode::SUCCESS;
295  }*/
296 
297  // Fire BeginEvent "Incident"
298  m_incidentSvc->fireIncident( std::make_unique<Incident>( name(), IncidentType::BeginEvent, ctx ) );
299 
300  // Now add event to the scheduler
301  VERBOSE_MSG << "Adding event " << ctx.evt() << ", slot " << ctx.slot() << " to the scheduler" << endmsg;
302 
303  m_incidentSvc->fireIncident( std::make_unique<Incident>( name(), IncidentType::BeginProcessing, ctx ) );
304 
305  StatusCode addEventStatus = m_schedulerSvc->pushNewEvent( new EventContext{std::move( ctx )} );
306 
307  // If this fails, we need to wait for something to complete
308  if ( !addEventStatus.isSuccess() ) {
309  fatal() << "An event processing slot should be now free in the scheduler, but it appears not to be the case."
310  << endmsg;
311  }
312 
313  return StatusCode::SUCCESS;
314 }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
constexpr static const auto RECOVERABLE
Definition: StatusCode.h:102
T binary_search(T... args)
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
This class represents an entry point to all the event specific data.
Definition: EventContext.h:34
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
#define VERBOSE_MSG
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
virtual StatusCode pushNewEvent(EventContext *eventContext)=0
Make an event available to the scheduler.
bool isSuccess() const
Definition: StatusCode.h:365
T move(T... args)
#define LIKELY(x)
Definition: Kernel.h:105
virtual void reset(const EventContext &ctx)=0
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
virtual StatusCode freeStore(size_t partitionIndex)=0
Free a store partition.
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:202

◆ executeRun()

StatusCode HiveSlimEventLoopMgr::executeRun ( int  maxevt)
override

implementation of IEventProcessor::executeRun()

Definition at line 319 of file HiveSlimEventLoopMgr.cpp.

319  {
320  StatusCode sc;
321  bool eventfailed = false;
322 
323  if ( maxevt > 0 ) { // finite number of events to process
324  const unsigned int umaxevt = static_cast<unsigned int>( maxevt );
325  m_blackListBS = std::make_unique<boost::dynamic_bitset<>>( maxevt ); // all initialized to zero
326  for ( unsigned int i = 0; i < m_eventNumberBlacklist.size() && m_eventNumberBlacklist[i] <= umaxevt;
327  ++i ) { // black list is sorted in init
328  m_blackListBS->set( m_eventNumberBlacklist[i], true );
329  }
330  }
331 
332  // Call now the nextEvent(...)
333  sc = nextEvent( maxevt );
334  if ( sc.isFailure() ) eventfailed = true;
335 
336  m_blackListBS.reset( nullptr );
337 
338  return eventfailed ? StatusCode::FAILURE : StatusCode::SUCCESS;
339 }
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
T reset(T... args)
constexpr static const auto FAILURE
Definition: StatusCode.h:101
bool isFailure() const
Definition: StatusCode.h:145
int maxevt
Definition: Bootstrap.cpp:270
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent

◆ finalize()

StatusCode HiveSlimEventLoopMgr::finalize ( )
override

implementation of IService::finalize

Definition at line 209 of file HiveSlimEventLoopMgr.cpp.

209  {
210 
211  StatusCode scRet;
213 
214  if ( sc.isFailure() ) {
215  scRet = StatusCode::FAILURE;
216  error() << "Problems finalizing Service base class" << endmsg;
217  }
218 
219  // Save Histograms Now
220  if ( m_histoPersSvc ) {
221  HistogramAgent agent;
222  sc = m_histoDataMgrSvc->traverseTree( &agent );
223  if ( sc.isSuccess() ) {
224  const IDataSelector& objects = agent.selectedObjects();
225  // skip /stat entry!
226  sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode s, const auto& i ) {
227  IOpaqueAddress* pAddr = nullptr;
228  StatusCode iret = m_histoPersSvc->createRep( i, pAddr );
229  if ( iret.isSuccess() ) i->registry()->setAddress( pAddr );
230  return s.isFailure() ? s : iret;
231  } );
232  sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode s, const auto& i ) {
233  IRegistry* reg = i->registry();
234  StatusCode iret = m_histoPersSvc->fillRepRefs( reg->address(), i );
235  return s.isFailure() ? s : iret;
236  } );
237  if ( sc.isSuccess() ) {
238  info() << "Histograms converted successfully according to request." << endmsg;
239  } else {
240  error() << "Error while saving Histograms." << endmsg;
241  }
242  } else {
243  error() << "Error while traversing Histogram data store" << endmsg;
244  }
245  }
246 
247  scRet = sc;
248 
249  // Release event selector context
250  if ( m_evtSelector && m_evtContext ) {
252  m_evtContext = nullptr;
253  }
254 
256 
257  // Release all interfaces...
260 
264 
265  return scRet;
266 }
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
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:174
HistogramAgent base in charge of collecting all the references to DataObjects in a transient store th...
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
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:32
def end
Definition: IOTest.py:123
bool isSuccess() const
Definition: StatusCode.h:365
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
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.
string s
Definition: gaudirun.py:328
constexpr static const auto FAILURE
Definition: StatusCode.h:101
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:96
bool isFailure() const
Definition: StatusCode.h:145
AttribStringParser::Iterator begin(const AttribStringParser &parser)
T accumulate(T... args)
Opaque address interface definition.
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
const IDataSelector & selectedObjects() const
Return the set of selected DataObjects.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
IEvtSelector::Context * m_evtContext
Event Iterator.

◆ getEventRoot()

StatusCode HiveSlimEventLoopMgr::getEventRoot ( IOpaqueAddress *&  refpAddr)

Create event address using event selector.

Definition at line 447 of file HiveSlimEventLoopMgr.cpp.

447  {
448  refpAddr = nullptr;
450  if ( sc.isFailure() ) return sc;
451  // Create root address and assign address to data service
452  sc = m_evtSelector->createAddress( *m_evtContext, refpAddr );
453  if ( sc.isSuccess() ) return sc;
454  sc = m_evtSelector->next( *m_evtContext );
455  if ( sc.isFailure() ) return sc;
456  sc = m_evtSelector->createAddress( *m_evtContext, refpAddr );
457  if ( !sc.isSuccess() ) warning() << "Error creating IOpaqueAddress." << endmsg;
458  return sc;
459 }
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
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.
bool isSuccess() const
Definition: StatusCode.h:365
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
bool isFailure() const
Definition: StatusCode.h:145
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:202
IEvtSelector::Context * m_evtContext
Event Iterator.

◆ initialize()

StatusCode HiveSlimEventLoopMgr::initialize ( )
override

implementation of IService::initialize

Definition at line 42 of file HiveSlimEventLoopMgr.cpp.

42  {
44  if ( !sc.isSuccess() ) {
45  error() << "Failed to initialize Service Base class." << endmsg;
46  return StatusCode::FAILURE;
47  }
48 
49  // Get the references to the services that are needed by the ApplicationMgr itself
50  m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
51  if ( !m_incidentSvc ) {
52  fatal() << "Error retrieving IncidentSvc." << endmsg;
53  return StatusCode::FAILURE;
54  }
55 
56  // Setup access to event data services
57  m_evtDataMgrSvc = serviceLocator()->service( "EventDataSvc" );
58  if ( !m_evtDataMgrSvc ) {
59  fatal() << "Error retrieving EventDataSvc interface IDataManagerSvc." << endmsg;
60  return StatusCode::FAILURE;
61  }
62  m_whiteboard = serviceLocator()->service( "EventDataSvc" );
63  if ( !m_whiteboard ) {
64  fatal() << "Error retrieving EventDataSvc interface IHiveWhiteBoard." << endmsg;
65  return StatusCode::FAILURE;
66  }
68  if ( !m_schedulerSvc ) {
69  fatal() << "Error retrieving SchedulerSvc interface IScheduler." << endmsg;
70  return StatusCode::FAILURE;
71  }
72  // Obtain the IProperty of the ApplicationMgr
74  if ( !m_appMgrProperty ) {
75  fatal() << "IProperty interface not found in ApplicationMgr." << endmsg;
76  return StatusCode::FAILURE;
77  }
78 
79  // We do not expect a Event Selector necessarily being declared
80  setProperty( m_appMgrProperty->getProperty( "EvtSel" ) ).ignore();
81 
82  if ( m_evtsel != "NONE" || m_evtsel.length() == 0 ) {
83  m_evtSelector = serviceLocator()->service( "EventSelector" );
84  if ( m_evtSelector ) {
85  // Setup Event Selector
87  if ( !sc.isSuccess() ) {
88  fatal() << "Can not create the event selector Context." << endmsg;
89  return sc;
90  }
91  } else {
92  fatal() << "EventSelector not found." << endmsg;
93  return sc;
94  }
95  } else {
96  m_evtSelector = 0;
97  m_evtContext = 0;
98  if ( m_warnings ) {
99  warning() << "Unable to locate service \"EventSelector\" " << endmsg;
100  warning() << "No events will be processed from external input." << endmsg;
101  }
102  }
103 
104  // Setup access to histogramming services
105  m_histoDataMgrSvc = serviceLocator()->service( "HistogramDataSvc" );
106  if ( !m_histoDataMgrSvc ) {
107  fatal() << "Error retrieving HistogramDataSvc." << endmsg;
108  return sc;
109  }
110  // Setup histogram persistency
111  m_histoPersSvc = serviceLocator()->service( "HistogramPersistencySvc" );
112  if ( !m_histoPersSvc ) {
113  warning() << "Histograms cannot not be saved - though required." << endmsg;
114  return sc;
115  }
116 
117  // Setup algorithm resource pool
118  m_algResourcePool = serviceLocator()->service( "AlgResourcePool" );
119  if ( !m_algResourcePool ) {
120  fatal() << "Error retrieving AlgResourcePool" << endmsg;
121  return StatusCode::FAILURE;
122  }
123 
124  m_algExecStateSvc = serviceLocator()->service( "AlgExecStateSvc" );
125  if ( !m_algExecStateSvc ) {
126  fatal() << "Error retrieving AlgExecStateSvc" << endmsg;
127  return StatusCode::FAILURE;
128  }
129 
131  info() << "Found " << m_eventNumberBlacklist.size() << " events in black list" << endmsg;
132 
133  return StatusCode::SUCCESS;
134 }
StatusCode initialize() override
Definition: Service.cpp:70
Gaudi::Property< std::string > m_evtsel
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Gaudi::Property< bool > m_warnings
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
bool isSuccess() const
Definition: StatusCode.h:365
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Gaudi::Property< std::string > m_schedulerName
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
constexpr static const auto FAILURE
Definition: StatusCode.h:101
T sort(T... args)
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
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:202
IEvtSelector::Context * m_evtContext
Event Iterator.

◆ nextEvent()

StatusCode HiveSlimEventLoopMgr::nextEvent ( int  maxevt)
override

implementation of IService::nextEvent

Definition at line 361 of file HiveSlimEventLoopMgr.cpp.

361  {
362 
363  // Calculate runtime
365 
366  // Reset the application return code.
368 
369  int finishedEvts = 0;
370  int createdEvts = 0;
371  int skippedEvts = 0;
372  info() << "Starting loop on events" << endmsg;
373  // Loop until the finished events did not reach the maxevt number
374  bool loop_ended = false;
375  // Run the first event before spilling more than one
376  bool newEvtAllowed = false;
377 
378  constexpr double oneOver1024 = 1. / 1024.;
379 
380  uint iteration = 0;
381  auto start_time = Clock::now();
382  while ( !loop_ended && ( maxevt < 0 || ( finishedEvts + skippedEvts ) < maxevt ) ) {
383  DEBUG_MSG << "work loop iteration " << iteration++ << endmsg;
384  // if the created events did not reach maxevt, create an event
385  if ( ( newEvtAllowed || createdEvts == 0 ) && // Launch the first event alone
386  createdEvts >= 0 && // The events are not finished with an unlimited number of events
387  ( createdEvts < maxevt || maxevt < 0 ) && // The events are not finished with a limited number of events
388  m_schedulerSvc->freeSlots() > 0 && // There are still free slots in the scheduler
389  m_whiteboard->freeSlots() > 0 ) { // There are still free slots in the whiteboard
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() ) loop_ended = true;
431  newEvtAllowed = true;
432  }
433  } // end main loop on finished events
434  auto end_time = Clock::now();
435 
436  info() << "---> Loop Finished (skipping 1st evt) - "
437  << " WSS " << System::mappedMemory( System::MemoryUnit::kByte ) * oneOver1024 << " total time "
438  << std::chrono::duration_cast<std::chrono::nanoseconds>( end_time - start_time ).count() << endmsg;
439  info() << skippedEvts << " events were SKIPed" << endmsg;
440 
441  return StatusCode::SUCCESS;
442 }
#define DEBUG_MSG
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
StatusCode drainScheduler(int &finishedEvents)
Drain the scheduler from all actions that may be queued.
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
constexpr static const auto RECOVERABLE
Definition: StatusCode.h:102
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
virtual size_t freeSlots()=0
Get free slots number.
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
bool isSuccess() const
Definition: StatusCode.h:365
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:59
T move(T... args)
GAUDI_API long mappedMemory(MemoryUnit unit=kByte, InfoType fetch=Memory, long pid=-1)
Basic Process Information: priority boost.
Definition: Memory.cpp:197
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
bool isRecoverable() const
Definition: StatusCode.h:370
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
bool isFailure() const
Definition: StatusCode.h:145
int maxevt
Definition: Bootstrap.cpp:270
constexpr int Success
Definition: AppReturnCode.h:26
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:202

◆ reinitialize()

StatusCode HiveSlimEventLoopMgr::reinitialize ( )
override

implementation of IService::reinitialize

Definition at line 138 of file HiveSlimEventLoopMgr.cpp.

138  {
139 
140  // Check to see whether a new Event Selector has been specified
141  setProperty( m_appMgrProperty->getProperty( "EvtSel" ) ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
142  if ( m_evtsel != "NONE" || m_evtsel.empty() ) {
143  auto theSvc = serviceLocator()->service( "EventSelector" );
144  auto theEvtSel = theSvc.as<IEvtSelector>();
145  StatusCode sc;
146  if ( theEvtSel && ( theEvtSel.get() != m_evtSelector.get() ) ) {
147  // Setup Event Selector
148  if ( m_evtSelector.get() && m_evtContext ) {
149  // Need to release context before switching to new event selector
150  m_evtSelector->releaseContext( m_evtContext ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
151  m_evtContext = nullptr;
152  }
153  m_evtSelector = theEvtSel;
154  if ( theSvc->FSMState() == Gaudi::StateMachine::INITIALIZED ) {
155  sc = theSvc->reinitialize();
156  if ( !sc.isSuccess() ) {
157  error() << "Failure Reinitializing EventSelector " << theSvc->name() << endmsg;
158  return sc;
159  }
160  } else {
161  sc = theSvc->sysInitialize();
162  if ( !sc.isSuccess() ) {
163  error() << "Failure Initializing EventSelector " << theSvc->name() << endmsg;
164  return sc;
165  }
166  }
168  if ( !sc.isSuccess() ) {
169  error() << "Can not create Context " << theSvc->name() << endmsg;
170  return sc;
171  }
172 
173  } else if ( m_evtSelector ) {
174  if ( m_evtContext ) {
175  m_evtSelector->releaseContext( m_evtContext ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
176  m_evtContext = nullptr;
177  }
179  if ( !sc.isSuccess() ) {
180  error() << "Can not create Context " << theSvc->name() << endmsg;
181  return sc;
182  }
183  }
184  } else if ( m_evtSelector && m_evtContext ) {
185  m_evtSelector->releaseContext( m_evtContext ).ignore( /* AUTOMATICALLY ADDED FOR gaudi/Gaudi!763 */ );
186  m_evtSelector = nullptr;
187  m_evtContext = nullptr;
188  }
189  return StatusCode::SUCCESS;
190 }
Gaudi::Property< std::string > m_evtsel
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
The Event Selector Interface.
Definition: IEvtSelector.h:28
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:86
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:61
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
virtual StatusCode getProperty(Gaudi::Details::PropertyBase *p) const =0
Get the property by property.
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
const StatusCode & ignore() const
Ignore/check StatusCode.
Definition: StatusCode.h:168
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
IEvtSelector::Context * m_evtContext
Event Iterator.

◆ stop()

StatusCode HiveSlimEventLoopMgr::stop ( )
override

implementation of IService::stop

Definition at line 196 of file HiveSlimEventLoopMgr.cpp.

196  {
197  if ( !m_endEventFired ) {
198  // Fire pending EndEvent incident
199  m_incidentSvc->fireIncident( Incident( name(), IncidentType::EndEvent ) );
200  m_endEventFired = true;
201  }
202  return StatusCode::SUCCESS;
203 }
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:284
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
Base class for all Incidents (computing events).
Definition: Incident.h:27
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event)

◆ stopRun()

StatusCode HiveSlimEventLoopMgr::stopRun ( )
override

implementation of IEventProcessor::stopRun()

Definition at line 344 of file HiveSlimEventLoopMgr.cpp.

344  {
345  // Set the application return code
346  auto appmgr = serviceLocator()->as<IProperty>();
348  error() << "Could not set return code of the application (" << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
349  }
350  m_scheduledStop = true;
351  return StatusCode::SUCCESS;
352 }
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:287
bool m_scheduledStop
Scheduled stop of event processing.
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
SmartIF< IFace > as()
Definition: ISvcLocator.h:113
constexpr int ScheduledStop
Definition: AppReturnCode.h:35
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:59
bool isFailure() const
Definition: StatusCode.h:145
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:30
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202

Member Data Documentation

◆ m_abortEventListener

SmartIF<IIncidentListener> HiveSlimEventLoopMgr::m_abortEventListener
protected

Instance of the incident listener waiting for AbortEvent.

Definition at line 73 of file HiveSlimEventLoopMgr.h.

◆ m_abortOnFailure

Gaudi::Property<bool> HiveSlimEventLoopMgr::m_abortOnFailure {this, "AbortOnFailure", true, "Abort job on event failure"}
protected

Definition at line 41 of file HiveSlimEventLoopMgr.h.

◆ m_algExecStateSvc

SmartIF<IAlgExecStateSvc> HiveSlimEventLoopMgr::m_algExecStateSvc
protected

Reference to the AlgExecStateSvc.

Definition at line 58 of file HiveSlimEventLoopMgr.h.

◆ m_algResourcePool

SmartIF<IAlgResourcePool> HiveSlimEventLoopMgr::m_algResourcePool
protected

Reference to the Algorithm resource pool.

Definition at line 56 of file HiveSlimEventLoopMgr.h.

◆ m_appMgrProperty

SmartIF<IProperty> HiveSlimEventLoopMgr::m_appMgrProperty
protected

Property interface of ApplicationMgr.

Definition at line 60 of file HiveSlimEventLoopMgr.h.

◆ m_blackListBS

std::unique_ptr<boost::dynamic_bitset<> > HiveSlimEventLoopMgr::m_blackListBS
protected

Definition at line 80 of file HiveSlimEventLoopMgr.h.

◆ m_endEventFired

bool HiveSlimEventLoopMgr::m_endEventFired = false
protected

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

Definition at line 63 of file HiveSlimEventLoopMgr.h.

◆ m_eventNumberBlacklist

Gaudi::Property<std::vector<unsigned int> > HiveSlimEventLoopMgr::m_eventNumberBlacklist {this, "EventNumberBlackList", {}, ""}
protected

Definition at line 40 of file HiveSlimEventLoopMgr.h.

◆ m_evtContext

IEvtSelector::Context* HiveSlimEventLoopMgr::m_evtContext = nullptr
protected

Event Iterator.

Definition at line 48 of file HiveSlimEventLoopMgr.h.

◆ m_evtDataMgrSvc

SmartIF<IDataManagerSvc> HiveSlimEventLoopMgr::m_evtDataMgrSvc
protected

Reference to the Event Data Service's IDataManagerSvc interface.

Definition at line 44 of file HiveSlimEventLoopMgr.h.

◆ m_evtsel

Gaudi::Property<std::string> HiveSlimEventLoopMgr::m_evtsel {this, "EvtSel", "", ""}
protected

Definition at line 36 of file HiveSlimEventLoopMgr.h.

◆ m_evtSelector

SmartIF<IEvtSelector> HiveSlimEventLoopMgr::m_evtSelector
protected

Reference to the Event Selector.

Definition at line 46 of file HiveSlimEventLoopMgr.h.

◆ m_histoDataMgrSvc

SmartIF<IDataManagerSvc> HiveSlimEventLoopMgr::m_histoDataMgrSvc
protected

Reference to the Histogram Data Service.

Definition at line 50 of file HiveSlimEventLoopMgr.h.

◆ m_histoPersSvc

SmartIF<IConversionSvc> HiveSlimEventLoopMgr::m_histoPersSvc
protected

Reference to the Histogram Persistency Service.

Definition at line 52 of file HiveSlimEventLoopMgr.h.

◆ m_histPersName

Gaudi::Property<std::string> HiveSlimEventLoopMgr::m_histPersName {this, "HistogramPersistency", "", ""}
protected

Definition at line 35 of file HiveSlimEventLoopMgr.h.

◆ m_incidentSvc

SmartIF<IIncidentSvc> HiveSlimEventLoopMgr::m_incidentSvc
protected

Reference to the incident service.

Definition at line 77 of file HiveSlimEventLoopMgr.h.

◆ m_nevt

EventContext::ContextEvt_t HiveSlimEventLoopMgr::m_nevt {0}
protected

Definition at line 82 of file HiveSlimEventLoopMgr.h.

◆ m_scheduledStop

bool HiveSlimEventLoopMgr::m_scheduledStop = false
protected

Scheduled stop of event processing.

Definition at line 75 of file HiveSlimEventLoopMgr.h.

◆ m_schedulerName

Gaudi::Property<std::string> HiveSlimEventLoopMgr::m_schedulerName
protected
Initial value:
{this, "SchedulerName", "AvalancheSchedulerSvc",
"Name of the scheduler to be used"}

Definition at line 38 of file HiveSlimEventLoopMgr.h.

◆ m_schedulerSvc

SmartIF<IScheduler> HiveSlimEventLoopMgr::m_schedulerSvc
protected

A shortcut for the scheduler.

Definition at line 65 of file HiveSlimEventLoopMgr.h.

◆ m_warnings

Gaudi::Property<bool> HiveSlimEventLoopMgr::m_warnings {this, "Warnings", true, "Set this property to false to suppress warning messages"}
protected

Definition at line 37 of file HiveSlimEventLoopMgr.h.

◆ m_whiteboard

SmartIF<IHiveWhiteBoard> HiveSlimEventLoopMgr::m_whiteboard
protected

Reference to the Whiteboard.

Definition at line 54 of file HiveSlimEventLoopMgr.h.


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