3 from __future__
import print_function
4 import time, os, sys, math, re, gzip
7 from cmsPerfCommons
import CandFname
10 from array
import array
13 from functools
import reduce
15 _cmsver = os.environ[
'CMSSW_VERSION']
16 values_set=(
'vsize',
'delta_vsize',
'rss',
'delta_rss')
19 """Base class for exceptions in this module.""" 23 """Exception raised when Could not parse TimingReport Log. 26 expression -- input expression in which the error occurred 27 message -- explanation of the error 34 """Exception raised when Could not parse TimingReport Log. 37 expression -- input expression in which the error occurred 38 message -- explanation of the error 45 """Exception raised when Could not parse TimingReport Log. 48 expression -- input expression in which the error occurred 49 message -- explanation of the error 56 """Exception raised when Could not parse TimingReport Log. 59 expression -- input expression in which the error occurred 60 message -- explanation of the error 70 parser = opt.OptionParser()
74 parser.add_option(
'-n',
76 help=
'Number of secs per bin. Default is 1.' ,
79 parser.add_option(
'-t',
82 choices= (
"timing",
"simplememory",
"edmsize",
"igprof",
"callgrind",
""),
83 help=
'Type of report to perform regrssion on. Default is TimingReport.' ,
86 parser.add_option(
'-i',
89 choices= (
"-y MEM_TOTAL",
"-y MEM_LIVE",
""),
90 help=
'Eventual IgProfMem counter to use for the regression. Default is no argument (IgProfPerf).' ,
93 (options,args) = parser.parse_args()
95 parser.error(
"ERROR: Not enough arguments")
99 path1 = os.path.abspath(args[0])
100 path2 = os.path.abspath(args[1])
101 if os.path.exists(path1)
and os.path.exists(path2):
102 return (path1, path2, options.startevt, options.reporttype, options.igprofmem)
104 print(
"Error: one of the paths does not exist")
134 sys.argv=sys.argv[:1]
135 ROOT.gROOT.SetStyle(
"Plain")
140 ROOT.gROOT.SetBatch(1)
148 rootfilename = os.path.join(outdir,filename)
150 exists = os.path.exists(rootfilename)
152 myfile=ROOT.TFile(rootfilename,
'UPDATE')
154 myfile=ROOT.TFile(rootfilename,
'RECREATE')
164 logfile=open(logfile_name,
'r') 165 logfile_lines=logfile.readlines() 170 while i < len(logfile_lines):
171 line=logfile_lines[i]
172 if 'TimeEvent>' in line:
174 line_content_list = line.split(
' ')[0:]
175 event_number =
int(line_content_list[1])
176 seconds =
float(line_content_list[3])
177 data.append((event_number,seconds))
187 values_set=(
'vsize',
'delta_vsize',
'rss',
'delta_rss')
190 logfile=open(logfile_name,
'r') 191 logfile_lines=logfile.readlines() 202 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],
"TimingReport"))
204 stepreg = re.compile(
"([^_]*(_PILEUP)?)_%s((.log)|(.gz))?"%
"TimingReport")
207 found=stepreg.search(logfile_name)
209 step=found.groups()[0]
210 print(
"Determined step from log filename to be %s"%step)
212 print(
"Could not determine step from log filename")
257 event_number= startevt
258 for line
in logfile_lines:
260 if '%MSG-w MemoryCheck:' in line:
262 if int(tokens[-1])>= startevt:
263 event_number=
int(tokens[-1])
266 vsize=
float(tokens[4])
267 delta_vsize=
float(tokens[5])
269 delta_rss=
float(tokens[8])
270 data.append((event_number,{
'vsize':vsize,
271 'delta_vsize':delta_vsize,
273 'delta_rss':delta_rss
278 if not len(data) == 0:
280 steps.append((step,data))
290 def newGraphAndHisto(histoleg,leg,npoints,nbins,min_val,max_val,data,graph_num,prevrev=""):
294 if not prevrev ==
"":
295 (head, tail) = os.path.split(prevrev)
296 prevRevName = os.path.basename(tail)
297 releaseNames = [
"Previous (%s)" % prevRevName,_cmsver]
299 histo=ROOT.TH1F(
"Seconds per event (histo: %s)" % graph_num,
'Seconds per event',nbins,min_val,max_val)
301 graph=ROOT.TGraph(npoints)
305 for evt_num,secs
in data:
308 graph.SetPoint(evt_counter,evt_num,secs)
313 map(
lambda x: allsecs.append(x[1]),data)
314 total = reduce(
lambda x,y: x + y,allsecs)
315 mean = total / evt_counter
316 rms = math.sqrt(reduce(
lambda x,y: x + y,
map(
lambda x: x * x,allsecs)) / evt_counter)
319 graph.SetMarkerStyle(8)
320 graph.SetMarkerSize(.7)
321 graph.SetMarkerColor(1)
322 graph.SetLineWidth(3)
323 graph.SetLineColor(colors[graph_num])
324 histo.SetLineColor(colors[graph_num])
326 histoleg.AddEntry(histo,
"%s release" % releaseNames[graph_num],
"l")
327 leg.AddEntry(graph ,
"%s release" % releaseNames[graph_num],
"l")
328 leg.AddEntry(graph ,
"Mean: %s" %
str(mean) ,
"l")
329 leg.AddEntry(graph ,
"RMS : %s" %
str(rms) ,
"l")
330 leg.AddEntry(graph ,
"Peak: %s" %
str(peak) ,
"l")
331 leg.AddEntry(graph ,
"Total time: %s" %
str(total) ,
"l")
333 histo.SetFillColor(colors[graph_num])
335 return (graph,histo,mean)
343 interval=
int(max_val-min_val)
345 min_val=min_val-interval*0.2
346 max_val=max_val+interval*0.2
347 interval=
int(max_val-min_val)
349 nbins=
int(interval/secsperbin)
353 last_event=data[-1][0]
355 return (min_val,max_val,interval,npoints,last_event)
365 title =
'Seconds per event' 366 name =
'SecondsPerEvent' 368 ytitle =
"Processing time for each event (s)" 369 graph1.GetYaxis().SetRangeUser(0,max_val)
370 graph2.GetYaxis().SetRangeUser(0,max_val)
371 elif reporttype == 1:
372 name =
"%s_graph" % title
376 graph1.SetTitle(title)
378 graph1.GetXaxis().SetTitle(xtitle)
379 graph1.GetYaxis().SetTitleOffset(1.3)
380 graph1.GetYaxis().SetTitle(ytitle)
381 graph1.GetXaxis().SetLimits(0,last_event)
384 graph2.GetXaxis().SetLimits(0,last_event)
391 avg_line=ROOT.TLine(1,avg,last_event,avg)
392 avg_line.SetLineColor(colors[graph_num])
393 avg_line.SetLineWidth(2)
402 for x
in range(len(data2)):
404 if data2[x][0] == data1[x][0]:
405 avgEventNum = data2[x][0]
406 diffSecs = data2[x][1] - data1[x][1]
407 data3.append((avgEventNum,diffSecs))
413 graph=ROOT.TGraph(npoints)
417 for evt_num,secs
in data3:
420 graph.SetPoint(evt_counter,evt_num,secs)
424 map(
lambda x: allsecs.append(x[1]),data3)
425 total = reduce(
lambda x,y: x + y,allsecs)
426 mean = total / evt_counter
427 rms = math.sqrt(reduce(
lambda x,y: x + y,
map(
lambda x: x * x,allsecs)) / evt_counter)
431 interval=
int(max_val-min_val)
433 min_val=min_val-interval*0.2
434 max_val=max_val+interval*0.2
435 interval=
int(max_val-min_val)
440 new_max = min_val + orig_max_val
441 if new_max < max_val:
446 graph.SetTitle(
'Change in processing time for each event between revs')
447 graph.SetName(
'SecondsPerEvent')
448 graph.GetXaxis().SetTitle(
"Event Number")
449 graph.GetYaxis().SetTitle(
"Change in processing time between revs (s)")
450 graph.GetYaxis().SetTitleOffset(1.3)
451 graph.SetLineColor(2)
452 graph.SetMarkerStyle(8)
453 graph.SetMarkerSize(.7)
454 graph.SetMarkerColor(1)
455 graph.SetLineWidth(3)
456 graph.GetXaxis().SetLimits(0,last_event)
457 graph.GetYaxis().SetRangeUser(min_val,max_val)
458 leg = ROOT.TLegend(0.5,0.7,0.89,0.89)
459 leg.AddEntry(graph,
"Mean: %s" %
str(mean),
"l")
460 leg.AddEntry(graph,
"RMS : %s" %
str(rms) ,
"l")
461 leg.AddEntry(graph,
"Peak: %s" %
str(peak),
"l")
462 leg.AddEntry(graph,
"Total time change: %s" %
str(total) ,
"l")
470 graph_canvas = ROOT.TCanvas(
"graph_canvas")
483 histo_canvas = ROOT.TCanvas(
"histo_canvas")
485 histo_stack.Draw(
"nostack")
493 graph_canvas = ROOT.TCanvas(
"change_canvas")
503 biggestLastEvt = last_event1
504 biggestMaxval = max_val1
505 lowest_val = min_val1
507 if min_val2 < lowest_val:
508 lowest_val = min_val2
509 if last_event2 > biggestLastEvt:
510 biggestLastEvt = last_event2
511 if max_val2 > biggestMaxval:
512 biggestMaxval = max_val2
513 return (biggestLastEvt,biggestMaxval,lowest_val)
519 if data[0][0]==data[1][0]:
520 print(
'Two modules seem to have some output.\nCollapsing ...')
526 new_eventnumber=dataline1[0]
527 new_vsize=dataline2[1][
'vsize']
528 new_delta_vsize=dataline1[1][
'delta_vsize']+dataline2[1][
'delta_vsize']
529 new_rss=dataline2[1][
'rss']
530 new_delta_rss=dataline1[1][
'delta_rss']+dataline2[1][
'delta_rss']
532 new_data.append((new_eventnumber,{
'vsize':new_vsize,
533 'delta_vsize':new_delta_vsize,
535 'delta_rss':new_delta_rss}))
537 if i==len(data):
break 540 print(
'Collapsing: Done!')
544 return (data,len(data))
551 values = [
"vsize",
"rss"]
554 if not prevrev ==
"":
555 (head, tail) = os.path.split(prevrev)
556 prevRevName = os.path.basename(tail)
558 releaseNames = [
"Previous (%s)" % prevRevName,_cmsver]
570 graph = ROOT.TGraph(npoints)
571 graph.SetTitle(value)
572 graph.SetLineColor(colors[graph_num])
573 graph.SetMarkerStyle(8)
574 graph.SetMarkerSize(.7)
575 graph.SetMarkerColor(1)
576 graph.SetLineWidth(3)
577 graph.GetXaxis().SetTitle(
"Event")
578 graph.GetYaxis().SetTitleOffset(1.3)
579 graph.GetYaxis().SetTitle(
"MB")
585 for event_number,vals_dict
in data:
587 minim = vals_dict[value]
588 peak = vals_dict[value]
590 if vals_dict[value] > peak:
591 peak = vals_dict[value]
592 if vals_dict[value] < minim:
593 minim = vals_dict[value]
594 graph.SetPoint(point_counter, event_number, vals_dict[value])
595 total += vals_dict[value]
596 rms += vals_dict[value] * vals_dict[value]
599 rms = math.sqrt(rms /
float(point_counter))
600 mean = total /
float(point_counter)
601 last_event=data[-1][0]
604 graph.GetXaxis().SetRangeUser(0,last_event+1)
605 leg.AddEntry(graph ,
"%s release" % releaseNames[graph_num],
"l")
606 leg.AddEntry(graph ,
"Mean: %s" %
str(mean) ,
"l")
607 leg.AddEntry(graph ,
"RMS : %s" %
str(rms) ,
"l")
608 leg.AddEntry(graph ,
"Peak: %s" %
str(peak) ,
"l")
612 return (graphs[0] , last_event, peaks[0], minims[0], graphs[1], last_event, peaks[1], minims[1])
617 def getMemDiff(data1,data2,npoints,last_event,orig_max_val,stepname,rss=False):
623 graph=ROOT.TGraph(npoints)
630 for x
in range(len(data2)):
632 (evtnum2,valdict2) = data2[x]
633 (evtnum1,valdict1) = data1[x]
634 if evtnum2 == evtnum1:
635 diffMBytes = valdict2[memtype] - valdict1[memtype]
641 if diffMBytes > peak:
643 if diffMBytes < minum:
645 graph.SetPoint(evt_counter,evtnum2,diffMBytes)
648 rms += (diffMBytes * diffMBytes)
654 mean = total / evt_counter
655 rms = math.sqrt(rms /
float(evt_counter))
659 interval =
int(max_val-min_val)
661 min_val=min_val-interval*0.2
662 max_val=max_val+interval*0.2
663 interval=
int(max_val-min_val)
667 new_max = min_val + orig_max_val
668 if new_max < max_val:
673 graph.SetTitle(
"Change in %s memory usage for each event between revs for step %s" % (memtype,stepname))
674 graph.SetName(
'MemoryUsagePerEvent')
675 graph.GetXaxis().SetTitle(
"Event Number")
676 graph.GetYaxis().SetTitle(
"Change in memory usage between revs (MBs)")
677 graph.GetYaxis().SetTitleOffset(1.3)
678 graph.SetLineColor(2)
679 graph.SetMarkerStyle(8)
680 graph.SetMarkerSize(.7)
681 graph.SetMarkerColor(1)
682 graph.SetLineWidth(3)
683 graph.GetXaxis().SetLimits(0,last_event)
684 graph.GetYaxis().SetRangeUser(min_val,max_val)
685 leg = ROOT.TLegend(0.5,0.7,0.89,0.89)
686 leg.AddEntry(graph,
"Mean: %s" %
str(mean),
"l")
687 leg.AddEntry(graph,
"RMS : %s" %
str(rms) ,
"l")
688 leg.AddEntry(graph,
"Peak: %s" %
str(peak),
"l")
689 leg.AddEntry(graph,
"Trough: %s" %
str(minum) ,
"l")
696 def drawMemGraphs(graph1,graph2,min_val,max_val,last_event,leg,memtype,stepname):
697 graph_canvas=ROOT.TCanvas(
"%s_%s_canvas" % (memtype,stepname))
699 graph1.GetYaxis().SetRangeUser(min_val,max_val)
700 graph1.GetXaxis().SetRangeUser(0,last_event)
704 graph_canvas.ForceUpdate()
712 graph_canvas=ROOT.TCanvas(
"%s_%s_change_canvas" % (memtype,stepname))
716 graph_canvas.ForceUpdate()
729 def cmpSimpMemReport(rootfilename,outdir,oldLogfile,newLogfile,startevt,batch=True,candle="",prevrev=""):
734 print(
"#####LOGFILES in cmsPErfRegress:")
760 candreg = re.compile(
"(.*)(?:\.log)")
772 (stepname1, data1) = info1[0]
773 (stepname2, data2) = info2[0]
806 leg = ROOT.TLegend(0.6,0.99,0.89,0.8)
808 leg = ROOT.TLegend(0.6,0.99,0.89,0.8)
850 (vsize_lstevt, vsize_max_val, vsize_min_val) =
getTwoGraphLimits(vsize_lstevt1, vsize_peak1, vsize_lstevt2, vsize_peak2, vsize_minim1, vsize_minim2)
851 (rss_lstevt , rss_max_val , rss_min_val) =
getTwoGraphLimits(rss_lstevt1 , rss_peak1, rss_lstevt2 , rss_peak2, rss_minim1, rss_minim2)
853 (vsize_min,vsize_max) =
getMemOrigScale(vsize_minim1,vsize_minim2,vsize_peak1,vsize_peak2)
854 (rss_min ,rss_max ) =
getMemOrigScale(rss_minim1,rss_minim2,rss_peak1,rss_peak2)
861 title =
"%s_vsize" % stepname1)
867 title =
"%s_rss" % stepname2)
869 (vsizePerfDiffgraph, vsizeleg) =
getMemDiff(data1,data2,npoints2,vsize_lstevt, (vsize_max - vsize_min), stepname1, rss=
False)
870 (rssPerfDiffgraph, rssleg) =
getMemDiff(data1,data2,npoints2,rss_lstevt , (rss_max - rss_min) , stepname1, rss=
True )
872 vsize_canvas =
drawMemGraphs(vsize_graph1, vsize_graph2, vsize_min_val, vsize_max_val, vsize_lstevt, legs[0],
"vsize", stepname1)
873 rss_canvas =
drawMemGraphs(rss_graph1 , rss_graph2 , rss_min_val, rss_max_val, rss_lstevt, legs[1],
"rss" , stepname1)
874 vsize_change_canvas =
drawMemChangeGraphs(vsizePerfDiffgraph, vsizeleg,
"vsize", stepname1)
882 found = candreg.search(os.path.basename(newLogfile))
885 logcandle = found.groups()[0]
887 if candle
in CandFname:
888 candFilename = CandFname[candle]
889 elif logcandle
in CandFname:
890 candFilename = CandFname[logcandle]
892 print(
"%s is an unknown candle!"%candle)
893 candFilename =
"Unknown-candle" 895 outputdir =
"%s_%s_SimpleMemReport" % (candFilename,stepname1)
896 outputdir = os.path.join(outdir,outputdir)
898 if not os.path.exists(outputdir):
903 newrootfile =
createROOT(outputdir,rootfilename)
905 vsize_canvas.Print( os.path.join(outputdir,
"vsize_graphs.png"),
"png")
906 rss_canvas.Print( os.path.join(outputdir,
"rss_graphs.png" ),
"png")
907 vsize_change_canvas.Print(os.path.join(outputdir,
"vsize_change.png"),
"png")
908 rss_change_canvas.Print( os.path.join(outputdir,
"rss_change.png" ),
"png")
910 map(
lambda x: x.Write(), [vsize_graph1,vsize_graph2, rss_graph1, rss_graph2, vsizePerfDiffgraph, rssPerfDiffgraph])
911 map(
lambda x: x.Write(), [vsize_canvas,rss_canvas,vsize_change_canvas,rss_change_canvas])
920 canvases.append(rss_canvas)
921 canvases.append(vsize_canvas)
922 canvases.append(vsize_change_canvas)
923 canvases.append(rss_change_canvas)
936 if len(canvases) > 0:
937 while reduce(
lambda x,y: x
or y ,canvases):
942 def cmpTimingReport(rootfilename,outdir,oldLogfile,newLogfile,secsperbin,batch=True,prevrev=""):
950 (min_val1,max_val1,nbins1,npoints1,last_event1) =
getLimits(data1,secsperbin)
951 except IndexError
as detail:
955 (min_val2,max_val2,nbins2,npoints2,last_event2) =
getLimits(data2,secsperbin)
956 except IndexError
as detail:
959 hsStack = ROOT.THStack(
"hsStack",
"Histogram Comparison")
960 leg = ROOT.TLegend(0.6,0.99,0.89,0.8)
961 histoleg = ROOT.TLegend(0.5,0.8,0.89,0.89)
965 (graph1,histo1,mean1) =
newGraphAndHisto(histoleg,leg,npoints1,nbins1,min_val1,max_val1,data1,0,prevrev)
967 (graph2,histo2,mean2) =
newGraphAndHisto(histoleg,leg,npoints2,nbins2,min_val2,max_val2,data2,1,prevrev)
970 (biggestLastEvt,biggestMaxval, trashthis) =
getTwoGraphLimits(last_event1,max_val1,last_event2,max_val2,min_val1,min_val2)
972 (changegraph,chgleg) =
getTimingDiff(data1,data2,npoints2,biggestLastEvt,biggestMaxval)
980 histo1.GetXaxis().SetTitle(
"s")
981 graph_canvas =
drawGraphs(graph1,graph2,avg_line1,avg_line2,leg)
993 tot_a1 =
array(
"f", [ 0 ] )
994 tot_a2 =
array(
"f", [ 0 ] )
999 cput.Branch(
"total1",tot_a1,
"total1/F")
1000 cput.Branch(
"total2",tot_a2,
"total2/F")
1002 cput.Write(
"cpu_time_tuple",ROOT.TObject.kOverwrite)
1004 names = [
"graphs.png",
"changes.png",
"histos.png"]
1006 graph_canvas.Print( os.path.join(outdir,names[0]),
"png")
1007 changes_canvas.Print(os.path.join(outdir,names[1]),
"png")
1008 histo_canvas.Print( os.path.join(outdir,names[2]),
"png")
1010 map(
lambda x:x.Write(),[graph1,graph2,changegraph,hsStack,histo1,histo2])
1012 graph_canvas.Write()
1013 changes_canvas.Write()
1014 histo_canvas.Write()
1020 while graph_canvas
or histo_canvas
or changes_canvas:
1028 RemoveCmd=
"rm -Rf %s"%path
1029 os.system(RemoveCmd)
1030 except OSError
as detail:
1031 if detail.errno == 39:
1039 os.remove(os.path.join(path,f))
1041 rmtree(os.path.join(path,d))
1042 except OSError
as detail:
1044 except IOError
as detail:
1051 src = os.environ[
"CMSSW_SEARCH_PATH"]
1052 except KeyError
as detail:
1053 print(
"ERROR: scramv1 environment could not be located", detail)
1055 vars = src.split(
":")
1066 cmssw_release_base =
"" 1069 cmssw_release_base = os.environ[
'CMSSW_RELEASE_BASE']
1070 cmssw_data = os.environ[
'CMSSW_DATA_PATH']
1071 except KeyError
as detail:
1074 xmlfile = os.path.join(cmssw_release_base,
"src",
"Validation",
"Performance",
"doc",
"regress.xml")
1076 prRoot =
"/afs/cern.ch/user/g/gbenelli/public/PerfReport2/2.0.1" 1087 tmpdir = tmp.mkdtemp(prefix=os.path.join(outdir,
"tmp"))
1089 perfcmd =
"%s %s %s -c %s -t%s -i %s -r %s -o %s" % (os.path.join(prRoot,
"bin",
"perfreport"),proftype,IgProfMemopt,xmlfile,tmpdir,file2,file1,outdir)
1090 cmd =
"tcsh -c \"cd %s ; eval `scramv1 runtime -csh` ; cd - ;source %s/etc/profile.d/init.csh ; %s\"" % (loc,prRoot,perfcmd)
1093 process = subprocess.Popen(cmd,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
1094 exitstat = process.wait()
1095 cmdout = process.stdout.read()
1096 exitstat = process.returncode
1101 except IOError
as detail:
1102 print(
"WARNING: Could not remove dir because IO%s" % detail)
1103 except OSError
as detail:
1104 print(
"WARNING: Could not remove dir because %s" % detail)
1110 if not exitstat ==
None:
1111 sig = exitstat >> 16
1112 xstatus = exitstat & 0xffff
1113 raise PerfReportErr(
"ERROR: PerfReport returned a non-zero exit status (%s, SIG_INT = %s) run %s. Dump follows: \n%s" % (perfcmd,xstatus,sig,cmdout))
1120 gzf = gzip.open(inf,
"r") 1125 print(
"finish ungzipping")
1129 os.system(
"gzip -c -d %s > %s" % (inf,out))
1132 (tfile1, tfile2) = (
"",
"")
1135 (th1, tfile1) = tmp.mkstemp(prefix=os.path.join(outdir,
"igprofRegressRep."))
1136 (th2, tfile2) = tmp.mkstemp(prefix=os.path.join(outdir,
"igprofRegressRep."))
1144 perfreport(1,tfile1,tfile2,outdir,IgProfMemOpt)
1148 except OSError
as detail:
1149 raise PerfReportErr(
"WARNING: The OS returned the following error when comparing %s and %s\n%s" % (file1,file2,
str(detail)))
1150 if os.path.exists(tfile1):
1152 if os.path.exists(tfile2):
1154 except IOError
as detail:
1155 raise PerfReportErr(
"IOError: When comparing %s and %s using temporary files %s and %s. Error message:\n%s" % (file1,file2,tfile1,tfile2,
str(detail)))
1156 if os.path.exists(tfile1):
1158 if os.path.exists(tfile2):
1166 outdir = os.getcwd()
1168 (file1,file2,secsperbin,reporttype,IgProfMemOptions) =
getParameters()
1171 if reporttype ==
"timing":
1172 rootfilename =
"timingrep-regression.root" 1174 elif reporttype ==
"simplememory":
1175 rootfilename =
"simpmem-regression.root" 1177 elif reporttype ==
"edmsize":
1179 elif reporttype ==
"callgrind":
1181 elif reporttype ==
"igprof":
1183 except TimingParseErr
as detail:
1184 print(
"WARNING: Could not parse data from Timing report file %s; not performing regression" % detail.message)
1185 except SimpMemParseErr
as detail:
1186 print(
"WARNING: Could not parse data from Memory report file %s; not performing regression" % detail.message)
1187 except PerfReportErr
as detail:
1188 print(
"WARNING: Could not parse data from Edm file %s; not performing regression" % detail.message)
1189 except IOError
as detail:
1191 except OSError
as detail:
1194 if __name__ ==
"__main__":
def cmpEdmSizeReport(outdir, file1, file2)
def cmpTimingReport(rootfilename, outdir, oldLogfile, newLogfile, secsperbin, batch=True, prevrev="")
def perfreport(perftype, file1, file2, outdir, IgProfMemopt="")
def getMeanLines(avg, last_event, graph_num)
Plot the mean line on a graph.
def createSimplMemGraphs(data, npoints, graph_num, legs, prevrev="")
Create simple memory check graphs.
def getMemOrigScale(fst_min, snd_min, fst_max, snd_max)
def getSimpleMemLogData(logfile_name, startevt, candle)
Parse memory check data from log file.
def drawHistos(histo_stack, hstleg)
Draw superimposed histograms on a separate canvas.
def __init__(self, message)
def getMemDiff(data1, data2, npoints, last_event, orig_max_val, stepname, rss=False)
Produce the difference of two memory data sets.
def setBatch()
Setup PyRoot as a batch run.
def __init__(self, message)
def drawMemGraphs(graph1, graph2, min_val, max_val, last_event, leg, memtype, stepname)
Draw two memory graphs superimposed on one another.
S & print(S &os, JobReport::InputFile const &f)
def drawGraphs(graph1, graph2, avg1, avg2, leg)
Draw superimposed graphs on a separate canvas.
def get_min(data, index=1)
Get min value in data set.
def cmpCallgrindReport(outdir, file1, file2)
def __init__(self, message)
def cmpSimpMemReport(rootfilename, outdir, oldLogfile, newLogfile, startevt, batch=True, candle="", prevrev="")
def createROOT(outdir, filename)
Create the root file to save the graphs in.
def newGraphAndHisto(histoleg, leg, npoints, nbins, min_val, max_val, data, graph_num, prevrev="")
Create a new timing graph and histogram.
def cmpIgProfReport(outdir, file1, file2, IgProfMemOpt="")
def getLimits(data, secsperbin)
Get limits to plot the graph.
def __init__(self, message)
def getTimingLogData(logfile_name)
Parse timing data from log file.
def getTwoGraphLimits(last_event1, max_val1, last_event2, max_val2, min_val1=-1, min_val2=-1)
Get limits for two graphs that will be superimposed upon one another.
def get_max(data, index=1)
Get max value in data set.
def drawChanges(graph, chgleg)
Draw data differences (comparison between two data sets or releases) on a separate canvas...
def drawMemChangeGraphs(graph, leg, memtype, stepname)
Draw the comparison graphs of two memory graphs.
def getTimingDiff(data1, data2, npoints, last_event, orig_max_val)
Get the difference in timing data (for comparison of two releases)
def setupSuperimpose(graph1, graph2, last_event, max_val, reporttype=0, title="")
Setup graph information for one graph (no need to it on both if they are superimposed) ...