82 profSets = [
"Callgrind",
91 for candle
in Candles:
93 for profset
in profSets:
95 adir = os.path.join(newdir,
"%s_%s" % (candle,profset))
96 if os.path.exists(adir):
98 print "Found directory %s"%adir
102 if profset ==
"Callgrind" or profset ==
"PU_Callgrind":
104 elif profset ==
"TimeSize" or profset ==
"PU_TimeSize":
105 Profs = [
"TimingReport",
109 elif profset ==
"IgProf" or profset ==
"PU_IgProf" :
110 Profs = [
"IgProfperf",
116 print "Checking %s profile(s)"%prof
117 if prof ==
"EdmSize" or prof ==
"valgrind":
118 stepLogs = glob.glob(
"%s/%s_*_%s" % (adir,CandFname[candle],prof))
119 elif prof ==
"IgProfMemLive" or prof ==
"IgProfMemTotal":
120 stepLogs = glob.glob(
"%s/%s_*_%s.gz" % (adir,CandFname[candle],
"IgProfMemTotal"))
121 elif prof ==
"IgProfperf":
122 stepLogs = glob.glob(
"%s/%s_*_%s.gz" % (adir,CandFname[candle],prof))
123 elif prof ==
"SimpleMemoryCheck":
127 stepLogs = glob.glob(
"%s/%s_*_%s.log" % (adir,CandFname[candle],
'TimingReport'))
128 elif prof ==
"TimingReport":
129 stepLogs = glob.glob(
"%s/%s_*_%s.log" % (adir,CandFname[candle],prof))
132 print "Found the following step logs: %s"%stepLogs
134 profdir = os.path.basename(adir)
138 if prof ==
"TimingReport" or prof ==
"EdmSize" or prof ==
"valgrind" or prof ==
"IgProfMemTotal" or prof ==
"IgProfMemLive" or prof ==
"IgProfperf":
141 if prof ==
"IgProfMemLive":
142 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],
"IgProfMemTotal"))
144 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],prof))
148 base = os.path.basename(log)
150 if prof ==
"IgProfMemTotal" or prof ==
"IgProfMemLive" or prof ==
"IgProfperf":
151 base = base.split(
".gz")[0]
153 searchob = stepreg.search(base)
158 step = searchob.groups()[0]
160 outpath = os.path.join(adir,
"%s_%s_%s_regression" % (CandFname[candle],step,prof))
161 oldlog = os.path.join(olddir,
"%s_%s" % (candle,profset),base)
163 if prof ==
"IgProfMemTotal" or prof ==
"IgProfMemLive" or prof ==
"IgProfperf":
164 oldlog = os.path.join(olddir,
"%s_%s" % (candle,profset),base +
".gz")
165 if not os.path.exists(outpath):
167 if os.path.exists(oldlog):
171 if not prof ==
"TimingReport":
172 print "** Comparing", candle, step, prof,
"previous release: %s, latest release %s" % (oldlog,log)
175 if prof ==
"EdmSize":
176 cpr.cmpEdmSizeReport(outpath,oldlog,log)
177 elif prof ==
"TimingReport":
178 logdir =
"%s_%s_%s" % (CandFname[candle],step,prof)
179 outd = os.path.join(adir,logdir)
180 rootf =
"timing-regress.root" 181 oldlog = os.path.join(olddir,profdir,base)
182 if os.path.exists(log)
and os.path.exists(oldlog)
and os.path.exists(outd):
183 print "** Comparing", candle, step, prof,
"previous release: %s and latest release: %s" % (oldlog,log)
187 cpr.cmpTimingReport(rootf, outd, oldlog, log, 1, batch =
True, prevrev = oldRelName)
189 print "WARNING: While comparing", candle, step, prof,
" at least one of the logfiles/directories: old (%s) or new (%s) was not found!!!" % (oldlog,log)
191 elif prof ==
"valgrind":
192 cpr.cmpCallgrindReport(outpath,oldlog,log)
193 elif prof ==
"IgProfperf":
195 cpr.cmpIgProfReport(outpath,oldlog,log,IgProfMemOpt)
196 elif prof ==
"IgProfMemTotal":
197 IgProfMemOpt=
"-y MEM_TOTAL" 198 cpr.cmpIgProfReport(outpath,oldlog,log,IgProfMemOpt)
199 elif prof ==
"IgProfMemLive":
200 IgProfMemOpt=
"-y MEM_LIVE" 201 cpr.cmpIgProfReport(outpath,oldlog,log,IgProfMemOpt)
202 except cpr.PerfReportErr
as detail:
203 print "WARNING: Perfreport return non-zero exit status when comparing %s and %s. Perfreport output follows" % (oldlog,log)
205 except cpr.TimingParseErr
as detail:
206 print "WARNING: Could not parse data from log file %s; not performing regression" % detail.message
207 except OSError
as detail:
208 print "WARNING: The OS returned the following error when comparing %s and %s" % (oldlog,log), detail
209 except IOError
as detail:
210 print "IOError:", detail
212 print "Successfully compared %s and %s" % (oldlog,log)
214 print "WARNING: Could not find an equivalent logfile for %s in the previous release dir %s " % (log,oldlog)
219 elif prof ==
"SimpleMemoryCheck":
223 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],
"TimingReport"))
224 base = os.path.basename(log)
226 searchob = stepreg.search(base)
231 step = searchob.groups()[0]
232 print "and the step taken is %s"%step
234 oldlog = os.path.join(olddir,
"%s_%s" % (candle,profset),base)
235 if os.path.exists(oldlog):
238 print "** Comparing for SimpleMemoryCheck", candle, step, prof,
"previous release: %s, latest release %s" % (oldlog,log)
245 regress = open(
"%s/REGRESSION.%s.vs.%s" % (newdir,
getVerFromLog(olddir),newRelName),
"w")
246 regress.write(olddir)
def compareSimMemPair(newLog, candle, profdir, curdir, oldlog, oldRelName="")
def getVerFromLog(previous)
def getOldRelName(oldRelName, adir)
def regressReports(olddir, newdir, oldRelName="", newRelName="")