| The Gaudi Framework v32r1 (f65d50dc)

Functions | Variables
plotSpeedup Namespace Reference

## Functions
def | getRuntime (n_algos_in_flight, n_evts_in_flight, cloneFlag)
def | getRuntimes ()
def | getGraphPoints (n_evts_in_flight, cloneFlag, runtimes)
def | getSingleGraph (n_evts_in_flight, cloneFlag, runtimes, colour, style)
def | make_plot (runtimes, cloneFlag)

## Variables
list | n_algos_in_flight_l = [1, 2, 5, 7, 10, 16, 20, 22]
list | n_evts_in_flight_l = [1, 2, 4, 6, 7, 8, 9, 11, 13, 14, 15]
list | colour_l = [kRed, kBlue, kOrange, kGreen, kMagenta, kCyan] * 2
list | line_style_l = [1] * 6 + [2] * 6
list | cloneFlag_l = [True, False]
string | filename_scheleton = "timing_measurement_BrunelScenario_n150_eif%s_aif%s_nthreads24_c%s_dqFalse.log"
def | runtimes = getRuntimes()

## Detailed Description

    Script that fetches all the logfiles from disk and reads the timings.
    Parameters can be changed according to the working points considered.
    Some parameters of the plots are hardcoded.

## Function Documentation

## ◆ getGraphPoints()

def plotSpeedup.getGraphPoints | ( |  | n_evts_in_flight,
|  |  | cloneFlag,
|  |  | runtimes
| ) |  |

Definition at line 51 of file plotSpeedup.py.

51 def getGraphPoints(n_evts_in_flight, cloneFlag, runtimes):
52 points = []
53 for key, rt in runtimes.items():
54 this_n_algos_in_flight, this_n_evts_in_flight, this_cloneFlag = key
55 if this_n_evts_in_flight == n_evts_in_flight and \
56 this_cloneFlag == cloneFlag:
57 points.append((this_n_algos_in_flight, rt))
58 return sorted(points)
59
60
plotSpeedup.getGraphPoints
def getGraphPoints(n_evts_in_flight, cloneFlag, runtimes)
Definition: plotSpeedup.py:51

## ◆ getRuntime()

def plotSpeedup.getRuntime | ( |  | n_algos_in_flight,
|  |  | n_evts_in_flight,
|  |  | cloneFlag
| ) |  |

Definition at line 22 of file plotSpeedup.py.

22 def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag):
23 filename = filename_scheleton % (n_evts_in_flight, n_algos_in_flight,
24 cloneFlag)
25 print filename
26 rt = 0.
27 for line in open(filename, "r").readlines():
28 rt = float(line[:-1])
29 # print filename
30 # print rt
31 return rt
32
33
34 '''
35 Dictionary with
36 o Key = [n_algos_in_flight, n_evts_in_flight, cloneFlag]
37 o Val = Runtime
38 '''
39
40
plotSpeedup.getRuntime
def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
Definition: plotSpeedup.py:22

## ◆ getRuntimes()

def plotSpeedup.getRuntimes | ( |  | ) |

Definition at line 41 of file plotSpeedup.py.

41 def getRuntimes():
42 runtimes = {}
43 for n_algos_in_flight in n_algos_in_flight_l:
44 for n_evts_in_flight in n_evts_in_flight_l:
45 for cloneFlag in cloneFlag_l:
46 rt = getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
47 runtimes[n_algos_in_flight, n_evts_in_flight, cloneFlag] = rt
48 return runtimes
49
50
plotSpeedup.getRuntimes
def getRuntimes()
Definition: plotSpeedup.py:41
plotSpeedup.getRuntime
def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
Definition: plotSpeedup.py:22

## ◆ getSingleGraph()

def plotSpeedup.getSingleGraph | ( |  | n_evts_in_flight,
|  |  | cloneFlag,
|  |  | runtimes,
|  |  | colour,
|  |  | style
| ) |  |

Definition at line 61 of file plotSpeedup.py.

61 def getSingleGraph(n_evts_in_flight, cloneFlag, runtimes, colour, style):
62 points = getGraphPoints(n_evts_in_flight, cloneFlag, runtimes)
63 graph = TGraph(len(points))
64 graph.GetXaxis().SetTitle("Maximum # in flight algos")
65 graph.GetXaxis().SetRangeUser(0, 23)
66 graph.GetYaxis().SetTitle("Runtime [s]")
67 graph.GetYaxis().SetTitleOffset(1.45)
68 graph.GetYaxis().SetRangeUser(0.1, 275)
69 graph.GetYaxis().SetNdivisions(12, 5, 1)
70 graph.SetLineWidth(3)
71 graph.SetLineColor(colour)
72 graph.SetMarkerColor(colour)
73 graph.SetLineStyle(style)
74 graph.SetFillColor(kWhite)
75 point_n = 0
76 # print points
77 for x, y in points:
78 graph.SetPoint(point_n, x, y)
79 point_n += 1
80 return graph
81
82
plotSpeedup.getGraphPoints
def getGraphPoints(n_evts_in_flight, cloneFlag, runtimes)
Definition: plotSpeedup.py:51
plotSpeedup.getSingleGraph
def getSingleGraph(n_evts_in_flight, cloneFlag, runtimes, colour, style)
Definition: plotSpeedup.py:61

## ◆ make_plot()

def plotSpeedup.make_plot | ( |  | runtimes,
|  |  | cloneFlag
| ) |  |

Definition at line 83 of file plotSpeedup.py.

83 def make_plot(runtimes, cloneFlag):
84 title = "Brunel 150 events"
85 clone_string = ""
86 if cloneFlag:
87 clone_string = "_clone"
88 title += " (Cloning)"
89 plotname = "runtime%s.pdf" % clone_string
90
91 canvas = TCanvas(plotname, "plot", 500, 400)
92 canvas.SetGrid()
93 canvas.cd()
94
95 graphs = []
96 first = True
97 for colour, n_evts_in_flight, line_style in zip(
98 colour_l, n_evts_in_flight_l, line_style_l):
99 print n_evts_in_flight
100 graph = getSingleGraph(n_evts_in_flight, cloneFlag, runtimes, colour,
101 line_style)
102 opts = "LSame"
103 if first:
104 opts = "AL"
105 first = False
106 graph.SetTitle(title)
107 graph.Draw(opts)
108 graphs.append(graph)
109
110 # Make Legend
111 legend = TLegend(.499, .45, .9, .9, "# Parallel Events")
112 legend.SetTextSize(0.04)
113 legend.SetFillColor(kWhite)
114 # evil
115 for graph, n in zip(graphs, n_evts_in_flight_l):
116 legend.AddEntry(graph, "%s" % n)
117 legend.Draw()
118
119 # Add some text
120 l = TLatex(.13, .16, "#font[12]{#scale[.8]{24 Threads}}")
121 l.SetNDC()
122 l.Draw()
123
124 dummy = raw_input("Press enter to save...")
125 canvas.Print(plotname)
126
127
128 # -------------------------------------------------------------------------------
plotSpeedup.make_plot
def make_plot(runtimes, cloneFlag)
Definition: plotSpeedup.py:83
plotSpeedup.getSingleGraph
def getSingleGraph(n_evts_in_flight, cloneFlag, runtimes, colour, style)
Definition: plotSpeedup.py:61

## Variable Documentation

## ◆ cloneFlag_l

list plotSpeedup.cloneFlag_l = [True, False]

Definition at line 14 of file plotSpeedup.py.

## ◆ colour_l

list plotSpeedup.colour_l = [kRed, kBlue, kOrange, kGreen, kMagenta, kCyan] * 2

Definition at line 12 of file plotSpeedup.py.

## ◆ filename_scheleton

string plotSpeedup.filename_scheleton = "timing_measurement_BrunelScenario_n150_eif%s_aif%s_nthreads24_c%s_dqFalse.log"

Definition at line 19 of file plotSpeedup.py.

## ◆ line_style_l

list plotSpeedup.line_style_l = [1] * 6 + [2] * 6

Definition at line 13 of file plotSpeedup.py.

## ◆ n_algos_in_flight_l

list plotSpeedup.n_algos_in_flight_l = [1, 2, 5, 7, 10, 16, 20, 22]

Definition at line 10 of file plotSpeedup.py.

## ◆ n_evts_in_flight_l

list plotSpeedup.n_evts_in_flight_l = [1, 2, 4, 6, 7, 8, 9, 11, 13, 14, 15]

Definition at line 11 of file plotSpeedup.py.

## ◆ runtimes

def plotSpeedup.runtimes = getRuntimes()

Definition at line 129 of file plotSpeedup.py.