| The Gaudi Framework v28r2p1 (f1a77ff4)

- 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 47 of file plotSpeedup.py.

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

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, cloneFlag)
24 print filename
25 rt=0.
26 for line in open(filename,"r").readlines():
27 rt=float(line[:-1])
28 #print filename
29 #print rt
30 return rt
31
32 '''
33 Dictionary with
34 o Key = [n_algos_in_flight, n_evts_in_flight, cloneFlag]
35 o Val = Runtime
36 '''
plotSpeedup.getRuntime
def getRuntime(n_algos_in_flight, n_evts_in_flight, cloneFlag)
Definition: plotSpeedup.py:22

def plotSpeedup.getRuntimes | ( |  | ) |

Definition at line 37 of file plotSpeedup.py.

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

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

Definition at line 56 of file plotSpeedup.py.

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

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

Definition at line 77 of file plotSpeedup.py.

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

## 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 122 of file plotSpeedup.py.