The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
plotSpeedupsPyRoot Namespace Reference

Functions

 scaleCores (n_threads)
 
 getText (x, y, text, scale, angle, colour, font)
 
 formatGraphs (graph, graphc)
 
 createFname (neif, nt, cFlag)
 
 xtractTiming (neif, nt, cFlag)
 

Variables

tuple fname_template
 
list neif_l = [1, 2, 3, 5, 20, 30]
 
list nts = [2, 3, 5, 10, 11, 12, 13, 15, 23]
 
list cFlags = ["True", "False"]
 
float ScalarTime = 1640.87
 
str LegendDrawOpts = "lp"
 
list LineColours
 
list MarkerStyles
 
int MarkerSize = 4
 
int LineWidth = 6
 
int LineStyle = 7
 
int graph_counter = 0
 
int PhCores = 11
 
int TotalCores = 24
 
float HtCoreWeight = 0.4
 
int LabelsFont = 12
 
float LabelsSize = 0.6
 
bool scaleThreads = False
 
int len_nt = len(nts) + 1
 
 idealSpeedup = ROOT.TGraph(2)
 
str scaled_s = ""
 
list neif_graphs = []
 
 graph = ROOT.TGraph(len_nt)
 
 graphc = ROOT.TGraph(len_nt)
 
int counter = 1
 
 scaled_tn = tn
 
 time = xtractTiming(neif, tn, False)
 
 timec = xtractTiming(neif, tn, True)
 
 canvas = ROOT.TCanvas("Speedup", "Speedup", 2048, 1800)
 
 line = ROOT.TLine(11, 0, 11, 25)
 
 legend = ROOT.TLegend(0.1, 0.45, 0.38, 0.9)
 
 ph_cores = getText(10.5, 15, "Physical Cores", LabelsSize, 90, 2, LabelsFont)
 
 ht_cores = getText(12.0, 15, "Hardware Threaded Regime", LabelsSize, 90, 2, LabelsFont)
 
 is_text = getText(16, 16.5, "Ideal (linear) Speedup", LabelsSize, 45, 918, LabelsFont)
 
int ht_weight = 0
 

Function Documentation

◆ createFname()

plotSpeedupsPyRoot.createFname ( neif,
nt,
cFlag )

Definition at line 110 of file plotSpeedupsPyRoot.py.

110def createFname(neif, nt, cFlag):
111 return fname_template % (neif, nt, cFlag)
112
113
114# --------------------
115
116

◆ formatGraphs()

plotSpeedupsPyRoot.formatGraphs ( graph,
graphc )

Definition at line 94 of file plotSpeedupsPyRoot.py.

94def formatGraphs(graph, graphc):
95 global graph_counter
96 graphc.SetLineStyle(LineStyle)
97 graphs = (graph, graphc)
98 for g in graphs:
99 g.SetLineWidth(LineWidth)
100 g.SetMarkerSize(MarkerSize)
101 g.SetMarkerStyle(MarkerStyles[graph_counter])
102 g.SetLineColor(LineColours[graph_counter])
103 g.SetMarkerColor(LineColours[graph_counter])
104 graph_counter += 1
105
106
107# --------------------
108
109

◆ getText()

plotSpeedupsPyRoot.getText ( x,
y,
text,
scale,
angle,
colour,
font )

Definition at line 82 of file plotSpeedupsPyRoot.py.

82def getText(x, y, text, scale, angle, colour, font):
83 lat = ROOT.TLatex(
84 x, y, "#scale[%s]{#color[%s]{#font[%s]{%s}}}" % (scale, colour, font, text)
85 )
86 if angle != 0.0:
87 lat.SetTextAngle(angle)
88 return lat
89
90
91# --------------------
92
93

◆ scaleCores()

plotSpeedupsPyRoot.scaleCores ( n_threads)

Definition at line 71 of file plotSpeedupsPyRoot.py.

71def scaleCores(n_threads):
72 effective_n_threads = n_threads
73 if effective_n_threads > PhCores:
74 ht_cores = n_threads - PhCores
75 effective_n_threads = PhCores + ht_cores * HtCoreWeight
76 return effective_n_threads
77
78
79# --------------------
80
81

◆ xtractTiming()

plotSpeedupsPyRoot.xtractTiming ( neif,
nt,
cFlag )

Definition at line 117 of file plotSpeedupsPyRoot.py.

117def xtractTiming(neif, nt, cFlag):
118 filename = createFname(neif, nt, cFlag)
119 ifile = open(filename, "r")
120 seconds = -1
121 for line in ifile:
122 if "seconds" in line:
123 line = line[:-1]
124 seconds = float(line.split(" ")[-1])
125 break
126 ifile.close()
127 if seconds == -1:
128 seconds = xtractTiming(neif, nts[nts.index(nt) - 1], cFlag)
129 return seconds
130
131
132# --------------------
133

Variable Documentation

◆ canvas

plotSpeedupsPyRoot.canvas = ROOT.TCanvas("Speedup", "Speedup", 2048, 1800)

Definition at line 191 of file plotSpeedupsPyRoot.py.

◆ cFlags

list plotSpeedupsPyRoot.cFlags = ["True", "False"]

Definition at line 34 of file plotSpeedupsPyRoot.py.

◆ counter

int plotSpeedupsPyRoot.counter = 1

Definition at line 175 of file plotSpeedupsPyRoot.py.

◆ fname_template

tuple plotSpeedupsPyRoot.fname_template
Initial value:
1= (
2 "measurement_BrunelScenario_n100_eif%s_aif100_nthreads%s_c%s_dqFalse_v5.log"
3)

Definition at line 26 of file plotSpeedupsPyRoot.py.

◆ graph

plotSpeedupsPyRoot.graph = ROOT.TGraph(len_nt)

