13 Script that fetches all the logfiles from disk and reads the timings.
14 Parameters can be changed according to the working points considered.
15 Some parameters of the plots are hardcoded.
17 from __future__
import print_function
21 n_algos_in_flight_l = [1, 2, 5, 7, 10, 16, 20, 22]
22 n_evts_in_flight_l = [1, 2, 4, 6, 7, 8, 9, 11, 13, 14, 15]
23 colour_l = [kRed, kBlue, kOrange, kGreen, kMagenta, kCyan] * 2
24 line_style_l = [1] * 6 + [2] * 6
25 cloneFlag_l = [
True,
False]
27 To be filled with files on disk of the form
28 timing_measurement_BrunelScenario_n150_eif2_aif20_nthreads24_cFalse_dqFalse.log
30 filename_scheleton = (
31 "timing_measurement_BrunelScenario_n150_eif%s_aif%s_nthreads24_c%s_dqFalse.log"
35 def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag):
36 filename = filename_scheleton % (n_evts_in_flight, n_algos_in_flight, cloneFlag)
39 for line
in open(filename,
"r").readlines():
48 o Key = [n_algos_in_flight, n_evts_in_flight, cloneFlag]
55 for n_algos_in_flight
in n_algos_in_flight_l:
56 for n_evts_in_flight
in n_evts_in_flight_l:
57 for cloneFlag
in cloneFlag_l:
58 rt =
getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
59 runtimes[n_algos_in_flight, n_evts_in_flight, cloneFlag] = rt
65 for key, rt
in runtimes.items():
66 this_n_algos_in_flight, this_n_evts_in_flight, this_cloneFlag = key
67 if this_n_evts_in_flight == n_evts_in_flight
and this_cloneFlag == cloneFlag:
68 points.append((this_n_algos_in_flight, rt))
74 graph = TGraph(len(points))
75 graph.GetXaxis().SetTitle(
"Maximum # in flight algos")
76 graph.GetXaxis().SetRangeUser(0, 23)
77 graph.GetYaxis().SetTitle(
"Runtime [s]")
78 graph.GetYaxis().SetTitleOffset(1.45)
79 graph.GetYaxis().SetRangeUser(0.1, 275)
80 graph.GetYaxis().SetNdivisions(12, 5, 1)
82 graph.SetLineColor(colour)
83 graph.SetMarkerColor(colour)
84 graph.SetLineStyle(style)
85 graph.SetFillColor(kWhite)
89 graph.SetPoint(point_n, x, y)
95 title =
"Brunel 150 events"
98 clone_string =
"_clone"
100 plotname =
"runtime%s.pdf" % clone_string
102 canvas = TCanvas(plotname,
"plot", 500, 400)
108 for colour, n_evts_in_flight, line_style
in zip(
109 colour_l, n_evts_in_flight_l, line_style_l
111 print(n_evts_in_flight)
113 n_evts_in_flight, cloneFlag, runtimes, colour, line_style
119 graph.SetTitle(title)
124 legend = TLegend(0.499, 0.45, 0.9, 0.9,
"# Parallel Events")
125 legend.SetTextSize(0.04)
126 legend.SetFillColor(kWhite)
128 for graph, n
in zip(graphs, n_evts_in_flight_l):
129 legend.AddEntry(graph,
"%s" % n)
133 l = TLatex(0.13, 0.16,
"#font[12]{#scale[.8]{24 Threads}}")
137 dummy = raw_input(
"Press enter to save...")
138 canvas.Print(plotname)