| The Gaudi Framework v27r1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
HiveEventLoopMgr Class Reference

`#include <GaudiHive/HiveEventLoopMgr.h>`

Inheritance diagram for HiveEventLoopMgr:
[legend]
Collaboration diagram for HiveEventLoopMgr:
[legend]

## Public Member Functions
| HiveEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc)
| Standard Constructor. More...
virtual | ~HiveEventLoopMgr ()
| 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...
void | taskFinished (IAlgorithm *&algo)
| Decrement the number of algos in flight and put algo back in manager - maybe private. More...
Public Member Functions inherited from MinimalEventLoopMgr
| MinimalEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc)
| Standard Constructor. More...
| ~MinimalEventLoopMgr () override=default
| Standard Destructor. More...
StatusCode | initialize () override
| implementation of IService::initialize More...
StatusCode | start () override
| implementation of IService::start More...
StatusCode | stop () override
| implementation of IService::stop More...
StatusCode | finalize () override
| implementation of IService::finalize More...
StatusCode | reinitialize () override
| implementation of IService::reinitialize More...
StatusCode | restart () override
| implementation of IService::restart More...
StatusCode | nextEvent (int maxevt) override
| implementation of IEventProcessor::nextEvent More...
StatusCode | executeEvent (void *par) override
| implementation of IEventProcessor::executeEvent(void* par) More...
StatusCode | executeRun (int maxevt) override
| implementation of IEventProcessor::executeRun( ) More...
StatusCode | stopRun () override
| implementation of IEventProcessor::stopRun( ) More...
void | topAlgHandler (Property &p)
| Top algorithm List handler. More...
StatusCode | decodeTopAlgs ()
| decodeTopAlgNameList & topAlgNameListHandler More...
void | outStreamHandler (Property &p)
| Output stream List handler. More...
StatusCode | decodeOutStreams ()
| decodeOutStreamNameList & outStreamNameListHandler 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::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
| ~extends () override=default
| Virtual destructor. More...
Public Member Functions inherited from Service
const std::string & | name () 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 Property & | getProperty (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 >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (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...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () 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 Types
typedef std::vector< std::vector< std::string > > | algosDependenciesCollection
| Algorithms Inputs. More...
Protected Types inherited from MinimalEventLoopMgr
enum | State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED }

## Protected Member Functions
void | find_dependencies ()
| Get the input and output collections. 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< IDataManagerSvc > | m_evtDataMgrSvc
| Reference to the Event Data Service's IDataManagerSvc interface. More...
SmartIF< IDataProviderSvc > | m_evtDataSvc
| Reference to the Event Data Service's IDataProviderSvc interface. More...
SmartIF< IEvtSelector > | m_evtSelector
| Reference to the Event Selector. More...
IEvtSelector::Context * | m_evtContext
| Event Iterator. More...
std::string | m_evtsel
| Event selector. More...
SmartIF< IDataManagerSvc > | m_histoDataMgrSvc
| Reference to the Histogram Data Service. More...
SmartIF< IConversionSvc > | m_histoPersSvc
| Reference to the Histogram Persistency Service. More...
SmartIF< IHiveWhiteBoard > | m_whiteboard
| Reference to the Histogram Persistency Service. More...
SmartIF< IAlgResourcePool > | m_algResourcePool
| Reference to the Algorithm resource pool. More...
std::string | m_histPersName
| Name of the Hist Pers type. More...
SmartIF< IProperty > | m_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...
unsigned int | m_max_parallel
| Maximum number of parallel running algorithms. More...
tbb::task_scheduler_init * | m_tbb_scheduler_init
| Pointer to tbb task scheduler. More...
state_type | m_termination_requirement
| The termination requirement. More...
std::vector< state_type > | m_all_requirements
| All requirements. More...
std::map< DataObjID, unsigned int > | m_product_indices
| Register of input products. More...
std::atomic_uint | m_total_algos_in_flight
| Total number of algos in flight across all events. More...
unsigned int | m_numberOfAlgos
| Total number of algos. More...
bool | m_DumpQueues
| Dump the algorithm queues. More...
unsigned int | m_evts_parallel
| Number of events in parallel. More...
unsigned int | m_num_threads
| Total numbers of threads. More...
bool | m_CloneAlgorithms
| Clone algorithms to run them simultaneously. More...
algosDependenciesCollection | m_AlgosDependencies
unsigned int | m_nProducts
Protected Attributes inherited from MinimalEventLoopMgr
SmartIF< IAppMgrUI > | m_appMgrUI
| Reference to the IAppMgrUI interface of the application manager. More...
SmartIF< IIncidentSvc > | m_incidentSvc
| Reference to the incident service. More...
ListAlg | m_topAlgList
| List of top level algorithms. More...
ListAlg | m_outStreamList
| List of output streams. More...
std::string | m_outStreamType
| Out Stream type. More...
StringArrayProperty | m_topAlgNames
| List of top level algorithms names. More...
StringArrayProperty | m_outStreamNames
| List of output stream names. More...
State | m_state = OFFLINE
| State of the object. More...
bool | m_scheduledStop = false
| Scheduled stop of event processing. More...
SmartIF< IIncidentListener > | m_abortEventListener
| Instance of the incident listener waiting for AbortEvent. More...
bool | m_abortEvent = false
| Flag signalling that the event being processedhas to be aborted (skip all following top algs). More...
std::string | m_abortEventSource
| Source of the AbortEvent incident. More...
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 MinimalEventLoopMgr
typedef std::vector< SmartIF< IAlgorithm > > | ListAlg
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 32 of file HiveEventLoopMgr.h.

## Member Typedef Documentation

typedef std::vector<std::vector<std::string> > HiveEventLoopMgr::algosDependenciesCollection
| protected

Algorithms Inputs.

Definition at line 91 of file HiveEventLoopMgr.h.

## Constructor & Destructor Documentation

HiveEventLoopMgr::HiveEventLoopMgr | ( | const std::string & | nam,
|  | ISvcLocator * | svcLoc
| ) |  |

Standard Constructor.

Definition at line 79 of file HiveEventLoopMgr.cpp.

80 : MinimalEventLoopMgr(nam, svcLoc)
81 {
82 m_histoDataMgrSvc = 0;
83 m_histoPersSvc = 0;
84 m_evtDataMgrSvc = 0;
85 m_evtDataSvc = 0;
86 m_evtSelector = 0;
87 m_evtContext = 0;
88 m_algResourcePool = 0;
89 m_endEventFired = true;
90 m_total_algos_in_flight=0;
91 m_max_parallel = 1;
92 m_evts_parallel = 1;
93 m_num_threads = 1;
94 m_DumpQueues = true;
95 m_nProducts = 0;
96
97 // Declare properties
98 declareProperty("HistogramPersistency", m_histPersName = "");
99 declareProperty("EvtSel", m_evtsel );
100 declareProperty("Warnings",m_warnings=true,
101 "Set this property to false to suppress warning messages");
102 declareProperty("MaxAlgosParallel", m_max_parallel );
103 declareProperty("MaxEventsParallel", m_evts_parallel);
104 declareProperty("NumThreads", m_num_threads);
105 declareProperty("DumpQueues", m_DumpQueues= false);
106 declareProperty("CloneAlgorithms", m_CloneAlgorithms= false);
107 declareProperty("AlgosDependencies", m_AlgosDependencies);
108 }
HiveEventLoopMgr::m_nProducts
unsigned int m_nProducts
Definition: HiveEventLoopMgr.h:95
HiveEventLoopMgr::m_max_parallel
unsigned int m_max_parallel
Maximum number of parallel running algorithms.
Definition: HiveEventLoopMgr.h:66
HiveEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveEventLoopMgr.h:53
HiveEventLoopMgr::m_CloneAlgorithms
bool m_CloneAlgorithms
Clone algorithms to run them simultaneously.
Definition: HiveEventLoopMgr.h:88
HiveEventLoopMgr::m_endEventFired
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event) ...
Definition: HiveEventLoopMgr.h:60
HiveEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveEventLoopMgr.h:37
HiveEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveEventLoopMgr.h:49
HiveEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveEventLoopMgr.h:47
HiveEventLoopMgr::m_evts_parallel
unsigned int m_evts_parallel
Number of events in parallel.
Definition: HiveEventLoopMgr.h:84
HiveEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveEventLoopMgr.h:41
HiveEventLoopMgr::m_evtsel
std::string m_evtsel
Event selector.
Definition: HiveEventLoopMgr.h:45
HiveEventLoopMgr::m_evtDataSvc
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
Definition: HiveEventLoopMgr.h:39
HiveEventLoopMgr::m_num_threads
unsigned int m_num_threads
Total numbers of threads.
Definition: HiveEventLoopMgr.h:86
HiveEventLoopMgr::m_total_algos_in_flight
std::atomic_uint m_total_algos_in_flight
Total number of algos in flight across all events.
Definition: HiveEventLoopMgr.h:78
HiveEventLoopMgr::m_warnings
bool m_warnings
Flag to disable warning messages when using external input.
Definition: HiveEventLoopMgr.h:62
HiveEventLoopMgr::m_AlgosDependencies
algosDependenciesCollection m_AlgosDependencies
Definition: HiveEventLoopMgr.h:93
HiveEventLoopMgr::m_histPersName
std::string m_histPersName
Name of the Hist Pers type.
Definition: HiveEventLoopMgr.h:55
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
MinimalEventLoopMgr::MinimalEventLoopMgr
MinimalEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
Definition: MinimalEventLoopMgr.cpp:52
HiveEventLoopMgr::m_DumpQueues
bool m_DumpQueues
Dump the algorithm queues.
Definition: HiveEventLoopMgr.h:82

HiveEventLoopMgr::~HiveEventLoopMgr | ( |  | ) |
| virtual

Standard Destructor.

Definition at line 113 of file HiveEventLoopMgr.cpp.

113 {
114 if( m_histoDataMgrSvc ) m_histoDataMgrSvc->release();
115 if( m_histoPersSvc ) m_histoPersSvc->release();
116 if( m_evtDataMgrSvc ) m_evtDataMgrSvc->release();
117 if( m_evtDataSvc ) m_evtDataSvc->release();
118 if( m_evtSelector ) m_evtSelector->release();
119 if( m_evtContext ) delete m_evtContext;
120 }
HiveEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveEventLoopMgr.h:37
HiveEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveEventLoopMgr.h:49
HiveEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveEventLoopMgr.h:47
HiveEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveEventLoopMgr.h:41
HiveEventLoopMgr::m_evtDataSvc
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
Definition: HiveEventLoopMgr.h:39
IInterface::release
virtual unsigned long release()=0
Release Interface instance.
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43

## Member Function Documentation

StatusCode HiveEventLoopMgr::executeEvent | ( | void * | par | ) |
| virtual

implementation of IEventProcessor::executeEvent(void* par)

Definition at line 370 of file HiveEventLoopMgr.cpp.

370 {
371
372 // Fire BeginEvent "Incident"
373 m_incidentSvc->fireIncident(Incident(name(),IncidentType::BeginEvent));
374 // An incident may schedule a stop, in which case is better to exit before the actual execution.
375 if ( m_scheduledStop ) {
376 always() << "Terminating event processing loop due to a stop scheduled by an incident listener" << endmsg;
377 return StatusCode::SUCCESS;
378 }
379
380 // Execute Algorithms
381 m_incidentSvc->fireIncident(Incident(name(), IncidentType::BeginProcessing));
382
383 // Prepare the event context for concurrency
384
385
386 // Call the resetExecuted() method of ALL "known" algorithms
387 // (before we were reseting only the topalgs)
388 SmartIF<IAlgManager> algMan(serviceLocator());
389 if (LIKELY(algMan.isValid())) {
390 for(auto ialg: algMan->getAlgorithms()) {
391 if (LIKELY(0 != ialg)) ialg->resetExecuted();
392 }
393 }
394
395 bool eventfailed = false;//run_parallel();
396
397 // ensure that the abortEvent flag is cleared before the next event
398 if (UNLIKELY(m_abortEvent)) {
399 DEBMSG << "AbortEvent incident fired by " << m_abortEventSource << endmsg;
400 m_abortEvent = false;
401 }
402
403 // Call the execute() method of all output streams
404 for (ListAlg::iterator ito = m_outStreamList.begin(); ito != m_outStreamList.end(); ito++ ) {
405 (*ito)->resetExecuted();
406 StatusCode sc;
407 sc = (*ito)->sysExecute();
408 if (UNLIKELY(!sc.isSuccess())) {
409 warning() << "Execution of output stream " << (*ito)->name() << " failed" << endmsg;
410 eventfailed = true;
411 }
412 }
413
414 m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing));
415
416 // Check if there was an error processing current event
417 if (UNLIKELY(eventfailed)){
418 error() << "Error processing event loop." << endmsg;
419 return StatusCode(StatusCode::FAILURE,true);
420 }
421 return StatusCode(StatusCode::SUCCESS,true);
422
423 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
SmartIF< IAlgManager >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
MinimalEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: MinimalEventLoopMgr.h:51
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::vector::end
T end(T...args)
merge_files.sc
int sc
Definition: merge_files.py:167
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
DEBMSG
#define DEBMSG
Definition: HiveEventLoopMgr.cpp:46
MinimalEventLoopMgr::m_abortEventSource
std::string m_abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:58
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:37
LIKELY
#define LIKELY(x)
Definition: Kernel.h:125
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
std::vector::begin
T begin(T...args)
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
CommonMessagingBase::always
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Definition: CommonMessaging.h:109
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_abortEvent
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
Definition: MinimalEventLoopMgr.h:56

StatusCode HiveEventLoopMgr::executeRun | ( | int | maxevt | ) |
| virtual