Definition at line 168 of file plotSpeedupsPyRoot.py.

◆ graph_counter

int plotSpeedupsPyRoot.graph_counter = 0

Definition at line 59 of file plotSpeedupsPyRoot.py.

◆ graphc

plotSpeedupsPyRoot.graphc = ROOT.TGraph(len_nt)

Definition at line 172 of file plotSpeedupsPyRoot.py.

◆ ht_cores

plotSpeedupsPyRoot.ht_cores = getText(12.0, 15, "Hardware Threaded Regime", LabelsSize, 90, 2, LabelsFont)

Definition at line 220 of file plotSpeedupsPyRoot.py.

◆ ht_weight

plotSpeedupsPyRoot.ht_weight = 0

Definition at line 224 of file plotSpeedupsPyRoot.py.

◆ HtCoreWeight

float plotSpeedupsPyRoot.HtCoreWeight = 0.4

Definition at line 63 of file plotSpeedupsPyRoot.py.

◆ idealSpeedup

plotSpeedupsPyRoot.idealSpeedup = ROOT.TGraph(2)

Definition at line 151 of file plotSpeedupsPyRoot.py.

◆ is_text

plotSpeedupsPyRoot.is_text = getText(16, 16.5, "Ideal (linear) Speedup", LabelsSize, 45, 918, LabelsFont)

Definition at line 222 of file plotSpeedupsPyRoot.py.

◆ LabelsFont

int plotSpeedupsPyRoot.LabelsFont = 12

Definition at line 65 of file plotSpeedupsPyRoot.py.

◆ LabelsSize

float plotSpeedupsPyRoot.LabelsSize = 0.6

Definition at line 66 of file plotSpeedupsPyRoot.py.

◆ legend

plotSpeedupsPyRoot.legend = ROOT.TLegend(0.1, 0.45, 0.38, 0.9)

Definition at line 209 of file plotSpeedupsPyRoot.py.

◆ LegendDrawOpts

str plotSpeedupsPyRoot.LegendDrawOpts = "lp"

Definition at line 39 of file plotSpeedupsPyRoot.py.

◆ len_nt

int plotSpeedupsPyRoot.len_nt = len(nts) + 1

Definition at line 149 of file plotSpeedupsPyRoot.py.

◆ line

plotSpeedupsPyRoot.line = ROOT.TLine(11, 0, 11, 25)

Definition at line 198 of file plotSpeedupsPyRoot.py.

◆ LineColours

list plotSpeedupsPyRoot.LineColours
Initial value:
1= [
2 ROOT.kRed,
3 ROOT.kBlue,
4 ROOT.kGreen + 2,
5 ROOT.kOrange,
6 ROOT.kPink + 10,
7 ROOT.kViolet + 10,
8]

Definition at line 40 of file plotSpeedupsPyRoot.py.

◆ LineStyle

int plotSpeedupsPyRoot.LineStyle = 7

Definition at line 58 of file plotSpeedupsPyRoot.py.

◆ LineWidth

int plotSpeedupsPyRoot.LineWidth = 6

Definition at line 57 of file plotSpeedupsPyRoot.py.

◆ MarkerSize

int plotSpeedupsPyRoot.MarkerSize = 4

Definition at line 56 of file plotSpeedupsPyRoot.py.

◆ MarkerStyles

list plotSpeedupsPyRoot.MarkerStyles
Initial value:
1= [
2 ROOT.kFullCircle,
3 ROOT.kOpenCross,
4 ROOT.kFullTriangleUp,
5 ROOT.kOpenStar,
6 ROOT.kFullCross,
7 ROOT.kOpenCircle,
8]

Definition at line 48 of file plotSpeedupsPyRoot.py.

◆ neif_graphs

list plotSpeedupsPyRoot.neif_graphs = []

Definition at line 166 of file plotSpeedupsPyRoot.py.

◆ neif_l

list plotSpeedupsPyRoot.neif_l = [1, 2, 3, 5, 20, 30]

Definition at line 30 of file plotSpeedupsPyRoot.py.

◆ nts

list plotSpeedupsPyRoot.nts = [2, 3, 5, 10, 11, 12, 13, 15, 23]

Definition at line 32 of file plotSpeedupsPyRoot.py.

◆ ph_cores

plotSpeedupsPyRoot.ph_cores = getText(10.5, 15, "Physical Cores", LabelsSize, 90, 2, LabelsFont)

Definition at line 218 of file plotSpeedupsPyRoot.py.

◆ PhCores

int plotSpeedupsPyRoot.PhCores = 11

Definition at line 61 of file plotSpeedupsPyRoot.py.

◆ ScalarTime

float plotSpeedupsPyRoot.ScalarTime = 1640.87

Definition at line 36 of file plotSpeedupsPyRoot.py.

◆ scaled_s

str plotSpeedupsPyRoot.scaled_s = ""

Definition at line 154 of file plotSpeedupsPyRoot.py.

◆ scaled_tn

plotSpeedupsPyRoot.scaled_tn = tn

Definition at line 177 of file plotSpeedupsPyRoot.py.

◆ scaleThreads

bool plotSpeedupsPyRoot.scaleThreads = False

Definition at line 136 of file plotSpeedupsPyRoot.py.

◆ time

plotSpeedupsPyRoot.time = xtractTiming(neif, tn, False)

Definition at line 180 of file plotSpeedupsPyRoot.py.

◆ timec

plotSpeedupsPyRoot.timec = xtractTiming(neif, tn, True)

Definition at line 182 of file plotSpeedupsPyRoot.py.

◆ TotalCores

int plotSpeedupsPyRoot.TotalCores = 24

Definition at line 62 of file plotSpeedupsPyRoot.py.