Skip to content
Snippets Groups Projects
Commit 82dcb6b2 authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'master-muon-config-add-option-for-forcing-cloneability' into 'master'

Adding new argument to control whether cardinality is overridden or not.

See merge request atlas/athena!27819
parents 4782525b 7e7da942
No related branches found
No related tags found
No related merge requests found
......@@ -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')
......
......@@ -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")
......
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