CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
cmsBenchmarkReader Namespace Reference

Functions

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

Variables

tuple datafile = optionParse()
 

Function Documentation

def cmsBenchmarkReader.optionParse ( )

Parses name of datafile from the arguments.

Definition at line 8 of file cmsBenchmarkReader.py.

8 
9 def optionParse():
10  parser = opt.OptionParser()
11  parser.add_option_group(devel)
12  (options, args) = parser.parse_args()
13 
14  if not len(args) == 1:
15  parser.error("you must only pass one file as an argument")
16  sys.exit()
17 
18  datafile = os.path.abspath(args[0])
19  if not os.path.isfile(datafile):
20  parser.error("%s file does not exist" % datafile)
21  sys.exit()
22 
23  return datafile
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.

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

Variable Documentation

tuple cmsBenchmarkReader.datafile = optionParse()

Definition at line 79 of file cmsBenchmarkReader.py.