CMS 3D CMS Logo

Functions | Variables
cmsBenchmarkReader Namespace Reference

Functions

def optionParse ()
 Parses name of datafile from the arguments. More...
 
def printBenchmarkData (afile)
 (this could be cleaned up a little bit) Format of the data file should be: More...
 

Variables

 datafile
 

Function Documentation

def cmsBenchmarkReader.optionParse ( )

Parses name of datafile from the arguments.

Definition at line 8 of file cmsBenchmarkReader.py.

8 def optionParse():
9  parser = opt.OptionParser()
10  parser.add_option_group(devel)
11  (options, args) = parser.parse_args()
12 
13  if not len(args) == 1:
14  parser.error("you must only pass one file as an argument")
15  sys.exit()
16 
17  datafile = os.path.abspath(args[0])
18  if not os.path.isfile(datafile):
19  parser.error("%s file does not exist" % datafile)
20  sys.exit()
21 
22  return datafile
23 
def optionParse()
Parses name of datafile from the arguments.
def cmsBenchmarkReader.printBenchmarkData (   afile)

(this could be cleaned up a little bit) Format of the data file should be:

[ host_tuple ] # list of host data

host_tuple = ( hostname, [ command_results ]) # hostname and list of results (one for each job specification: each run)

command_results = {cpu_id: data_output} # contains a dictionary, one set of data for each cpu

For example: returned data = [ cmd_output1, cmd_output2 ... ] cmd_output1 = { cpuid1 : cpu_output1, cpuid2 : cpu_output2 ... } # cpuid is "None" if there was only one cpu used cpu_output1 = { candle1 : profset_output1, candle2 : profset_output2 ... } profset_output1 = { profset1 : profile_output1, ... } profile_output1 = { profiletype1: step_output1, ... } step_output1 = { step1: list_of_cpu_times, ... } list_of_cpu_times = [ (evt_num1, secs1), ... ]

Definition at line 43 of file cmsBenchmarkReader.py.

References harvestTrackValidationPlots.str.

43 def printBenchmarkData(afile):
44  ph = open(afile,"rb")
45  list = pickle.load(ph)
46  ph.close()
47  for host, data in list:
48  try:
49  for options, cpudata in data:
50  for cpukey in cpudata:
51  cpustr = ""
52  if cpukey == "None":
53  cpustr = "cpu: " + str(options["cpus"][0])
54  else:
55  cpustr = "cpu: " + str(cpukey)
56  candledata = cpudata[cpukey]
57  for candlekey in candledata:
58  profsetdata = candledata[candlekey]
59  for profsetkey in profsetdata:
60  profiledata = profsetdata[profsetkey]
61  for profilekey in profiledata:
62  stepdata = profiledata[profilekey]
63  for stepkey in stepdata:
64  print "Host: " + str(host)
65  print "Options: " + str(options)
66  print cpustr
67  print "candle: " + str(candlekey)
68  print "profsetdata: " + str(profsetkey)
69  print "profiler: " + str(profilekey)
70  print "step: " + str(stepkey)
71  for evtdat in stepdata[stepkey]:
72  print evtdat
73  except TypeError as detail:
74  print "Data: does not exist for this machine, the server failed to return a valid data structure"
75  print detail
76 
77 
def printBenchmarkData(afile)
(this could be cleaned up a little bit) Format of the data file should be:

Variable Documentation

cmsBenchmarkReader.datafile

Definition at line 79 of file cmsBenchmarkReader.py.