Verified Commit 2348bd03 authored by Tadej Novak's avatar Tadej Novak
Browse files

Log using secondary event number in event loop managers

parent bbe698de
Pipeline #1174353 passed with stage
in 0 seconds
......@@ -75,9 +75,15 @@ topSequence += CfgGetter.getAlgorithm("CopyTimings")
#--------------------------------------------------------------
# Athena EventLoop Manager
#--------------------------------------------------------------
AthenaEventLoopMgr = Service( "AthenaEventLoopMgr" )
AthenaEventLoopMgr.UseSecondaryEventNumber = True
AthenaEventLoopMgr.OutputLevel = INFO
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
nThreads = jp.ConcurrencyFlags.NumThreads()
if nThreads > 0:
EventLoop = Service("AthenaHiveEventLoopMgr")
else:
EventLoop = Service("AthenaEventLoopMgr")
EventLoop.UseSecondaryEventNumber = True
EventLoop.OutputLevel = INFO
svcMgr += EventLoop
#--------------------------------------------------------------
# DEBUG messaging
......@@ -105,7 +111,6 @@ Stream1.ItemList += ["RecoTimingObj#EVNTtoHITS_timings"]
# Set output level threshold (2=DEBUG, 3=INFO, 4=WARNING, 5=ERROR, 6=FATAL )
#--------------------------------------------------------------
svcMgr.MessageSvc = Service( "MessageSvc" )
svcMgr.MessageSvc.OutputLevel = WARNING
svcMgr.MessageSvc.debugLimit = 100000
# No stats printout
......
......@@ -316,6 +316,12 @@ StatusCode AthenaEventLoopMgr::initialize()
CHECK( m_conditionsCleaner.retrieve() );
// Print if we override the event number using the one from secondary event
if (m_useSecondaryEventNumber)
{
info() << "Using secondary event number." << endmsg;
}
return sc;
}
......@@ -646,25 +652,34 @@ StatusCode AthenaEventLoopMgr::executeEvent(EventContext&& ctx)
// an option to override primary eventNumber with the secondary one in case of DoubleEventSelector
if ( m_useSecondaryEventNumber ) {
unsigned long long eventNumberSecondary{};
if ( !(pAttrList->exists("hasSecondaryInput") && (*pAttrList)["hasSecondaryInput"].data<bool>()) ) {
fatal() << "Secondary EventNumber requested, but secondary input does not exist!" << endmsg;
return StatusCode::FAILURE;
}
if ( pAttrList->exists("EventNumber_secondary") ) {
eventNumber = (*pAttrList)["EventNumber_secondary"].data<unsigned long long>();
eventNumberSecondary = (*pAttrList)["EventNumber_secondary"].data<unsigned long long>();
}
else {
// try legacy EventInfo if secondary input did not have attribute list
// primary input should not have this EventInfo type
const EventInfo* pEventSecondary = eventStore()->tryConstRetrieve<EventInfo>();
if (pEventSecondary) {
eventNumber = pEventSecondary->event_ID()->event_number();
eventNumberSecondary = pEventSecondary->event_ID()->event_number();
}
else {
fatal() << "Secondary EventNumber requested, but it does not exist!" << endmsg;
return StatusCode::FAILURE;
}
}
if (eventNumberSecondary != 0) {
bool doEvtHeartbeat(m_eventPrintoutInterval.value() > 0 &&
0 == (m_nev % m_eventPrintoutInterval.value()));
if (doEvtHeartbeat) {
info() << " ===>>> using secondary event #" << eventNumberSecondary << " instead of #" << eventNumber << "<<<===" << endmsg;
}
eventNumber = eventNumberSecondary;
}
}
pEventPtr = std::make_unique<EventInfo>
......
......@@ -352,6 +352,12 @@ StatusCode AthenaHiveEventLoopMgr::initialize()
CHECK( m_conditionsCleaner.retrieve() );
// Print if we override the event number using the one from secondary event
if (m_useSecondaryEventNumber)
{
info() << "Using secondary event number." << endmsg;
}
return sc;
}
......@@ -1116,25 +1122,32 @@ int AthenaHiveEventLoopMgr::declareEventRootAddress(EventContext& ctx){
// an option to override primary eventNumber with the secondary one in case of DoubleEventSelector
if ( m_useSecondaryEventNumber ) {
unsigned long long eventNumberSecondary{};
if ( !(pAttrList->exists("hasSecondaryInput") && (*pAttrList)["hasSecondaryInput"].data<bool>()) ) {
fatal() << "Secondary EventNumber requested, but secondary input does not exist!" << endmsg;
return -1;
}
if ( pAttrList->exists("EventNumber_secondary") ) {
eventNumber = (*pAttrList)["EventNumber_secondary"].data<unsigned long long>();
eventNumberSecondary = (*pAttrList)["EventNumber_secondary"].data<unsigned long long>();
}
else {
// try legacy EventInfo if secondary input did not have attribute list
// primary input should not have this EventInfo type
const EventInfo* pEventSecondary = eventStore()->tryConstRetrieve<EventInfo>();
if (pEventSecondary) {
eventNumber = pEventSecondary->event_ID()->event_number();
eventNumberSecondary = pEventSecondary->event_ID()->event_number();
}
else {
fatal() << "Secondary EventNumber requested, but it does not exist!" << endmsg;
return -1;
}
}
if (eventNumberSecondary != 0) {
if (m_doEvtHeartbeat) {
info() << " ===>>> using secondary event #" << eventNumberSecondary << " instead of #" << eventNumber << "<<<===" << endmsg;
}
eventNumber = eventNumberSecondary;
}
}
auto pEventPtr = std::make_unique<EventInfo>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment