diff options
| author | Joshua Bakita <bakitajoshua@gmail.com> | 2020-05-29 12:56:36 -0400 |
|---|---|---|
| committer | Joshua Bakita <bakitajoshua@gmail.com> | 2020-05-29 12:56:36 -0400 |
| commit | 7b715ab6c23af2695f58917ffe6e5df3b14ab360 (patch) | |
| tree | 8ad92a96a3565ecbee37a49cf2beb47d15f7eb38 /baseline/summarize.py | |
| parent | 8dfefc152f16f9fd9e8aa0910fd4d23d6543d87e (diff) | |
Add remaining scripts from Joshua's PRP experimentsfor-jbakita-prp
***This is the final commit which supports reproducing his
PRP results***
Diffstat (limited to 'baseline/summarize.py')
| -rwxr-xr-x | baseline/summarize.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/baseline/summarize.py b/baseline/summarize.py new file mode 100755 index 0000000..82f82d9 --- /dev/null +++ b/baseline/summarize.py | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #!/usr/bin/python3 | ||
| 2 | import sys | ||
| 3 | |||
| 4 | f = sys.argv[1] | ||
| 5 | res = {} | ||
| 6 | mem_res = {} | ||
| 7 | memw_res = {} | ||
| 8 | samples = {} | ||
| 9 | |||
| 10 | with open(f) as fp: | ||
| 11 | for line in fp: | ||
| 12 | s = line.split() | ||
| 13 | if s[0] not in res: | ||
| 14 | print(s[0]) | ||
| 15 | res[s[0]] = int(s[5]) | ||
| 16 | mem_res[s[0]] = int(s[8]) | ||
| 17 | memw_res[s[0]] = int(s[9]) | ||
| 18 | samples[s[0]] =int(s[4]) | ||
| 19 | else: | ||
| 20 | res[s[0]] += int(s[5]) | ||
| 21 | mem_res[s[0]] += int(s[8]) | ||
| 22 | memw_res[s[0]] += int(s[9]) | ||
| 23 | |||
| 24 | print("Average times:") | ||
| 25 | for r in res.keys(): | ||
| 26 | print(res[r]/samples[r]) | ||
| 27 | |||
| 28 | print("Average memory read:") | ||
| 29 | for r in mem_res.keys(): | ||
| 30 | print(mem_res[r]/samples[r]) | ||
| 31 | |||
| 32 | print("Average memory write:") | ||
| 33 | for r in memw_res.keys(): | ||
| 34 | print(memw_res[r]/samples[r]) | ||
