CMS 3D CMS Logo

Functions | Variables

cmsBenchmarkReader Namespace Reference

Functions

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

Variables

tuple datafile = optionParse()

Function Documentation

def cmsBenchmarkReader::optionParse ( )

Parses name of datafile from the arguments.

Definition at line 8 of file cmsBenchmarkReader.py.

00009                  :
00010     parser = opt.OptionParser()
00011     parser.add_option_group(devel)
00012     (options, args) = parser.parse_args()
00013 
00014     if not len(args) == 1:
00015         parser.error("you must only pass one file as an argument")
00016         sys.exit()
00017 
00018     datafile = os.path.abspath(args[0])
00019     if not os.path.isfile(datafile):
00020         parser.error("%s file does not exist" % datafile)
00021         sys.exit()
00022         
00023     return datafile

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.

00044                              :
00045     ph = open(afile,"rb")
00046     list = pickle.load(ph)
00047     ph.close()
00048     for host, data in list:
00049         try:
00050             for options, cpudata in data:
00051                 for cpukey in cpudata:
00052                     cpustr = ""
00053                     if cpukey == "None":
00054                         cpustr = "cpu: " + str(options["cpus"][0])
00055                     else:
00056                         cpustr = "cpu: " + str(cpukey)
00057                     candledata = cpudata[cpukey] 
00058                     for candlekey in candledata:
00059                         profsetdata = candledata[candlekey] 
00060                         for profsetkey in profsetdata:
00061                             profiledata = profsetdata[profsetkey]
00062                             for profilekey in profiledata:
00063                                 stepdata = profiledata[profilekey] 
00064                                 for stepkey in stepdata:
00065                                     print "Host: " + str(host)
00066                                     print "Options: " + str(options)
00067                                     print cpustr
00068                                     print "candle: " + str(candlekey)
00069                                     print "profsetdata: " + str(profsetkey)                                
00070                                     print "profiler: " + str(profilekey)                                
00071                                     print "step: " + str(stepkey)
00072                                     for evtdat in stepdata[stepkey]:
00073                                         print evtdat
00074         except TypeError, detail:
00075             print "Data: does not exist for this machine, the server failed to return a valid data structure"
00076             print detail
00077 


Variable Documentation

tuple cmsBenchmarkReader::datafile = optionParse()

Definition at line 79 of file cmsBenchmarkReader.py.