From 6ea9939e0610a809f6f47d13ec68df00d1ca0afc Mon Sep 17 00:00:00 2001 From: Joshua Bakita Date: Fri, 16 Oct 2020 16:55:14 -0400 Subject: Move the DIS benchmarks up a directory and update hardcoded paths Note that this repo does not attempt to keep a copy of the original DIS benchmark distributions. UNC real-time has another repo for that. --- dis/original/summarize.py | 71 ----------------------------------------------- 1 file changed, 71 deletions(-) delete mode 100755 dis/original/summarize.py (limited to 'dis/original/summarize.py') diff --git a/dis/original/summarize.py b/dis/original/summarize.py deleted file mode 100755 index f8f6929..0000000 --- a/dis/original/summarize.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/python3 -import sys - -f = sys.argv[1] -res = {} -mem_res = {} -memw_res = {} -samples = {} -max_res = {} - -with open(f) as fp: - for line in fp: - s = line.split() - if s[0] not in res: -# print(s[0]) - res[s[0]] = list([int(s[5])])#)int(s[5]) - mem_res[s[0]] = int(s[8]) - memw_res[s[0]] = int(s[9]) - samples[s[0]] = int(s[4]) - max_res[s[0]] = int(s[5]) - else: - res[s[0]].append(int(s[5])) - mem_res[s[0]] += int(s[8]) - memw_res[s[0]] += int(s[9]) - max_res[s[0]] = max(int(s[5]), max_res[s[0]]) -## {{{ http://code.activestate.com/recipes/511478/ (r1) -import math -import functools - -def percentile(N, percent, key=lambda x:x): - """ - Find the percentile of a list of values. - - @parameter N - is a list of values. Note N MUST BE already sorted. - @parameter percent - a float value from 0.0 to 1.0. - @parameter key - optional key function to compute value from each element of N. - - @return - the percentile of the values - """ - if not N: - return None - k = (len(N)-1) * percent - f = math.floor(k) - c = math.ceil(k) - if f == c: - return key(N[int(k)]) - d0 = key(N[int(f)]) * (c-k) - d1 = key(N[int(c)]) * (k-f) - return d0+d1 -## end of http://code.activestate.com/recipes/511478/ }}} -""" -print("Average times:") -for r in res.keys(): - print(res[r]/samples[r]) - -print("Average memory read:") -for r in mem_res.keys(): - print(mem_res[r]/samples[r]) - -print("Average memory write:") -for r in memw_res.keys(): - print(memw_res[r]/samples[r]) - -print("Max times:") -for r in max_res.keys(): - print(max_res[r]) -""" -print("Name\t\tAverage\t\tMax\t\t99th %\t\tAvg Mem Read\tAvg Mem Write\t") -for r in res.keys(): -# print(r + "\t\t" + str(res[r]/samples[r]) + "\t\t" + str(max_res[r])) - print("{:12}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}\t{:>12.0f}".format(r, sum(res[r])/len(res[r]), max(res[r]), percentile(sorted(res[r]), 0.99), mem_res[r]/samples[r], memw_res[r]/samples[r])) -- cgit v1.2.2