CMS 3D CMS Logo

cmsBenchmark Namespace Reference


Functions

def main
def usage

Variables

list cmssw_base = os.environ["CMSSW_BASE"]
list cmssw_release_base = os.environ["CMSSW_RELEASE_BASE"]
list cmssw_version = os.environ["CMSSW_VERSION"]
list host = os.environ["HOST"]
string Script = "cmsPerfSuite.py"
list user = os.environ["USER"]


Function Documentation

def cmsBenchmark::main (   argv  ) 

Definition at line 76 of file cmsBenchmark.py.

00076               :
00077     #Some default values:
00078     #Number of cpu cores on the machine
00079     coresOption="4"
00080     cores=" --cores=4"
00081     #Cpu core(s) on which the suite is run:
00082     cpuOption=(1) #not necessary to use tuple for single cpu, but for type consistency use ().
00083     cpu=" --cpu=1"
00084     #Number of events per test (per candle/per step):
00085     numevtsOption="100"
00086     numevts=" --timesize=100"
00087     #default benchmark does not run igprof nor valgrind
00088     igprofevts=" --igprof=0"
00089     valgrindevts=" --valgrind=0"
00090     #Default option for candle is "" since, usually all 7 candles of the suite will be run!
00091     candleOption=""
00092     candle=""
00093     #Default option for step is ["GEN,SIM","DIGI","RECO"] since we don't need to profile all steps of the suite
00094     stepOption="GEN-SIM,DIGI,RECO"
00095     step=" --step="+stepOption
00096     #Default option for repeat
00097     repeatOption=1 #Use integer here since it will be used directly in the script
00098     #Let's check the command line arguments
00099     try:
00100         opts, args = getopt.getopt(argv, "n:hd", ["cpu=","cores=","numevts=","candle=","step=","repeat=","help"])
00101     except getopt.GetoptError:
00102         print "This argument option is not accepted"
00103         usage()
00104         sys.exit(2)
00105     for opt, arg in opts:
00106         if opt in ("-h", "--help"):
00107             usage()
00108             sys.exit()
00109         elif opt == '-d':
00110             global _debug
00111             _debug = 1
00112         elif opt == "--cpu":
00113             cpuOption=arg
00114             cpus=cpuOption.split(",")
00115             cpu=" --cpu="+cpuOption
00116         elif opt == "--cores":
00117             coresOption = arg
00118         elif opt in ("-n", "--numevts"):
00119             numevtsOption = arg
00120             numevts=" --timesize="+arg
00121         elif opt == "--candle":
00122             candleOption = arg
00123             candle=" --candle="+arg
00124         elif opt == "--step":
00125             stepOption = arg
00126             steps=stepOption.split(",")
00127         elif opt == "--repeat":
00128             repeatOption = int(arg)
00129     #Case with no arguments (using defaults)
00130     if opts == []:
00131         print "No arguments given, so DEFAULT test will be run:"
00132     #Print a time stamp at the beginning:
00133     import time
00134     date=time.ctime()
00135     path=os.path.abspath(".")
00136     print "CMS Benchmarking started running at %s on %s in directory %s, run by user %s" % (date,host,path,user)
00137     #showtags=os.popen4("showtags -r")[1].read()
00138     #print showtags
00139     #For the log:
00140     print "This machine (%s) is assumed to have %s cores, and the suite will be run on cpu(s) %s" %(host,coresOption,cpuOption)
00141     print "%s events per test will be run" % numevtsOption
00142     if candleOption !="":
00143         print "Running only %s candle, instead of all the candles in the performance suite" % candleOption
00144     if stepOption != "":
00145         print "Profiling only the following steps: %s" % stepOption
00146         step=" --step="+stepOption
00147         #This "unpacking" of the steps is better done in cmsPerfSuite.py or the cmsSimPyRelVal.py (.pl for now)
00148         #steps=stepOption.split(",")
00149         #cmsPerfSuiteSteps=[]
00150         #for step in steps:
00151         #    newstep=reduce(lambda a,b:a+","+b,step.split("-"))
00152         #    cmsPerfSuiteSteps.append(newstep)
00153     if repeatOption !=1:
00154         print "The benchmarking will be repeated %s times" % repeatOption
00155     #Now let's play!
00156     for repetition in range(repeatOption):
00157         mkdircdcmd="mkdir Run"+str(repetition+1)+";cd Run"+str(repetition+1)
00158         #mkdircdstdout=os.popen4(mkdircmd)[1].read()
00159         #if mkdirstdout:
00160         #    print mkdirstdout,
00161         #print "Here we'd launch cmsPerfSuite.py!"
00162         PerfSuitecmd="cmsPerfSuite.py" + cpu + cores + numevts + igprofevts + valgrindevts + candle + step + ">& cmsPerfSuiteRun" + str(repetition + 1) + ".log"
00163         launchcmd=mkdircdcmd+";"+PerfSuitecmd
00164         print launchcmd
00165         sys.stdout.flush()
00166         launchcmdstdout=os.popen4(launchcmd)[1].read()
00167         print launchcmdstdout
00168         
if __name__ == "__main__":

def cmsBenchmark::usage (  ) 

Definition at line 73 of file cmsBenchmark.py.

00073            :
00074     print __doc__
00075 
def main(argv):


Variable Documentation

list cmsBenchmark::cmssw_base = os.environ["CMSSW_BASE"] [static]

Definition at line 60 of file cmsBenchmark.py.

list cmsBenchmark::cmssw_release_base = os.environ["CMSSW_RELEASE_BASE"] [static]

Definition at line 61 of file cmsBenchmark.py.

list cmsBenchmark::cmssw_version = os.environ["CMSSW_VERSION"] [static]

Definition at line 62 of file cmsBenchmark.py.

list cmsBenchmark::host = os.environ["HOST"] [static]

Definition at line 63 of file cmsBenchmark.py.

Referenced by WebInterface::Configure(), DBInterface::DBInterface(), DQMService::DQMService(), evf::ParameterSetRetriever::getHostString(), HcalDbOnline::HcalDbOnline(), and HcalDbPoolOCCI::HcalDbPoolOCCI().

string cmsBenchmark::Script = "cmsPerfSuite.py" [static]

Definition at line 67 of file cmsBenchmark.py.

list cmsBenchmark::user = os.environ["USER"] [static]

Definition at line 64 of file cmsBenchmark.py.

Referenced by CondBasicIter::create(), DBInterface::DBInterface(), StoreEcalCondition::fillHeader(), HcalDbOnline::HcalDbOnline(), HcalDbPoolOCCI::HcalDbPoolOCCI(), IgConfigElement::initConfiguration(), VariableHelperService::set(), and SiStripConfigDb::usingDatabase().


Generated on Tue Jun 9 18:36:41 2009 for CMSSW by  doxygen 1.5.4