ATLAS Offline Software
Loading...
Searching...
No Matches
MPIHiveEventLoopMgr Class Reference

The MPI event loop manager. More...

#include <MPIHiveEventLoopMgr.h>

Inheritance diagram for MPIHiveEventLoopMgr:
Collaboration diagram for MPIHiveEventLoopMgr:

Public Types

typedef IEvtSelector::Context EvtContext
typedef std::list< SmartIF< IAlgorithm > > ListAlg

Public Member Functions

 MPIHiveEventLoopMgr (const std::string &name, ISvcLocator *svcLoc)
 Standard Constructor.
virtual ~MPIHiveEventLoopMgr ()
 Standard Destructor.
virtual StatusCode initialize () override
 implementation of IAppMgrUI::initalize
virtual StatusCode finalize () override
 implementation of IAppMgrUI::finalize
virtual StatusCode nextEvent (int maxevt) override
 implementation of IAppMgrUI::nextEvent. maxevt==0 returns immediately
StatusCode getEventRoot (IOpaqueAddress *&refpAddr)
 Create event address using event selector.
virtual StatusCode executeEvent (EventContext &&ctx) override
 implementation of IEventProcessor::executeEvent(void* par)
virtual StatusCode executeRun (int maxevt) override
 implementation of IEventProcessor::executeRun(int maxevt)
virtual StatusCode stopRun () override
 implementation of IEventProcessor::stopRun()
virtual StatusCode stop () override
 implementation of IService::stop
virtual StatusCode seek (int evt) override
 Seek to a given event.
virtual int curEvent () const override
 Return the current event count.
virtual int size () override
 Return the size of the collection.
virtual void handle (const Incident &inc) override
 IIncidentListenet interfaces.
virtual const std::string & name () const override
virtual void modifyEventContext (EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
MsgStream & msg () const
 The standard message stream.
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream.
bool msgLvl (const MSG::Level lvl) const
 Test the output level.
void setLevel (MSG::Level lvl)
 Change the current logging level.

Protected Types

typedef ServiceHandle< IIncidentSvc > IIncidentSvc_t
typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t
typedef ServiceHandle< IDataManagerSvc > IDataManagerSvc_t
typedef ServiceHandle< IConversionSvc > IConversionSvc_t
typedef ServiceHandle< IEvtIdModifierSvc > IEvtIdModifierSvc_t
typedef EventID::number_type number_type
typedef IAthenaEvtLoopPreSelectTool tool_type
typedef ToolHandleArray< tool_type > tool_store
typedef tool_store::const_iterator tool_iterator
typedef std::vector< unsigned int > tool_stats
typedef tool_stats::const_iterator tool_stats_iterator

Protected Member Functions

StatusCode drainLocalScheduler ()
 Drain the local scheduler of any (at least one) completed events.
StatusCode insertEvent (int eventIdx, bool &endOfStream, std::int64_t requestTime_ns)
 Insert an event into the local scheduler.
StatusCode workerEventLoop ()
 Worker event loop (runs on worker, requests events over MPI).
StatusCode masterEventLoop (int maxEvt)
 Master event loop (runs on master, provides events over MPI).
void setupPreSelectTools (Gaudi::Details::PropertyBase &)
 property update handler:sets up the Pre-selection tools
virtual StatusCode writeHistograms (bool force=false)
 Dump out histograms as needed.
virtual StatusCode executeAlgorithms ()
 Run the algorithms for the current event.
StatusCode initializeAlgorithms ()
 Initialize all algorithms and output streams.
StatusCode clearWBSlot (int evtSlot)
 Clear a slot in the WB.
int declareEventRootAddress (EventContext &)
 Declare the root address of the event.
virtual EventContext createEventContext () override
 Create event context.
int drainScheduler (int &finishedEvents)
 Drain the scheduler from all actions that may be queued.
void setTimeout (Timeout &instance)
 Set timeout.
void resetTimeout (Timeout &instance)
 Reset timeout.

Protected Attributes

ServiceHandle< IMPIClusterSvc > m_clusterSvc
 Reference to the MPIClusterSvc.
int m_contiguousFailedEvts {0}
int m_totalFailedEvts {0}
int m_nLocalCreatedEvts {0}
int m_nLocalSkippedEvts {0}
int m_nLocalFinishedEvts {0}
IIncidentSvc_t m_incidentSvc
 Reference to the incident service.
StoreGateSvc_t m_eventStore
 Reference to StoreGateSvc;.
IEvtSelector * m_evtSelector
 Reference to the Event Selector.
EvtContext * m_evtContext
 Gaudi event selector Context (may be used as a cursor by the evt selector).
StringProperty m_evtsel
IDataManagerSvc_t m_histoDataMgrSvc
 Reference to the Histogram Data Service.
IConversionSvc_t m_histoPersSvc
IEvtIdModifierSvc_t m_evtIdModSvc
StringProperty m_histPersName
number_type m_currentRun
 current run number
bool m_firstRun
IntegerProperty m_failureMode
UnsignedIntegerProperty m_eventPrintoutInterval
tool_stats m_toolInvoke
 tool called counter
tool_stats m_toolReject
 tool returns StatusCode::FAILURE counter
tool_stats m_toolAccept
 tool returns StatusCode::SUCCESS counter
tool_store m_tools
 internal tool store
bool m_requireInputAttributeList {}
 require input attribute list
bool m_useSecondaryEventNumber {}
 read event number from secondary input
SmartIF< IHiveWhiteBoard > m_whiteboard
 Reference to the Whiteboard interface.
SmartIF< IAlgResourcePool > m_algResourcePool
 Reference to the Algorithm resource pool.
SmartIF< IAlgExecStateSvc > m_aess
 Reference to the Algorithm Execution State Svc.
SmartIF< IProperty > m_appMgrProperty
 Property interface of ApplicationMgr.
SmartIF< IScheduler > m_schedulerSvc
 A shortcut for the scheduler.
SmartIF< IIncidentListener > m_abortEventListener
 Instance of the incident listener waiting for AbortEvent.
std::string m_schedulerName
 Name of the scheduler to be used.
std::string m_whiteboardName
 Name of the Whiteboard to be used.
bool m_scheduledStop
 Scheduled stop of event processing.
bool m_terminateLoop { false }
unsigned int m_nev
 events processed
unsigned int m_proc
bool m_useTools
bool m_doEvtHeartbeat
EventContext m_lastEventContext

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc.

Private Attributes

UnsignedIntegerProperty m_firstEventIndex
int m_evtSelectorCurrentPos = 0
unsigned int m_nevt
unsigned int m_timeStamp { 0 }
UnsignedIntegerProperty m_writeInterval
bool m_writeHists
bool m_firstEventAlone
unsigned int m_flmbi
unsigned int m_timeStampInt
ServiceHandle< Athena::IConditionsCleanerSvc > m_conditionsCleaner
std::string m_nm
 Message source name.
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels).
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer.
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level.
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging).

Detailed Description

The MPI event loop manager.

As with AthenaHiveEventLoopMgr but in a multi-node MPI environment. This class is derived from and implemented in terms of AthenaHiveEventLoopMgr.

Definition at line 34 of file MPIHiveEventLoopMgr.h.

Member Typedef Documentation

◆ EvtContext

typedef IEvtSelector::Context AthenaHiveEventLoopMgr::EvtContext
inherited

Definition at line 74 of file AthenaHiveEventLoopMgr.h.

◆ IConversionSvc_t

typedef ServiceHandle<IConversionSvc> AthenaHiveEventLoopMgr::IConversionSvc_t
protectedinherited

Definition at line 96 of file AthenaHiveEventLoopMgr.h.

◆ IDataManagerSvc_t

typedef ServiceHandle<IDataManagerSvc> AthenaHiveEventLoopMgr::IDataManagerSvc_t
protectedinherited

Definition at line 92 of file AthenaHiveEventLoopMgr.h.

◆ IEvtIdModifierSvc_t

◆ IIncidentSvc_t

typedef ServiceHandle<IIncidentSvc> AthenaHiveEventLoopMgr::IIncidentSvc_t
protectedinherited

Definition at line 77 of file AthenaHiveEventLoopMgr.h.

◆ ListAlg

typedef std::list<SmartIF<IAlgorithm> > AthenaHiveEventLoopMgr::ListAlg
inherited

Definition at line 264 of file AthenaHiveEventLoopMgr.h.

◆ number_type

Definition at line 107 of file AthenaHiveEventLoopMgr.h.

◆ StoreGateSvc_t

Definition at line 81 of file AthenaHiveEventLoopMgr.h.

◆ tool_iterator

typedef tool_store::const_iterator AthenaHiveEventLoopMgr::tool_iterator
protectedinherited

Definition at line 121 of file AthenaHiveEventLoopMgr.h.

◆ tool_stats

typedef std::vector<unsigned int> AthenaHiveEventLoopMgr::tool_stats
protectedinherited

Definition at line 122 of file AthenaHiveEventLoopMgr.h.

◆ tool_stats_iterator

typedef tool_stats::const_iterator AthenaHiveEventLoopMgr::tool_stats_iterator
protectedinherited

Definition at line 123 of file AthenaHiveEventLoopMgr.h.

◆ tool_store

typedef ToolHandleArray< tool_type > AthenaHiveEventLoopMgr::tool_store
protectedinherited

Definition at line 120 of file AthenaHiveEventLoopMgr.h.

◆ tool_type

Definition at line 119 of file AthenaHiveEventLoopMgr.h.

Constructor & Destructor Documentation

◆ MPIHiveEventLoopMgr()

MPIHiveEventLoopMgr::MPIHiveEventLoopMgr ( const std::string & name,
ISvcLocator * svcLoc )

Standard Constructor.

Definition at line 22 of file MPIHiveEventLoopMgr.cxx.

24 : AthenaHiveEventLoopMgr(name, svcLoc) {}
virtual const std::string & name() const override
AthenaHiveEventLoopMgr()=delete

◆ ~MPIHiveEventLoopMgr()

MPIHiveEventLoopMgr::~MPIHiveEventLoopMgr ( )
virtualdefault

Standard Destructor.

Member Function Documentation

◆ clearWBSlot()

StatusCode AthenaHiveEventLoopMgr::clearWBSlot ( int evtSlot)
protectedinherited

Clear a slot in the WB.

Definition at line 1294 of file AthenaHiveEventLoopMgr.cxx.

1294 {
1295 return m_whiteboard->freeStore(evtSlot);
1296}
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard interface.

◆ createEventContext()

EventContext AthenaHiveEventLoopMgr::createEventContext ( )
overrideprotectedvirtualinherited

Create event context.

Definition at line 1157 of file AthenaHiveEventLoopMgr.cxx.

1157 {
1158
1159 EventContext ctx{ m_nevt, m_whiteboard->allocateStore( m_nevt ) };
1160
1161 StatusCode sc = m_whiteboard->selectStore( ctx.slot() );
1162 if (sc.isFailure()) {
1163 ATH_MSG_FATAL ( "Slot {} could not be selected for the WhiteBoard",
1164 ctx.slot());
1165 return EventContext{}; // invalid EventContext
1166 } else {
1168 Atlas::ExtendedEventContext( m_eventStore->hiveProxyDict() ) );
1169
1170 ATH_MSG_DEBUG ( "created EventContext, num: {} in slot: {}",
1171 ctx.evt(), ctx.slot());
1172 }
1173
1174 return ctx;
1175}
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_FATAL(x,...)
static Double_t sc
StoreGateSvc_t m_eventStore
Reference to StoreGateSvc;.
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ curEvent()

int AthenaHiveEventLoopMgr::curEvent ( ) const
overridevirtualinherited

Return the current event count.

Definition at line 809 of file AthenaHiveEventLoopMgr.cxx.

810{
811 return m_nevt;
812}

◆ declareEventRootAddress()

int AthenaHiveEventLoopMgr::declareEventRootAddress ( EventContext & ctx)
protectedinherited

Declare the root address of the event.

FIXME ???

Definition at line 936 of file AthenaHiveEventLoopMgr.cxx.

