diff --git a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py index 22d94e6297d2828167d3160a4f886eada2bffb70..a4462f1119d707877db3b06ad8ee7ec3d811a2fd 100644 --- a/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py +++ b/Reconstruction/RecJobTransforms/share/skeleton.RDOtoRDOtrigger.py @@ -113,6 +113,8 @@ if TriggerFlags.doMT(): log.info("configuring MT Trigger") TriggerFlags.triggerMenuSetup = "LS2_v1" + from AthenaConfiguration.AllConfigFlags import ConfigFlags + ConfigFlags.Trigger.CostMonitoring.doCostMonitoring = True from AthenaCommon.AlgScheduler import AlgScheduler AlgScheduler.CheckDependencies( True ) @@ -148,7 +150,6 @@ if TriggerFlags.doMT(): from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=True from TriggerJobOpts.TriggerConfig import triggerIDCCacheCreatorsCfg - from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.lock() triggerIDCCacheCreatorsCfg(ConfigFlags).appendToGlobals() Configurable.configurableRun3Behavior=False @@ -179,8 +180,10 @@ if TriggerFlags.doMT(): from TriggerJobOpts.HLTTriggerGetter import setTHistSvcOutput setTHistSvcOutput(svcMgr.THistSvc.Output) - - + #------------------------------------------------------------- + # Non-ComponentAccumulator Cost Monitoring + #------------------------------------------------------------- + include("TrigCostMonitorMT/TrigCostMonitorMT_jobOptions.py") if rec.doFileMetaData(): from RecExConfig.ObjKeyStore import objKeyStore diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt b/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt index 7371bf87663058ca4fc7de96acaf7ed41c2b48fd..0baf431770664fb8f7713e14dd9736f232b04937 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt +++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/CMakeLists.txt @@ -28,3 +28,4 @@ atlas_add_component( TrigCostMonitorMT # Install files from the package: atlas_install_headers( TrigCostMonitorMT ) atlas_install_python_modules( python/*.py) + atlas_install_joboptions( share/*.py ) diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/share/TrigCostMonitorMT_jobOptions.py b/Trigger/TrigMonitoring/TrigCostMonitorMT/share/TrigCostMonitorMT_jobOptions.py new file mode 100644 index 0000000000000000000000000000000000000000..176ac51520ae0dbba60e83fa1a46dbb0e8df47d7 --- /dev/null +++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/share/TrigCostMonitorMT_jobOptions.py @@ -0,0 +1,25 @@ +# +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# + +""" +Non-Component Accumulator based configuration of Trigger Cost MT Service and associated Auditor +Prefer the use of TrigCostMonitorMT.TrigCostMonitorMTConfig, if possible +""" + +from AthenaCommon.AppMgr import ServiceMgr +from AthenaCommon.AppMgr import theApp +from GaudiSvc.GaudiSvcConf import AuditorSvc +from TrigCostMonitorMT.TrigCostMonitorMTConf import TrigCostMTAuditor, TrigCostMTSvc +from AthenaConfiguration.AllConfigFlags import ConfigFlags + +if ConfigFlags.Trigger.CostMonitoring.doCostMonitoring: + trigCostService = TrigCostMTSvc() + trigCostService.MonitorAllEvents = True + trigCostService.SaveHashes = True # This option will go away once the TrigConfigSvc is fully up & running + ServiceMgr += trigCostService + + if not hasattr(ServiceMgr, "AuditorSvc"): + ServiceMgr += AuditorSvc() + ServiceMgr.AuditorSvc += TrigCostMTAuditor() + theApp.AuditAlgorithms=True diff --git a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx index d779b707614f54d4436327af97ef56cddd734b3a..0ad970083cb8b4048817764ba9bade0a17b8460b 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx +++ b/Trigger/TrigMonitoring/TrigCostMonitorMT/src/TrigCostMTSvc.cxx @@ -61,7 +61,10 @@ StatusCode TrigCostMTSvc::initialize() { StatusCode TrigCostMTSvc::finalize() { ATH_MSG_DEBUG("TrigCostMTSvc finalize()"); - if (m_saveHashes) TrigConf::HLTUtils::hashes2file(); + if (m_saveHashes) { + TrigConf::HLTUtils::hashes2file(); + ATH_MSG_INFO("Calling hashes2file, saving dump of job's HLT hashing dictionary to disk."); + } return StatusCode::SUCCESS; } @@ -172,6 +175,10 @@ StatusCode TrigCostMTSvc::endEvent(const EventContext& context, SG::WriteHandle< return StatusCode::SUCCESS; } + // As we will miss the AuditType::After of the DecisionSummaryMakerAlg (which is calling this TrigCostMTSvc::endEvent), let's add it now. + // This will be our canonical final timestamps for measuring this event. Similar was done for L1Decoder at the start + ATH_CHECK(processAlg(context, m_decisionSummaryMakerAlgName, AuditType::After)); + // Reset eventMonitored flags m_eventMonitored[ context.slot() ] = false; @@ -201,22 +208,13 @@ StatusCode TrigCostMTSvc::endEvent(const EventContext& context, SG::WriteHandle< { tbb::concurrent_hash_map::const_accessor stopTimeAcessor; if (m_algStopTime.retrieve(ai, stopTimeAcessor).isFailure()) { - if (ai.m_caller == m_decisionSummaryMakerAlgName) { - // TrigCostMTSvc::endEvent is called by the DecisionSummaryMakerAlg. So we don't expect to find an end time for this alg. - // But also, "right now" is an appropriate stop time for this alg. So we keep gotStopTime=true and use the TrigTimeStamp initialised to "now". - TrigTimeStamp now; - stopTime = now.microsecondsSinceEpoch(); - ATH_MSG_DEBUG("Setting stop time of '" << m_decisionSummaryMakerAlgName << "' to 'now' (" << stopTime << ")"); - } else { - ATH_MSG_DEBUG("No end time for '" << ai.m_caller << "', '" << ai.m_store << "'"); - } + ATH_MSG_DEBUG("No end time for '" << ai.m_caller << "', '" << ai.m_store << "'"); } else { // retrieve was a success stopTime = stopTimeAcessor->second.microsecondsSinceEpoch(); } // stopTimeAcessor goes out of scope - lock released } - // Make a new TrigComposite to persist monitoring payload for this alg xAOD::TrigComposite* tc = new xAOD::TrigComposite(); outputHandle->push_back( tc ); diff --git a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py index d0277360b868b6c4922418ef5b3ab7e3b6d98f15..5da3e4e3c5dd99b3d16e76b65034da03773db8ab 100644 --- a/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py +++ b/Trigger/TriggerCommon/TriggerJobOpts/share/runHLT_standalone.py @@ -218,12 +218,6 @@ else: # More data modifiers 'forceTileRODMap', ] -#make some more common trig cost operations easier to setup -if opt.enableCostD3PD: - enableCostMonitoring = True # This goes without saying! - enableCostForCAF = True # This sets the cost mon to monitor every event and always export the data. - - TriggerFlags.doID = opt.doID TriggerFlags.doMuon = opt.doMuon TriggerFlags.doCalo = opt.doCalo @@ -581,18 +575,7 @@ if opt.doWriteBS or opt.doWriteRDOTrigger: #------------------------------------------------------------- # Non-ComponentAccumulator Cost Monitoring #------------------------------------------------------------- -from AthenaCommon.AppMgr import ServiceMgr -from TrigCostMonitorMT.TrigCostMonitorMTConf import TrigCostMTAuditor, TrigCostMTSvc - -# This should be temporary, it is doing the same job as TrigCostMonitorMTConfig but without using a ComponentAccumulator -if ConfigFlags.Trigger.CostMonitoring.doCostMonitoring: - trigCostService = TrigCostMTSvc() - trigCostService.MonitorAllEvents = ConfigFlags.Trigger.CostMonitoring.monitorAllEvents - trigCostService.SaveHashes = True # This option will go away once the TrigConfigSvc is fully up & running - ServiceMgr += trigCostService - # - ServiceMgr.AuditorSvc += TrigCostMTAuditor() - theApp.AuditAlgorithms=True +include("TrigCostMonitorMT/TrigCostMonitorMT_jobOptions.py") #------------------------------------------------------------- # Debugging for view cross-dependencies