23 derivedGroup = self.parser.add_argument_group(
'Athena specific arguments')
24 derivedGroup.add_argument(
'--config-only', dest=
'config_only',
25 action=
'store_true', help=
'Only generate the configuration and save it to a pickle file')
26 derivedGroup.add_argument(
'--perfmon', dest=
'perfmon', default=
'none',
27 help=
'Run PerfMon to measure the job performance')
28 derivedGroup.add_argument(
'--pool-file-reading', dest=
'pool_file_reading',
29 action=
'store_true', help=
'Run the job with the POOL-based file reading')
30 derivedGroup.add_argument(
'--test-mt-dependencies', dest=
'test_mt_dependencies',
31 type=int, default=
None,
32 help=
'Print out multithreading dependencies, and run with the given number of threads')
36 from AthenaConfiguration.ComponentFactory
import CompFactory
37 algSeq = CompFactory.AthSequencer()
38 self.logger.info(
"Configuring algorithms based on YAML file")
40 self.logger.info(
"Configuring common services")
41 from AnalysisAlgorithmsConfig.ConfigAccumulator
import ConfigAccumulator
42 configAccumulator = ConfigAccumulator(autoconfigFromFlags=self.
flags,
44 noSystematics=self.
args.no_systematics)
45 if not self.
args.merge_output_files:
46 configAccumulator.setDefaultHistogramStream(
'ANALYSIS_HIST')
47 self.logger.info(
"Configuring algorithms")
48 configSeq.fullConfigure(configAccumulator)
50 self.modifyAlgSequence()
51 return configAccumulator.CA
63 from PerfMonComps.PerfMonConfigHelpers
import setPerfmonFlagsFromRunArgs
66 if self.
args.test_mt_dependencies
is not None:
67 self.
flags.Concurrency.NumThreads = self.
args.test_mt_dependencies
68 self.
flags.Scheduler.ShowControlFlow =
True
69 self.
flags.Scheduler.ShowDataDeps =
True
74 if self.
args.pool_file_reading:
75 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
78 from AthenaRootComps.xAODEventSelectorConfig
import xAODReadCfg
80 from EventBookkeeperTools.EventBookkeeperToolsConfig
import CutFlowSvcCfg
83 outputFile = f
"ANALYSIS DATAFILE='{self.outputName}.root' OPT='RECREATE'"
84 from AthenaConfiguration.ComponentFactory
import CompFactory
85 self.
cfg.addService(CompFactory.THistSvc(Output=[outputFile]))
86 if not self.
args.merge_output_files:
87 outputFileHist = f
"ANALYSIS_HIST DATAFILE='hist-{self.outputName}.root' OPT='RECREATE'"
88 from AthenaConfiguration.ComponentFactory
import CompFactory
89 self.
cfg.addService(CompFactory.THistSvc(Output=[outputFileHist]))
95 if self.
flags.PerfMon.doFastMonMT
or self.
flags.PerfMon.doFullMonMT:
96 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
99 self.
cfg.printConfig()
102 if self.
args.config_only:
103 with open(
"CPRunConfig.pkl",
"wb")
as f:
108 sys.exit(sc.isFailure())