936 {
937
938 // return codes:
939 // -1 : error
940 // 0 : no more events in selection
941 // 1 : ok
942
943 StatusCode sc(StatusCode::SUCCESS);
944
945 //-----------------------------------------------------------------------
946 // we need an EventInfo Object to fire the incidents.
947 //-----------------------------------------------------------------------
948 std::unique_ptr<const EventInfo> pEvent{};
949 if ( m_evtContext ) {
950 // Deal with the case when an EventSelector is provided
951 //
952 // FIXME: flow control if no more events in selector, etc.
953 //
954
955 IOpaqueAddress* addr{};
956
957 sc = m_evtSelector->next(*m_evtContext);
958
959 if ( !sc.isSuccess() ) {
960 // This is the end of the loop. No more events in the selection
961 ATH_MSG_INFO ( "No more events in event selection " );
962 return 0;
963 }
964
965 if (m_evtSelector->createAddress(*m_evtContext, addr).isFailure()) {
966 ATH_MSG_ERROR ( "Could not create an IOpaqueAddress" );
967 return -1;
968 }
969
970
971 // Most iterators provide the IOA of an event header (EventInfo, DataHeader)
972 if (0 != addr) {
973 //create its proxy
974 sc = m_eventStore->recordAddress(addr);
975 if( !sc.isSuccess() ) {
977 ATH_MSG_WARNING ( "Error declaring Event object" );
978 return 0;
979 }
980 } if ((sc=m_eventStore->loadEventProxies()).isFailure()) {
981 ATH_MSG_ERROR ( "Error loading Event proxies" );
982 return -1;
983 }
984
985 bool consume_modifier_stream = false;
986 // First try to build a legacy EventInfo object from the TAG information
987 // Read the attribute list
988 const AthenaAttributeList* pAttrList = m_eventStore->tryConstRetrieve<AthenaAttributeList>("Input");
989 if ( pAttrList != nullptr && pAttrList->size() > 6 ) { // Try making EventID-only EventInfo object from in-file TAG
990 try {
991 unsigned int runNumber = (*pAttrList)["RunNumber"].data<unsigned int>();
992 unsigned long long eventNumber = (*pAttrList)["EventNumber"].data<unsigned long long>();
993 unsigned int eventTime = (*pAttrList)["EventTime"].data<unsigned int>();
994 unsigned int eventTimeNS = (*pAttrList)["EventTimeNanoSec"].data<unsigned int>();
995 unsigned int lumiBlock = (*pAttrList)["LumiBlockN"].data<unsigned int>();
996 unsigned int bunchId = (*pAttrList)["BunchId"].data<unsigned int>();
997
998 ATH_MSG_DEBUG ( "use TAG with runNumber={}", runNumber );
999 consume_modifier_stream = true;
1000 // an option to override primary eventNumber with the secondary one in case of DoubleEventSelector
1002 unsigned long long eventNumberSecondary{};
1003 if ( !(pAttrList->exists("hasSecondaryInput") && (*pAttrList)["hasSecondaryInput"].data<bool>()) ) {
1004 ATH_MSG_FATAL ( "Secondary EventNumber requested, but secondary input does not exist!" );
1005 return -1;
1006 }
1007 if ( pAttrList->exists("EventNumber_secondary") ) {
1008 eventNumberSecondary = (*pAttrList)["EventNumber_secondary"].data<unsigned long long>();
1009 }
1010 else {
1011 // try legacy EventInfo if secondary input did not have attribute list
1012 // primary input should not have this EventInfo type
1013 const EventInfo* pEventSecondary = m_eventStore->tryConstRetrieve<EventInfo>();
1014 if (pEventSecondary) {
1015 eventNumberSecondary = pEventSecondary->event_ID()->event_number();
1016 }
1017 else {
1018 ATH_MSG_FATAL ( "Secondary EventNumber requested, but it does not exist!" );
1019 return -1;
1020 }
1021 }
1022 if (eventNumberSecondary != 0) {
1023 m_doEvtHeartbeat = (m_eventPrintoutInterval.value() > 0 &&
1024 0 == (m_nev % m_eventPrintoutInterval.value()));
1025 if (m_doEvtHeartbeat) {
1026 ATH_MSG_INFO ( " ===>>> using secondary event #{} instead of #{} <<<===",
1027 eventNumberSecondary, eventNumber);
1028 }
1029 eventNumber = eventNumberSecondary;
1030 }
1031 }
1032
1033 pEvent = std::make_unique<EventInfo>(
1034 std::make_unique<EventID>(runNumber, eventNumber, eventTime,
1035 eventTimeNS, lumiBlock, bunchId),
1036 nullptr);
1037 } catch (...) {
1038 }
1039 } else if (m_requireInputAttributeList) {
1040 ATH_MSG_FATAL ( "Valid input attribute list required but not present!" );
1041 return -1;
1042 }
1043 // In the case that there is no TAG information
1044 const EventInfo* pEventObserver{pEvent.get()};
1045 if (!pEventObserver) {
1046 // Secondly try to retrieve a legacy EventInfo object from the input file
1047 // Again, m_nevt is incremented after executeEvent in the Hive manager so we don't need a -1
1049 pEventObserver = m_eventStore->tryConstRetrieve<EventInfo>();
1050 if (pEventObserver) {
1051 consume_modifier_stream = false; // stream will already have been consumed during EventInfo TP conversion
1052 ATH_MSG_DEBUG ( "use EventInfo" );
1053 } else {
1054 // Finally try to retrieve an xAOD::EventInfo object from the
1055 // input file and build a legacy EventInfo object from that.
1056 const xAOD::EventInfo* pXEvent{nullptr};
1057 sc = m_eventStore->retrieve(pXEvent);
1058 if( !sc.isSuccess() ) {
1059 ATH_MSG_ERROR ( "Unable to retrieve Event root object" );
1060 return -1;
1061 }
1062 consume_modifier_stream = true;
1063 ATH_MSG_DEBUG ( "use xAOD::EventInfo with runNumber={}", pXEvent->runNumber() );
1064 // Build the old-style Event Info object for those clients that still need it
1065 pEvent = std::make_unique<EventInfo>(
1066 std::make_unique<EventID>(eventIDFromxAOD(pXEvent)),
1067 std::make_unique<EventType>(eventTypeFromxAOD(pXEvent)));
1068 pEventObserver = pEvent.get();
1069 sc = m_eventStore->record(std::move(pEvent), "");
1070 if( !sc.isSuccess() ) {
1071 ATH_MSG_ERROR ( "Error declaring event data object" );
1072 return -1;
1073 }
1074 }
1075 }
1076
1077 modifyEventContext(ctx, *(pEventObserver->event_ID()),
1078 consume_modifier_stream);
1079
1080 }
1081 else {
1082 // No EventSelector is provided, so with no iterator it's up to us
1083 // to create an EventInfo
1084 // first event # == 1
1085 unsigned int runNmb{1}, evtNmb{m_nevt + 1};
1086
1087 // increment the run/lumiBlock number if desired
1088 if (m_flmbi != 0) {
1089 runNmb = m_nevt / m_flmbi + 1;
1090 evtNmb = m_nevt % m_flmbi + 1;
1091 }
1092 auto eid = std::make_unique<EventID> (runNmb,evtNmb, m_timeStamp);
1093 // Change lumiBlock# to match runNumber
1094 eid->set_lumi_block( runNmb );
1095
1097
1098 pEvent = std::make_unique<EventInfo>(std::move(eid),
1099 std::make_unique<EventType>());
1100
1101 bool consume_modifier_stream = true;
1102 // EventInfo TP Conversion not called in this case, so we would
1103 // want to consume the next IoV from the list in the
1104 // EvtIdModifierSvc.
1105 modifyEventContext(ctx,*(pEvent->event_ID()), consume_modifier_stream);
1106
1107 ATH_MSG_DEBUG ( "selecting store: {}", ctx.slot() );
1108
1109 m_whiteboard->selectStore( ctx.slot() ).ignore();
1110
1111 // EventInfo not working with format
1112 ATH_MSG_DEBUG ( "recording EventInfo " << *pEvent->event_ID() << " in "
1113 << m_eventStore->name() );
1114
1115 sc = m_eventStore->record(std::move(pEvent), "McEventInfo");
1116 if( !sc.isSuccess() ) {
1117 ATH_MSG_ERROR ( "Error declaring event data object" );
1118 return -1;
1119 }
1120 }
1121
1122 return 1;
1123}
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
EventID eventIDFromxAOD(const xAOD::EventInfo *xaod)
Create EventID object from xAOD::EventInfo.
EventType eventTypeFromxAOD(const xAOD::EventInfo *xaod)
Create EventType object from xAOD::EventInfo.
EventInfo
UnsignedIntegerProperty m_eventPrintoutInterval
IEvtSelector * m_evtSelector
Reference to the Event Selector.
unsigned int m_nev
events processed
bool m_useSecondaryEventNumber
read event number from secondary input
bool m_requireInputAttributeList
require input attribute list
EvtContext * m_evtContext
Gaudi event selector Context (may be used as a cursor by the evt selector).
virtual void modifyEventContext(EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
EventID * event_ID()
the unique identification of the event.
uint32_t runNumber() const
The current event's run number.
event_number_t eventIndex
EventInfo_v1 EventInfo
Definition of the latest event info version.
setTeId lumiBlock

◆ drainLocalScheduler()

StatusCode MPIHiveEventLoopMgr::drainLocalScheduler ( )
protected

Drain the local scheduler of any (at least one) completed events.

drainLocalScheduler Drain the local scheduler on this MPI rank

Definition at line 382 of file MPIHiveEventLoopMgr.cxx.

382 {
383
384 StatusCode sc(StatusCode::SUCCESS);
385
386 // maybe we can do better
387 std::vector<std::unique_ptr<EventContext>> finishedEvtContexts;
388
389 EventContext* finishedEvtContext(nullptr);
390
391 // Here we wait not to loose cpu resources
392 ATH_MSG_DEBUG("drainLocalScheduler: [{}] Waiting for a context",
394 sc = m_schedulerSvc->popFinishedEvent(finishedEvtContext);
395
396 // We got past it: cache the pointer
397 if (sc.isSuccess()) {
398 ATH_MSG_DEBUG("drainLocalScheduler: scheduler not empty: Context "
399 << finishedEvtContext);
400 finishedEvtContexts.emplace_back(finishedEvtContext);
401 } else {
402 // no more events left in scheduler to be drained
403 ATH_MSG_DEBUG("drainLocalScheduler: scheduler empty");
404 return StatusCode::SUCCESS;
405 }
406
407 // Let's see if we can pop other event contexts
408 while (m_schedulerSvc->tryPopFinishedEvent(finishedEvtContext).isSuccess()) {
409 finishedEvtContexts.emplace_back(finishedEvtContext);
410 }
411
412 // Now we flush them
413 StatusCode fail(StatusCode::SUCCESS);
414 for (auto& thisFinishedEvtContext : finishedEvtContexts) {
415 if (!thisFinishedEvtContext) {
416 ATH_MSG_FATAL("Detected nullptr ctxt while clearing WB!");
417 fail = StatusCode::FAILURE;
418 continue;
419 }
420
421 // Update event log
422 m_clusterSvc->log_completeEvent(
423 thisFinishedEvtContext->evt(),
424 thisFinishedEvtContext->eventID().run_number(),
425 thisFinishedEvtContext->eventID().event_number(),
426 m_aess->eventStatus(*thisFinishedEvtContext));
427
428 if (m_aess->eventStatus(*thisFinishedEvtContext) != EventStatus::Success) {
429 ATH_MSG_ERROR("Failed event detected on "
430 << thisFinishedEvtContext << " w/ fail mode: "
431 << m_aess->eventStatus(*thisFinishedEvtContext));
434 if (m_contiguousFailedEvts >= 3 || m_totalFailedEvts >= 10) {
435 // If we have 3 contiguous failed events or 10 total, end the job
436 fail = StatusCode::FAILURE;
437 continue;
438 }
439 } else {
440 // Event succeeded, reset contiguous failed events
442 }
443
444 EventID::number_type n_run(0);
445 EventID::event_number_t n_evt(0);
446
447 if (m_whiteboard->selectStore(thisFinishedEvtContext->slot()).isSuccess()) {
448 n_run = thisFinishedEvtContext->eventID().run_number();
449 n_evt = thisFinishedEvtContext->eventID().event_number();
450 } else {
451 ATH_MSG_ERROR("DrainSched: unable to select store {}",
452 thisFinishedEvtContext->slot());
453 thisFinishedEvtContext.reset();
454 fail = StatusCode::FAILURE;
455 continue;
456 }
457
458 // Some code still needs global context in addition to that passed in the
459 // incident
460 Gaudi::Hive::setCurrentContext(*thisFinishedEvtContext);
461 m_incidentSvc->fireIncident(
462 Incident(name(), IncidentType::EndProcessing, *thisFinishedEvtContext));
463
464 ATH_MSG_DEBUG("Clearing slot {} (event {}) of the whiteboard",
465 thisFinishedEvtContext->slot(),
466 thisFinishedEvtContext->evt());
467
468 StatusCode sc = clearWBSlot(thisFinishedEvtContext->slot());
469 if (!sc.isSuccess()) {
470 ATH_MSG_ERROR("Whiteboard slot {} could not be properly cleared",
471 thisFinishedEvtContext->slot());
472 if (fail != StatusCode::FAILURE) {
473 fail = sc;
474 }
475 thisFinishedEvtContext.reset();
476 continue;
477 }
478
480
481 writeHistograms().ignore();
482 ++m_proc;
483
484 if (m_doEvtHeartbeat) {
485 if (!m_useTools) {
486 ATH_MSG_INFO(" ===>>> done processing event #{}, run #{} on slot {}, {} events processed so far <<<===",
487 n_evt, n_run, thisFinishedEvtContext->slot(), m_proc);
488 } else {
489 ATH_MSG_INFO(" ===>>> done processing event #{}, run #{} on slot {}, {} events read and {} events processed so far <<<===",
490 n_evt, n_run, thisFinishedEvtContext->slot(), m_nev, m_proc);
491
492 }
493 std::ofstream outfile("eventLoopHeartBeat.txt");
494 if (!outfile) {
495 ATH_MSG_ERROR(" unable to open: eventLoopHeartBeat.txt");
496 fail = StatusCode::FAILURE;
497 thisFinishedEvtContext.reset();
498 continue;
499 }
500 std::println (outfile, " done processing event #{}, run #{} {} events read so far <<<===",
501 n_evt, n_run, m_nev);
502 outfile.close();
503 }
504
505 ATH_MSG_DEBUG("drainLocalScheduler thisFinishedEvtContext: "
506 << thisFinishedEvtContext);
507
508 thisFinishedEvtContext.reset();
509 }
510
511 return fail;
512}
SmartIF< IAlgExecStateSvc > m_aess
Reference to the Algorithm Execution State Svc.
IIncidentSvc_t m_incidentSvc
Reference to the incident service.
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
virtual StatusCode writeHistograms(bool force=false)
Dump out histograms as needed.
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
EventIDBase::number_type number_type
Definition EventID.h:36
ServiceHandle< IMPIClusterSvc > m_clusterSvc
Reference to the MPIClusterSvc.
fail(message)

◆ drainScheduler()

int AthenaHiveEventLoopMgr::drainScheduler ( int & finishedEvents)
protectedinherited

Drain the scheduler from all actions that may be queued.

Definition at line 1180 of file AthenaHiveEventLoopMgr.cxx.

1180 {
1181
1182 StatusCode sc(StatusCode::SUCCESS);
1183
1184 // maybe we can do better
1185 std::vector<std::unique_ptr<EventContext>> finishedEvtContexts;
1186
1187 EventContext* finishedEvtContext(nullptr);
1188
1189 // Here we wait not to loose cpu resources
1190 ATH_MSG_DEBUG ( "drainScheduler: [{}] Waiting for a context", finishedEvts);
1191 sc = m_schedulerSvc->popFinishedEvent(finishedEvtContext);
1192
1193 // We got past it: cache the pointer
1194 if (sc.isSuccess()){
1195 // EventContext not working with std::format
1196 ATH_MSG_DEBUG ( "drainScheduler: scheduler not empty: Context "
1197 << finishedEvtContext );
1198 finishedEvtContexts.emplace_back(finishedEvtContext);
1199 } else{
1200 // no more events left in scheduler to be drained
1201 ATH_MSG_DEBUG ( "drainScheduler: scheduler empty" );
1202 return 0;
1203 }
1204
1205 // Let's see if we can pop other event contexts
1206 while (m_schedulerSvc->tryPopFinishedEvent(finishedEvtContext).isSuccess()){
1207 finishedEvtContexts.emplace_back(finishedEvtContext);
1208 }
1209
1210 // Now we flush them
1211 bool fail(false);
1212 for (auto& thisFinishedEvtContext : finishedEvtContexts){
1213 if (!thisFinishedEvtContext) {
1214 ATH_MSG_FATAL ( "Detected nullptr ctxt while clearing WB!");
1215 fail = true;
1216 continue;
1217 }
1218
1219 if (m_aess->eventStatus(*thisFinishedEvtContext) != EventStatus::Success) {
1220 // EventContext not working with std::format
1221 ATH_MSG_FATAL ( "Failed event detected on " << thisFinishedEvtContext
1222 << " w/ fail mode: "
1223 << m_aess->eventStatus(*thisFinishedEvtContext) );
1224 fail = true;
1225 continue;
1226 }
1227
1228 EventID::number_type n_run(0);
1229 EventID::event_number_t n_evt(0);
1230
1231 if (m_whiteboard->selectStore(thisFinishedEvtContext->slot()).isSuccess()) {
1232 n_run = thisFinishedEvtContext->eventID().run_number();
1233 n_evt = thisFinishedEvtContext->eventID().event_number();
1234 } else {
1235 ATH_MSG_ERROR ( "DrainSched: unable to select store {}",
1236 thisFinishedEvtContext->slot() );
1237 fail = true;
1238 continue;
1239 }
1240
1241 // m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndEvent,
1242 // *thisFinishedEvtContext ));
1243
1244 // Some code still needs global context in addition to that passed in the incident
1245 Gaudi::Hive::setCurrentContext( *thisFinishedEvtContext );
1246 m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing, *thisFinishedEvtContext ));
1247
1248 ATH_MSG_DEBUG( "Clearing slot {} (event {}) of the whiteboard",
1249 thisFinishedEvtContext->slot(),
1250 thisFinishedEvtContext->evt() );
1251
1252 StatusCode sc = clearWBSlot(thisFinishedEvtContext->slot());
1253 if (!sc.isSuccess()) {
1254 ATH_MSG_ERROR ( "Whiteboard slot {} could not be properly cleared",
1255 thisFinishedEvtContext->slot() );
1256 fail = true;
1257 continue;
1258 }
1259
1260 finishedEvts++;
1261
1262 writeHistograms().ignore();
1263 ++m_proc;
1264
1265 if (m_doEvtHeartbeat) {
1266 if(!m_useTools)
1267 ATH_MSG_INFO ( " ===>>> done processing event #{}, run #{} on slot {}, {} events processed so far <<<===",
1268 n_evt, n_run, thisFinishedEvtContext->slot(), m_proc);
1269 else
1270 ATH_MSG_INFO ( " ===>>> done processing event #{}, run #{} on slot {}, {} events read and {} events processed so far <<<===",
1271 n_evt, n_run, thisFinishedEvtContext->slot(), m_nev, m_proc);
1272 std::ofstream outfile( "eventLoopHeartBeat.txt");
1273 if ( !outfile ) {
1274 ATH_MSG_ERROR ( " unable to open: eventLoopHeartBeat.txt" );
1275 fail = true;
1276 continue;
1277 } else {
1278 std::println (outfile, " done processing event #{}, run #{} {} events read so far <<<===",
1279 n_evt, n_run, m_nev);
1280 outfile.close();
1281 }
1282 }
1283
1284 // EventContext not working with format.
1285 ATH_MSG_DEBUG ( "drainScheduler thisFinishedEvtContext: " << thisFinishedEvtContext );
1286 }
1287
1288 return ( fail ? -1 : 1 );
1289
1290}

