2 from __future__
import print_function
3 from cmsPerfCommons
import Candles, CandFname
5 import cmsPerfRegress
as cpr
6 import sys, os, glob, re
8 _PROG_NAME = os.path.basename(sys.argv[0])
14 parser = opt.OptionParser(usage=
"""./%s [perf dir] [options]""" % _PROG_NAME)
16 (options, args) = parser.parse_args()
18 if not len(args) == 1:
19 parser.error(
"You have not supplied a perfsuite directory.")
22 args[0] = os.path.abspath(args[0])
27 if not os.path.isdir(args[0]):
28 parser.error(
"You have not provided a valid perfsuite output directory")
41 globpath = os.path.join(profsetdir,
"%s_*_TimingReport.log" % CandFname[candle])
42 globs = glob.glob(globpath)
44 stepreg = re.compile(
"%s_([^_]*)_TimingReport.log" % CandFname[candle])
46 base = os.path.basename(globule)
47 found = stepreg.search(base)
49 step = found.groups()[0]
52 print(
"Error: could not resolve step something is wrong")
54 if "TimingReport" not in out:
55 out[
"TimingReport"] = {}
56 stepdict = out[
"TimingReport"]
57 stepdict[step] = cpr.getTimingLogData(globule)
58 out[
"TimingReport"] = stepdict
59 except (OSError, IOError)
as detail:
62 print(
"Error: Could not determine step from %s" % base)
70 for candle
in Candles:
71 globpath = os.path.join(visitdir,
"%s_*" % (candle))
72 globs = glob.glob(globpath)
74 profsetreg = re.compile(
"%s_(.*)" % candle)
76 base = os.path.basename(globule)
77 found = profsetreg.search(base)
79 profset = found.groups()[0]
80 if profset ==
"TimeSize":
82 print(
"Error: could not resolve candle something is wrong")
85 print(
"Error: could not resolve profset something is wrong")
89 candledict = out[candle]
90 if profset
in candledict:
91 print(
"Error: we already have a profset that matches %s" %
str(profset))
94 out[candle] = candledict
101 cpureg = re.compile(
"cpu_([0-9][0-9]*)")
103 globpath = os.path.join(perfdir,
"cpu_*")
104 globs = glob.glob(globpath)
106 for globule
in globs:
107 base = os.path.basename(globule)
108 found = cpureg.search(base)
110 cpuid = found.groups()[0]
112 print(
"Error: we already have a cpu run with this id %s ! Skipping..." % cpuid)
115 print(
"Error: could not resolve cpuid something is wrong")
117 out[cpuid] =
visit(globule)
119 print(
"Error: could not determine valid cpu id from %s ! Skipping..." % base)
122 out[
"None"] =
visit(perfdir)
126 if __name__ ==
"__main__":
def optionParse()
Parse options.
def visit_timesize_steps(candle, profsetdir)
Harvest information from a timesize directory, currently only retrieves TimingReport information...
S & print(S &os, JobReport::InputFile const &f)
def visit(visitdir)
Retrieve data from a perf suite output (sub) directory, only examines TimeSize at the moment...
def harvest(perfdir)
Harvest all data from a perfsuite directory (if cpu subdirectories exist, it will examine them) ...