diff --git a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py index 8ff6f8b03bd5638f8c809e848ca0446f077bac17..4055d3e20dc9fba23a77326ca301a8c2fe587ffa 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonSegmentFindingConfig.py @@ -722,6 +722,9 @@ if __name__=="__main__": parser.add_argument("--run", help="Run directly from the python. If false, just stop once the pickle is written.", action="store_true") + parser.add_argument("--forceclone", help="Override default cloneability of algorithms to force them to run in parallel", + action="store_true") + args = parser.parse_args() from AthenaCommon.Configurable import Configurable @@ -757,6 +760,8 @@ if __name__=="__main__": if args.run: from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg cfg = MainServicesThreadedCfg(ConfigFlags) + msgService = cfg.getService('MessageSvc') + msgService.Format = "S:%s E:%e % F%58W%S%7W%R%T %0W%M" else: cfg=ComponentAccumulator() @@ -766,10 +771,13 @@ if __name__=="__main__": acc = MuonSegmentFindingCfg(ConfigFlags, cardinality=args.threads) cfg.merge(acc) - if args.threads>1: + if args.threads>1 and args.forceclone: + log.info('Forcing segment finding cardinality to be equal to '+str(args.threads)) # We want to force the algorithms to run in parallel (eventually the algorithm will be marked as cloneable in the source code) from GaudiHive.GaudiHiveConf import AlgResourcePool cfg.addService(AlgResourcePool( OverrideUnClonable=True ) ) + segment_finder = acc.getPrimary() + segment_finder.Cardinality=args.threads # This is a temporary fix - it should go someplace central as it replaces the functionality of addInputRename from here: # https://gitlab.cern.ch/atlas/athena/blob/master/Control/SGComps/python/AddressRemappingSvc.py @@ -792,10 +800,6 @@ if __name__=="__main__": # outstream.OutputLevel=DEBUG outstream.ForceRead = True - # Show slots & events - # msgService = cfg.getService('MessageSvc') - # msgService.Format = "S:%s E:%e % F%48W%S%7W%R%T %0W%M" - # Fix for ATLASRECTS-5151 from TrkEventCnvTools.TrkEventCnvToolsConf import Trk__EventCnvSuperTool cnvTool = Trk__EventCnvSuperTool(name = 'EventCnvSuperTool') diff --git a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py index 1bbf5bd4e03fded5697327dc75810a7b09920518..58872225c0eecc6e3e4575796ae0949f7c5ca11e 100644 --- a/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py +++ b/MuonSpectrometer/MuonConfig/python/MuonTrackBuildingConfig.py @@ -361,16 +361,19 @@ if __name__=="__main__": from argparse import ArgumentParser parser = ArgumentParser() - parser.add_argument("-t", "--threads", dest="threads", type=int, + parser.add_argument("-t", "--threads", type=int, help="number of threads", default=1) - parser.add_argument("-o", "--output", dest="output", default='newESD.pool.root', + parser.add_argument("-o", "--output", default='newESD.pool.root', help="write ESD to FILE", metavar="FILE") parser.add_argument("--run", help="Run directly from the python. If false, just stop once the pickle is written.", action="store_true") + + parser.add_argument("--forceclone", help="Override default cloneability of algorithms to force them to run in parallel", + action="store_true") - args = parser.parse_args() + args = parser.parse_args() from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=1 @@ -403,6 +406,8 @@ if __name__=="__main__": if args.run: from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg cfg = MainServicesThreadedCfg(ConfigFlags) + msgService = cfg.getService('MessageSvc') + msgService.Format = "S:%s E:%e % F%58W%S%7W%R%T %0W%M" else: cfg=ComponentAccumulator() @@ -413,7 +418,8 @@ if __name__=="__main__": acc = MuonTrackBuildingCfg(ConfigFlags) cfg.merge(acc) - if args.threads>1: + if args.threads>1 and args.forceclone: + log.info('Forcing track building cardinality to be equal to '+str(args.threads)) # We want to force the algorithms to run in parallel (eventually the algorithm will be marked as cloneable in the source code) from GaudiHive.GaudiHiveConf import AlgResourcePool cfg.addService(AlgResourcePool( OverrideUnClonable=True ) ) @@ -440,22 +446,12 @@ if __name__=="__main__": # outstream.OutputLevel=DEBUG outstream.ForceRead = True - # Show slots & events - # msgService = cfg.getService('MessageSvc') - # msgService.Format = "S:%s E:%e % F%48W%S%7W%R%T %0W%M" - # msgService.OutputLevel=DEBUG - # Fix for ATLASRECTS-5151 from TrkEventCnvTools.TrkEventCnvToolsConf import Trk__EventCnvSuperTool cnvTool = Trk__EventCnvSuperTool(name = 'EventCnvSuperTool') cnvTool.MuonCnvTool.FixTGCs = True cfg.addPublicTool(cnvTool) - # from MuonEventCnvTools.MuonEventCnvToolsConf import Muon__MuonEventCnvTool - # cnvTool = Muon__MuonEventCnvTool(name='MuonEventCnvTool') - # cnvTool.FixTGCs = True - # cfg.addPublicTool(cnvTool) - cfg.printConfig(withDetails = True, summariseProps = True) f=open("MuonTrackBuilding.pkl","w")