| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

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]
int | colour_l = [kRed, kBlue, kOrange, kGreen, kMagenta, kCyan]*2
int | line_style_l = [1]*6
list | cloneFlag_l = [True, False]
string | filename_scheleton = "timing_measurement_BrunelScenario_n150_eif%s_aif%s_nthreads24_c%s_dqFalse.log"
| 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

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

Definition at line 54 of file plotSpeedup.py.

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

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

Definition at line 24 of file plotSpeedup.py.

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

def plotSpeedup.getRuntimes | ( |  | ) |

Definition at line 43 of file plotSpeedup.py.

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

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

Definition at line 64 of file plotSpeedup.py.

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

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

Definition at line 86 of file plotSpeedup.py.

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

## Variable Documentation

list plotSpeedup.cloneFlag_l = [True, False]

Definition at line 15 of file plotSpeedup.py.

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

Definition at line 13 of file plotSpeedup.py.

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

Definition at line 21 of file plotSpeedup.py.

int plotSpeedup.line_style_l = [1]*6

Definition at line 14 of file plotSpeedup.py.

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

Definition at line 11 of file plotSpeedup.py.

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

Definition at line 12 of file plotSpeedup.py.

plotSpeedup.runtimes = getRuntimes()

Definition at line 131 of file plotSpeedup.py.