CMS 3D CMS Logo

Functions | Variables
cmsBenchmark Namespace Reference

Functions

def main (argv)
 
def usage ()
 

Variables

 cmssw_base
 
 cmssw_release_base
 
 cmssw_version
 
 host
 
 Script
 
 user
 

Detailed Description

Usage: ./cmsBenchmark.py [options]
   
Options:
  --cpu=...            specify the core on which to run the performance suite
  --cores=...          specify the number of cores of the machine (can be used with 0 to stop cmsScimark from running on the other cores)
  -n ..., --numevts    specify the number of events for each tests/each candle/each step
  --candle=...         specify the candle to run instead of all the 7 candles of the suite
  --step=...           specify the step to run instead of all steps of the suite
  --repeat=...         specify the number of times to re-run the whole suite
  -h, --help           show this help
  -d                   show debugging information

Legal entries for individual candles (--candle option):
HiggsZZ4LM190
MinBias
SingleElectronE1000
SingleMuMinusPt10
SinglePiMinusE1000
TTbar
QCD_80_120

Legal entries for specific tests (--step option):
GEN
SIM
DIGI
L1
DIGI2RAW
HLT
RAW2DIGI
RECO
and combinations of steps like:
GEN-SIM
L1-DIGI2RAW-HLT
DIGI2RAW-RAW2DIGI
and sequences of steps or combinations of steps like:
GEN-SIM,DIGI,L1-DIGI2RAW-RAW2DIGI,RECO
Note: when the necessary pre-steps are omitted, cmsPerfSuite.py will take care of it.

Examples:
./cmsBenchmark.py
 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).
OR
./cmsBenchmark.py --cpu=2
 This will run the test on core cpu2.
OR
./cmsBenchmark.py --cpu=0,1 --cores=8 -n 200
 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.
OR
./cmsBenchmark.py --cores=8 --repeat=10 --candle QCD_80_120 
 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.
OR 
./cmsBenchmark.py --step=GEN-SIM,DIGI,RECO
 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.

Function Documentation

def cmsBenchmark.main (   argv)

Definition at line 78 of file cmsBenchmark.py.

References createfilelist.int, edm.print(), str, and usage().

78 def main(argv):
79  #Some default values:
80  #Number of cpu cores on the machine
81  coresOption="4"
82  cores=" --cores=4"
83  #Cpu core(s) on which the suite is run:
84  cpuOption=(1) #not necessary to use tuple for single cpu, but for type consistency use ().
85  cpu=" --cpu=1"
86  #Number of events per test (per candle/per step):
87  numevtsOption="100"
88  numevts=" --timesize=100"
89  #default benchmark does not run igprof nor valgrind
90  igprofevts=" --igprof=0"
91  valgrindevts=" --valgrind=0"
92  #Default option for candle is "" since, usually all 7 candles of the suite will be run!
93  candleOption=""
94  candle=""
95  #Default option for step is ["GEN,SIM","DIGI","RECO"] since we don't need to profile all steps of the suite
96  stepOption="GEN-SIM,DIGI,RECO"
97  step=" --step="+stepOption
98  #Default option for repeat
99  repeatOption=1 #Use integer here since it will be used directly in the script
100  #Let's check the command line arguments
101  try:
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")
105  usage()
106  sys.exit(2)
107  for opt, arg in opts:
108  if opt in ("-h", "--help"):
109  usage()
110  sys.exit()
111  elif opt == '-d':
112  global _debug
113  _debug = 1
114  elif opt == "--cpu":
115  cpuOption=arg
116  cpus=cpuOption.split(",")
117  cpu=" --cpu="+cpuOption
118  elif opt == "--cores":
119  coresOption = arg
120  elif opt in ("-n", "--numevts"):
121  numevtsOption = arg
122  numevts=" --timesize="+arg
123  elif opt == "--candle":
124  candleOption = arg
125  candle=" --candle="+arg
126  elif opt == "--step":
127  stepOption = arg
128  steps=stepOption.split(",")
129  elif opt == "--repeat":
130  repeatOption = int(arg)
131  #Case with no arguments (using defaults)
132  if opts == []:
133  print("No arguments given, so DEFAULT test will be run:")
134  #Print a time stamp at the beginning:
135  import time
136  date=time.ctime()
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))
139  #showtags=os.popen4("showtags -r")[1].read()
140  #print showtags
141  #For the log:
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)
146  if stepOption != "":
147  print("Profiling only the following steps: %s" % stepOption)
148  step=" --step="+stepOption
149  #This "unpacking" of the steps is better done in cmsPerfSuite.py or the cmsSimPyRelVal.py (.pl for now)
150  #steps=stepOption.split(",")
151  #cmsPerfSuiteSteps=[]
152  #for step in steps:
153  # newstep=reduce(lambda a,b:a+","+b,step.split("-"))
154  # cmsPerfSuiteSteps.append(newstep)
155  if repeatOption !=1:
156  print("The benchmarking will be repeated %s times" % repeatOption)
157  #Now let's play!
158  for repetition in range(repeatOption):
159  mkdircdcmd="mkdir Run"+str(repetition+1)+";cd Run"+str(repetition+1)
160  #mkdircdstdout=os.popen4(mkdircmd)[1].read()
161  #if mkdirstdout:
162  # print mkdirstdout,
163  #print "Here we'd launch cmsPerfSuite.py!"
164  PerfSuitecmd="cmsPerfSuite.py" + cpu + cores + numevts + igprofevts + valgrindevts + candle + step + ">& cmsPerfSuiteRun" + str(repetition + 1) + ".log"
165  launchcmd=mkdircdcmd+";"+PerfSuitecmd
166  print(launchcmd)
167  sys.stdout.flush()
168  #Obsolete popen4-> subprocess.Popen
169  #launchcmdstdout=os.popen4(launchcmd)[1].read()
170  launchcmdstdout=Popen(launchcmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT).stdout.read()
171  print(launchcmdstdout)
172 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def main(argv)
Definition: cmsBenchmark.py:78
#define str(s)
def cmsBenchmark.usage ( )

Definition at line 75 of file cmsBenchmark.py.

References edm.print().

Referenced by main().

75 def usage():
76  print(__doc__)
77 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66

Variable Documentation

cmsBenchmark.cmssw_base
cmsBenchmark.cmssw_release_base
cmsBenchmark.cmssw_version

Definition at line 64 of file cmsBenchmark.py.

cmsBenchmark.host

Definition at line 65 of file cmsBenchmark.py.

cmsBenchmark.Script

Definition at line 69 of file cmsBenchmark.py.

cmsBenchmark.user

Definition at line 66 of file cmsBenchmark.py.