def setupCommonServices(): from AthenaCommon import CfgMgr from AthenaCommon.Logging import logging from AthenaCommon.Constants import INFO from AthenaCommon.AppMgr import ServiceMgr as svcMgr, theApp from AthenaCommon.ConcurrencyFlags import jobproperties as jps # Setup messaging for Python and C++ from AthenaCommon.Logging import log log.setFormat("%(asctime)s Py:%(name)-31s %(levelname)7s %(message)s") # Create our own logger log = logging.getLogger('TriggerUnixStandardSetup::setupCommonServices:') from TrigServices.TrigServicesConfig import setupMessageSvc setupMessageSvc() # Do the default Atlas job configuration first import AthenaCommon.AtlasUnixStandardJob # noqa: F401 # Now do HLT/thread specific configuration (see e.g. AtlasThreadedJob.py) from StoreGate.StoreGateConf import SG__HiveMgrSvc svcMgr += SG__HiveMgrSvc("EventDataSvc", NSlots=jps.ConcurrencyFlags.NumConcurrentEvents()) import StoreGate.StoreGateConf as StoreGateConf svcMgr += StoreGateConf.StoreGateSvc("ConditionStore") # Configure the CoreDumpSvc if not hasattr(svcMgr, "CoreDumpSvc"): from AthenaServices.Configurables import CoreDumpSvc svcMgr += CoreDumpSvc() # ThreadPoolService thread local initialization from GaudiHive.GaudiHiveConf import ThreadPoolSvc svcMgr += ThreadPoolSvc("ThreadPoolSvc") svcMgr.ThreadPoolSvc.ThreadInitTools = ["ThreadInitTool"] from GaudiHive.GaudiHiveConf import AlgResourcePool svcMgr += AlgResourcePool(OutputLevel=INFO, TopAlg=["AthSequencer/AthMasterSeq"]) from AthenaCommon.AlgSequence import AlgSequence from SGComps.SGCompsConf import SGInputLoader topSequence = AlgSequence() topSequence += SGInputLoader( FailIfNoProxy=False) # change to True eventually from AthenaCommon.AlgScheduler import AlgScheduler AlgScheduler.ShowDataDependencies(False) AlgScheduler.ShowControlFlow(False) AlgScheduler.setDataLoaderAlg('SGInputLoader') # Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute theApp.AuditAlgorithms = True from SGComps.SGCompsConf import SGCommitAuditor svcMgr.AuditorSvc += SGCommitAuditor() # setup ROOT6 from PyUtils.Helpers import ROOT6Setup ROOT6Setup() # Setup online THistSvc unless specifically configured otherwise # setup the THistSvc early and force the creation of the THistSvc # so that it can be used by infrastructure services to book histograms # (to avoid problems e.g. with histograms in ROBDataProviderSvc) if _Conf.useOnlineTHistSvc: if hasattr(svcMgr, 'THistSvc'): log.fatal( "The offline histogramming THistSvc is already in place.") raise RuntimeError( "Cannot setup online histogramming TrigMonTHistSvc") log.debug("Using online histogramming service (TrigMonTHistSvc)") from TrigServices.TrigServicesConf import TrigMonTHistSvc svcMgr += TrigMonTHistSvc("THistSvc") else: log.debug("Using offline histogramming service (THistSvc)") from GaudiSvc.GaudiSvcConf import THistSvc svcMgr += THistSvc() # StoreGateSvc svcMgr.StoreGateSvc.ActivateHistory = False # ProxyProviderSvc services configuration svcMgr += CfgMgr.ProxyProviderSvc() # --- ByteStreamAddressProviderSvc configuration svcMgr += CfgMgr.ByteStreamAddressProviderSvc() svcMgr.ProxyProviderSvc.ProviderNames += ["ByteStreamAddressProviderSvc"] theApp.CreateSvc += [svcMgr.ByteStreamAddressProviderSvc.getFullName()] # Initialization of DetDescrCnvSvc svcMgr += CfgMgr.DetDescrCnvSvc( # specify primary Identifier dictionary to be used IdDictName="IdDictParser/ATLAS_IDS.xml") theApp.CreateSvc += [svcMgr.DetDescrCnvSvc.getFullName()] svcMgr.EventPersistencySvc.CnvServices += ["DetDescrCnvSvc"] # Online services for ByteStream input/output from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConf import TrigEventSelectorByteStream from TrigByteStreamCnvSvc.TrigByteStreamCnvSvcConfig import TrigByteStreamInputSvc, TrigByteStreamCnvSvc svcMgr += TrigByteStreamCnvSvc( "ByteStreamCnvSvc") # this name is hard-coded in some converters svcMgr.EventPersistencySvc.CnvServices += ["ByteStreamCnvSvc"] svcMgr += TrigByteStreamInputSvc("ByteStreamInputSvc") svcMgr += TrigEventSelectorByteStream( "EventSelector", ByteStreamInputSvc=svcMgr.ByteStreamInputSvc) theApp.EvtSel = "EventSelector" # Online event loop manager from TrigServices.TrigServicesConfig import HltEventLoopMgr loopMgr = HltEventLoopMgr("HltEventLoopMgr") loopMgr.WhiteboardSvc = "EventDataSvc" loopMgr.SchedulerSvc = AlgScheduler.getScheduler().getName() loopMgr.EvtSel = svcMgr.EventSelector loopMgr.OutputCnvSvc = svcMgr.ByteStreamCnvSvc svcMgr += loopMgr theApp.EventLoop = loopMgr.name() from TrigOutputHandling.TrigOutputHandlingConfig import HLTResultMTMakerCfg svcMgr.HltEventLoopMgr.ResultMaker = HLTResultMTMakerCfg() # Configuration of Interval of Validity Service svcMgr += CfgMgr.IOVSvc() # Configure COOL update helper tool from TrigServices.TrigServicesConfig import TrigCOOLUpdateHelper svcMgr.HltEventLoopMgr.CoolUpdateTool = TrigCOOLUpdateHelper() # Configure the online ROB data provider service from TrigServices.TrigServicesConfig import HltROBDataProviderSvc svcMgr += HltROBDataProviderSvc() # Explicitly set a few OutputLevels (needed because some services are created in # different order when running with the PSC) svcMgr.IncidentSvc.OutputLevel = theApp.OutputLevel svcMgr.ProxyProviderSvc.OutputLevel = theApp.OutputLevel svcMgr.StoreGateSvc.OutputLevel = theApp.OutputLevel return
from StoreGate.StoreGateConf import SG__HiveMgrSvc svcMgr += SG__HiveMgrSvc("EventDataSvc") svcMgr.EventDataSvc.NSlots = numStores #svcMgr.ForwardSchedulerSvc.AlgosDependencies = [[],['8000/WriteData'],[],[]] from AthenaCommon.AlgScheduler import AlgScheduler AlgScheduler.setThreadPoolSize(1) svcMgr += AthenaHiveEventLoopMgr() svcMgr.AthenaHiveEventLoopMgr.WhiteboardSvc = "EventDataSvc" svcMgr.AthenaHiveEventLoopMgr.OutputLevel = DEBUG svcMgr.AthenaHiveEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler( ).getName() from StoreGate.StoreGateConf import SG__HiveMgrSvc svcMgr += SG__HiveMgrSvc("EventDataSvc") svcMgr.EventDataSvc.NSlots = numStores svcMgr.EventDataSvc.OutputLevel = DEBUG from StoreGate.StoreGateConf import StoreGateSvc svcMgr += StoreGateSvc() svcMgr.StoreGateSvc.OutputLevel = VERBOSE svcMgr.StoreGateSvc.Dump = True from StoreGate.StoreGateConf import SGImplSvc
allViewAlgorithms.StopOverride = False makeViewSequence = AthSequencer( "makeViewSequence" ) makeViewSequence.ModeOR = False makeViewSequence.Sequential = True makeViewSequence.StopOverride = False # Event-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() # Make views makeViewSequence += CfgMgr.AthViews__ViewSubgraphAlg("make_alg") makeViewSequence.make_alg.ViewBaseName = "view" makeViewSequence.make_alg.ViewNumber = 10 makeViewSequence.make_alg.ViewNodeName = "allViewAlgorithms" makeViewSequence.make_alg.Scheduler = AlgScheduler.getScheduler() # View algorithm ViewTest = CfgMgr.AthViews__ViewTestAlg("view_test") allViewAlgorithms += ViewTest # Add the view algorithms to the job makeViewSequence += allViewAlgorithms job += makeViewSequence #-------------------------------------------------------------- # Event related parameters #-------------------------------------------------------------- theApp.EvtMax = 10
makeViewSequence = AthSequencer("makeViewSequence") makeViewSequence.ModeOR = False makeViewSequence.Sequential = True makeViewSequence.StopOverride = False # Event-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() # Make views makeViewSequence += CfgMgr.AthViews__ViewSubgraphAlg("make_alg") makeViewSequence.make_alg.ViewBaseName = "view" makeViewSequence.make_alg.ViewNumber = 10 makeViewSequence.make_alg.ViewNodeName = l1ViewAlgorithms.name() makeViewSequence.make_alg.Scheduler = AlgScheduler.getScheduler() # View algorithms ViewTest = CfgMgr.AthViews__ViewTestAlg("view_test") l1ViewAlgorithms += ViewTest # l1ViewAlgorithms += CfgMgr.AthViews__ViewSubgraphAlg("nest_alg") l1ViewAlgorithms.nest_alg.ViewBaseName = "viewView" l1ViewAlgorithms.nest_alg.ViewNumber = 10 l1ViewAlgorithms.nest_alg.ViewNodeName = l2ViewAlgorithms.name() l1ViewAlgorithms.nest_alg.Scheduler = AlgScheduler.getScheduler() # ViewViewTest = CfgMgr.AthViews__ViewTestAlg("viewView_test") l2ViewAlgorithms += ViewViewTest # Add the view algorithms to the job
def _setupAtlasThreadedJob(): from AthenaCommon.AppMgr import theApp from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon import Constants from AthenaCommon.ConcurrencyFlags import jobproperties as jps if (jps.ConcurrencyFlags.NumProcs() == 0): theApp.MessageSvcType = "InertMessageSvc" else: # InertMessageSvc doesn't play nice with MP theApp.MessageSvcType = "MessageSvc" svcMgr.MessageSvc.defaultLimit = 0 svcMgr.MessageSvc.Format = "% F%40W%S%4W%R%e%s%8W%R%T %0W%M" numStores = jps.ConcurrencyFlags.NumConcurrentEvents() from StoreGate.StoreGateConf import SG__HiveMgrSvc svcMgr += SG__HiveMgrSvc("EventDataSvc") svcMgr.EventDataSvc.NSlots = numStores from GaudiHive.GaudiHiveConf import AlgResourcePool arp = AlgResourcePool(OutputLevel=Constants.INFO) arp.TopAlg = ["AthMasterSeq"] #this should enable control flow svcMgr += arp from AthenaCommon.AlgScheduler import AlgScheduler AlgScheduler.ShowDataDependencies(False) AlgScheduler.ShowControlFlow(False) from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() from SGComps.SGCompsConf import SGInputLoader # FailIfNoProxy=False makes it a warning, not an error, if unmet data # dependencies are not found in the store. It should probably be changed # to True eventually. topSequence += SGInputLoader(FailIfNoProxy=False) AlgScheduler.setDataLoaderAlg('SGInputLoader') if theApp._opts.mtes: # Multi-threaded Event Service from AthenaServices.AthenaServicesConf import AthenaMtesEventLoopMgr svcMgr += AthenaMtesEventLoopMgr() svcMgr.AthenaMtesEventLoopMgr.WhiteboardSvc = "EventDataSvc" svcMgr.AthenaMtesEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler( ).getName() svcMgr.AthenaMtesEventLoopMgr.EventRangeChannel = theApp._opts.mtes_channel theApp.EventLoop = "AthenaMtesEventLoopMgr" else: from AthenaServices.AthenaServicesConf import AthenaHiveEventLoopMgr svcMgr += AthenaHiveEventLoopMgr() svcMgr.AthenaHiveEventLoopMgr.WhiteboardSvc = "EventDataSvc" svcMgr.AthenaHiveEventLoopMgr.SchedulerSvc = AlgScheduler.getScheduler( ).getName() theApp.EventLoop = "AthenaHiveEventLoopMgr" # enable timeline recording from GaudiHive.GaudiHiveConf import TimelineSvc svcMgr += TimelineSvc(RecordTimeline=True, Partial=False) # ## Setup SGCommitAuditor to sweep new DataObjects at end of Alg execute # theAuditorSvc = svcMgr.AuditorSvc theApp.AuditAlgorithms = True from SGComps.SGCompsConf import SGCommitAuditor theAuditorSvc += SGCommitAuditor()
viewSequence.ModeOR = False viewSequence.Sequential = True viewSequence.StopOverride = False # Event-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() # Make views view_make_1 = CfgMgr.AthViews__ViewSubgraphAlg("view_make_1") view_make_1.ViewBaseName = "view_1" view_make_1.ViewStart = "view_data_1" view_make_1.ViewNumber = totalViews view_make_1.AllViews = "view_collection_1" view_make_1.ViewNodeName = view_1.name() view_make_1.Scheduler = AlgScheduler.getScheduler() viewSequence += view_make_1 # View 1 algorithm view_verify_1 = CfgMgr.AthViews__ViewDataVerifier("view_verify_1") view_verify_1.DataObjects = [ ('int','view_data_1') ] view_1 += view_verify_1 # Add the view node to the job viewSequence += view_1 # Make child views view_make_2 = CfgMgr.AthViews__ViewSubgraphAlg("view_make_2") view_make_2.ViewBaseName = "view_2" view_make_2.ViewStart = "view_data_2" view_make_2.ViewNumber = totalViews
allViewAlgorithms.StopOverride = False makeViewSequence = AthSequencer("makeViewSequence") makeViewSequence.ModeOR = False makeViewSequence.Sequential = True makeViewSequence.StopOverride = False # Event-level algorithm sequence from AthenaCommon.AlgSequence import AlgSequence job = AlgSequence() # Make views DigiSetup = CfgMgr.AthViews__DigiDemoSetupAlg("digi_setup") DigiSetup.ViewBaseName = "view" DigiSetup.ViewNumber = 10 DigiSetup.ViewNodeName = "allViewAlgorithms" DigiSetup.Scheduler = AlgScheduler.getScheduler() DigiSetup.DigiStore = DigiStore DigiSetup.DigiData = "dflow_ints" makeViewSequence += DigiSetup # View algorithms run transparently in the digi store events ViewTest = CfgMgr.AthViews__ViewTestAlg("view_test") allViewAlgorithms += ViewTest # Add the view algorithms to the job makeViewSequence += allViewAlgorithms # Merge data from many digi store events DigiMerge = CfgMgr.AthViews__ViewMergeAlg("digi_merge") makeViewSequence += DigiMerge