◆ executeAlgorithms()

StatusCode AthenaHiveEventLoopMgr::executeAlgorithms ( )
protectedvirtualinherited

Run the algorithms for the current event.

Definition at line 478 of file AthenaHiveEventLoopMgr.cxx.

478 {
479
480 return StatusCode::SUCCESS;
481}

◆ executeEvent()

StatusCode AthenaHiveEventLoopMgr::executeEvent ( EventContext && ctx)
overridevirtualinherited

implementation of IEventProcessor::executeEvent(void* par)

Fire begin-Run incident if new run:

Definition at line 487 of file AthenaHiveEventLoopMgr.cxx.

488{
489
490 // An incident may schedule a stop, in which case is better to exit before the actual execution.
491 if ( m_scheduledStop ) {
492 ATH_MSG_ALWAYS ( "A stopRun was requested by an incidentListener. "
493 "Do not process this event." );
494 m_terminateLoop = true;
495 return (StatusCode::SUCCESS);
496 }
497
498 m_aess->reset( ctx );
499
500 // Make sure context with slot is set before calling es->next().
501 Gaudi::Hive::setCurrentContext ( ctx );
502
503 int declEvtRootSc = declareEventRootAddress( ctx );
504 if (declEvtRootSc == 0 ) { // We ran out of events!
505 m_terminateLoop = true; // we have finished!
506 return StatusCode::SUCCESS;
507 } else if ( declEvtRootSc == -1) {
508 // No std::format for EventContext
509 ATH_MSG_ERROR ( "declareEventRootAddress for context " << ctx << " failed" );
510 return StatusCode::FAILURE;
511 }
512
513 EventID::event_number_t evtNumber = ctx.eventID().event_number();
514 unsigned int conditionsRun = ctx.eventID().run_number();
515 if (!m_evtIdModSvc.isSet()) {
516 const AthenaAttributeList* attr = nullptr;
517 if (m_eventStore->contains<AthenaAttributeList> ("Input") &&
518 m_eventStore->retrieve(attr, "Input").isSuccess()) {
519 if (attr->exists ("ConditionsRun")) {
520 conditionsRun = (*attr)["ConditionsRun"].data<unsigned int>();
521 }
522 }
523 }
525 Gaudi::Hive::setCurrentContext ( ctx );
526
527 // Record EventContext in current whiteboard
528 if (m_eventStore->record(std::make_unique<EventContext> (ctx),
529 "EventContext").isFailure())
530 {
531 ATH_MSG_ERROR ( "Error recording event context object" );
532 return (StatusCode::FAILURE);
533 }
534
536 if (m_firstRun || (m_currentRun != ctx.eventID().run_number()) ) {
537 // Fire EndRun incident unless this is the first run
538 if (!m_firstRun) {
539 // FIXME!!!
540 m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndRun));
541 }
542 m_firstRun=false;
543 m_currentRun = ctx.eventID().run_number();
544
545 ATH_MSG_INFO ( " ===>>> start of run {} <<<===", m_currentRun);
546
547 // FIXME!!! Fire BeginRun "Incident"
548 m_incidentSvc->fireIncident(Incident(name(),IncidentType::BeginRun,ctx));
549
550 }
551
552 bool toolsPassed=true;
553 // CGL: FIXME
554 // bool eventFailed = false;
555
556 // Call any attached tools to reject events early
557 unsigned int toolCtr=0;
558 if(m_useTools) {
559 tool_store::iterator theTool = m_tools.begin();
560 tool_store::iterator lastTool = m_tools.end();
561 while(toolsPassed && theTool!=lastTool )
562 {
563 toolsPassed = (*theTool)->passEvent(ctx.eventID());
564 m_toolInvoke[toolCtr]++;
565 {toolsPassed ? m_toolAccept[toolCtr]++ : m_toolReject[toolCtr]++;}
566 ++toolCtr;
567 ++theTool;
568 }
569 }
570
572 0 == (m_nev % m_eventPrintoutInterval.value()));
573 if (m_doEvtHeartbeat) {
574 if(!m_useTools) {
575 ATH_MSG_INFO ( " ===>>> start processing event #{}, run #{} on slot {}, {} events processed so far <<<===",
576 evtNumber, m_currentRun, ctx.slot(), m_proc);
577 }
578 else {
579 ATH_MSG_INFO ( " ===>>> start processing event #{}, run #{} on slot {}, {} events read and {} events processed so far <<<===",
580 evtNumber, m_currentRun, ctx.slot(), m_nev, m_proc);
581 }
582 }
583
584 // Reset the timeout singleton
586 if(toolsPassed) {
587
588 CHECK( m_conditionsCleaner->event (ctx, true) );
589
590 // Remember the last event context for after event processing finishes.
591 m_lastEventContext = ctx;
592
593 // Now add event to the scheduler
594 ATH_MSG_DEBUG ( "Adding event {}, slot {} to the scheduler",
595 ctx.evt(), ctx.slot());
596
597 m_incidentSvc->fireIncident(Incident(name(), IncidentType::BeginProcessing,
598 ctx));
599 StatusCode addEventStatus = m_schedulerSvc->pushNewEvent( new EventContext{ std::move(ctx) } );
600
601 // If this fails, we need to wait for something to complete
602 if (!addEventStatus.isSuccess()){
603 ATH_MSG_FATAL ( "An event processing slot should be now free in the scheduler, but it appears not to be the case." );
604 }
605
606 } // end of toolsPassed test
607
608 ++m_nev;
609
610 ++m_nevt;
611
612 // invalidate thread local context once outside of event execute loop
613 Gaudi::Hive::setCurrentContext( EventContext() );
614
615 return StatusCode::SUCCESS;
616
617}
#define ATH_MSG_ALWAYS(x,...)
#define CHECK(...)
Evaluate an expression and check for errors.
number_type m_currentRun
current run number
tool_stats m_toolAccept
tool returns StatusCode::SUCCESS counter
tool_stats m_toolInvoke
tool called counter
int declareEventRootAddress(EventContext &)
Declare the root address of the event.
bool m_scheduledStop
Scheduled stop of event processing.
ServiceHandle< Athena::IConditionsCleanerSvc > m_conditionsCleaner
tool_store m_tools
internal tool store
tool_stats m_toolReject
tool returns StatusCode::FAILURE counter
IEvtIdModifierSvc_t m_evtIdModSvc
void resetTimeout(Timeout &instance)
Reset timeout.
Definition Timeout.h:83
static Timeout & instance()
Get reference to Timeout singleton.
Definition Timeout.h:64
void setConditionsRun(EventIDBase::number_type conditionsRun)
const ExtendedEventContext & getExtendedEventContext(const EventContext &ctx)
Retrieve an extended context from a context object.

◆ executeRun()

StatusCode AthenaHiveEventLoopMgr::executeRun ( int maxevt)
overridevirtualinherited

implementation of IEventProcessor::executeRun(int maxevt)

Definition at line 622 of file AthenaHiveEventLoopMgr.cxx.

623{
624
626 bool eventfailed = false;
627
628 // Call now the nextEvent(...)
629 sc = nextEvent(maxevt);
630 if (!sc.isSuccess())
631 eventfailed = true;
632
633 if (eventfailed)
634 return StatusCode::FAILURE;
635
636 m_incidentSvc->fireIncident(Incident(name(),"EndEvtLoop"));
637 return StatusCode::SUCCESS;
638}
virtual StatusCode nextEvent(int maxevt) override
implementation of IAppMgrUI::nextEvent. maxevt==0 returns immediately

◆ finalize()

StatusCode MPIHiveEventLoopMgr::finalize ( )
overridevirtual

implementation of IAppMgrUI::finalize

Finalize Finalizes AthenaHiveEventLoopMgr.

Reimplemented from AthenaHiveEventLoopMgr.

Definition at line 39 of file MPIHiveEventLoopMgr.cxx.

39 {
41}
virtual StatusCode finalize() override
implementation of IAppMgrUI::finalize

◆ getEventRoot()

StatusCode AthenaHiveEventLoopMgr::getEventRoot ( IOpaqueAddress *& refpAddr)
inherited

Create event address using event selector.

Definition at line 914 of file AthenaHiveEventLoopMgr.cxx.

914 {
915 refpAddr = 0;
917 if ( !sc.isSuccess() ) {
918 return sc;
919 }
920 // Create root address and assign address to data service
921 sc = m_evtSelector->createAddress(*m_evtContext,refpAddr);
922 if( !sc.isSuccess() ) {
923 sc = m_evtSelector->next(*m_evtContext);
924 if ( sc.isSuccess() ) {
925 sc = m_evtSelector->createAddress(*m_evtContext,refpAddr);
926 if ( !sc.isSuccess() ) {
927 ATH_MSG_WARNING ( "Error creating IOpaqueAddress." );
928 }
929 }
930 }
931 return sc;
932}

◆ handle()

void AthenaHiveEventLoopMgr::handle ( const Incident & inc)
overridevirtualinherited

IIncidentListenet interfaces.

Definition at line 839 of file AthenaHiveEventLoopMgr.cxx.

840{
841
842 if(inc.type() == "EndAlgorithms") {
843 // Clear the store at the end of the event.
844 // Do it here so that it executes in an algorithm context and thus
845 // multiple stores can be cleared at the same time.
846 StatusCode sc = m_whiteboard->clearStore(inc.context().slot());
847 if( !sc.isSuccess() ) {
848 ATH_MSG_WARNING ( "Clear of Event data store failed" );
849 }
850 return;
851 }
852
853 if(inc.type()!="BeforeFork")
854 return;
855
856 if(!m_evtContext || !m_firstRun) {
857 ATH_MSG_WARNING ( "Skipping BeforeFork handler. Either no event selector is provided or begin run has already passed" );
858 }
859
860 // Initialize Algorithms and Output Streams
862 if(sc.isFailure()) {
863 ATH_MSG_ERROR ( "Failed to initialize Algorithms" );
864 return;
865 }
866
867 // Construct EventInfo
868 sc = m_evtSelector->next(*m_evtContext);
869 if(!sc.isSuccess()) {
870 ATH_MSG_INFO ( "No more events in event selection " );
871 return;
872 }
873 IOpaqueAddress* addr{nullptr};
874 sc = m_evtSelector->createAddress(*m_evtContext, addr);
875 if (sc.isFailure()) {
876 ATH_MSG_ERROR ( "Could not create an IOpaqueAddress" );
877 return;
878 }
879 if (0 != addr) {
880 //create its proxy
881 sc = m_eventStore->recordAddress(addr);
882 if(!sc.isSuccess()) {
883 ATH_MSG_ERROR ( "Error declaring Event object" );
884 return;
885 }
886 }
887
888 if(m_eventStore->loadEventProxies().isFailure()) {
889 ATH_MSG_WARNING ( "Error loading Event proxies" );
890 return;
891 }
892
893 // Retrieve the legacy EventInfo object
894 const EventInfo* pEvent{nullptr};
895 sc = m_eventStore->retrieve(pEvent);
896 if(!sc.isSuccess()) {
897 ATH_MSG_ERROR ( "Unable to retrieve Event root object" );
898 return;
899 }
900
901 m_firstRun=false;
902 m_currentRun = pEvent->event_ID()->run_number();
903
904 // Clear Store
905 sc = m_eventStore->clearStore();
906 if(!sc.isSuccess()) {
907 ATH_MSG_ERROR ( "Clear of Event data store failed" );
908 }
909}
StatusCode initializeAlgorithms()
Initialize all algorithms and output streams.

◆ initialize()

StatusCode MPIHiveEventLoopMgr::initialize ( )
overridevirtual

implementation of IAppMgrUI::initalize

Initialize Initializes AthenaHiveEventLoop and MPIClusterSvc.

Reimplemented from AthenaHiveEventLoopMgr.

Definition at line 31 of file MPIHiveEventLoopMgr.cxx.

31 {
32 // Initialize cluster svc
33 ATH_CHECK(m_clusterSvc.retrieve());
35}
#define ATH_CHECK
Evaluate an expression and check for errors.
virtual StatusCode initialize() override
implementation of IAppMgrUI::initalize

◆ initializeAlgorithms()

StatusCode AthenaHiveEventLoopMgr::initializeAlgorithms ( )
protectedinherited

Initialize all algorithms and output streams.

Definition at line 470 of file AthenaHiveEventLoopMgr.cxx.

470 {
471
472 return StatusCode::SUCCESS;
473}

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40{
42 // If user did not set an explicit level, set a default
43 if (m_lvl == MSG::NIL) {
44 m_lvl = m_imsg ?
45 static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
46 MSG::INFO;
47 }
48}
std::string m_nm
Message source name.
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
std::atomic< MSG::Level > m_lvl
Current logging level.
IMessageSvc * getMessageSvc(bool quiet=false)
int outputLevel(const IMessageSvc *ims, const std::string &source)

◆ insertEvent()

StatusCode MPIHiveEventLoopMgr::insertEvent ( int eventIdx,
bool & endOfStream,
std::int64_t requestTime_ns )
protected

Insert an event into the local scheduler.

Insert event into local scheduler.

Definition at line 335 of file MPIHiveEventLoopMgr.cxx.

336 {
337 // fast-forward to event
338 // Create the event context now so next writes into the next slot when
339 // skipping, not the one that's being used
340 endOfStream = false;
341 auto ctx = createEventContext();
342 Gaudi::Hive::setCurrentContext(ctx);
343 ctx.setEvt(
344 eventIdx); // Make the event numbers in the log actually make sense
345 if (!ctx.valid()) {
346 endOfStream = true; // BUG: Doesn't actually mean end of stream. Remove
347 // after making sure!
348 return StatusCode::FAILURE;
349 }
350
351 const std::size_t slot = ctx.slot(); // Need this for later
352 // Codex (GPT 5.6-sol) identified use of seek should be reverted since that
353 // function isn't implemented properly
354 if (m_evtSelector != nullptr) {
355 const int nToJump = (eventIdx - 1) - m_evtSelectorCurrentPos;
356 if (nToJump < 0) {
357 ATH_MSG_ERROR("Cannot jump backwards by {} events", nToJump);
358 return StatusCode::FAILURE;
359 }
360 if (nToJump > 0) {
361 ATH_CHECK(m_evtSelector->next(*m_evtContext, nToJump));
362 }
363 m_evtSelectorCurrentPos = eventIdx;
364 }
365 // execute event
366 StatusCode sc = executeEvent(std::move(ctx));
367 const auto evtID =
368 m_lastEventContext.eventID(); // Set in AthenaHiveEventLoopMgr
369 m_clusterSvc->log_addEvent(eventIdx, evtID.run_number(), evtID.event_number(),
370 requestTime_ns, slot);
371
372 if (sc.isRecoverable()) {
374 } else if (sc.isSuccess()) {
376 }
377 return sc;
378}
virtual StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(void* par)
virtual EventContext createEventContext() override
Create event context.

◆ masterEventLoop()

StatusCode MPIHiveEventLoopMgr::masterEventLoop ( int maxEvt)
protected

Master event loop (runs on master, provides events over MPI).

Master event loop.

Definition at line 63 of file MPIHiveEventLoopMgr.cxx.

63 {
64 ATH_MSG_INFO("Running with " << m_clusterSvc->numRanks() << " ranks");
65 // Determine number of events to process
66 int skipEvts = int(m_firstEventIndex.value());
67 if (m_evtSelector != nullptr) {
68 int evt = size();
69 if (evt == -1) {
70 m_clusterSvc->abort();
71 return StatusCode::FAILURE;
72 }
73 if (maxEvt < 0 || (skipEvts + maxEvt) > evt) {
74 maxEvt = evt - skipEvts;
75 }
76 ATH_MSG_INFO("Will be processing " << maxEvt << " events");
77 }
78
79 // Setup worker status DB (Spare one at start)
80 std::vector<bool> workers_done(m_clusterSvc->numRanks(), false);
81 workers_done[0] =
82 true; // Set 0 to true because it doesn't correspond to a worker
83 int num_workers_done = 1; // Init to 1 so we can compare to numRanks
84 std::vector<ClusterMessage::WorkerStatus> statuses(m_clusterSvc->numRanks());
85
86 // Entering event loop
87 m_clusterSvc->barrier();
88 // Note: no ++evt. This is because this is really a message loop, and we don't
89 // want to increment evt if we haven't provided an event
90 auto start = Clock::now();
91 for (int evt = skipEvts; evt < skipEvts + maxEvt;) {
92 ClusterMessage msg = m_clusterSvc->waitReceiveMessage();
93 // Messages we can get are RequestEvent, FinalWorkerStatus, or WorkerError
94 if (msg.messageType == ClusterMessageType::RequestEvent) {
95 ATH_MSG_DEBUG("Starting event " << evt << " on " << msg.source);
96 m_clusterSvc->sendMessage(
97 msg.source, ClusterMessage(ClusterMessageType::ProvideEvent, evt));
98 ++evt;
99 continue;
100 }
101
102 if (msg.messageType == ClusterMessageType::WorkerError) {
103 ATH_MSG_ERROR("Received WorkerError message from " << msg.source);
105 workers_done.at(msg.source) =
106 true; // If a worker hits an error, it's done
107 ++num_workers_done;
108 for (int i = 1; i < m_clusterSvc->numRanks(); ++i) {
109 if (!workers_done.at(i)) {
110 // Tell workers that aren't done to emergency stop
111 m_clusterSvc->sendMessage(
112 i, ClusterMessage(ClusterMessageType::EmergencyStop));
113 workers_done[i] = true;
114 ++num_workers_done;
115 }
116 }
117 break;
118 }
119
120 if (msg.messageType == ClusterMessageType::FinalWorkerStatus) {
121 ATH_MSG_INFO("Received FinalWorkerStatus from " << msg.source);
123 workers_done.at(msg.source) = true; // Worker hit end of stream
124 ++num_workers_done;
125 continue;
126 }
127
128 // Other message types are an error
129 ATH_MSG_ERROR("Received unexpected message {} from {}",
130 msg.messageType, msg.source);
131 }
132 auto all_provided = Clock::now() - start;
133 ATH_MSG_INFO("Provided all events to workers, waiting for them to complete.");
134 // Event loop done, tell remaining workers
135 while (num_workers_done < m_clusterSvc->numRanks()) {
136 ClusterMessage msg = m_clusterSvc->waitReceiveMessage();
137 // Messages we can get are RequestEvent, FinalWorkerStatus, or WorkerError
138 if (msg.messageType == ClusterMessageType::RequestEvent) {
139 m_clusterSvc->sendMessage(msg.source,
140 ClusterMessage(ClusterMessageType::EventsDone));
141 continue;
142 }
143
144 if (msg.messageType == ClusterMessageType::WorkerError) {
145 ATH_MSG_ERROR("Received WorkerError message from {}", msg.source);
147 workers_done.at(msg.source) =
148 true; // If a worker hits an error, it's done
149 ++num_workers_done;
150 for (int i = 1; i < m_clusterSvc->numRanks(); ++i) {
151 if (!workers_done.at(i)) {
152 // Tell workers that aren't done to emergency stop
153 m_clusterSvc->sendMessage(
154 i, ClusterMessage(ClusterMessageType::EmergencyStop));
155 workers_done[i] = true;
156 ++num_workers_done;
157 }
158 }
159 break;
160 }
161
162 if (msg.messageType == ClusterMessageType::FinalWorkerStatus) {
163 ATH_MSG_INFO("Received FinalWorkerStatus from {}", msg.source);
165 workers_done.at(msg.source) = true; // Told worker we're done
166 ++num_workers_done;
167 continue;
168 }
169
170 // Other message types are an error
171 ATH_MSG_ERROR("Received unexpected message {} from {}",
172 msg.messageType, msg.source);
173 }
174 auto all_done = Clock::now() - start;
175 // Collate status
176 int n_created = 0;
177 int n_skipped = 0;
178 int n_finished = 0;
179
180 StatusCode sc = StatusCode::SUCCESS;
181 int worker_idx = 0;
182 for (const auto& worker_status : statuses) {
183 if (worker_status.status.isFailure() &&
184 worker_status.status != StatusCode(9999)) {
185 sc = worker_status.status;
186 }
187 n_created += worker_status.createdEvents;
188 n_skipped += worker_status.skippedEvents;
189 n_finished += worker_status.finishedEvents;
190
191 if ((worker_idx++) != 0) {
192 ATH_MSG_INFO("Worker " << worker_idx << ": SC " << worker_status.status
193 << ", created " << worker_status.createdEvents
194 << ", skipped " << worker_status.skippedEvents
195 << ", finished " << worker_status.finishedEvents);
196 }
197 }
198
199 ATH_MSG_INFO("Overall: SC " << sc << ", created " << n_created << ", skipped "
200 << n_skipped << ", finished " << n_finished);
201 ATH_MSG_INFO("MASTER: Took {} to provide all events.",
202 std::chrono::hh_mm_ss(all_provided));
203 ATH_MSG_INFO("MASTER: Took {} to complete all events.",
204 std::chrono::hh_mm_ss(all_done));
205 return sc;
206}
MsgStream & msg() const
The standard message stream.
virtual int size() override
Return the size of the collection.
UnsignedIntegerProperty m_firstEventIndex
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
list statuses