implementation of IEventProcessor::executeRun()

Definition at line 428 of file HiveEventLoopMgr.cpp.

428 {
429 StatusCode sc;
430 // initialize the base class
431 sc = MinimalEventLoopMgr::executeRun(maxevt);
432 return sc;
433 }
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MinimalEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun( )
Definition: MinimalEventLoopMgr.cpp:306

StatusCode HiveEventLoopMgr::finalize | ( |  | ) |
| virtual

implementation of IService::finalize

Definition at line 299 of file HiveEventLoopMgr.cpp.

299 {
300 StatusCode sc;
301
302 // Finalize base class
303 sc = MinimalEventLoopMgr::finalize();
304 if (! sc.isSuccess()) {
305 error() << "Error finalizing base class" << endmsg;
306 return sc;
307 }
308
309 // Save Histograms Now
310 if ( m_histoPersSvc != 0 ) {
311 HistogramAgent agent;
312 sc = m_histoDataMgrSvc->traverseTree( &agent );
313 if( sc.isSuccess() ) {
314 IDataSelector* objects = agent.selectedObjects();
315 // skip /stat entry!
316 if ( objects->size() > 0 ) {
317 IDataSelector::iterator i;
318 for ( i = objects->begin(); i != objects->end(); i++ ) {
319 IOpaqueAddress* pAddr = 0;
320 StatusCode iret = m_histoPersSvc->createRep(*i, pAddr);
321 if ( iret.isSuccess() ) {
322 (*i)->registry()->setAddress(pAddr);
323 }
324 else {
325 sc = iret;
326 }
327 }
328 for ( i = objects->begin(); i != objects->end(); i++ ) {
329 IRegistry* reg = (*i)->registry();
330 StatusCode iret = m_histoPersSvc->fillRepRefs(reg->address(), *i);
331 if ( !iret.isSuccess() ) {
332 sc = iret;
333 }
334 }
335 }
336 if ( sc.isSuccess() ) {
337 info() << "Histograms converted successfully according to request." << endmsg;
338 }
339 else {
340 error() << "Error while saving Histograms." << endmsg;
341 }
342 }
343 else {
344 error() << "Error while traversing Histogram data store" << endmsg;
345 }
346 }
347
348 // Release event selector context
349 if ( m_evtSelector && m_evtContext ) {
350 m_evtSelector->releaseContext(m_evtContext).ignore();
351 m_evtContext = 0;
352 }
353
354 // Release all interfaces...
355 m_histoDataMgrSvc = 0;
356 m_histoPersSvc = 0;
357
358 m_evtSelector = 0;
359 m_evtDataSvc = 0;
360 m_evtDataMgrSvc = 0;
361
362 delete m_tbb_scheduler_init;
363
364 return StatusCode::SUCCESS;
365 }
MinimalEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: MinimalEventLoopMgr.cpp:247
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
HistogramAgent
HistogramAgent base in charge of collecting all the refereces to DataObjects in a transient store tha...
Definition: HistogramAgent.h:17
std::vector::end
T end(T...args)
IConverter::createRep
virtual StatusCode createRep(DataObject *pObject, IOpaqueAddress *&refpAddress)=0
Convert the transient object to the requested representation.
HiveEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveEventLoopMgr.h:37
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
HiveEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveEventLoopMgr.h:49
HiveEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveEventLoopMgr.h:47
IDataManagerSvc::traverseTree
virtual StatusCode traverseTree(IDataStoreAgent *pAgent)=0
Analyse by traversing all data objects in the data store.
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
HiveEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveEventLoopMgr.h:41
IEvtSelector::releaseContext
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
IRegistry
The IRegistry represents the entry door to the environment any data object residing in a transient da...
Definition: IRegistry.h:22
HistogramAgent::selectedObjects
IDataSelector * selectedObjects()
Return the set of selected DataObjects.
Definition: HistogramAgent.h:28
IRegistry::address
virtual IOpaqueAddress * address() const =0
Retrieve opaque storage address.
HiveEventLoopMgr::m_evtDataSvc
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
Definition: HiveEventLoopMgr.h:39
std::vector::size
T size(T...args)
std::vector< DataObject * >
std::vector::begin
T begin(T...args)
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43
HiveEventLoopMgr::m_tbb_scheduler_init
tbb::task_scheduler_init * m_tbb_scheduler_init
Pointer to tbb task scheduler.
Definition: HiveEventLoopMgr.h:68
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
ana.i
list i
Definition: ana.py:128
IConverter::fillRepRefs
virtual StatusCode fillRepRefs(IOpaqueAddress *pAddress, DataObject *pObject)=0
Resolve the references of the converted object.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void HiveEventLoopMgr::find_dependencies | ( |  | ) |
| protected

Get the input and output collections.

Compute dependencies between the algorithms.

Definition at line 744 of file HiveEventLoopMgr.cpp.

