83 profSets = [
"Callgrind",
92 for candle
in Candles:
94 for profset
in profSets:
96 adir = os.path.join(newdir,
"%s_%s" % (candle,profset))
97 if os.path.exists(adir):
99 print "Found directory %s"%adir
103 if profset ==
"Callgrind" or profset ==
"PU_Callgrind":
105 elif profset ==
"TimeSize" or profset ==
"PU_TimeSize":
106 Profs = [
"TimingReport",
110 elif profset ==
"IgProf" or profset ==
"PU_IgProf" :
111 Profs = [
"IgProfperf",
117 print "Checking %s profile(s)"%prof
118 if prof ==
"EdmSize" or prof ==
"valgrind":
119 stepLogs = glob.glob(
"%s/%s_*_%s" % (adir,CandFname[candle],prof))
120 elif prof ==
"IgProfMemLive" or prof ==
"IgProfMemTotal":
121 stepLogs = glob.glob(
"%s/%s_*_%s.gz" % (adir,CandFname[candle],
"IgProfMemTotal"))
122 elif prof ==
"IgProfperf":
123 stepLogs = glob.glob(
"%s/%s_*_%s.gz" % (adir,CandFname[candle],prof))
124 elif prof ==
"SimpleMemoryCheck":
128 stepLogs = glob.glob(
"%s/%s_*_%s.log" % (adir,CandFname[candle],
'TimingReport'))
129 elif prof ==
"TimingReport":
130 stepLogs = glob.glob(
"%s/%s_*_%s.log" % (adir,CandFname[candle],prof))
133 print "Found the following step logs: %s"%stepLogs
135 profdir = os.path.basename(adir)
139 if prof ==
"TimingReport" or prof ==
"EdmSize" or prof ==
"valgrind" or prof ==
"IgProfMemTotal" or prof ==
"IgProfMemLive" or prof ==
"IgProfperf":
142 if prof ==
"IgProfMemLive":
143 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],
"IgProfMemTotal"))
145 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],prof))
149 base = os.path.basename(log)
151 if prof ==
"IgProfMemTotal" or prof ==
"IgProfMemLive" or prof ==
"IgProfperf":
152 base = base.split(
".gz")[0]
154 searchob = stepreg.search(base)
159 step = searchob.groups()[0]
161 outpath = os.path.join(adir,
"%s_%s_%s_regression" % (CandFname[candle],step,prof))
162 oldlog = os.path.join(olddir,
"%s_%s" % (candle,profset),base)
164 if prof ==
"IgProfMemTotal" or prof ==
"IgProfMemLive" or prof ==
"IgProfperf":
165 oldlog = os.path.join(olddir,
"%s_%s" % (candle,profset),base +
".gz")
166 if not os.path.exists(outpath):
168 if os.path.exists(oldlog):
172 if not prof ==
"TimingReport":
173 print "** Comparing", candle, step, prof,
"previous release: %s, latest release %s" % (oldlog,log)
176 if prof ==
"EdmSize":
177 cpr.cmpEdmSizeReport(outpath,oldlog,log)
178 elif prof ==
"TimingReport":
179 logdir =
"%s_%s_%s" % (CandFname[candle],step,prof)
180 outd = os.path.join(adir,logdir)
181 rootf =
"timing-regress.root"
182 oldlog = os.path.join(olddir,profdir,base)
183 if os.path.exists(log)
and os.path.exists(oldlog)
and os.path.exists(outd):
184 print "** Comparing", candle, step, prof,
"previous release: %s and latest release: %s" % (oldlog,log)
188 cpr.cmpTimingReport(rootf, outd, oldlog, log, 1, batch =
True, prevrev = oldRelName)
190 print "WARNING: While comparing", candle, step, prof,
" at least one of the logfiles/directories: old (%s) or new (%s) was not found!!!" % (oldlog,log)
192 elif prof ==
"valgrind":
193 cpr.cmpCallgrindReport(outpath,oldlog,log)
194 elif prof ==
"IgProfperf":
196 cpr.cmpIgProfReport(outpath,oldlog,log,IgProfMemOpt)
197 elif prof ==
"IgProfMemTotal":
198 IgProfMemOpt=
"-y MEM_TOTAL"
199 cpr.cmpIgProfReport(outpath,oldlog,log,IgProfMemOpt)
200 elif prof ==
"IgProfMemLive":
201 IgProfMemOpt=
"-y MEM_LIVE"
202 cpr.cmpIgProfReport(outpath,oldlog,log,IgProfMemOpt)
203 except cpr.PerfReportErr
as detail:
204 print "WARNING: Perfreport return non-zero exit status when comparing %s and %s. Perfreport output follows" % (oldlog,log)
206 except cpr.TimingParseErr
as detail:
207 print "WARNING: Could not parse data from log file %s; not performing regression" % detail.message
208 except OSError
as detail:
209 print "WARNING: The OS returned the following error when comparing %s and %s" % (oldlog,log), detail
210 except IOError
as detail:
211 print "IOError:", detail
213 print "Successfully compared %s and %s" % (oldlog,log)
215 print "WARNING: Could not find an equivalent logfile for %s in the previous release dir %s " % (log,oldlog)
220 elif prof ==
"SimpleMemoryCheck":
224 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],
"TimingReport"))
225 base = os.path.basename(log)
227 searchob = stepreg.search(base)
232 step = searchob.groups()[0]
233 print "and the step taken is %s"%step
235 oldlog = os.path.join(olddir,
"%s_%s" % (candle,profset),base)
236 if os.path.exists(oldlog):
239 print "** Comparing for SimpleMemoryCheck", candle, step, prof,
"previous release: %s, latest release %s" % (oldlog,log)
246 regress = open(
"%s/REGRESSION.%s.vs.%s" % (newdir,
getVerFromLog(olddir),newRelName),
"w")
247 regress.write(olddir)