diff --git a/Control/AthenaConfiguration/python/AllConfigFlags.py b/Control/AthenaConfiguration/python/AllConfigFlags.py index c21fbda7d826bc787a8df725ddbb46e39aefa10f..1d1687c19529ec6bb0a4733d6bb7878971b77443 100644 --- a/Control/AthenaConfiguration/python/AllConfigFlags.py +++ b/Control/AthenaConfiguration/python/AllConfigFlags.py @@ -83,6 +83,7 @@ def _createCfgFlags(): acf.addFlag('Concurrency.DebugWorkers', False ) acf.addFlag('Scheduler.CheckDependencies', True) + acf.addFlag('Scheduler.CheckOutputUsage', False) acf.addFlag('Scheduler.ShowDataDeps', True) acf.addFlag('Scheduler.ShowDataFlow', True) acf.addFlag('Scheduler.ShowControlFlow', True) diff --git a/Control/AthenaConfiguration/python/MainServicesConfig.py b/Control/AthenaConfiguration/python/MainServicesConfig.py index f20c20c74b2cd51aeda4245dbdf2e20154d2cdaa..e48c3e7979fbba10945398d9b96e59ec857481a0 100644 --- a/Control/AthenaConfiguration/python/MainServicesConfig.py +++ b/Control/AthenaConfiguration/python/MainServicesConfig.py @@ -21,6 +21,27 @@ def MainServicesMiniCfg(loopMgr='AthenaEventLoopMgr', masterSequence='AthAlgSeq' return cfg +def AvalancheSchedulerSvcCfg(cfgFlags, **kwargs): + kwargs.setdefault("CheckDependencies", cfgFlags.Scheduler.CheckDependencies) + kwargs.setdefault("CheckOutputUsage", cfgFlags.Scheduler.CheckOutputUsage) + kwargs.setdefault("ShowDataDependencies", cfgFlags.Scheduler.ShowDataDeps) + kwargs.setdefault("ShowDataFlow", cfgFlags.Scheduler.ShowDataFlow) + kwargs.setdefault("ShowControlFlow", cfgFlags.Scheduler.ShowControlFlow) + kwargs.setdefault("VerboseSubSlots", cfgFlags.Scheduler.EnableVerboseViews) + kwargs.setdefault("ThreadPoolSize", cfgFlags.Concurrency.NumThreads) + + cfg = ComponentAccumulator() + cfg.addService(CompFactory.AvalancheSchedulerSvc(**kwargs), primary=True) + return cfg + + +def OutputUsageIgnoreCfg(cfgFlags, algorithm): + cfg = ComponentAccumulator() + if cfgFlags.Concurrency.NumThreads > 0 and cfgFlags.Scheduler.CheckOutputUsage: + cfg.merge(AvalancheSchedulerSvcCfg(cfgFlags, CheckOutputUsageIgnoreList=[algorithm])) + return cfg + + def AthenaEventLoopMgrCfg(cfgFlags): cfg = ComponentAccumulator() @@ -51,14 +72,7 @@ def AthenaHiveEventLoopMgrCfg(cfgFlags): arp.TopAlg = ["AthMasterSeq"] #this should enable control flow cfg.addService( arp ) - scheduler = CompFactory.AvalancheSchedulerSvc() - scheduler.CheckDependencies = cfgFlags.Scheduler.CheckDependencies - scheduler.ShowDataDependencies = cfgFlags.Scheduler.ShowDataDeps - scheduler.ShowDataFlow = cfgFlags.Scheduler.ShowDataFlow - scheduler.ShowControlFlow = cfgFlags.Scheduler.ShowControlFlow - scheduler.VerboseSubSlots = cfgFlags.Scheduler.EnableVerboseViews - scheduler.ThreadPoolSize = cfgFlags.Concurrency.NumThreads - cfg.addService(scheduler) + scheduler = cfg.getPrimaryAndMerge(AvalancheSchedulerSvcCfg(cfgFlags)) from SGComps.SGInputLoaderConfig import SGInputLoaderCfg # FailIfNoProxy=False makes it a warning, not an error, if unmet data diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py b/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py index 2b9afa36f1609a495c284c3701fda69f2a983620..cc0bbe27b176f6a68f985869f27d0e032158531d 100644 --- a/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py +++ b/Database/AthenaPOOL/OutputStreamAthenaPool/python/OutputStreamConfig.py @@ -54,12 +54,18 @@ def OutputStreamCfg(configFlags, streamName, ItemList=[], MetadataItemList=[], f"OutputStream{streamName}", StreamName=outputStreamName, WritingTool=writingTool, - ItemList = finalItemList, - MetadataItemList = MetadataItemList, + ItemList=finalItemList, + MetadataItemList=MetadataItemList, OutputFile=fileName, ) outputStream.AcceptAlgs += AcceptAlgs outputStream.ExtraOutputs += [("DataHeader", f"StoreGateSvc+{outputStreamName}")] + if configFlags.Concurrency.NumThreads > 0 and configFlags.Scheduler.CheckOutputUsage: + outputStream.ExtraInputs = [tuple(l.split('#')) for l in finalItemList if '*' not in l and 'Aux' not in l] + # Ignore dependencies + from AthenaConfiguration.MainServicesConfig import OutputUsageIgnoreCfg + result.merge(OutputUsageIgnoreCfg(configFlags, outputStream.name)) + result.addService(CompFactory.StoreGateSvc("MetaDataStore")) outputStream.MetadataStore = result.getService("MetaDataStore") outputStream.MetadataItemList += [ @@ -155,6 +161,7 @@ def OutputStreamCfg(configFlags, streamName, ItemList=[], MetadataItemList=[], result.addEventAlgo(outputStream, domain='IO') return result + def addToESD(configFlags, itemOrList, **kwargs): """ Adds items to ESD stream @@ -169,6 +176,7 @@ def addToESD(configFlags, itemOrList, **kwargs): items = [itemOrList] if isinstance(itemOrList, str) else itemOrList return OutputStreamCfg(configFlags, "ESD", ItemList=items, **kwargs) + def addToAOD(configFlags, itemOrList, **kwargs): """ Adds items to AOD stream diff --git a/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py b/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py index badfe81c57467b9acfeda051c2d8477fd863d0ca..e0cbecdcdf7afb270772696437f4f16a94ac0819 100755 --- a/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py +++ b/Simulation/BeamEffects/python/BeamEffectsAlgConfig.py @@ -160,6 +160,11 @@ def BeamSpotReweightingAlgCfg(flags, name="BeamSpotReweightingAlg", **kwargs): kwargs.setdefault("Input_beam_sigma_z", flags.Digitization.InputBeamSigmaZ) acc.addEventAlgo(CompFactory.Simulation.BeamSpotReweightingAlg(name, **kwargs)) + + # Ignore dependencies + from AthenaConfiguration.MainServicesConfig import OutputUsageIgnoreCfg + acc.merge(OutputUsageIgnoreCfg(flags, name)) + return acc diff --git a/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py b/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py index 87d937ec35c1a01193b74aaa55e569ce37f1685b..ab57de11585f8c0e0848243f1c20fb9287ddc3fe 100755 --- a/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py +++ b/Simulation/Overlay/OverlayConfiguration/test/OverlayTest.py @@ -42,6 +42,7 @@ if args.profile: ConfigFlags.Scheduler.AutoLoadUnmetDependencies = False if args.dependencies: ConfigFlags.Input.FailOnUnknownCollections = True + ConfigFlags.Scheduler.CheckOutputUsage = True print("Checking dependencies...") print() @@ -65,11 +66,6 @@ if ConfigFlags.Overlay.DataOverlay: if ConfigFlags.Concurrency.NumThreads > 0: acc.getService("AlgResourcePool").CountAlgorithmInstanceMisses = True -# Dependency check -if args.dependencies: - acc.getEventAlgo("OutputStreamRDO").ExtraInputs += [tuple(l.split('#')) for l in acc.getEventAlgo("OutputStreamRDO").ItemList if '*' not in l and 'Aux' not in l] - acc.getService("AthenaHiveEventLoopMgr").DependencyCheck = True - # dump pickle with open("ConfigOverlay.pkl", "wb") as f: acc.store(f)