diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-03-28 17:47:11 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-03-28 17:47:11 -0400 |
commit | 9d81b76d5e2d47335d676c6e9f0d4e77e523b16e (patch) | |
tree | 14480d87ab6f8dc7ac78cbb1bf6fe2b9ea52f00c | |
parent | 446af539e7f80fda13cbeff952a1009f7384610c (diff) |
Evaluate standard deviation on measured average
- Also save proper measure (mean - std; mean + std) for gnuplot
error bars
-rwxr-xr-x | pm_data_analysis/pm_data_analyzer.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/pm_data_analysis/pm_data_analyzer.py b/pm_data_analysis/pm_data_analyzer.py index ca4267a..aeab5b6 100755 --- a/pm_data_analysis/pm_data_analyzer.py +++ b/pm_data_analysis/pm_data_analyzer.py | |||
@@ -220,12 +220,11 @@ class Analyzer(defapp.App): | |||
220 | 220 | ||
221 | # The output is one csv WSS file per ovhd type, "tss, max_ovd, avg_ovd" | 221 | # The output is one csv WSS file per ovhd type, "tss, max_ovd, avg_ovd" |
222 | # Filename output format: | 222 | # Filename output format: |
223 | # pm_plugin=GSN-EDF_dist=uni_light_wss=2048_ovd=preemption.csv | 223 | # pm_wss=2048_ovd=preemption.csv |
224 | # ovd: preemption, onchip, offchip, l2cache | 224 | # ovd: preemption, onchip, offchip, l2cache |
225 | 225 | ||
226 | def analyze_data(self, dname, conf): | 226 | def analyze_data(self, dname, conf): |
227 | csvbname = dname + '/pm_plugin=' + conf['plugin'] + \ | 227 | csvbname = dname + '/pm_wss=' + conf['wss'] |
228 | '_dist=uni_light_wss=' + conf['wss'] | ||
229 | 228 | ||
230 | for tss in sorted(self.valid_ovds_list.keys(), key=int): | 229 | for tss in sorted(self.valid_ovds_list.keys(), key=int): |
231 | if tss == 'min': | 230 | if tss == 'min': |
@@ -274,19 +273,28 @@ class Analyzer(defapp.App): | |||
274 | # still negative value, they shouldn't be considered | 273 | # still negative value, they shouldn't be considered |
275 | max_vec = np.max(vector) | 274 | max_vec = np.max(vector) |
276 | avg_vec = np.average(vector) | 275 | avg_vec = np.average(vector) |
276 | std_vec = np.std(vector) | ||
277 | else: | 277 | else: |
278 | max_vec = 0 | 278 | max_vec = 0 |
279 | avg_vec = 0 | 279 | avg_vec = 0 |
280 | std_vec = 0 | ||
280 | 281 | ||
281 | if self.options.cpufreq == 0: | 282 | if self.options.cpufreq == 0: |
282 | max_vec_str = "%5.5f" % max_vec | 283 | max_vec_str = "%5.5f" % max_vec |
283 | avg_vec_str = "%5.5f" % avg_vec | 284 | avg_vec_str = "%5.5f" % avg_vec |
285 | std_vec_up = "%5.5f" % (avg_vec + std_vec) | ||
286 | std_vec_down = "%5.5f" % (avg_vec - std_vec) | ||
287 | |||
284 | else: | 288 | else: |
285 | max_vec_str = "%5.5f" % (max_vec / self.options.cpufreq) | 289 | max_vec_str = "%5.5f" % (max_vec / self.options.cpufreq) |
286 | avg_vec_str = "%5.5f" % (avg_vec / self.options.cpufreq) | 290 | avg_vec_str = "%5.5f" % (avg_vec / self.options.cpufreq) |
291 | std_vec_up = "%5.5f" % ((avg_vec + std_vec) / self.options.cpufreq) | ||
292 | std_vec_down = "%5.5f" % ((avg_vec - std_vec) / self.options.cpufreq) | ||
287 | 293 | ||
288 | csvlist.append(max_vec_str) | 294 | csvlist.append(max_vec_str) |
289 | csvlist.append(avg_vec_str) | 295 | csvlist.append(avg_vec_str) |
296 | csvlist.append(std_vec_down) | ||
297 | csvlist.append(std_vec_up) | ||
290 | pms.csv_it(csvf, csvlist) | 298 | pms.csv_it(csvf, csvlist) |
291 | csvf.close() | 299 | csvf.close() |
292 | 300 | ||
@@ -295,10 +303,12 @@ class Analyzer(defapp.App): | |||
295 | print i[1] + " overheads (ticks)" | 303 | print i[1] + " overheads (ticks)" |
296 | print "Max = %5.5f" % max_vec | 304 | print "Max = %5.5f" % max_vec |
297 | print "Avg = %5.5f" % avg_vec | 305 | print "Avg = %5.5f" % avg_vec |
306 | print "Std = %5.5f" % std_vec | ||
298 | else: | 307 | else: |
299 | print i[1] + " overheads (us)" | 308 | print i[1] + " overheads (us)" |
300 | print "Max = %5.5f" % (max_vec / self.options.cpufreq) | 309 | print "Max = %5.5f" % (max_vec / self.options.cpufreq) |
301 | print "Avg = %5.5f" % (avg_vec / self.options.cpufreq) | 310 | print "Avg = %5.5f" % (avg_vec / self.options.cpufreq) |
311 | print "Std = %5.5f" % (std_vec / self.options.cpufreq) | ||
302 | 312 | ||
303 | def process_datafile(self, datafile, dname, fname, conf): | 313 | def process_datafile(self, datafile, dname, fname, conf): |
304 | if self.options.verbose: | 314 | if self.options.verbose: |