2 from cmsPerfCommons
import Candles, CandFname
4 import cmsPerfRegress
as cpr
5 import sys, os, glob, re
7 _PROG_NAME = os.path.basename(sys.argv[0])
13 parser = opt.OptionParser(usage=
"""./%s [perf dir] [options]""" % _PROG_NAME)
15 (options, args) = parser.parse_args()
17 if not len(args) == 1:
18 parser.error(
"You have not supplied a perfsuite directory.")
21 args[0] = os.path.abspath(args[0])
26 if not os.path.isdir(args[0]):
27 parser.error(
"You have not provided a valid perfsuite output directory")
40 globpath = os.path.join(profsetdir,
"%s_*_TimingReport.log" % CandFname[candle])
41 globs = glob.glob(globpath)
43 stepreg = re.compile(
"%s_([^_]*)_TimingReport.log" % CandFname[candle])
45 base = os.path.basename(globule)
46 found = stepreg.search(base)
48 step = found.groups()[0]
51 print "Error: could not resolve step something is wrong"
53 if not out.has_key(
"TimingReport"):
54 out[
"TimingReport"] = {}
55 stepdict = out[
"TimingReport"]
56 stepdict[step] = cpr.getTimingLogData(globule)
57 out[
"TimingReport"] = stepdict
58 except (OSError, IOError), detail:
61 print "Error: Could not determine step from %s" % base
69 for candle
in Candles:
70 globpath = os.path.join(visitdir,
"%s_*" % (candle))
71 globs = glob.glob(globpath)
73 profsetreg = re.compile(
"%s_(.*)" % candle)
75 base = os.path.basename(globule)
76 found = profsetreg.search(base)
78 profset = found.groups()[0]
79 if profset ==
"TimeSize":
81 print "Error: could not resolve candle something is wrong"
84 print "Error: could not resolve profset something is wrong"
86 if not out.has_key(candle):
88 candledict = out[candle]
89 if candledict.has_key(profset):
90 print "Error: we already have a profset that matches %s" % str(profset)
93 out[candle] = candledict
100 cpureg = re.compile(
"cpu_([0-9][0-9]*)")
102 globpath = os.path.join(perfdir,
"cpu_*")
103 globs = glob.glob(globpath)
105 for globule
in globs:
106 base = os.path.basename(globule)
107 found = cpureg.search(base)
109 cpuid = found.groups()[0]
110 if out.has_key(cpuid):
111 print "Error: we already have a cpu run with this id %s ! Skipping..." % cpuid
114 print "Error: could not resolve cpuid something is wrong"
116 out[cpuid] =
visit(globule)
118 print "Error: could not determine valid cpu id from %s ! Skipping..." % base
121 out[
"None"] =
visit(perfdir)
125 if __name__ ==
"__main__":
def visit_timesize_steps
Harvest information from a timesize directory, currently only retrieves TimingReport information...
def visit
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def optionParse
Parse options.
def harvest
Harvest all data from a perfsuite directory (if cpu subdirectories exist, it will examine them) ...