64 def makeplots(arch,sample,build,vals,nC,text):
66 if build ==
'BH' : pos = 8
67 elif build ==
'STD' : pos = 11
68 elif build ==
'CE' : pos = 14
69 elif build ==
'FV' : pos = 17
71 print build,
'is not a valid test! Exiting...'
75 print arch,sample,build,text
78 g_time = ROOT.TGraphErrors(len(vals)-1)
79 g_speedup = ROOT.TGraphErrors(len(vals)-1)
83 g_time_int = ROOT.TGraphErrors(1)
84 g_speedup_int = ROOT.TGraphErrors(1)
88 if val
is '16int': xval = 16.0
89 elif val
is '8int' : xval = 8.0
90 else : xval = float(val)
93 yvals = array.array(
'd');
99 if text
is 'VU' : os.system(
'grep Matriplex log_'+arch+
'_'+sample+
'_'+build+
'_NVU'+val+
'_NTH'+nC +
'.txt >& log_'+arch+
'_'+sample+
'_'+build+
'_'+text+
'.txt')
100 elif text
is 'TH' : os.system(
'grep Matriplex log_'+arch+
'_'+sample+
'_'+build+
'_NVU'+nC +
'_NTH'+val+
'.txt >& log_'+arch+
'_'+sample+
'_'+build+
'_'+text+
'.txt')
102 print 'VU or TH are the only options for extra text! Exiting...'
106 with open(
'log_'+arch+
'_'+sample+
'_'+build+
'_'+text+
'.txt')
as f :
108 if 'Matriplex' not in line :
continue
109 if 'Total' in line :
continue
113 lsplit = line.split()
114 yvals.append(float(lsplit[pos]))
118 for yval
in range(0,len(yvals)):
119 sum = sum + yvals[yval]
121 mean = sum/len(yvals)
125 for yval
in range(0,len(yvals)):
126 emean = emean + ((yvals[yval] - mean) * (yvals[yval] - mean))
128 emean = math.sqrt(emean / (len(yvals) - 1))
129 emean = emean/math.sqrt(len(yvals))
134 print val,mean,
'+/-',emean
137 if 'int' not in val :
138 g_time.SetPoint(point,xval,mean)
139 g_time.SetPointError(point,0,emean)
142 g_time_int.SetPoint(0,xval,mean)
143 g_time_int.SetPointError(0,0,emean)
146 g_time.Write(
'g_'+build+
'_'+text+
'_time')
150 g_time_int.Write(
'g_'+build+
'_'+text+
'_time_int')
153 xval0 = array.array(
'd',[0])
154 yval0 = array.array(
'd',[0])
155 yerr0 = array.array(
'd',[0])
158 g_time.GetPoint(0,xval0,yval0)
159 yerr0.append(g_time.GetErrorY(0))
164 xval = array.array(
'd',[0])
165 yval = array.array(
'd',[0])
166 yerr = array.array(
'd',[0])
169 if 'int' not in val :
170 g_time.GetPoint(point,xval,yval)
171 yerr.append(g_time.GetErrorY(point))
173 g_time_int.GetPoint(0,xval,yval)
174 yerr.append(g_time_int.GetErrorY(0))
178 if yval[0] > 0.
and yval0[0] > 0. :
179 speedup = yval0[0]/yval[0]
180 espeedup = speedup * math.sqrt(math.pow(yerr0[0]/yval0[0],2) + math.pow(yerr[0]/yval[0],2))
183 if 'int' not in val :
184 g_speedup.SetPoint(point,xval[0],speedup)
185 g_speedup.SetPointError(point,0,espeedup)
188 g_speedup_int.SetPoint(0,xval[0],speedup)
189 g_speedup_int.SetPointError(0,0,espeedup)
192 g_speedup.Write(
'g_'+build+
'_'+text+
'_speedup')
196 g_speedup_int.Write(
'g_'+build+
'_'+text+
'_speedup_int')