744 {
745
746 // Count how many products are actually requested
747 for (auto& thisAlgoDependencies : m_AlgosDependencies){
748 m_nProducts += thisAlgoDependencies.size();
749 }
750 const unsigned int n_algos = m_topAlgList.size();
751 std::vector<state_type> all_requirements(n_algos,state_type(m_nProducts));
752
753 unsigned int algo_counter=0;
754 unsigned int input_counter=0;
755
756 MsgStream log(msgSvc(), name());
757 // loop on the dependencies
758 for (const auto& algoDependencies : m_AlgosDependencies){ // loop on algo dependencies lists
759 state_type requirements(m_nProducts);
760 log << MSG::DEBUG << "Algorithm " << algo_counter << " dependencies: " << endmsg;
761 for (const auto& dependency : algoDependencies){ // loop on dependencies
762 log << MSG::DEBUG << " - " << dependency << endmsg;
763 auto ret = m_product_indices.insert(std::pair<std::string, unsigned int>("/Event/"+dependency,input_counter));
764 // insert successful means == wasn't known before. So increment counter
765 if (ret.second==true) ++input_counter;
766 // in any case the return value holds the proper product index
767 requirements[ret.first->second] = true;
768 log << MSG::DEBUG << " - Requirements now: " << requirements[ret.first->second] << endmsg;
769 }// end loop on single dependencies
770
771 all_requirements[algo_counter] = requirements;
772 ++algo_counter;
773 } // end loop on algo dependencies lists
774
775 // Loop on the product indices
776 log << MSG::DEBUG << "Product indices:" << endmsg;
777 for (auto& prod_index: m_product_indices)
778 log << MSG::DEBUG << " - " << prod_index.first << " " << prod_index.second << endmsg;
779
780 m_numberOfAlgos = algo_counter;
781 m_all_requirements = all_requirements;
782
783 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
HiveEventLoopMgr::m_nProducts
unsigned int m_nProducts
Definition: HiveEventLoopMgr.h:95
HiveEventLoopMgr::m_numberOfAlgos
unsigned int m_numberOfAlgos
Total number of algos.
Definition: HiveEventLoopMgr.h:80
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
MSG::DEBUG
Definition: IMessageSvc.h:18
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
HiveEventLoopMgr::m_product_indices
std::map< DataObjID, unsigned int > m_product_indices
Register of input products.
Definition: HiveEventLoopMgr.h:76
HiveEventLoopMgr::m_all_requirements
std::vector< state_type > m_all_requirements
All requirements.
Definition: HiveEventLoopMgr.h:74
std::pair
state_type
boost::dynamic_bitset state_type
Definition: EventSchedulingState.h:11
std::map::insert
T insert(T...args)
std::vector::size
T size(T...args)
std::vector< state_type >
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
HiveEventLoopMgr::m_AlgosDependencies
algosDependenciesCollection m_AlgosDependencies
Definition: HiveEventLoopMgr.h:93
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

StatusCode HiveEventLoopMgr::getEventRoot | ( | IOpaqueAddress *& | refpAddr | ) |

Create event address using event selector.

Definition at line 717 of file HiveEventLoopMgr.cpp.

717 {
718 refpAddr = 0;
719 StatusCode sc = m_evtSelector->next(*m_evtContext);
720 if ( !sc.isSuccess() ) {
721 return sc;
722 }
723 // Create root address and assign address to data service
724 sc = m_evtSelector->createAddress(*m_evtContext,refpAddr);
725 if( !sc.isSuccess() ) {
726 sc = m_evtSelector->next(*m_evtContext);
727 if ( sc.isSuccess() ) {
728 sc = m_evtSelector->createAddress(*m_evtContext,refpAddr);
729 if ( !sc.isSuccess() ) {
730 warning() << "Error creating IOpaqueAddress." << endmsg;
731 }
732 }
733 }
734 return sc;
735 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IEvtSelector::next
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...
HiveEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveEventLoopMgr.h:41
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43
IEvtSelector::createAddress
virtual StatusCode createAddress(const Context &c, IOpaqueAddress *&iop) const =0
Create an IOpaqueAddress object from the event fetched.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode HiveEventLoopMgr::initialize | ( |  | ) |
| virtual

implementation of IService::initialize

Definition at line 125 of file HiveEventLoopMgr.cpp.

125 {
126 // Initialize the base class
127 StatusCode sc = MinimalEventLoopMgr::initialize();
128 if( !sc.isSuccess() ) {
129 DEBMSG << "Error Initializing base class MinimalEventLoopMgr." << endmsg;
130 return sc;
131 }
132
133 find_dependencies();
134
135 // Setup access to event data services
136 m_evtDataMgrSvc = serviceLocator()->service("EventDataSvc");
137 if( !m_evtDataMgrSvc.isValid() ) {
138 fatal() << "Error retrieving EventDataSvc interface IDataManagerSvc." << endmsg;
139 return StatusCode::FAILURE;
140 }
141 m_evtDataSvc = serviceLocator()->service("EventDataSvc");
142 if( !m_evtDataSvc.isValid() ) {
143 fatal() << "Error retrieving EventDataSvc interface IDataProviderSvc." << endmsg;
144 return StatusCode::FAILURE;
145 }
146 m_whiteboard = serviceLocator()->service("EventDataSvc");
147 if( !m_whiteboard.isValid() ) {
148 fatal() << "Error retrieving EventDataSvc interface IHiveWhiteBoard." << endmsg;
149 return StatusCode::FAILURE;
150 }
151 m_whiteboard->setNumberOfStores(m_evts_parallel).ignore();
152
153 // Obtain the IProperty of the ApplicationMgr
154 m_appMgrProperty = serviceLocator();
155 if ( ! m_appMgrProperty.isValid() ) {
156 fatal() << "IProperty interface not found in ApplicationMgr." << endmsg;
157 return StatusCode::FAILURE;
158 }
159
160 // We do not expect a Event Selector necessarily being declared
161 setProperty(m_appMgrProperty->getProperty("EvtSel")).ignore();
162
163 if( m_evtsel != "NONE" || m_evtsel.length() == 0) {
164 m_evtSelector = serviceLocator()->service("EventSelector");
165 if( m_evtSelector.isValid() ) {
166 // Setup Event Selector
167 sc=m_evtSelector->createContext(m_evtContext);
168 if( !sc.isSuccess() ) {
169 fatal() << "Can not create the event selector Context." << endmsg;
170 return sc;
171 }
172 }
173 else {
174 fatal() << "EventSelector not found." << endmsg;
175 return sc;
176 }
177 }
178 else {
179 m_evtSelector = 0;
180 m_evtContext = 0;
181 if ( m_warnings ) {
182 warning() << "Unable to locate service \"EventSelector\" " << endmsg;
183 warning() << "No events will be processed from external input." << endmsg;
184 }
185 }
186
187 // Setup access to histogramming services
188 m_histoDataMgrSvc = serviceLocator()->service("HistogramDataSvc");
189 if( !m_histoDataMgrSvc.isValid() ) {
190 fatal() << "Error retrieving HistogramDataSvc." << endmsg;
191 return sc;
192 }
193 // Setup histogram persistency
194 m_histoPersSvc = serviceLocator()->service("HistogramPersistencySvc");
195 if( !m_histoPersSvc.isValid() ) {
196 warning() << "Histograms cannot not be saved - though required." << endmsg;
197 return sc;
198 }
199
200 // Setup algorithm resource pool
201 m_algResourcePool = serviceLocator()->service("AlgResourcePool");
202 if( !m_algResourcePool.isValid() ) {
203 fatal() << "Error retrieving AlgResourcePool" << endmsg;
204 return StatusCode::FAILURE;
205 }
206
207 // Setup tbb task scheduler
208 // TODO: shouldn't be in this case
209 // One more for the current thread
210 m_tbb_scheduler_init = new tbb::task_scheduler_init(m_num_threads+1);
211
212 return StatusCode::SUCCESS;
213 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
HiveEventLoopMgr::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Histogram Persistency Service.
Definition: HiveEventLoopMgr.h:51
IProperty::getProperty
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
HiveEventLoopMgr::find_dependencies
void find_dependencies()
Get the input and output collections.
Definition: HiveEventLoopMgr.cpp:744
IHiveWhiteBoard::setNumberOfStores
virtual StatusCode setNumberOfStores(size_t slots)=0
Set the number of 'slots'.
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MinimalEventLoopMgr::initialize
StatusCode initialize() override
implementation of IService::initialize
Definition: MinimalEventLoopMgr.cpp:65
HiveEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveEventLoopMgr.h:53
Service::setProperty
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
HiveEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveEventLoopMgr.h:37
merge_files.sc
int sc
Definition: merge_files.py:167
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
DEBMSG
#define DEBMSG
Definition: HiveEventLoopMgr.cpp:46
HiveEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveEventLoopMgr.h:49
HiveEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveEventLoopMgr.h:47
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
HiveEventLoopMgr::m_evts_parallel
unsigned int m_evts_parallel
Number of events in parallel.
Definition: HiveEventLoopMgr.h:84
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IEvtSelector::createContext
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
HiveEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveEventLoopMgr.h:41
HiveEventLoopMgr::m_evtsel
std::string m_evtsel
Event selector.
Definition: HiveEventLoopMgr.h:45
HiveEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveEventLoopMgr.h:57
HiveEventLoopMgr::m_evtDataSvc
SmartIF< IDataProviderSvc > m_evtDataSvc
Reference to the Event Data Service's IDataProviderSvc interface.
Definition: HiveEventLoopMgr.h:39
std::string::length
T length(T...args)
HiveEventLoopMgr::m_num_threads
unsigned int m_num_threads
Total numbers of threads.
Definition: HiveEventLoopMgr.h:86
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
HiveEventLoopMgr::m_warnings
bool m_warnings
Flag to disable warning messages when using external input.
Definition: HiveEventLoopMgr.h:62
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43
HiveEventLoopMgr::m_tbb_scheduler_init
tbb::task_scheduler_init * m_tbb_scheduler_init
Pointer to tbb task scheduler.
Definition: HiveEventLoopMgr.h:68
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode HiveEventLoopMgr::nextEvent | ( | int | maxevt | ) |
| virtual

implementation of IService::nextEvent

Definition at line 442 of file HiveEventLoopMgr.cpp.

442 {
443 // Collapse executeEvent and run_parallel in the same method
444 // TODO _very_ sporty on conditions and checks!!
445
446 auto start_time = tbb::tick_count::now();
447 auto secsFromStart = [&start_time]()->double{
448 return (tbb::tick_count::now()-start_time).seconds();
449 };
450
451 typedef std::tuple<EventContext*,EventSchedulingState*> contextSchedState_tuple;
452
453 MsgStream log(msgSvc(), name());
454
455
456 // Reset the application return code.
457 Gaudi::setAppReturnCode(m_appMgrProperty, Gaudi::ReturnCode::Success, true).ignore();
458
459 // Lambda to check if an event has finished
460 auto has_finished = [] // acquire nothing
461 (contextSchedState_tuple evtContext_evtstate) // argument is a tuple
462 { return std::get<1>(evtContext_evtstate)->hasFinished();}; // true if finished
463
464 // Useful for the Logs
465 always() << "Running with "
466 << m_evts_parallel << " parallel events, "
467 << m_max_parallel << " max concurrent algorithms, "
468 << m_num_threads << " threads."
469 << endmsg;
470
471 int n_processed_events = 0;
472 bool eof = false;
473 StatusCode sc;
474
475 // Events in flight
476 std::list<contextSchedState_tuple> events_in_flight;
477
478 // Loop until no more evts are there
479
480 while( maxevt == -1 ? !eof : n_processed_events < maxevt ){// TODO Fix the condition in case of -1
481
482 const unsigned int n_events_in_flight = events_in_flight.size();
483 const unsigned int n_evts_to_process = maxevt - n_processed_events - n_events_in_flight;
484
485 unsigned int n_acquirable_events = m_evts_parallel - n_events_in_flight ;
486 if (n_acquirable_events > n_evts_to_process)
487 n_acquirable_events = n_evts_to_process;
488
489 log << MSG::INFO << "Evts in flight: " << n_events_in_flight << endmsg;
490 log << MSG::INFO << "Evts processed: " << n_processed_events<< endmsg;
491 log << MSG::INFO << "Evts parallel: " << m_evts_parallel << endmsg;
492 log << MSG::INFO << "Acquirable Events are " << n_acquirable_events << endmsg;
493
494 // Initialisation section ------------------------------------------------
495
496 // Loop on events to be initialised
497 for (unsigned int offset=0; offset< n_acquirable_events; ++offset){
498
499 EventContext* evtContext(new EventContext);
500 const int evt_num = n_processed_events + offset + n_events_in_flight;
501 evtContext->set(evt_num, m_whiteboard->allocateStore(evt_num) );
502 m_whiteboard->selectStore(evtContext->slot()).ignore();
503
504 if( m_evtContext ) {
505 //---This is the "event iterator" context from EventSelector
506 IOpaqueAddress* pAddr = 0;
507 sc = getEventRoot(pAddr);
508 if( !sc.isSuccess() ) {
509 info() << "No more events in event selection " << endmsg;
510 eof = true;
511 maxevt = evt_num; // Set the maxevt to the determined maximum
512 break;
513 }
514 sc = m_evtDataMgrSvc->setRoot ("/Event", pAddr);
515 if( !sc.isSuccess() ) {
516 warning() << "Error declaring event root address." << endmsg;
517 }
518 }
519 else {
520 //---In case of no event selector----------------
521 sc = m_evtDataMgrSvc->setRoot ("/Event", new DataObject());
522 if( !sc.isSuccess() ) {
523 warning() << "Error declaring event root DataObject" << endmsg;
524 }
525 }
526
527 EventSchedulingState* event_state = new EventSchedulingState(m_topAlgList.size(),m_nProducts);
528 events_in_flight.push_back(std::make_tuple(evtContext,event_state));
529 info() << "Started event " << evt_num << " at " << secsFromStart() << endmsg;
530
531 }// End initialisation loop on acquired events
532
533 // End initialisation section --------------------------------------------
534
535 // Scheduling section ----------------------------------------------------
536 auto in_flight_end = events_in_flight.end();
537 auto in_flight_begin = events_in_flight.begin();
538 // loop until at least one evt finished
539 while (in_flight_end == find_if(in_flight_begin, in_flight_end ,has_finished)){
540 bool no_algo_can_run = true;
541 for (auto& evtContext_evtstate : events_in_flight){ // loop on evts
542
543 EventContext* event_Context = std::get<0>(evtContext_evtstate);
544 EventSchedulingState* event_state = std::get<1>(evtContext_evtstate);
545
546 for (unsigned int algo_counter=0; algo_counter<m_topAlgList.size(); algo_counter++) { // loop on algos
547 // check whether all requirements/dependencies for the algorithm are fulfilled...
548 const state_type& algo_requirements = m_all_requirements[algo_counter];
549 // Very verbose!
550 // log << MSG::VERBOSE << "Checking dependencies for algo " << algo_counter << ":\n"
551 // << " o Requirements: " << algo_requirements << std::endl
552 // << " o State: " << event_state->state() << endmsg;
553
554 // ...and whether the algorithm was already started and if it can be started
555 bool algo_not_started_and_dependencies_there = (algo_requirements.is_subset_of(event_state->state()) &&
556 (event_state->hasStarted(algo_counter) ) == false);
557
558 // It could run, just the maximum number of algos in flight has been reached
559 if (algo_not_started_and_dependencies_there)
560 no_algo_can_run = false;
561 if (algo_not_started_and_dependencies_there &&
562 (m_total_algos_in_flight < m_max_parallel )) {
563 // Pick the algorithm if available and if not and requested create one
564 IAlgorithm* ialgo=NULL;
565 // To be transferred to the algomanager, this is inefficient
566 ListAlg::iterator algoIt = m_topAlgList.begin();
567 std::advance(algoIt, algo_counter);
568 if(m_algResourcePool->acquireAlgorithm(algoIt->get()->name(),ialgo)){
569 log << MSG::INFO << "Launching algo " << algo_counter<< " on event " << event_Context->evt() << endmsg;
570 // Attach context to the algo
571 Algorithm* algo = dynamic_cast<Algorithm*> (ialgo);
572 algo->setContext(event_Context);
573
574 tbb::task* t = new( tbb::task::allocate_root() ) HiveAlgoTask(ialgo, event_state, this);
575 tbb::task::enqueue( *t);
576
577 event_state->algoStarts(algo_counter);
578 ++m_total_algos_in_flight;
579
580 log << MSG::INFO << "Algos in flight: " << m_total_algos_in_flight << endmsg;
581 }
582 } // End scheduling if block
583
584 }// end loop on algo indices
585
586 // update the event state with what has been put into the DataSvc
587 // std::vector<std::string> new_products;
588 DataObjIDColl new_products;
589 m_whiteboard->selectStore(event_Context->slot()).ignore();
590 sc = m_whiteboard->getNewDataObjects(new_products);
591 if( !sc.isSuccess() ){
592 warning() << "Error getting recent new products (since last time called)" << endmsg;
593 }
594 for (const auto& newProduct : new_products) {
595 log << MSG::DEBUG << "New Product: " << newProduct << " in the store." << endmsg;
596 if (m_product_indices.count( newProduct ) == 1) { // only products with dependencies upon need to be announced to other algos
597 log << MSG::DEBUG << " - Used as input by some algorithm. Updating the event state." << endmsg;
598 event_state->update_state(m_product_indices[newProduct]);
599 }
600 }
601
602
603 /* Check if we stall on the current event
604 * One should check if:
605 * - Nothing can run
606 * - Nothing is running
607 * - No new product is available
608 * - The event is not finished
609 * At this point one could claim a stall.
610 * The implementation poses a challenge though, which resides in the
611 * asyncronous termination of algorithm and potential writing in the
612 * store. Therefore one checks the 4 aforementioned conditions.
613 * Then, the store is again checked (without removing the new
614 * elements). If something new is there the stall is not sure
615 * anymore.
616 * Another possibility could be to check if any algo terminated
617 * during the checks made to the wb probably.
618 */
619 if (no_algo_can_run && // nothing could run
620 m_total_algos_in_flight==0 && // nothing is running
621 new_products.size() == 0 && // no new product available
622 ! event_state->hasFinished() ){ // the event is not finished
623
624 // Check if something arrived on the wb meanwhile
625 if(!m_whiteboard->newDataObjectsPresent()){
626
627 std::string errorMessage("No algorithm can run, "
628 "no algorithm in flight, "
629 "no new products in the store, "
630 "event not complete: this is a stall.");
631 fatal() << errorMessage << std::endl
632 << "Algorithms that ran for event " << event_Context->evt() << std::endl;
633 unsigned int algo_counter=0;
634 for (auto& algo : m_topAlgList){
635 bool has_started = event_state->hasStarted(algo_counter);
636 if (has_started)
637 fatal() << " o " << algo->name() << " could run" << std::endl;
638 else
639 fatal() << " o " << algo->name() << " could NOT run" << std::endl;
640 algo_counter++;
641 } // End ofloop on algos
642 fatal() << endmsg;
643 throw GaudiException (errorMessage,"HiveEventLoopMgr",StatusCode::FAILURE);
644 }
645 }
646 }// end loop on evts in flight
647 }// end loop until at least one evt in flight finished
648
649 // Remove from the in flight events the finished ones
650 std::list<contextSchedState_tuple>::iterator it=events_in_flight.begin();
651
652 while (it!=events_in_flight.end()){
653 // Now proceed to deletion
654 if (std::get<1>(*it)->hasFinished()){
655 const unsigned int evt_num = std::get<0>(*it)->evt();
656 const unsigned int evt_slot = std::get<0>(*it)->slot();
657 log << MSG::INFO << "Event "<< evt_num << " finished. Events in flight are "
658 << events_in_flight.size() << ". Processed events are "
659 << n_processed_events << endmsg;
660 info() << "Event "<< evt_num << " finished. now is " << secsFromStart() << endmsg;
661
662 // Calculate min and max event num
663 unsigned int min_event_num=0xFFFFFFFF;
664 unsigned int max_event_num=0;
665
666 for (auto& evtContext_evtstate : events_in_flight){
667 const unsigned int evt_num = std::get<0>(evtContext_evtstate)->evt();
668 // Update min and max for backlog calculation
669 if (evt_num > max_event_num) max_event_num=evt_num;
670 if (evt_num < min_event_num) min_event_num=evt_num;
671 }
672 unsigned int evt_backlog=max_event_num-min_event_num;
673 info() << "Event backlog (max= " << max_event_num << ", min= "
674 << min_event_num<<" ) = " << evt_backlog << endmsg;
675
676
677 // Output
678 // Call the execute() method of all output streams
679 for (ListAlg::iterator ito = m_outStreamList.begin(); ito != m_outStreamList.end(); ito++ ) {
680 (*ito)->resetExecuted();
681 StatusCode sc;
682 sc = (*ito)->sysExecute();
683 if (UNLIKELY(!sc.isSuccess())) {
684 warning() << "Execution of output stream " << (*ito)->name() << " failed" << endmsg;
685 }
686 }
687
688 sc = m_whiteboard->clearStore(evt_slot);
689 if( !sc.isSuccess() ) {
690 warning() << "Clear of Event data store failed" << endmsg;
691 }
692 else {
693 info() << "Cleared store " << evt_slot << endmsg;
694 }
695 m_whiteboard->freeStore(evt_slot).ignore();
696
697 delete std::get<0>(*it);
698 delete std::get<1>(*it);
699 it=events_in_flight.erase(it) ;
700
701 n_processed_events++;
702
703 } else{
704 ++it;
705 }
706 }
707 // End scheduling session ------------------------------------------------
708
709 } // End while loop on events
710
711 always() << "---> Loop Finished (seconds): " << secsFromStart() <<endmsg;
712
713 return StatusCode::SUCCESS;
714 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
HiveEventLoopMgr::m_nProducts
unsigned int m_nProducts
Definition: HiveEventLoopMgr.h:95
IAlgResourcePool::acquireAlgorithm
virtual StatusCode acquireAlgorithm(const std::string &name, IAlgorithm *&algo, bool blocking=false)=0
Acquire a certain algorithm using its name.
HiveEventLoopMgr::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Histogram Persistency Service.
Definition: HiveEventLoopMgr.h:51
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:41
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
HiveEventLoopMgr::m_max_parallel
unsigned int m_max_parallel
Maximum number of parallel running algorithms.
Definition: HiveEventLoopMgr.h:66
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
std::advance
T advance(T...args)
MSG::DEBUG
Definition: IMessageSvc.h:18
std::endl
T endl(T...args)
HiveEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveEventLoopMgr.h:53
std::make_tuple
T make_tuple(T...args)
std::list::end
T end(T...args)
HiveEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveEventLoopMgr.h:37
merge_files.sc
int sc
Definition: merge_files.py:167
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
Algorithm::setContext
void setContext(EventContext *context)
set the context
Definition: Algorithm.h:574
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
std::string
STL class.
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:820
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
std::list::push_back
T push_back(T...args)
IHiveWhiteBoard::selectStore
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given 'slot' for all subsequent calls within the same thread id.
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
IHiveWhiteBoard::clearStore
virtual StatusCode clearStore(size_t partitionIndex)=0
Clear an given 'slot'.
StatusCode::FAILURE
Definition: StatusCode.h:29
IHiveWhiteBoard::getNewDataObjects
virtual StatusCode getNewDataObjects(DataObjIDColl &products)=0
Get the latest new data objects registred in store.
HiveEventLoopMgr::m_evts_parallel
unsigned int m_evts_parallel
Number of events in parallel.
Definition: HiveEventLoopMgr.h:84
HiveEventLoopMgr::m_product_indices
std::map< DataObjID, unsigned int > m_product_indices
Register of input products.
Definition: HiveEventLoopMgr.h:76
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
read_lhcb_event_file.evt
tuple evt
Definition: read_lhcb_event_file.py:14
std::unordered_set< DataObjID, DataObjID_Hasher >
HiveEventLoopMgr::m_all_requirements
std::vector< state_type > m_all_requirements
All requirements.
Definition: HiveEventLoopMgr.h:74
HiveEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveEventLoopMgr.h:57
std::list
STL class.
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
IDataManagerSvc::setRoot
virtual StatusCode setRoot(std::string root_name, DataObject *pObject)=0
Initialize data store for new event by giving new event path.
std::map::count
T count(T...args)
std::tuple
state_type
boost::dynamic_bitset state_type
Definition: EventSchedulingState.h:11
IHiveWhiteBoard::newDataObjectsPresent
virtual bool newDataObjectsPresent()=0
Check if something is new in the whiteboard without getting the products.
GaudiPython.Bindings.DataObject
DataObject
Definition: Bindings.py:50
Algorithm
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:74
std::find_if
T find_if(T...args)
std::list::size
T size(T...args)
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
HiveAlgoTask
dirty place for adding an AlgoTask wrapper
Definition: HiveEventLoopMgr.cpp:51
HiveEventLoopMgr::getEventRoot
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
Definition: HiveEventLoopMgr.cpp:717
HiveEventLoopMgr::m_num_threads
unsigned int m_num_threads
Total numbers of threads.
Definition: HiveEventLoopMgr.h:86
IHiveWhiteBoard::allocateStore
virtual size_t allocateStore(int evtnumber)=0
Allocate a store partition for new event.
std::list::begin
T begin(T...args)
EventSchedulingState
Definition: EventSchedulingState.h:14
IHiveWhiteBoard::freeStore
virtual StatusCode freeStore(size_t partitionIndex)=0
Free a store partition.
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
HiveEventLoopMgr::m_total_algos_in_flight
std::atomic_uint m_total_algos_in_flight
Total number of algos in flight across all events.
Definition: HiveEventLoopMgr.h:78
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:108
Gaudi::ReturnCode::Success
constexpr int Success
Definition: AppReturnCode.h:16
MSG::INFO
Definition: IMessageSvc.h:19
CommonMessagingBase::always
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
Definition: CommonMessaging.h:109
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

StatusCode HiveEventLoopMgr::reinitialize | ( |  | ) |
| virtual

implementation of IService::reinitialize

Definition at line 217 of file HiveEventLoopMgr.cpp.

217 {
218
219 // Initialize the base class
220 StatusCode sc = MinimalEventLoopMgr::reinitialize();
221 if( !sc.isSuccess() ) {
222 DEBMSG << "Error Initializing base class MinimalEventLoopMgr." << endmsg;
223 return sc;
224 }
225
226 // Check to see whether a new Event Selector has been specified
227 setProperty(m_appMgrProperty->getProperty("EvtSel"));
228 if( m_evtsel != "NONE" || m_evtsel.length() == 0) {
229 SmartIF<IService> theSvc(serviceLocator()->service("EventSelector"));
230 SmartIF<IEvtSelector> theEvtSel(theSvc);
231 if( theEvtSel.isValid() && ( theEvtSel.get() != m_evtSelector.get() ) ) {
232 // Setup Event Selector
233 if ( m_evtSelector.get() && m_evtContext ) {
234 // Need to release context before switching to new event selector
235 m_evtSelector->releaseContext(m_evtContext);
236 m_evtContext = 0;
237 }
238 m_evtSelector = theEvtSel;
239 if (theSvc->FSMState() == Gaudi::StateMachine::INITIALIZED) {
240 sc = theSvc->reinitialize();
241 if( !sc.isSuccess() ) {
242 error() << "Failure Reinitializing EventSelector "
243 << theSvc->name( ) << endmsg;
244 return sc;
245 }
246 }
247 else {
248 sc = theSvc->sysInitialize();
249 if( !sc.isSuccess() ) {
250 error() << "Failure Initializing EventSelector "
251 << theSvc->name( ) << endmsg;
252 return sc;
253 }
254 }
255 sc = m_evtSelector->createContext(m_evtContext);
256 if( !sc.isSuccess() ) {
257 error() << "Can not create Context " << theSvc->name( ) << endmsg;
258 return sc;
259 }
260 info() << "EventSelector service changed to "
261 << theSvc->name( ) << endmsg;
262 }
263 else if ( m_evtSelector.isValid() ) {
264 if ( m_evtContext ) {
265 m_evtSelector->releaseContext(m_evtContext);
266 m_evtContext = 0;
267 }
268 sc = m_evtSelector->createContext(m_evtContext);
269 if( !sc.isSuccess() ) {
270 error() << "Can not create Context " << theSvc->name( ) << endmsg;
271 return sc;
272 }
273 }
274 }
275 else if ( m_evtSelector.isValid() && m_evtContext ) {
276 m_evtSelector->releaseContext(m_evtContext);
277 m_evtSelector = 0;
278 m_evtContext = 0;
279 }
280 return StatusCode::SUCCESS;
281 }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
SmartIF< IService >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
IProperty::getProperty
virtual StatusCode getProperty(Property *p) const =0
Get the property by property.
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:124
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
Service::setProperty
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
merge_files.sc
int sc
Definition: merge_files.py:167
MinimalEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: MinimalEventLoopMgr.cpp:198
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
DEBMSG
#define DEBMSG
Definition: HiveEventLoopMgr.cpp:46
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IEvtSelector::createContext
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
HiveEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveEventLoopMgr.h:41
IEvtSelector::releaseContext
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
HiveEventLoopMgr::m_evtsel
std::string m_evtsel
Event selector.
Definition: HiveEventLoopMgr.h:45
HiveEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveEventLoopMgr.h:57
std::string::length
T length(T...args)
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
Service::service
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
HiveEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveEventLoopMgr.h:43
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode HiveEventLoopMgr::stop | ( |  | ) |
| virtual

implementation of IService::stop

Definition at line 287 of file HiveEventLoopMgr.cpp.

287 {
288 if ( ! m_endEventFired ) {
289 // Fire pending EndEvent incident
290 m_incidentSvc->fireIncident(Incident(name(),IncidentType::EndEvent));
291 m_endEventFired = true;
292 }
293 return MinimalEventLoopMgr::stop();
294 }
HiveEventLoopMgr::m_endEventFired
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event) ...
Definition: HiveEventLoopMgr.h:60
MinimalEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: MinimalEventLoopMgr.cpp:171
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:37
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17

void HiveEventLoopMgr::taskFinished | ( | IAlgorithm *& | algo | ) |

Decrement the number of algos in flight and put algo back in manager - maybe private.

Definition at line 787 of file HiveEventLoopMgr.cpp.

787 {
788 m_algResourcePool->releaseAlgorithm(algo->name(),algo);
789 --m_total_algos_in_flight;
790 MsgStream log(msgSvc(), name());
791 log << MSG::DEBUG << "[taskFinished] Algos in flight: " << m_total_algos_in_flight << endmsg;
792 }
MsgStream
Definition of the MsgStream class used to transmit messages.
Definition: MsgStream.h:24
Gaudi.Configuration.log
tuple log
Definition: Configuration.py:13
MSG::DEBUG
Definition: IMessageSvc.h:18
HiveEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveEventLoopMgr.h:53
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
CommonMessagingBase::msgSvc
SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
Definition: CommonMessaging.h:73
HiveEventLoopMgr::m_total_algos_in_flight
std::atomic_uint m_total_algos_in_flight
Total number of algos in flight across all events.
Definition: HiveEventLoopMgr.h:78
IAlgResourcePool::releaseAlgorithm
virtual StatusCode releaseAlgorithm(const std::string &name, IAlgorithm *&algo)=0
Release a certain algorithm.
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

## Member Data Documentation

algosDependenciesCollection HiveEventLoopMgr::m_AlgosDependencies
| protected

Definition at line 93 of file HiveEventLoopMgr.h.

SmartIF<IAlgResourcePool> HiveEventLoopMgr::m_algResourcePool
| protected

Reference to the Algorithm resource pool.

Definition at line 53 of file HiveEventLoopMgr.h.

std::vector<state_type> HiveEventLoopMgr::m_all_requirements
| protected

All requirements.

Definition at line 74 of file HiveEventLoopMgr.h.

SmartIF<IProperty> HiveEventLoopMgr::m_appMgrProperty
| protected

Property interface of ApplicationMgr.

Definition at line 57 of file HiveEventLoopMgr.h.

bool HiveEventLoopMgr::m_CloneAlgorithms
| protected

Clone algorithms to run them simultaneously.

Definition at line 88 of file HiveEventLoopMgr.h.

bool HiveEventLoopMgr::m_DumpQueues
| protected

Dump the algorithm queues.

Definition at line 82 of file HiveEventLoopMgr.h.

bool HiveEventLoopMgr::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 60 of file HiveEventLoopMgr.h.

IEvtSelector::Context* HiveEventLoopMgr::m_evtContext
| protected

Event Iterator.

Definition at line 43 of file HiveEventLoopMgr.h.

SmartIF<IDataManagerSvc> HiveEventLoopMgr::m_evtDataMgrSvc
| protected

Reference to the Event Data Service's IDataManagerSvc interface.

Definition at line 37 of file HiveEventLoopMgr.h.

SmartIF<IDataProviderSvc> HiveEventLoopMgr::m_evtDataSvc
| protected

Reference to the Event Data Service's IDataProviderSvc interface.

Definition at line 39 of file HiveEventLoopMgr.h.

unsigned int HiveEventLoopMgr::m_evts_parallel
| protected

Number of events in parallel.

Definition at line 84 of file HiveEventLoopMgr.h.

std::string HiveEventLoopMgr::m_evtsel
| protected

Event selector.

Definition at line 45 of file HiveEventLoopMgr.h.

SmartIF<IEvtSelector> HiveEventLoopMgr::m_evtSelector
| protected

Reference to the Event Selector.

Definition at line 41 of file HiveEventLoopMgr.h.

SmartIF<IDataManagerSvc> HiveEventLoopMgr::m_histoDataMgrSvc
| protected

Reference to the Histogram Data Service.

Definition at line 47 of file HiveEventLoopMgr.h.

SmartIF<IConversionSvc> HiveEventLoopMgr::m_histoPersSvc
| protected

Reference to the Histogram Persistency Service.

Definition at line 49 of file HiveEventLoopMgr.h.

std::string HiveEventLoopMgr::m_histPersName
| protected

Name of the Hist Pers type.

Definition at line 55 of file HiveEventLoopMgr.h.

unsigned int HiveEventLoopMgr::m_max_parallel
| protected

Maximum number of parallel running algorithms.

Definition at line 66 of file HiveEventLoopMgr.h.

unsigned int HiveEventLoopMgr::m_nProducts
| protected

Definition at line 95 of file HiveEventLoopMgr.h.

unsigned int HiveEventLoopMgr::m_num_threads
| protected

Total numbers of threads.

Definition at line 86 of file HiveEventLoopMgr.h.

unsigned int HiveEventLoopMgr::m_numberOfAlgos
| protected

Total number of algos.

Definition at line 80 of file HiveEventLoopMgr.h.

std::map<DataObjID,unsigned int> HiveEventLoopMgr::m_product_indices
| protected

Register of input products.

Definition at line 76 of file HiveEventLoopMgr.h.

tbb::task_scheduler_init* HiveEventLoopMgr::m_tbb_scheduler_init
| protected

Pointer to tbb task scheduler.

Definition at line 68 of file HiveEventLoopMgr.h.

state_type HiveEventLoopMgr::m_termination_requirement
| protected

The termination requirement.

Definition at line 72 of file HiveEventLoopMgr.h.

std::atomic_uint HiveEventLoopMgr::m_total_algos_in_flight
| protected

Total number of algos in flight across all events.

Definition at line 78 of file HiveEventLoopMgr.h.

bool HiveEventLoopMgr::m_warnings
| protected

Flag to disable warning messages when using external input.

Definition at line 62 of file HiveEventLoopMgr.h.

SmartIF<IHiveWhiteBoard> HiveEventLoopMgr::m_whiteboard
| protected

Reference to the Histogram Persistency Service.

Definition at line 51 of file HiveEventLoopMgr.h.

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

- GaudiHive/GaudiHive/HiveEventLoopMgr.h
- GaudiHive/src/HiveEventLoopMgr.cpp