3 Usage: ./cmsBenchmark.py [options] 6 --cpu=... specify the core on which to run the performance suite 7 --cores=... specify the number of cores of the machine (can be used with 0 to stop cmsScimark from running on the other cores) 8 -n ..., --numevts specify the number of events for each tests/each candle/each step 9 --candle=... specify the candle to run instead of all the 7 candles of the suite 10 --step=... specify the step to run instead of all steps of the suite 11 --repeat=... specify the number of times to re-run the whole suite 12 -h, --help show this help 13 -d show debugging information 15 Legal entries for individual candles (--candle option): 24 Legal entries for specific tests (--step option): 33 and combinations of steps like: 37 and sequences of steps or combinations of steps like: 38 GEN-SIM,DIGI,L1-DIGI2RAW-RAW2DIGI,RECO 39 Note: when the necessary pre-steps are omitted, cmsPerfSuite.py will take care of it. 43 This will run with the default options --cpu=1, --cores=4, --numevts=100, --step=GEN-SIM,DIGI,RECO --repeat=1 (Note: all results will be reported in a directory called Run1). 45 ./cmsBenchmark.py --cpu=2 46 This will run the test on core cpu2. 48 ./cmsBenchmark.py --cpu=0,1 --cores=8 -n 200 49 This will run the suite with 200 events for all tests/candles/step, on cores cpu0 and cpu1 simulataneously, while running the cmsScimark benchmarks on the other 6 cores. 51 ./cmsBenchmark.py --cores=8 --repeat=10 --candle QCD_80_120 52 This will run the performance tests only on candle QCD_80_120, running 100 evts for all steps, and it will repeat these tests 10 times, saving the results in 10 separate directories (each called RunN, with N=1,..,10) to check for systematic/statistical uncertainties. Note that by default --repeat=1, so all results will be in a directory called Run1. 54 ./cmsBenchmark.py --step=GEN-SIM,DIGI,RECO 55 This will run the performance tests only for the steps "GEN,SIM" (at once), "DIGI" and "RECO" taking care of running the necessary intermediate steps to make sure all steps can be run. 58 from __future__
import print_function
59 from builtins
import range
62 cmssw_base=os.environ[
"CMSSW_BASE"]
63 cmssw_release_base=os.environ[
"CMSSW_RELEASE_BASE"]
64 cmssw_version=os.environ[
"CMSSW_VERSION"]
65 host=os.environ[
"HOST"]
66 user=os.environ[
"USER"]
69 Script=
"cmsPerfSuite.py" 88 numevts=
" --timesize=100" 90 igprofevts=
" --igprof=0" 91 valgrindevts=
" --valgrind=0" 96 stepOption=
"GEN-SIM,DIGI,RECO" 97 step=
" --step="+stepOption
102 opts, args = getopt.getopt(argv,
"n:hd", [
"cpu=",
"cores=",
"numevts=",
"candle=",
"step=",
"repeat=",
"help"])
103 except getopt.GetoptError:
104 print(
"This argument option is not accepted")
107 for opt, arg
in opts:
108 if opt
in (
"-h",
"--help"):
116 cpus=cpuOption.split(
",")
117 cpu=
" --cpu="+cpuOption
118 elif opt ==
"--cores":
120 elif opt
in (
"-n",
"--numevts"):
122 numevts=
" --timesize="+arg
123 elif opt ==
"--candle":
125 candle=
" --candle="+arg
126 elif opt ==
"--step":
128 steps=stepOption.split(
",")
129 elif opt ==
"--repeat":
130 repeatOption =
int(arg)
133 print(
"No arguments given, so DEFAULT test will be run:")
137 path=os.path.abspath(
".")
138 print(
"CMS Benchmarking started running at %s on %s in directory %s, run by user %s" % (date,host,path,user))
142 print(
"This machine (%s) is assumed to have %s cores, and the suite will be run on cpu(s) %s" %(host,coresOption,cpuOption))
143 print(
"%s events per test will be run" % numevtsOption)
144 if candleOption !=
"":
145 print(
"Running only %s candle, instead of all the candles in the performance suite" % candleOption)
147 print(
"Profiling only the following steps: %s" % stepOption)
148 step=
" --step="+stepOption
156 print(
"The benchmarking will be repeated %s times" % repeatOption)
158 for repetition
in range(repeatOption):
159 mkdircdcmd=
"mkdir Run"+
str(repetition+1)+
";cd Run"+
str(repetition+1)
164 PerfSuitecmd=
"cmsPerfSuite.py" + cpu + cores + numevts + igprofevts + valgrindevts + candle + step +
">& cmsPerfSuiteRun" +
str(repetition + 1) +
".log" 165 launchcmd=mkdircdcmd+
";"+PerfSuitecmd
170 launchcmdstdout=Popen(launchcmd,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT).stdout.read()
171 print(launchcmdstdout)
173 if __name__ ==
"__main__":
S & print(S &os, JobReport::InputFile const &f)