◆ modifyEventContext()

void AthenaHiveEventLoopMgr::modifyEventContext ( EventContext & ctx,
const EventID & eID,
bool consume_modifier_stream )
virtualinherited

Definition at line 1127 of file AthenaHiveEventLoopMgr.cxx.

1127 {
1128
1129 if(m_evtIdModSvc.isSet()) {
1130 EventID new_eID(eID);
1131 // In Hive EventLoopMgr ctx.evt() gets set to m_nevt and *then* m_nevt is
1132 // incremented later so it's zero-indexed and we don't need to subtract one
1133 m_evtIdModSvc->modify_evtid(new_eID, ctx.evt(), consume_modifier_stream);
1134 if (msgLevel(MSG::DEBUG)) {
1135 unsigned int oldrunnr=eID.run_number();
1136 unsigned int oldLB=eID.lumi_block();
1137 unsigned int oldTS=eID.time_stamp();
1138 unsigned int oldTSno=eID.time_stamp_ns_offset();
1139 ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc runnr={} -> {}",
1140 oldrunnr, new_eID.run_number());
1141 ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc LB={} -> {}",
1142 oldLB, new_eID.lumi_block());
1143 ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc TimeStamp={} -> {}",
1144 oldTS, new_eID.time_stamp());
1145 ATH_MSG_DEBUG ( "modifyEventContext: use evtIdModSvc TimeStamp ns Offset={} -> {}",
1146 oldTSno, new_eID.time_stamp_ns_offset());
1147 }
1148 ctx.setEventID( new_eID );
1149 Atlas::getExtendedEventContext(ctx).setConditionsRun( ctx.eventID().run_number() );
1150 return;
1151 }
1152
1153 ctx.setEventID( eID );
1154}

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 92 of file AthMessaging.h.

168{
169 MsgStream* ms = m_msg_tls.get();
170 if (!ms) {
171 if (!m_initialized.test_and_set()) initMessaging();
172 ms = new MsgStream(m_imsg,m_nm);
173 m_msg_tls.reset( ms );
174 }
175
176 ms->setLevel (m_lvl);
177 return *ms;
178}
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels).
void initMessaging() const
Initialize our message level and MessageSvc.

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 99 of file AthMessaging.h.

183{ return msg() << lvl; }
MsgStream & msg() const
The standard message stream.

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 86 of file AthMessaging.h.

152{
153 // If user did not set explicit message level we have to initialize
154 // the messaging and retrieve the default via the MessageSvc.
155 if (m_lvl==MSG::NIL && !m_initialized.test_and_set()) initMessaging();
156
157 if (m_lvl <= lvl) {
158 msg() << lvl;
159 return true;
160 } else {
161 return false;
162 }
163}

◆ name()

virtual const std::string & AthenaHiveEventLoopMgr::name ( ) const
inlineoverridevirtualinherited

Definition at line 228 of file AthenaHiveEventLoopMgr.h.

228{ return Service::name(); } //FIXME

◆ nextEvent()

StatusCode MPIHiveEventLoopMgr::nextEvent ( int maxevt)
overridevirtual

implementation of IAppMgrUI::nextEvent. maxevt==0 returns immediately

nextEvent Dispatches to either masterEventLoop or workerEventLoop

Reimplemented from AthenaHiveEventLoopMgr.

Definition at line 45 of file MPIHiveEventLoopMgr.cxx.

45 {
46 // make nextEvent(0) a dummy call
47 if (0 == maxevt) {
48 return StatusCode::SUCCESS;
49 }
50
51 // Reset the application return code.
52 Gaudi::setAppReturnCode(m_appMgrProperty, Gaudi::ReturnCode::Success, true)
53 .ignore();
54 ATH_MSG_INFO("Starting loop on events");
55
56 if (m_clusterSvc->rank() == 0) {
57 return masterEventLoop(maxevt);
58 }
59 return workerEventLoop();
60}
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
StatusCode workerEventLoop()
Worker event loop (runs on worker, requests events over MPI).
StatusCode masterEventLoop(int maxEvt)
Master event loop (runs on master, provides events over MPI).

◆ resetTimeout()

void Athena::TimeoutMaster::resetTimeout ( Timeout & instance)
inlineprotectedinherited

Reset timeout.

Definition at line 83 of file Timeout.h.

83{ instance.reset(); }
std::map< std::string, double > instance

◆ seek()

StatusCode AthenaHiveEventLoopMgr::seek ( int evt)
overridevirtualinherited

Seek to a given event.

Definition at line 777 of file AthenaHiveEventLoopMgr.cxx.

778{
779 IEvtSelectorSeek* is = dynamic_cast<IEvtSelectorSeek*> (m_evtSelector);
780 if (is == 0) {
781 ATH_MSG_ERROR ( "Seek failed; unsupported by event selector" );
782 return StatusCode::FAILURE;
783 }
784 //cppcheck-suppress nullPointerRedundantCheck
785 if (!m_evtContext) {
786 if (m_evtSelector->createContext(m_evtContext).isFailure()) {
787 ATH_MSG_FATAL ( "Can not create the event selector Context." );
788 return StatusCode::FAILURE;
789 }
790 }
791 //m_evtContext cannot be null if createContext succeeded
792 //cppcheck-suppress nullPointerRedundantCheck
793 StatusCode sc = is->seek (*m_evtContext, evt);
794 if (sc.isSuccess()) {
795 m_incidentSvc->fireIncident(ContextIncident<std::tuple<int, int>>(
796 name(), "SkipEvents", std::tuple<int, int>(m_nevt, evt)));
797 m_nevt = evt;
798 }
799 else {
800 ATH_MSG_ERROR ( "Seek failed." );
801 }
802 return sc;
803}
virtual StatusCode seek(IEvtSelector::Context &c, int evtnum) const =0
Seek to a given event number.

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29{
30 m_lvl = lvl;
31}

◆ setTimeout()

void Athena::TimeoutMaster::setTimeout ( Timeout & instance)
inlineprotectedinherited

Set timeout.

Definition at line 80 of file Timeout.h.

80{ instance.set(); }

◆ setupPreSelectTools()

void AthenaHiveEventLoopMgr::setupPreSelectTools ( Gaudi::Details::PropertyBase & )
protectedinherited

property update handler:sets up the Pre-selection tools

Definition at line 322 of file AthenaHiveEventLoopMgr.cxx.

322 {
323
324 m_toolInvoke.clear();
325 m_toolReject.clear();
326 m_toolAccept.clear();
327
328 m_tools.retrieve().ignore();
329 if(m_tools.size() > 0) {
330 m_useTools=true;
331 m_toolInvoke.resize(m_tools.size());
332 m_toolReject.resize(m_tools.size());
333 m_toolAccept.resize(m_tools.size());
334
335 tool_iterator firstTool = m_tools.begin();
336 tool_iterator lastTool = m_tools.end();
337 unsigned int toolCtr = 0;
338 for ( ; firstTool != lastTool; ++firstTool )
339 {
340 // reset statistics
341 m_toolInvoke[toolCtr] = 0;
342 m_toolReject[toolCtr] = 0;
343 m_toolAccept[toolCtr] = 0;
344 toolCtr++;
345 }
346 }
347
348 return;
349
350}
tool_store::const_iterator tool_iterator

◆ size()

int AthenaHiveEventLoopMgr::size ( )
overridevirtualinherited

Return the size of the collection.

Definition at line 817 of file AthenaHiveEventLoopMgr.cxx.

818{
819 IEvtSelectorSeek* cs = dynamic_cast<IEvtSelectorSeek*> (m_evtSelector);
820 if (cs == 0) {
821 ATH_MSG_ERROR ( "Collection size unsupported by event selector" );
822 return -1;
823 }
824 //cppcheck-suppress nullPointerRedundantCheck
825 if (!m_evtContext) {
826 if (m_evtSelector->createContext(m_evtContext).isFailure()) {
827 ATH_MSG_FATAL ( "Can not create the event selector Context." );
828 return -1;
829 }
830 }
831 //m_evtContext cannot be null if createContext succeeded
832 //cppcheck-suppress nullPointerRedundantCheck
833 return cs->size (*m_evtContext);
834}
virtual int size(IEvtSelector::Context &c) const =0
Return the size of the collection, or -1 if we can't get the size.

◆ stop()

StatusCode AthenaHiveEventLoopMgr::stop ( )
overridevirtualinherited

implementation of IService::stop

Definition at line 657 of file AthenaHiveEventLoopMgr.cxx.

658{
659 // To enable conditions access during stop we set an invalid EventContext
660 // (no event/slot number) but with valid EventID (and extended EventContext).
661 m_lastEventContext.setValid(false);
662 Gaudi::Hive::setCurrentContext( m_lastEventContext );
663
664 StatusCode sc = MinimalEventLoopMgr::stop();
665
666 // If we exit the event loop early due to an error, some event stores
667 // may not have been cleared. This can lead to segfaults later,
668 // as DetectorStore will usually get finalized before HiveSvcMgr.
669 // So make sure that all stores have been cleared at this point.
670 size_t nslot = m_whiteboard->getNumberOfStores();
671 for (size_t islot = 0; islot < nslot; islot++) {
672 sc &= clearWBSlot (islot);
673 }
674
675 Gaudi::Hive::setCurrentContext( EventContext() );
676 return sc;
677}

◆ stopRun()

StatusCode AthenaHiveEventLoopMgr::stopRun ( )
overridevirtualinherited

implementation of IEventProcessor::stopRun()

Definition at line 642 of file AthenaHiveEventLoopMgr.cxx.

642 {
643 // Set the application return code
644 SmartIF<IProperty> appmgr(serviceLocator());
645 if(Gaudi::setAppReturnCode(appmgr, Gaudi::ReturnCode::ScheduledStop, true).isFailure()) {
646 ATH_MSG_ERROR ( "Could not set return code of the application ({})",
647 Gaudi::ReturnCode::ScheduledStop);
648 }
649 m_scheduledStop = true;
650 return StatusCode::SUCCESS;
651}

◆ workerEventLoop()

StatusCode MPIHiveEventLoopMgr::workerEventLoop ( )
protected

Worker event loop (runs on worker, requests events over MPI).

Worker event loop.

Definition at line 209 of file MPIHiveEventLoopMgr.cxx.

209 {
210 bool end_of_stream = false;
211 // barrier so all ranks enter message loop together
212 m_clusterSvc->barrier();
213 auto start = Clock::now();
215 while (true) {
216 // Drain the scheduler (wait for at least one event to complete, then free
217 // up completed slots) in two circumstances
218 // 1. Have created exactly one event, so the first event runs to completion
219 // before any more are scheduled
220 // 2. There are no free slots left
221 bool haveFreeSlots =
222 m_schedulerSvc->freeSlots() > 0 && m_whiteboard->freeSlots() > 0;
223 if (!haveFreeSlots || m_nLocalCreatedEvts == 1) {
225 if (sc.isFailure()) {
226 ClusterMessage::WorkerStatus status{};
227 status.status = sc;
228 status.createdEvents = m_nLocalCreatedEvts;
229 status.skippedEvents = m_nLocalSkippedEvts;
230 status.finishedEvents = m_nLocalFinishedEvts;
231 m_clusterSvc->sendMessage(
232 0, ClusterMessage(ClusterMessageType::WorkerError, status));
233 return sc;
234 }
235 }
236
237 auto start_time = Clock::now();
238 m_clusterSvc->sendMessage(0,
239 ClusterMessage(ClusterMessageType::RequestEvent));
240 ClusterMessage msg = m_clusterSvc->waitReceiveMessage();
241 auto request_time = Clock::now() - start_time;
242 if (msg.messageType == ClusterMessageType::EmergencyStop) {
243 // Emergency stop, return FAILURE after fully draining the scheduler to
244 // prevent segfault
245 std::size_t numSlots = m_whiteboard->getNumberOfStores();
246 while (m_schedulerSvc->freeSlots() < numSlots) {
247 // Ignore StatusCode, going to return FAILURE anyway
248 (void)(drainLocalScheduler());
249 }
250 ATH_MSG_ERROR("Received EmergencyStop message!");
251 return StatusCode::FAILURE;
252 }
253
254 if (msg.messageType == ClusterMessageType::EventsDone) {
255 auto loop_time = Clock::now() - start;
256 ATH_MSG_INFO("Worker {} DONE. Loop took {} to process {} events.",
257 m_clusterSvc->rank(),
258 std::chrono::hh_mm_ss(loop_time),
260 // Been told we've reached end
261 // Provide status to master
262 ClusterMessage::WorkerStatus status{};
263 // At end of stream, we need to *fully* drain the scheduler
264 StatusCode sc = StatusCode::SUCCESS;
265 std::size_t numSlots = m_whiteboard->getNumberOfStores();
266 while (sc.isSuccess() && m_schedulerSvc->freeSlots() < numSlots) {
268 }
269 status.status = sc;
270 status.createdEvents = m_nLocalCreatedEvts;
271 status.skippedEvents = m_nLocalSkippedEvts;
272 status.finishedEvents = m_nLocalFinishedEvts;
273 m_clusterSvc->sendMessage(
274 0, ClusterMessage(ClusterMessageType::FinalWorkerStatus, status));
275 return sc;
276 }
277
278 // Any other message other than ProvideEvent would now be an error
279 if (msg.messageType != ClusterMessageType::ProvideEvent ||
280 msg.source != 0) {
281 ATH_MSG_ERROR("Received unexpected message {} from {}",
282 msg.messageType, msg.source);
283 ClusterMessage::WorkerStatus status{};
284 status.status = StatusCode::FAILURE;
285 status.createdEvents = m_nLocalCreatedEvts;
286 status.skippedEvents = m_nLocalSkippedEvts;
287 status.finishedEvents = m_nLocalFinishedEvts;
288 m_clusterSvc->sendMessage(
289 0, ClusterMessage(ClusterMessageType::WorkerError, status));
290 return StatusCode::FAILURE;
291 }
292
293 int evt = get<int>(msg.payload);
294 ATH_MSG_INFO("Starting event {}", evt);
296 evt, end_of_stream,
297 std::chrono::duration_cast<std::chrono::nanoseconds>(request_time)
298 .count());
299 if (sc.isFailure() && !sc.isRecoverable()) {
300 ClusterMessage::WorkerStatus status{};
301 status.status = sc;
302 status.createdEvents = m_nLocalCreatedEvts;
303 status.skippedEvents = m_nLocalSkippedEvts;
304 status.finishedEvents = m_nLocalFinishedEvts;
305 m_clusterSvc->sendMessage(
306 0, ClusterMessage(ClusterMessageType::WorkerError, status));
307 return sc;
308 }
309 if (end_of_stream || m_terminateLoop) {
310 auto loop_time = Clock::now() - start;
311 ATH_MSG_INFO("Worker {} DONE. Loop took to process events.",
312 m_clusterSvc->rank(),
313 std::chrono::hh_mm_ss(loop_time),
315 // reached end of stream, drain scheduler
316 ClusterMessage::WorkerStatus status{};
317 // At end of stream, we need to *fully* drain the scheduler
318 StatusCode sc = StatusCode::SUCCESS;
319 std::size_t numSlots = m_whiteboard->getNumberOfStores();
320 while (sc.isSuccess() && m_schedulerSvc->freeSlots() < numSlots) {
322 }
323 status.status = sc;
324 status.createdEvents = m_nLocalCreatedEvts;
325 status.skippedEvents = m_nLocalSkippedEvts;
326 status.finishedEvents = m_nLocalFinishedEvts;
327 m_clusterSvc->sendMessage(
328 0, ClusterMessage(ClusterMessageType::FinalWorkerStatus, status));
329 return sc;
330 }
331 }
332}
StatusCode drainLocalScheduler()
Drain the local scheduler of any (at least one) completed events.
StatusCode insertEvent(int eventIdx, bool &endOfStream, std::int64_t requestTime_ns)
Insert an event into the local scheduler.
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
status
Definition merge.py:16

◆ writeHistograms()

StatusCode AthenaHiveEventLoopMgr::writeHistograms ( bool force = false)
protectedvirtualinherited

Dump out histograms as needed.

Definition at line 414 of file AthenaHiveEventLoopMgr.cxx.

414 {
415
416 StatusCode sc (StatusCode::SUCCESS);
417
418 if ( 0 != m_histoPersSvc && m_writeHists ) {
419 std::vector<DataObject*> objects;
420 sc = m_histoDataMgrSvc->traverseTree( [&objects]( IRegistry* reg, int ) {
421 DataObject* obj = reg->object();
422 if ( !obj || obj->clID() == CLID_StatisticsFile ) return false;
423 objects.push_back( obj );
424 return true;
425 } );
426
427 if ( !sc.isSuccess() ) {
428 ATH_MSG_ERROR ( "Error while traversing Histogram data store" );
429 return sc;
430 }
431
432 if ( objects.size() > 0) {
433 int writeInterval(m_writeInterval.value());
434
435 if ( m_nevt == 1 || force ||
436 (writeInterval != 0 && m_nevt%writeInterval == 0) ) {
437
438 // skip /stat entry!
439 sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode isc, auto& i ) {
440 IOpaqueAddress* pAddr = nullptr;
441 StatusCode iret = m_histoPersSvc->createRep( i, pAddr );
442 if ( iret.isFailure() ) return iret;
443 i->registry()->setAddress( pAddr );
444 return isc;
445 } );
446 sc = std::accumulate( begin( objects ), end( objects ), sc, [&]( StatusCode isc, auto& i ) {
447 IRegistry* reg = i->registry();
448 StatusCode iret = m_histoPersSvc->fillRepRefs( reg->address(), i );
449 return iret.isFailure() ? iret : isc;
450 } );
451 if ( ! sc.isSuccess() ) {
452 ATH_MSG_ERROR ( "Error while saving Histograms." );
453 }
454 }
455
456 if (force || (writeInterval != 0 && m_nevt%writeInterval == 0) ) {
457 ATH_MSG_DEBUG ( "committing Histograms" );
458 m_histoPersSvc->conversionSvc()->commitOutput("",true).ignore();
459 }
460 }
461
462 }
463
464 return sc;
465}
UnsignedIntegerProperty m_writeInterval
IDataManagerSvc_t m_histoDataMgrSvc
Reference to the Histogram Data Service.

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging).

Definition at line 141 of file AthMessaging.h.

◆ m_abortEventListener

SmartIF< IIncidentListener > AthenaHiveEventLoopMgr::m_abortEventListener
protectedinherited

Instance of the incident listener waiting for AbortEvent.

Definition at line 176 of file AthenaHiveEventLoopMgr.h.

◆ m_aess

SmartIF<IAlgExecStateSvc> AthenaHiveEventLoopMgr::m_aess
protectedinherited

Reference to the Algorithm Execution State Svc.

Definition at line 160 of file AthenaHiveEventLoopMgr.h.

◆ m_algResourcePool

SmartIF<IAlgResourcePool> AthenaHiveEventLoopMgr::m_algResourcePool
protectedinherited

Reference to the Algorithm resource pool.

Definition at line 157 of file AthenaHiveEventLoopMgr.h.

◆ m_appMgrProperty

SmartIF<IProperty> AthenaHiveEventLoopMgr::m_appMgrProperty
protectedinherited

Property interface of ApplicationMgr.

Definition at line 163 of file AthenaHiveEventLoopMgr.h.

◆ m_clusterSvc

ServiceHandle<IMPIClusterSvc> MPIHiveEventLoopMgr::m_clusterSvc
protected
Initial value:
{this, "MPIClusterSvc", "",
"MPIClusterSvc"}

Reference to the MPIClusterSvc.

Definition at line 38 of file MPIHiveEventLoopMgr.h.

38 {this, "MPIClusterSvc", "",
39 "MPIClusterSvc"};

◆ m_conditionsCleaner

ServiceHandle<Athena::IConditionsCleanerSvc> AthenaHiveEventLoopMgr::m_conditionsCleaner
privateinherited

Definition at line 270 of file AthenaHiveEventLoopMgr.h.

◆ m_contiguousFailedEvts

int MPIHiveEventLoopMgr::m_contiguousFailedEvts {0}
protected

Definition at line 52 of file MPIHiveEventLoopMgr.h.

52{0};

◆ m_currentRun

number_type AthenaHiveEventLoopMgr::m_currentRun
protectedinherited

current run number

Definition at line 109 of file AthenaHiveEventLoopMgr.h.

◆ m_doEvtHeartbeat

bool AthenaHiveEventLoopMgr::m_doEvtHeartbeat
protectedinherited

Definition at line 251 of file AthenaHiveEventLoopMgr.h.

◆ m_eventPrintoutInterval

UnsignedIntegerProperty AthenaHiveEventLoopMgr::m_eventPrintoutInterval
protectedinherited

Definition at line 116 of file AthenaHiveEventLoopMgr.h.

◆ m_eventStore

StoreGateSvc_t AthenaHiveEventLoopMgr::m_eventStore
protectedinherited

Reference to StoreGateSvc;.

Property

Definition at line 83 of file AthenaHiveEventLoopMgr.h.

◆ m_evtContext

EvtContext* AthenaHiveEventLoopMgr::m_evtContext
protectedinherited

Gaudi event selector Context (may be used as a cursor by the evt selector).

Definition at line 88 of file AthenaHiveEventLoopMgr.h.

◆ m_evtIdModSvc

IEvtIdModifierSvc_t AthenaHiveEventLoopMgr::m_evtIdModSvc
protectedinherited

Definition at line 102 of file AthenaHiveEventLoopMgr.h.

◆ m_evtsel

StringProperty AthenaHiveEventLoopMgr::m_evtsel
protectedinherited

Definition at line 90 of file AthenaHiveEventLoopMgr.h.

◆ m_evtSelector

IEvtSelector* AthenaHiveEventLoopMgr::m_evtSelector
protectedinherited

Reference to the Event Selector.

Definition at line 86 of file AthenaHiveEventLoopMgr.h.

◆ m_evtSelectorCurrentPos

int MPIHiveEventLoopMgr::m_evtSelectorCurrentPos = 0
private

Definition at line 75 of file MPIHiveEventLoopMgr.h.

◆ m_failureMode

IntegerProperty AthenaHiveEventLoopMgr::m_failureMode
protectedinherited

Definition at line 113 of file AthenaHiveEventLoopMgr.h.

◆ m_firstEventAlone

bool AthenaHiveEventLoopMgr::m_firstEventAlone
privateinherited

Definition at line 258 of file AthenaHiveEventLoopMgr.h.

◆ m_firstEventIndex

UnsignedIntegerProperty MPIHiveEventLoopMgr::m_firstEventIndex
private
Initial value:
{
this, "FirstEventIndex", 0, "First event index (Exec.SkipEvents)"}

Definition at line 73 of file MPIHiveEventLoopMgr.h.

73 {
74 this, "FirstEventIndex", 0, "First event index (Exec.SkipEvents)"};

◆ m_firstRun

bool AthenaHiveEventLoopMgr::m_firstRun
protectedinherited

Definition at line 110 of file AthenaHiveEventLoopMgr.h.

◆ m_flmbi

unsigned int AthenaHiveEventLoopMgr::m_flmbi
privateinherited

Definition at line 260 of file AthenaHiveEventLoopMgr.h.

◆ m_histoDataMgrSvc

IDataManagerSvc_t AthenaHiveEventLoopMgr::m_histoDataMgrSvc
protectedinherited

Reference to the Histogram Data Service.

Definition at line 94 of file AthenaHiveEventLoopMgr.h.

◆ m_histoPersSvc

IConversionSvc_t AthenaHiveEventLoopMgr::m_histoPersSvc
protectedinherited

Definition at line 98 of file AthenaHiveEventLoopMgr.h.

◆ m_histPersName

StringProperty AthenaHiveEventLoopMgr::m_histPersName
protectedinherited

Definition at line 105 of file AthenaHiveEventLoopMgr.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

135{ nullptr };

◆ m_incidentSvc

IIncidentSvc_t AthenaHiveEventLoopMgr::m_incidentSvc
protectedinherited

Reference to the incident service.

Definition at line 79 of file AthenaHiveEventLoopMgr.h.

◆ m_lastEventContext

EventContext AthenaHiveEventLoopMgr::m_lastEventContext
protectedinherited

Definition at line 255 of file AthenaHiveEventLoopMgr.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

138{ MSG::NIL };

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels).

Definition at line 132 of file AthMessaging.h.

◆ m_nev

unsigned int AthenaHiveEventLoopMgr::m_nev
protectedinherited

events processed

Definition at line 248 of file AthenaHiveEventLoopMgr.h.

◆ m_nevt

unsigned int AthenaHiveEventLoopMgr::m_nevt
privateinherited

Definition at line 237 of file AthenaHiveEventLoopMgr.h.

◆ m_nLocalCreatedEvts

int MPIHiveEventLoopMgr::m_nLocalCreatedEvts {0}
protected

Definition at line 55 of file MPIHiveEventLoopMgr.h.

55{0};

◆ m_nLocalFinishedEvts

int MPIHiveEventLoopMgr::m_nLocalFinishedEvts {0}
protected

Definition at line 57 of file MPIHiveEventLoopMgr.h.

57{0};

◆ m_nLocalSkippedEvts

int MPIHiveEventLoopMgr::m_nLocalSkippedEvts {0}
protected

Definition at line 56 of file MPIHiveEventLoopMgr.h.

56{0};

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_proc

unsigned int AthenaHiveEventLoopMgr::m_proc
protectedinherited

Definition at line 249 of file AthenaHiveEventLoopMgr.h.

◆ m_requireInputAttributeList

bool AthenaHiveEventLoopMgr::m_requireInputAttributeList {}
protectedinherited

require input attribute list

Definition at line 134 of file AthenaHiveEventLoopMgr.h.

134{};

◆ m_scheduledStop

bool AthenaHiveEventLoopMgr::m_scheduledStop
protectedinherited

Scheduled stop of event processing.

Definition at line 182 of file AthenaHiveEventLoopMgr.h.

◆ m_schedulerName

std::string AthenaHiveEventLoopMgr::m_schedulerName
protectedinherited

Name of the scheduler to be used.

Definition at line 178 of file AthenaHiveEventLoopMgr.h.

◆ m_schedulerSvc

SmartIF<IScheduler> AthenaHiveEventLoopMgr::m_schedulerSvc
protectedinherited

A shortcut for the scheduler.

Definition at line 166 of file AthenaHiveEventLoopMgr.h.

◆ m_terminateLoop

bool AthenaHiveEventLoopMgr::m_terminateLoop { false }
protectedinherited

Definition at line 246 of file AthenaHiveEventLoopMgr.h.

246{ false };

◆ m_timeStamp

unsigned int AthenaHiveEventLoopMgr::m_timeStamp { 0 }
privateinherited

Definition at line 238 of file AthenaHiveEventLoopMgr.h.

238{ 0 };

◆ m_timeStampInt

unsigned int AthenaHiveEventLoopMgr::m_timeStampInt
privateinherited

Definition at line 260 of file AthenaHiveEventLoopMgr.h.

◆ m_toolAccept

tool_stats AthenaHiveEventLoopMgr::m_toolAccept
protectedinherited

tool returns StatusCode::SUCCESS counter

Definition at line 127 of file AthenaHiveEventLoopMgr.h.

◆ m_toolInvoke

tool_stats AthenaHiveEventLoopMgr::m_toolInvoke
protectedinherited

tool called counter

Definition at line 125 of file AthenaHiveEventLoopMgr.h.

◆ m_toolReject

tool_stats AthenaHiveEventLoopMgr::m_toolReject
protectedinherited

tool returns StatusCode::FAILURE counter

Definition at line 126 of file AthenaHiveEventLoopMgr.h.

◆ m_tools

tool_store AthenaHiveEventLoopMgr::m_tools
protectedinherited

internal tool store

Definition at line 128 of file AthenaHiveEventLoopMgr.h.

◆ m_totalFailedEvts

int MPIHiveEventLoopMgr::m_totalFailedEvts {0}
protected

Definition at line 53 of file MPIHiveEventLoopMgr.h.

53{0};

◆ m_useSecondaryEventNumber

bool AthenaHiveEventLoopMgr::m_useSecondaryEventNumber {}
protectedinherited

read event number from secondary input

Definition at line 137 of file AthenaHiveEventLoopMgr.h.

137{};

◆ m_useTools

bool AthenaHiveEventLoopMgr::m_useTools
protectedinherited

Definition at line 250 of file AthenaHiveEventLoopMgr.h.

◆ m_whiteboard

SmartIF<IHiveWhiteBoard> AthenaHiveEventLoopMgr::m_whiteboard
protectedinherited

Reference to the Whiteboard interface.

Definition at line 154 of file AthenaHiveEventLoopMgr.h.

◆ m_whiteboardName

std::string AthenaHiveEventLoopMgr::m_whiteboardName
protectedinherited

Name of the Whiteboard to be used.

Definition at line 180 of file AthenaHiveEventLoopMgr.h.

◆ m_writeHists

bool AthenaHiveEventLoopMgr::m_writeHists
privateinherited

Definition at line 241 of file AthenaHiveEventLoopMgr.h.

◆ m_writeInterval

UnsignedIntegerProperty AthenaHiveEventLoopMgr::m_writeInterval
privateinherited

Definition at line 240 of file AthenaHiveEventLoopMgr.h.


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