Skip to content
Snippets Groups Projects
Commit b8334652 authored by Walter Lampl's avatar Walter Lampl
Browse files

Merge branch 'protect_debug_athena_core' into 'master'

Protect DEBUG statements: Athena core

See merge request atlas/athena!34504
parents 1ea25c3a c57efd4f
No related branches found
No related tags found
No related merge requests found
......@@ -202,8 +202,10 @@ namespace ViewHelper
//Nothing to do for empty collections
if ( queryHandle->size() == 0 )
{
m_msg << MSG::DEBUG << "Empty collection " << queryHandle.key() <<" in a view " << inputView->name() <<endmsg;
continue;
if (m_msg.level() <= MSG::DEBUG) {
m_msg << MSG::DEBUG << "Empty collection " << queryHandle.key() <<" in a view " << inputView->name() <<endmsg;
continue;
}
}
//Merge the data
......@@ -217,7 +219,10 @@ namespace ViewHelper
//Add aux data for bookkeeping
viewBookkeeper( *outputObject ) = inputView->getROI();
}
m_msg << MSG::DEBUG << "Copied " << queryHandle->size() << " objects from collection in view " << inputView->name() << endmsg;
if (m_msg.level() <= MSG::DEBUG) {
m_msg << MSG::DEBUG << "Copied " << queryHandle->size() << " objects from collection in view " << inputView->name() << endmsg;
}
//Declare remapping
m_sg->remap( ClassID_traits< DataVector< T > >::ID(), inputView->name() + "_" + queryHandle.name(), queryHandle.name(), offset );
......
......@@ -673,9 +673,11 @@ StatusCode AthenaHiveEventLoopMgr::executeEvent( EventContext &&ctx )
m_lastEventContext = ctx;
// Now add event to the scheduler
debug() << "Adding event " << ctx.evt()
<< ", slot " << ctx.slot()
<< " to the scheduler" << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "Adding event " << ctx.evt()
<< ", slot " << ctx.slot()
<< " to the scheduler" << endmsg;
}
m_incidentSvc->fireIncident(Incident(name(), IncidentType::BeginProcessing,
ctx));
......@@ -790,13 +792,18 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
};
while ( !loop_ended and ( (maxevt < 0) or (finishedEvts < maxevt) ) ){
debug() << " -> createdEvts: " << createdEvts << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << " -> createdEvts: " << createdEvts << endmsg;
}
if ( ( !m_terminateLoop ) && // The events are not finished with an unlimited number of events
( (createdEvts < maxevt) or (maxevt<0) ) && // The events are not finished with a limited number of events
(m_schedulerSvc->freeSlots()>0) ){ // There are still free slots in the scheduler
debug() << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "createdEvts: " << createdEvts << ", freeslots: " << m_schedulerSvc->freeSlots() << endmsg;
}
auto ctx = createEventContext();
......@@ -819,7 +826,9 @@ StatusCode AthenaHiveEventLoopMgr::nextEvent(int maxevt)
// all the events were created but not all finished or the slots were
// all busy: the scheduler should finish its job
debug() << "Draining the scheduler" << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "Draining the scheduler" << endmsg;
}
// Pull out of the scheduler the finished events
int ir = drainScheduler(finishedEvts);
......@@ -1172,12 +1181,16 @@ int AthenaHiveEventLoopMgr::declareEventRootAddress(EventContext& ctx){
ctx.setEventID( *((EventIDBase*) pEvent->event_ID()) );
debug() << "selecting store: " << ctx.slot() << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "selecting store: " << ctx.slot() << endmsg;
}
m_whiteboard->selectStore( ctx.slot() ).ignore();
debug() << "recording EventInfo " << *pEvent->event_ID() << " in "
<< eventStore()->name() << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "recording EventInfo " << *pEvent->event_ID() << " in "
<< eventStore()->name() << endmsg;
}
sc = eventStore()->record(pEvent,"McEventInfo");
if( !sc.isSuccess() ) {
error() << "Error declaring event data object" << endmsg;
......@@ -1202,8 +1215,10 @@ EventContext AthenaHiveEventLoopMgr::createEventContext() {
Atlas::setExtendedEventContext(ctx,
Atlas::ExtendedEventContext( eventStore()->hiveProxyDict() ) );
debug() << "created EventContext, num: " << ctx.evt() << " in slot: "
<< ctx.slot() << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "created EventContext, num: " << ctx.evt() << " in slot: "
<< ctx.slot() << endmsg;
}
}
return ctx;
......@@ -1222,17 +1237,23 @@ AthenaHiveEventLoopMgr::drainScheduler(int& finishedEvts){
EventContext* finishedEvtContext(nullptr);
// Here we wait not to loose cpu resources
debug() << "drainScheduler: [" << finishedEvts << "] Waiting for a context" << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "drainScheduler: [" << finishedEvts << "] Waiting for a context" << endmsg;
}
sc = m_schedulerSvc->popFinishedEvent(finishedEvtContext);
// We got past it: cache the pointer
if (sc.isSuccess()){
debug() << "drainScheduler: scheduler not empty: Context "
<< finishedEvtContext << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "drainScheduler: scheduler not empty: Context "
<< finishedEvtContext << endmsg;
}
finishedEvtContexts.push_back(finishedEvtContext);
} else{
// no more events left in scheduler to be drained
debug() << "drainScheduler: scheduler empty" << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "drainScheduler: scheduler empty" << endmsg;
}
return 0;
}
......@@ -1280,9 +1301,11 @@ AthenaHiveEventLoopMgr::drainScheduler(int& finishedEvts){
Gaudi::Hive::setCurrentContext( *thisFinishedEvtContext );
m_incidentSvc->fireIncident(Incident(name(), IncidentType::EndProcessing, *thisFinishedEvtContext ));
debug() << "Clearing slot " << thisFinishedEvtContext->slot()
<< " (event " << thisFinishedEvtContext->evt()
<< ") of the whiteboard" << endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "Clearing slot " << thisFinishedEvtContext->slot()
<< " (event " << thisFinishedEvtContext->evt()
<< ") of the whiteboard" << endmsg;
}
StatusCode sc = clearWBSlot(thisFinishedEvtContext->slot());
if (!sc.isSuccess()) {
......@@ -1321,8 +1344,10 @@ AthenaHiveEventLoopMgr::drainScheduler(int& finishedEvts){
}
}
debug() << "drainScheduler thisFinishedEvtContext: " << thisFinishedEvtContext
<< endmsg;
if (msgLevel(MSG::DEBUG)) {
debug() << "drainScheduler thisFinishedEvtContext: " << thisFinishedEvtContext
<< endmsg;
}
delete thisFinishedEvtContext;
}
......
......@@ -508,20 +508,23 @@ AthSequencer::decodeNames( Gaudi::Property<std::vector<std::string>>& theNames,
}
// Print membership list
if ( result.isSuccess() && !theAlgs->empty() ) {
msg(MSG::DEBUG) << "Member list: ";
bool first = true;
for (Gaudi::Algorithm* alg : *theAlgs) {
if (first)
first = false;
else
msg() << ", ";
if ( alg->name() == System::typeinfoName(typeid(*alg)))
msg() << alg->name();
else
msg() << System::typeinfoName(typeid(*alg)) << "/" << alg->name();
if (msgLvl(MSG::DEBUG)) {
if ( result.isSuccess() && !theAlgs->empty() ) {
msg(MSG::DEBUG) << "Member list: ";
bool first = true;
for (Gaudi::Algorithm* alg : *theAlgs) {
if (first)
first = false;
else
msg() << ", ";
if ( alg->name() == System::typeinfoName(typeid(*alg)))
msg() << alg->name();
else
msg() << System::typeinfoName(typeid(*alg)) << "/" << alg->name();
}
msg(MSG::DEBUG) << endmsg;
}
msg(MSG::DEBUG) << endmsg;
}
theAlgMgr->release();
return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment