14Script to parse all the logs and produce the speedup plot.
16plotSpeedupsPyRoot.py --> vanilla plot
17plotSpeedupsPyRoot.py 1 --> HT scaled plot
18The variable fname_template contains the template of the file names to be
19opened and parsed and is FIXED for all the logs.
20The word "seconds" is looked for in the log and then the total runtime of the
21event loop is extracted. This allows to discard the time spent in calibration
27 "measurement_BrunelScenario_n100_eif%s_aif100_nthreads%s_c%s_dqFalse_v5.log"
30neif_l = [1, 2, 3, 5, 20, 30]
32nts = [2, 3, 5, 10, 11, 12, 13, 15, 23]
34cFlags = [
"True",
"False"]
72 effective_n_threads = n_threads
73 if effective_n_threads > PhCores:
74 ht_cores = n_threads - PhCores
75 effective_n_threads = PhCores + ht_cores * HtCoreWeight
76 return effective_n_threads
82def getText(x, y, text, scale, angle, colour, font):
84 x, y,
"#scale[%s]{#color[%s]{#font[%s]{%s}}}" % (scale, colour, font, text)
87 lat.SetTextAngle(angle)
96 graphc.SetLineStyle(LineStyle)
97 graphs = (graph, graphc)
99 g.SetLineWidth(LineWidth)
100 g.SetMarkerSize(MarkerSize)
101 g.SetMarkerStyle(MarkerStyles[graph_counter])
102 g.SetLineColor(LineColours[graph_counter])
103 g.SetMarkerColor(LineColours[graph_counter])
111 return fname_template % (neif, nt, cFlag)
119 ifile = open(filename,
"r")
122 if "seconds" in line:
124 seconds = float(line.split(
" ")[-1])
128 seconds =
xtractTiming(neif, nts[nts.index(nt) - 1], cFlag)
142 print(
"Events in flight: %s" % neif)
151idealSpeedup = ROOT.TGraph(2)
152idealSpeedup.SetPoint(0, 1, 1)
153idealSpeedup.SetPoint(1, TotalCores, TotalCores)
156 scaled_s =
" (scaled for HT)"
157idealSpeedup.SetTitle(
158 "GaudiHive Speedup (Brunel, 100 evts);Thread Pool Size%s;Speedup wrt Serial Case"
161idealSpeedup.SetLineWidth(4)
162idealSpeedup.SetLineColor(ROOT.kGray - 2)
163idealSpeedup.SetLineStyle(2)
168 graph = ROOT.TGraph(len_nt)
169 graph.SetName(
"%s" % neif)
170 graph.SetPoint(0, 1, 1)
172 graphc = ROOT.TGraph(len_nt)
173 graphc.SetName(
"%s clone" % neif)
174 graphc.SetPoint(0, 1, 1)
181 graph.SetPoint(counter, scaled_tn, ScalarTime / time)
183 graphc.SetPoint(counter, scaled_tn, ScalarTime / timec)
186 neif_graphs.append([neif, graph, graphc])
191canvas = ROOT.TCanvas(
"Speedup",
"Speedup", 2048, 1800)
194idealSpeedup.Draw(
"APL")
195idealSpeedup.GetYaxis().SetRangeUser(0.1, TotalCores + 1)
198line = ROOT.TLine(11, 0, 11, 25)
199line.SetLineColor(ROOT.kRed)
204for neif, graph, graphc
in neif_graphs:
206 graphc.Draw(
"SamePL")
209legend = ROOT.TLegend(0.1, 0.45, 0.38, 0.9)
210legend.SetFillColor(ROOT.kWhite)
211legend.SetHeader(
"# Simultaneous Evts")
212for neif, graph, graphc
in neif_graphs:
213 legend.AddEntry(graph,
"%s" % neif, LegendDrawOpts)
214 legend.AddEntry(graphc,
"%s (clone)" % neif, LegendDrawOpts)
218ph_cores =
getText(10.5, 15,
"Physical Cores", LabelsSize, 90, 2, LabelsFont)
220ht_cores =
getText(12.0, 15,
"Hardware Threaded Regime", LabelsSize, 90, 2, LabelsFont)
222is_text =
getText(16, 16.5,
"Ideal (linear) Speedup", LabelsSize, 45, 918, LabelsFont)
229 "#splitline{Hardware threaded}{cores weight: %s}" % HtCoreWeight,
238 scaled_s =
"_HTScaled"
239canvas.Print(
"GaudiHivePerfBrunelAllPoints%s.png" % scaled_s)
createFname(neif, nt, cFlag)
formatGraphs(graph, graphc)
xtractTiming(neif, nt, cFlag)
getText(x, y, text, scale, angle, colour, font)