aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcompact_multiple.sh21
-rwxr-xr-xcompact_pm_ovd.py14
-rwxr-xr-xplot_pm.py62
3 files changed, 26 insertions, 71 deletions
diff --git a/compact_multiple.sh b/compact_multiple.sh
new file mode 100755
index 0000000..be48698
--- /dev/null
+++ b/compact_multiple.sh
@@ -0,0 +1,21 @@
1#!/bin/bash
2
3if [ $# -lt 2 ]; then
4 echo "directory _sorted_WSS(es)"
5 exit -1
6fi
7
8for OH in preemption l2cache offchip onchip;
9do
10 FILES=""
11 COUNT=1
12 for i ;
13 do
14 if [ $COUNT == "1" ]; then
15 COUNT=$((COUNT + 1))
16 continue
17 fi
18 FILES="$FILES $1/pm_plugin=GSN-EDF_dist=uni_light_wss=${i}_ovd=${OH}.csv"
19 done
20 ./compact_pm_ovd.py $FILES
21done
diff --git a/compact_pm_ovd.py b/compact_pm_ovd.py
index 3b646ca..4670de0 100755
--- a/compact_pm_ovd.py
+++ b/compact_pm_ovd.py
@@ -2,17 +2,7 @@
2 2
3from os.path import splitext, basename, dirname 3from os.path import splitext, basename, dirname
4from optparse import OptionParser 4from optparse import OptionParser
5 5from plot import decode
6def decode(name):
7 params = {}
8 parts = name.split('_')
9 for p in parts:
10 kv = p.split('=')
11 k = kv[0]
12 v = kv[1] if len(kv) > 1 else None
13 params[k] = v
14 return params
15
16 6
17def build_name(dirname, conf, wss_list): 7def build_name(dirname, conf, wss_list):
18 if dirname == '': 8 if dirname == '':
@@ -100,7 +90,7 @@ def main(args):
100 wsscmpctr.write_csv(dirname(datafile), conf) 90 wsscmpctr.write_csv(dirname(datafile), conf)
101 91
102if __name__ == "__main__": 92if __name__ == "__main__":
103 usage = "Usage: %prog list-of-file" 93 usage = "Usage: %prog <list of files, _sorted_ by WSS>"
104 parser = OptionParser(usage=usage) 94 parser = OptionParser(usage=usage)
105 (options, args) = parser.parse_args() 95 (options, args) = parser.parse_args()
106 if len(args) < 1: 96 if len(args) < 1:
diff --git a/plot_pm.py b/plot_pm.py
index 9190d8e..22f6d6e 100755
--- a/plot_pm.py
+++ b/plot_pm.py
@@ -4,6 +4,7 @@ from os.path import splitext, basename
4from optparse import make_option as o 4from optparse import make_option as o
5from tempfile import NamedTemporaryFile as Tmp 5from tempfile import NamedTemporaryFile as Tmp
6 6
7from plot import decode, scenario_heading, get_data_tmpfile
7from gnuplot import gnuplot, FORMATS 8from gnuplot import gnuplot, FORMATS
8 9
9options = [ 10options = [
@@ -26,8 +27,8 @@ defaults = {
26 'alloh' : False, 27 'alloh' : False,
27 'type' : 'hard', 28 'type' : 'hard',
28 'format' : 'show', 29 'format' : 'show',
29 'xrange' : (74.5, 250.5), 30 'xrange' : (99.5, 200.5),
30 'yrange' : (0, 4350.05), 31 'yrange' : (0, 5300.05),
31 'xticks' : (0, 10), 32 'xticks' : (0, 10),
32 'yticks' : (0, 100), 33 'yticks' : (0, 100),
33 'title' : None, 34 'title' : None,
@@ -38,63 +39,6 @@ defaults = {
38 'wide' : False, 39 'wide' : False,
39 } 40 }
40 41
41def decode(name):
42 params = {}
43 parts = name.split('_')
44 for p in parts:
45 kv = p.split('=')
46 k = kv[0]
47 v = kv[1] if len(kv) > 1 else None
48 params[k] = v
49 return params
50
51def get_data_tmpfile(datafile):
52 """Removes all comments form datafile, stores result in a temp file.
53 The temp file is returned."""
54 count = 0
55 f = open(datafile, 'r')
56 d = Tmp()
57 for line in f:
58 if len(line) > 1 and line[0] != '#':
59 d.write(line)
60 count += 1
61 f.close()
62 d.flush()
63 if count > 0:
64 return d
65 else:
66 del d # removes temp file
67 return None
68
69def scenario_heading(conf, want_period=False):
70 dist = 'unknown distribution'
71 if 'dist' in conf:
72 if conf['dist'] == 'uni':
73 dist = 'utilization uniformly '
74 if 'light' in conf:
75 dist = dist + 'in [0.001, 0.1]'
76 elif 'medium' in conf:
77 dist = dist + 'in [0.1, 0.4]'
78 elif 'heavy' in conf:
79 dist = dist + 'in [0.5, 0.9]'
80 elif conf['dist'] == 'bimo':
81 dist = 'util. bimodially '
82 if 'light' in conf:
83 dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)'
84 elif 'medium' in conf:
85 dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)'
86 elif 'heavy' in conf:
87 dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)'
88 if want_period:
89 if '33' in conf:
90 dist += '; period uniformly in [3, 33]'
91 elif '250' in conf:
92 dist += '; period uniformly in [50, 250]'
93 else:
94 dist += '; period uniformly in [10, 100]'
95
96 return dist
97
98def overhead_heading(conf, sharedL3=False): 42def overhead_heading(conf, sharedL3=False):
99 ovd_type = 'unknowkn overhead' 43 ovd_type = 'unknowkn overhead'
100 if 'ovd' in conf: 44 if 'ovd' in conf: