3 Script that fetches all the logfiles from disk and reads the timings. 4 Parameters can be changed according to the working points considered. 5 Some parameters of the plots are hardcoded. 7 from __future__
import print_function
11 n_algos_in_flight_l = [1, 2, 5, 7, 10, 16, 20, 22]
12 n_evts_in_flight_l = [1, 2, 4, 6, 7, 8, 9, 11, 13, 14, 15]
13 colour_l = [kRed, kBlue, kOrange, kGreen, kMagenta, kCyan] * 2
14 line_style_l = [1] * 6 + [2] * 6
15 cloneFlag_l = [
True,
False]
17 To be filled with files on disk of the form 18 timing_measurement_BrunelScenario_n150_eif2_aif20_nthreads24_cFalse_dqFalse.log 20 filename_scheleton =
"timing_measurement_BrunelScenario_n150_eif%s_aif%s_nthreads24_c%s_dqFalse.log" 23 def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag):
24 filename = filename_scheleton % (n_evts_in_flight, n_algos_in_flight,
28 for line
in open(filename,
"r").readlines():
37 o Key = [n_algos_in_flight, n_evts_in_flight, cloneFlag] 44 for n_algos_in_flight
in n_algos_in_flight_l:
45 for n_evts_in_flight
in n_evts_in_flight_l:
46 for cloneFlag
in cloneFlag_l:
47 rt =
getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
48 runtimes[n_algos_in_flight, n_evts_in_flight, cloneFlag] = rt
54 for key, rt
in runtimes.items():
55 this_n_algos_in_flight, this_n_evts_in_flight, this_cloneFlag = key
56 if this_n_evts_in_flight == n_evts_in_flight
and \
57 this_cloneFlag == cloneFlag:
58 points.append((this_n_algos_in_flight, rt))
64 graph = TGraph(len(points))
65 graph.GetXaxis().SetTitle(
"Maximum # in flight algos")
66 graph.GetXaxis().SetRangeUser(0, 23)
67 graph.GetYaxis().SetTitle(
"Runtime [s]")
68 graph.GetYaxis().SetTitleOffset(1.45)
69 graph.GetYaxis().SetRangeUser(0.1, 275)
70 graph.GetYaxis().SetNdivisions(12, 5, 1)
72 graph.SetLineColor(colour)
73 graph.SetMarkerColor(colour)
74 graph.SetLineStyle(style)
75 graph.SetFillColor(kWhite)
79 graph.SetPoint(point_n, x, y)
85 title =
"Brunel 150 events" 88 clone_string =
"_clone" 90 plotname =
"runtime%s.pdf" % clone_string
92 canvas = TCanvas(plotname,
"plot", 500, 400)
98 for colour, n_evts_in_flight, line_style
in zip(
99 colour_l, n_evts_in_flight_l, line_style_l):
100 print(n_evts_in_flight)
101 graph =
getSingleGraph(n_evts_in_flight, cloneFlag, runtimes, colour,
107 graph.SetTitle(title)
112 legend = TLegend(.499, .45, .9, .9,
"# Parallel Events")
113 legend.SetTextSize(0.04)
114 legend.SetFillColor(kWhite)
116 for graph, n
in zip(graphs, n_evts_in_flight_l):
117 legend.AddEntry(graph,
"%s" % n)
121 l = TLatex(.13, .16,
"#font[12]{#scale[.8]{24 Threads}}")
125 dummy = raw_input(
"Press enter to save...")
126 canvas.Print(plotname)
def getGraphPoints(n_evts_in_flight, cloneFlag, runtimes)
def make_plot(runtimes, cloneFlag)
def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
def getSingleGraph(n_evts_in_flight, cloneFlag, runtimes, colour, style)