33 logfile=open(logfile_name,
'r')
34 logfile_lines=logfile.readlines()
36 print(
"The logfile %s is empty! Exiting now."%logfile_name)
43 while i < len(logfile_lines):
46 if 'Composite Score:' in line:
48 line_content_list=line.split()
51 composite_score=float(line_content_list[2])
54 data.append((bench_number,composite_score))
62 ROOT.gROOT.SetStyle(
"Plain")
70 rootfilename=
'%s/graphs.root' %outdir
71 myfile=ROOT.TFile(rootfilename,
'RECREATE')
77 interval=int(max_val-min_val)
79 min_val=min_val-interval*0.2
80 max_val=max_val+interval*0.2
81 interval=int(max_val-min_val)
83 nbins=int(interval/secsperbin)
85 print(
'Minval=',min_val,
' maxval=',max_val,
' interval=',interval)
87 histo=ROOT.TH1F(
'Composite Score(Mflops)',
'Composite Score (Mflops)',nbins,min_val,max_val)
88 histo.GetXaxis().SetTitle(
"Mflops")
92 graph=ROOT.TGraph(npoints)
93 graph.SetMarkerStyle(8)
94 graph.SetMarkerSize(.7)
95 graph.SetMarkerColor(1)
98 graph.SetTitle(
'Composite Score')
99 graph.SetName(
'Composite Score')
100 graph.GetXaxis().SetTitle(
"Benchmark sequential number")
102 last_event=data[-1][0]
103 print(
'last event =',last_event)
104 graph.GetXaxis().SetLimits(0,last_event)
106 graph.GetYaxis().SetTitleOffset(1.3)
107 graph.GetYaxis().SetTitle(
"Mflops")
108 graph.GetYaxis().SetRangeUser(min_val,max_val)
115 for bench_number,composite_score
in data:
116 graph.SetPoint(evt_counter,bench_number,composite_score)
117 histo.Fill(composite_score)
122 avg_line=ROOT.TLine(1,avg,last_event,avg)
123 avg_line.SetLineColor(4)
124 avg_line.SetLineWidth(2)
127 graph_canvas=ROOT.TCanvas(
'graph_canvas')
130 avg_line.Draw(
"Same")
132 graph_canvas.Print(
"%s/graph.png" %outdir,
"png")
138 histo_canvas=ROOT.TCanvas(
'histo_canvas')
142 histo_canvas.Print(
"%s/histo.png" %outdir,
"png")
152 titlestring=
'<b>Report executed with release %s on %s.</b>\n<br>\n<hr>\n'\
153 %(os.environ[
'CMSSW_VERSION'],time.asctime())
155 html_file_name=
'%s/%s.html' %(outdir,logfile_name[:-4])
156 html_file=open(html_file_name,
'w')
157 html_file.write(
'<html>\n<body>\n'+\
159 html_file.write(
'<table>\n'+\
160 '<tr><td><img src=graph.png></img></td></tr>'+\
161 '<tr><td><img src=histo.png></img></td></tr>'+\
163 html_file.write(
'\n</body>\n</html>')