3 from __future__
import print_function
4 from builtins
import range
5 import time, os, sys, math, re, gzip
8 from cmsPerfCommons
import CandFname
11 from array
import array
14 from functools
import reduce
16 _cmsver = os.environ[
'CMSSW_VERSION']
17 values_set=(
'vsize',
'delta_vsize',
'rss',
'delta_rss')
20 """Base class for exceptions in this module.""" 24 """Exception raised when Could not parse TimingReport Log. 27 expression -- input expression in which the error occurred 28 message -- explanation of the error 35 """Exception raised when Could not parse TimingReport Log. 38 expression -- input expression in which the error occurred 39 message -- explanation of the error 46 """Exception raised when Could not parse TimingReport Log. 49 expression -- input expression in which the error occurred 50 message -- explanation of the error 57 """Exception raised when Could not parse TimingReport Log. 60 expression -- input expression in which the error occurred 61 message -- explanation of the error 71 parser = opt.OptionParser()
75 parser.add_option(
'-n',
77 help=
'Number of secs per bin. Default is 1.' ,
80 parser.add_option(
'-t',
83 choices= (
"timing",
"simplememory",
"edmsize",
"igprof",
"callgrind",
""),
84 help=
'Type of report to perform regrssion on. Default is TimingReport.' ,
87 parser.add_option(
'-i',
90 choices= (
"-y MEM_TOTAL",
"-y MEM_LIVE",
""),
91 help=
'Eventual IgProfMem counter to use for the regression. Default is no argument (IgProfPerf).' ,
94 (options,args) = parser.parse_args()
96 parser.error(
"ERROR: Not enough arguments")
100 path1 = os.path.abspath(args[0])
101 path2 = os.path.abspath(args[1])
102 if os.path.exists(path1)
and os.path.exists(path2):
103 return (path1, path2, options.startevt, options.reporttype, options.igprofmem)
105 print(
"Error: one of the paths does not exist")
135 sys.argv=sys.argv[:1]
136 ROOT.gROOT.SetStyle(
"Plain")
141 ROOT.gROOT.SetBatch(1)
149 rootfilename = os.path.join(outdir,filename)
151 exists = os.path.exists(rootfilename)
153 myfile=ROOT.TFile(rootfilename,
'UPDATE')
155 myfile=ROOT.TFile(rootfilename,
'RECREATE')
165 logfile=open(logfile_name,
'r') 166 logfile_lines=logfile.readlines() 171 while i < len(logfile_lines):
172 line=logfile_lines[i]
173 if 'TimeEvent>' in line:
175 line_content_list = line.split(
' ')[0:]
176 event_number =
int(line_content_list[1])
177 seconds =
float(line_content_list[3])
178 data.append((event_number,seconds))
188 values_set=(
'vsize',
'delta_vsize',
'rss',
'delta_rss')
191 logfile=open(logfile_name,
'r') 192 logfile_lines=logfile.readlines() 203 stepreg = re.compile(
"%s_([^_]*(_PILEUP)?)_%s((.log)|(.gz))?" % (CandFname[candle],
"TimingReport"))
205 stepreg = re.compile(
"([^_]*(_PILEUP)?)_%s((.log)|(.gz))?"%
"TimingReport")
208 found=stepreg.search(logfile_name)
210 step=found.groups()[0]
211 print(
"Determined step from log filename to be %s"%step)
213 print(
"Could not determine step from log filename")
258 event_number= startevt
259 for line
in logfile_lines:
261 if '%MSG-w MemoryCheck:' in line:
263 if int(tokens[-1])>= startevt:
264 event_number=
int(tokens[-1])
267 vsize=
float(tokens[4])
268 delta_vsize=
float(tokens[5])
270 delta_rss=
float(tokens[8])
271 data.append((event_number,{
'vsize':vsize,
272 'delta_vsize':delta_vsize,
274 'delta_rss':delta_rss
279 if not len(data) == 0:
281 steps.append((step,data))
291 def newGraphAndHisto(histoleg,leg,npoints,nbins,min_val,max_val,data,graph_num,prevrev=""):
295 if not prevrev ==
"":
296 (head, tail) = os.path.split(prevrev)
297 prevRevName = os.path.basename(tail)
298 releaseNames = [
"Previous (%s)" % prevRevName,_cmsver]
300 histo=ROOT.TH1F(
"Seconds per event (histo: %s)" % graph_num,
'Seconds per event',nbins,min_val,max_val)
302 graph=ROOT.TGraph(npoints)
306 for evt_num,secs
in data:
309 graph.SetPoint(evt_counter,evt_num,secs)
314 map(
lambda x: allsecs.append(x[1]),data)
315 total = reduce(
lambda x,y: x + y,allsecs)
316 mean = total / evt_counter
317 rms = math.sqrt(reduce(
lambda x,y: x + y,
map(
lambda x: x * x,allsecs)) / evt_counter)
320 graph.SetMarkerStyle(8)
321 graph.SetMarkerSize(.7)
322 graph.SetMarkerColor(1)
323 graph.SetLineWidth(3)
324 graph.SetLineColor(colors[graph_num])
325 histo.SetLineColor(colors[graph_num])
327 histoleg.AddEntry(histo,
"%s release" % releaseNames[graph_num],
"l")
328 leg.AddEntry(graph ,
"%s release" % releaseNames[graph_num],
"l")
329 leg.AddEntry(graph ,
"Mean: %s" %
str(mean) ,
"l")
330 leg.AddEntry(graph ,
"RMS : %s" %
str(rms) ,
"l")
331 leg.AddEntry(graph ,
"Peak: %s" %
str(peak) ,
"l")
332 leg.AddEntry(graph ,
"Total time: %s" %
str(total) ,
"l")
334 histo.SetFillColor(colors[graph_num])
336 return (graph,histo,mean)
344 interval=
int(max_val-min_val)
346 min_val=min_val-interval*0.2
347 max_val=max_val+interval*0.2
348 interval=
int(max_val-min_val)
350 nbins=
int(interval/secsperbin)
354 last_event=data[-1][0]
356 return (min_val,max_val,interval,npoints,last_event)
366 title =
'Seconds per event' 367 name =
'SecondsPerEvent' 369 ytitle =
"Processing time for each event (s)" 370 graph1.GetYaxis().SetRangeUser(0,max_val)
371 graph2.GetYaxis().SetRangeUser(0,max_val)
372 elif reporttype == 1:
373 name =
"%s_graph" % title
377 graph1.SetTitle(title)
379 graph1.GetXaxis().SetTitle(xtitle)
380 graph1.GetYaxis().SetTitleOffset(1.3)
381 graph1.GetYaxis().SetTitle(ytitle)
382 graph1.GetXaxis().SetLimits(0,last_event)
385 graph2.GetXaxis().SetLimits(0,last_event)
392 avg_line=ROOT.TLine(1,avg,last_event,avg)
393 avg_line.SetLineColor(colors[graph_num])
394 avg_line.SetLineWidth(2)
403 for x
in range(len(data2)):
405 if data2[x][0] == data1[x][0]:
406 avgEventNum = data2[x][0]
407 diffSecs = data2[x][1] - data1[x][1]
408 data3.append((avgEventNum,diffSecs))
414 graph=ROOT.TGraph(npoints)
418 for evt_num,secs
in data3:
421 graph.SetPoint(evt_counter,evt_num,secs)
425 map(
lambda x: allsecs.append(x[1]),data3)
426 total = reduce(
lambda x,y: x + y,allsecs)
427 mean = total / evt_counter
428 rms = math.sqrt(reduce(
lambda x,y: x + y,
map(
lambda x: x * x,allsecs)) / evt_counter)
432 interval=
int(max_val-min_val)
434 min_val=min_val-interval*0.2
435 max_val=max_val+interval*0.2
436 interval=
int(max_val-min_val)
441 new_max = min_val + orig_max_val
442 if new_max < max_val:
447 graph.SetTitle(
'Change in processing time for each event between revs')
448 graph.SetName(
'SecondsPerEvent')
449 graph.GetXaxis().SetTitle(
"Event Number")
450 graph.GetYaxis().SetTitle(
"Change in processing time between revs (s)")
451 graph.GetYaxis().SetTitleOffset(1.3)
452 graph.SetLineColor(2)
453 graph.SetMarkerStyle(8)
454 graph.SetMarkerSize(.7)
455 graph.SetMarkerColor(1)
456 graph.SetLineWidth(3)
457 graph.GetXaxis().SetLimits(0,last_event)
458 graph.GetYaxis().SetRangeUser(min_val,max_val)
459 leg = ROOT.TLegend(0.5,0.7,0.89,0.89)
460 leg.AddEntry(graph,
"Mean: %s" %
str(mean),
"l")
461 leg.AddEntry(graph,
"RMS : %s" %
str(rms) ,
"l")
462 leg.AddEntry(graph,
"Peak: %s" %
str(peak),
"l")
463 leg.AddEntry(graph,
"Total time change: %s" %
str(total) ,
"l")
471 graph_canvas = ROOT.TCanvas(
"graph_canvas")
484 histo_canvas = ROOT.TCanvas(
"histo_canvas")
486 histo_stack.Draw(
"nostack")
494 graph_canvas = ROOT.TCanvas(
"change_canvas")
504 biggestLastEvt = last_event1
505 biggestMaxval = max_val1
506 lowest_val = min_val1
508 if min_val2 < lowest_val:
509 lowest_val = min_val2
510 if last_event2 > biggestLastEvt:
511 biggestLastEvt = last_event2
512 if max_val2 > biggestMaxval:
513 biggestMaxval = max_val2
514 return (biggestLastEvt,biggestMaxval,lowest_val)
520 if data[0][0]==data[1][0]:
521 print(
'Two modules seem to have some output.\nCollapsing ...')
527 new_eventnumber=dataline1[0]
528 new_vsize=dataline2[1][
'vsize']
529 new_delta_vsize=dataline1[1][
'delta_vsize']+dataline2[1][
'delta_vsize']
530 new_rss=dataline2[1][
'rss']
531 new_delta_rss=dataline1[1][
'delta_rss']+dataline2[1][
'delta_rss']
533 new_data.append((new_eventnumber,{
'vsize':new_vsize,
534 'delta_vsize':new_delta_vsize,
536 'delta_rss':new_delta_rss}))
538 if i==len(data):
break 541 print(
'Collapsing: Done!')
545 return (data,len(data))
552 values = [
"vsize",
"rss"]
555 if not prevrev ==
"":
556 (head, tail) = os.path.split(prevrev)
557 prevRevName = os.path.basename(tail)
559 releaseNames = [
"Previous (%s)" % prevRevName,_cmsver]
571 graph = ROOT.TGraph(npoints)
572 graph.SetTitle(value)
573 graph.SetLineColor(colors[graph_num])
574 graph.SetMarkerStyle(8)
575 graph.SetMarkerSize(.7)
576 graph.SetMarkerColor(1)
577 graph.SetLineWidth(3)
578 graph.GetXaxis().SetTitle(
"Event")
579 graph.GetYaxis().SetTitleOffset(1.3)
580 graph.GetYaxis().SetTitle(
"MB")
586 for event_number,vals_dict
in data:
588 minim = vals_dict[value]
589 peak = vals_dict[value]
591 if vals_dict[value] > peak:
592 peak = vals_dict[value]
593 if vals_dict[value] < minim:
594 minim = vals_dict[value]
595 graph.SetPoint(point_counter, event_number, vals_dict[value])
596 total += vals_dict[value]
597 rms += vals_dict[value] * vals_dict[value]
600 rms = math.sqrt(rms /
float(point_counter))
601 mean = total /
float(point_counter)
602 last_event=data[-1][0]
605 graph.GetXaxis().SetRangeUser(0,last_event+1)
606 leg.AddEntry(graph ,
"%s release" % releaseNames[graph_num],
"l")
607 leg.AddEntry(graph ,
"Mean: %s" %
str(mean) ,
"l")
608 leg.AddEntry(graph ,
"RMS : %s" %
str(rms) ,
"l")
609 leg.AddEntry(graph ,
"Peak: %s" %
str(peak) ,
"l")
613 return (graphs[0] , last_event, peaks[0], minims[0], graphs[1], last_event, peaks[1], minims[1])
618 def getMemDiff(data1,data2,npoints,last_event,orig_max_val,stepname,rss=False):
624 graph=ROOT.TGraph(npoints)
631 for x
in range(len(data2)):
633 (evtnum2,valdict2) = data2[x]
634 (evtnum1,valdict1) = data1[x]
635 if evtnum2 == evtnum1:
636 diffMBytes = valdict2[memtype] - valdict1[memtype]
642 if diffMBytes > peak:
644 if diffMBytes < minum:
646 graph.SetPoint(evt_counter,evtnum2,diffMBytes)
649 rms += (diffMBytes * diffMBytes)
655 mean = total / evt_counter
656 rms = math.sqrt(rms /
float(evt_counter))
660 interval =
int(max_val-min_val)
662 min_val=min_val-interval*0.2
663 max_val=max_val+interval*0.2
664 interval=
int(max_val-min_val)
668 new_max = min_val + orig_max_val
669 if new_max < max_val:
674 graph.SetTitle(
"Change in %s memory usage for each event between revs for step %s" % (memtype,stepname))
675 graph.SetName(
'MemoryUsagePerEvent')
676 graph.GetXaxis().SetTitle(
"Event Number")
677 graph.GetYaxis().SetTitle(
"Change in memory usage between revs (MBs)")
678 graph.GetYaxis().SetTitleOffset(1.3)
679 graph.SetLineColor(2)
680 graph.SetMarkerStyle(8)
681 graph.SetMarkerSize(.7)
682 graph.SetMarkerColor(1)
683 graph.SetLineWidth(3)
684 graph.GetXaxis().SetLimits(0,last_event)
685 graph.GetYaxis().SetRangeUser(min_val,max_val)
686 leg = ROOT.TLegend(0.5,0.7,0.89,0.89)
687 leg.AddEntry(graph,
"Mean: %s" %
str(mean),
"l")
688 leg.AddEntry(graph,
"RMS : %s" %
str(rms) ,
"l")
689 leg.AddEntry(graph,
"Peak: %s" %
str(peak),
"l")
690 leg.AddEntry(graph,
"Trough: %s" %
str(minum) ,
"l")
697 def drawMemGraphs(graph1,graph2,min_val,max_val,last_event,leg,memtype,stepname):
698 graph_canvas=ROOT.TCanvas(
"%s_%s_canvas" % (memtype,stepname))
700 graph1.GetYaxis().SetRangeUser(min_val,max_val)
701 graph1.GetXaxis().SetRangeUser(0,last_event)
705 graph_canvas.ForceUpdate()
713 graph_canvas=ROOT.TCanvas(
"%s_%s_change_canvas" % (memtype,stepname))
717 graph_canvas.ForceUpdate()
730 def cmpSimpMemReport(rootfilename,outdir,oldLogfile,newLogfile,startevt,batch=True,candle="",prevrev=""):
735 print(
"#####LOGFILES in cmsPErfRegress:")
761 candreg = re.compile(
"(.*)(?:\.log)")
773 (stepname1, data1) = info1[0]
774 (stepname2, data2) = info2[0]
807 leg = ROOT.TLegend(0.6,0.99,0.89,0.8)
809 leg = ROOT.TLegend(0.6,0.99,0.89,0.8)
851 (vsize_lstevt, vsize_max_val, vsize_min_val) =
getTwoGraphLimits(vsize_lstevt1, vsize_peak1, vsize_lstevt2, vsize_peak2, vsize_minim1, vsize_minim2)
852 (rss_lstevt , rss_max_val , rss_min_val) =
getTwoGraphLimits(rss_lstevt1 , rss_peak1, rss_lstevt2 , rss_peak2, rss_minim1, rss_minim2)
854 (vsize_min,vsize_max) =
getMemOrigScale(vsize_minim1,vsize_minim2,vsize_peak1,vsize_peak2)
855 (rss_min ,rss_max ) =
getMemOrigScale(rss_minim1,rss_minim2,rss_peak1,rss_peak2)
862 title =
"%s_vsize" % stepname1)
868 title =
"%s_rss" % stepname2)
870 (vsizePerfDiffgraph, vsizeleg) =
getMemDiff(data1,data2,npoints2,vsize_lstevt, (vsize_max - vsize_min), stepname1, rss=
False)
871 (rssPerfDiffgraph, rssleg) =
getMemDiff(data1,data2,npoints2,rss_lstevt , (rss_max - rss_min) , stepname1, rss=
True )
873 vsize_canvas =
drawMemGraphs(vsize_graph1, vsize_graph2, vsize_min_val, vsize_max_val, vsize_lstevt, legs[0],
"vsize", stepname1)
874 rss_canvas =
drawMemGraphs(rss_graph1 , rss_graph2 , rss_min_val, rss_max_val, rss_lstevt, legs[1],
"rss" , stepname1)
875 vsize_change_canvas =
drawMemChangeGraphs(vsizePerfDiffgraph, vsizeleg,
"vsize", stepname1)
883 found = candreg.search(os.path.basename(newLogfile))
886 logcandle = found.groups()[0]
888 if candle
in CandFname:
889 candFilename = CandFname[candle]
890 elif logcandle
in CandFname:
891 candFilename = CandFname[logcandle]
893 print(
"%s is an unknown candle!"%candle)
894 candFilename =
"Unknown-candle" 896 outputdir =
"%s_%s_SimpleMemReport" % (candFilename,stepname1)
897 outputdir = os.path.join(outdir,outputdir)
899 if not os.path.exists(outputdir):
904 newrootfile =
createROOT(outputdir,rootfilename)
906 vsize_canvas.Print( os.path.join(outputdir,
"vsize_graphs.png"),
"png")
907 rss_canvas.Print( os.path.join(outputdir,
"rss_graphs.png" ),
"png")
908 vsize_change_canvas.Print(os.path.join(outputdir,
"vsize_change.png"),
"png")
909 rss_change_canvas.Print( os.path.join(outputdir,
"rss_change.png" ),
"png")
911 map(
lambda x: x.Write(), [vsize_graph1,vsize_graph2, rss_graph1, rss_graph2, vsizePerfDiffgraph, rssPerfDiffgraph])
912 map(
lambda x: x.Write(), [vsize_canvas,rss_canvas,vsize_change_canvas,rss_change_canvas])
921 canvases.append(rss_canvas)
922 canvases.append(vsize_canvas)
923 canvases.append(vsize_change_canvas)
924 canvases.append(rss_change_canvas)
937 if len(canvases) > 0:
938 while reduce(
lambda x,y: x
or y ,canvases):
943 def cmpTimingReport(rootfilename,outdir,oldLogfile,newLogfile,secsperbin,batch=True,prevrev=""):
951 (min_val1,max_val1,nbins1,npoints1,last_event1) =
getLimits(data1,secsperbin)
952 except IndexError
as detail:
956 (min_val2,max_val2,nbins2,npoints2,last_event2) =
getLimits(data2,secsperbin)
957 except IndexError
as detail:
960 hsStack = ROOT.THStack(
"hsStack",
"Histogram Comparison")
961 leg = ROOT.TLegend(0.6,0.99,0.89,0.8)
962 histoleg = ROOT.TLegend(0.5,0.8,0.89,0.89)
966 (graph1,histo1,mean1) =
newGraphAndHisto(histoleg,leg,npoints1,nbins1,min_val1,max_val1,data1,0,prevrev)
968 (graph2,histo2,mean2) =
newGraphAndHisto(histoleg,leg,npoints2,nbins2,min_val2,max_val2,data2,1,prevrev)
971 (biggestLastEvt,biggestMaxval, trashthis) =
getTwoGraphLimits(last_event1,max_val1,last_event2,max_val2,min_val1,min_val2)
973 (changegraph,chgleg) =
getTimingDiff(data1,data2,npoints2,biggestLastEvt,biggestMaxval)
981 histo1.GetXaxis().SetTitle(
"s")
982 graph_canvas =
drawGraphs(graph1,graph2,avg_line1,avg_line2,leg)
994 tot_a1 =
array(
"f", [ 0 ] )
995 tot_a2 =
array(
"f", [ 0 ] )
1000 cput.Branch(
"total1",tot_a1,
"total1/F")
1001 cput.Branch(
"total2",tot_a2,
"total2/F")
1003 cput.Write(
"cpu_time_tuple",ROOT.TObject.kOverwrite)
1005 names = [
"graphs.png",
"changes.png",
"histos.png"]
1007 graph_canvas.Print( os.path.join(outdir,names[0]),
"png")
1008 changes_canvas.Print(os.path.join(outdir,names[1]),
"png")
1009 histo_canvas.Print( os.path.join(outdir,names[2]),
"png")
1011 map(
lambda x:x.Write(),[graph1,graph2,changegraph,hsStack,histo1,histo2])
1013 graph_canvas.Write()
1014 changes_canvas.Write()
1015 histo_canvas.Write()
1021 while graph_canvas
or histo_canvas
or changes_canvas:
1029 RemoveCmd=
"rm -Rf %s"%path
1030 os.system(RemoveCmd)
1031 except OSError
as detail:
1032 if detail.errno == 39:
1040 os.remove(os.path.join(path,f))
1042 rmtree(os.path.join(path,d))
1043 except OSError
as detail:
1045 except IOError
as detail:
1052 src = os.environ[
"CMSSW_SEARCH_PATH"]
1053 except KeyError
as detail:
1054 print(
"ERROR: scramv1 environment could not be located", detail)
1056 vars = src.split(
":")
1067 cmssw_release_base =
"" 1070 cmssw_release_base = os.environ[
'CMSSW_RELEASE_BASE']
1071 cmssw_data = os.environ[
'CMSSW_DATA_PATH']
1072 except KeyError
as detail:
1075 xmlfile = os.path.join(cmssw_release_base,
"src",
"Validation",
"Performance",
"doc",
"regress.xml")
1077 prRoot =
"/afs/cern.ch/user/g/gbenelli/public/PerfReport2/2.0.1" 1088 tmpdir = tmp.mkdtemp(prefix=os.path.join(outdir,
"tmp"))
1090 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)
1091 cmd =
"tcsh -c \"cd %s ; eval `scramv1 runtime -csh` ; cd - ;source %s/etc/profile.d/init.csh ; %s\"" % (loc,prRoot,perfcmd)
1094 process = subprocess.Popen(cmd,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
1095 exitstat = process.wait()
1096 cmdout = process.stdout.read()
1097 exitstat = process.returncode
1102 except IOError
as detail:
1103 print(
"WARNING: Could not remove dir because IO%s" % detail)
1104 except OSError
as detail:
1105 print(
"WARNING: Could not remove dir because %s" % detail)
1111 if not exitstat ==
None:
1112 sig = exitstat >> 16
1113 xstatus = exitstat & 0xffff
1114 raise PerfReportErr(
"ERROR: PerfReport returned a non-zero exit status (%s, SIG_INT = %s) run %s. Dump follows: \n%s" % (perfcmd,xstatus,sig,cmdout))
1121 gzf = gzip.open(inf,
"r") 1126 print(
"finish ungzipping")
1130 os.system(
"gzip -c -d %s > %s" % (inf,out))
1133 (tfile1, tfile2) = (
"",
"")
1136 (th1, tfile1) = tmp.mkstemp(prefix=os.path.join(outdir,
"igprofRegressRep."))
1137 (th2, tfile2) = tmp.mkstemp(prefix=os.path.join(outdir,
"igprofRegressRep."))
1145 perfreport(1,tfile1,tfile2,outdir,IgProfMemOpt)
1149 except OSError
as detail:
1150 raise PerfReportErr(
"WARNING: The OS returned the following error when comparing %s and %s\n%s" % (file1,file2,
str(detail)))
1151 if os.path.exists(tfile1):
1153 if os.path.exists(tfile2):
1155 except IOError
as detail:
1156 raise PerfReportErr(
"IOError: When comparing %s and %s using temporary files %s and %s. Error message:\n%s" % (file1,file2,tfile1,tfile2,
str(detail)))
1157 if os.path.exists(tfile1):
1159 if os.path.exists(tfile2):
1167 outdir = os.getcwd()
1169 (file1,file2,secsperbin,reporttype,IgProfMemOptions) =
getParameters()
1172 if reporttype ==
"timing":
1173 rootfilename =
"timingrep-regression.root" 1175 elif reporttype ==
"simplememory":
1176 rootfilename =
"simpmem-regression.root" 1178 elif reporttype ==
"edmsize":
1180 elif reporttype ==
"callgrind":
1182 elif reporttype ==
"igprof":
1184 except TimingParseErr
as detail:
1185 print(
"WARNING: Could not parse data from Timing report file %s; not performing regression" % detail.message)
1186 except SimpMemParseErr
as detail:
1187 print(
"WARNING: Could not parse data from Memory report file %s; not performing regression" % detail.message)
1188 except PerfReportErr
as detail:
1189 print(
"WARNING: Could not parse data from Edm file %s; not performing regression" % detail.message)
1190 except IOError
as detail:
1192 except OSError
as detail:
1195 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) ...