aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgnuplot.py5
-rwxr-xr-xplot.py82
2 files changed, 77 insertions, 10 deletions
diff --git a/gnuplot.py b/gnuplot.py
index e16de77..d32b3c5 100755
--- a/gnuplot.py
+++ b/gnuplot.py
@@ -94,6 +94,7 @@ options = [
94 o(None, '--yrange', action='store', dest='yrange', nargs=2, type='float'), 94 o(None, '--yrange', action='store', dest='yrange', nargs=2, type='float'),
95 o(None, '--xticks', action='store', dest='xticks', nargs=2, type='float'), 95 o(None, '--xticks', action='store', dest='xticks', nargs=2, type='float'),
96 o(None, '--yticks', action='store', dest='yticks', nargs=2, type='float'), 96 o(None, '--yticks', action='store', dest='yticks', nargs=2, type='float'),
97 o(None, '--term-opts', action='store', dest='term_opts'),
97 ] 98 ]
98 99
99defaults = { 100defaults = {
@@ -107,6 +108,7 @@ defaults = {
107 'yrange' : None, 108 'yrange' : None,
108 'xticks' : None, 109 'xticks' : None,
109 'yticks' : None, 110 'yticks' : None,
111 'term_opts' : None,
110 } 112 }
111 113
112class GnuPlotter(defapp.App): 114class GnuPlotter(defapp.App):
@@ -131,7 +133,8 @@ class GnuPlotter(defapp.App):
131 yrange=self.options.yrange, 133 yrange=self.options.yrange,
132 xticks=self.options.xticks, 134 xticks=self.options.xticks,
133 yticks=self.options.yticks, 135 yticks=self.options.yticks,
134 fname=self.options.out) 136 fname=self.options.out,
137 term_opts=self.options.term_opts)
135 138
136 def default(self, _): 139 def default(self, _):
137 cmd = self.get_cmd(list(self.args)) 140 cmd = self.get_cmd(list(self.args))
diff --git a/plot.py b/plot.py
index c0218e9..2190a6e 100755
--- a/plot.py
+++ b/plot.py
@@ -9,6 +9,7 @@ from gnuplot import gnuplot, FORMATS
9options = [ 9options = [
10 o('-f', '--format', action='store', dest='format', type='choice', 10 o('-f', '--format', action='store', dest='format', type='choice',
11 choices=FORMATS, help='output format'), 11 choices=FORMATS, help='output format'),
12 o(None, '--paper', action='store_true', dest='paper'),
12 ] 13 ]
13 14
14defaults = { 15defaults = {
@@ -20,6 +21,7 @@ defaults = {
20 'title' : None, 21 'title' : None,
21 'xlabel' : 'task set utilization cap (prior to inflation)', 22 'xlabel' : 'task set utilization cap (prior to inflation)',
22 'ylabel' : 'ratio of schedulable task sets', 23 'ylabel' : 'ratio of schedulable task sets',
24 'paper' : False,
23 } 25 }
24 26
25def decode(name): 27def decode(name):
@@ -54,15 +56,15 @@ def scenario_heading(conf):
54 dist = 'unknown distribution' 56 dist = 'unknown distribution'
55 if 'dist' in conf: 57 if 'dist' in conf:
56 if conf['dist'] == 'uni': 58 if conf['dist'] == 'uni':
57 dist = 'uniformly distributed' 59 dist = 'uniformly distributed '
58 if 'light' in conf: 60 if 'light' in conf:
59 dist = dist + ' in [0.001, 0.1]' 61 dist = dist + 'in [0.001, 0.1]'
60 elif 'medium' in conf: 62 elif 'medium' in conf:
61 dist = dist + ' in [0.1, 0.4]' 63 dist = dist + 'in [0.1, 0.4]'
62 elif 'heavy' in conf: 64 elif 'heavy' in conf:
63 dist = dist + ' in [0.5, 0.9]' 65 dist = dist + 'in [0.5, 0.9]'
64 elif conf['dist'] == 'bimo': 66 elif conf['dist'] == 'bimo':
65 dist = 'bimodially distributed' 67 dist = 'bimodially distributed '
66 if 'light' in conf: 68 if 'light' in conf:
67 dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)' 69 dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, 0.9] (1/9)'
68 elif 'medium' in conf: 70 elif 'medium' in conf:
@@ -75,7 +77,7 @@ class SchedPlotter(defapp.App):
75 def __init__(self): 77 def __init__(self):
76 defapp.App.__init__(self, options, defaults, no_std_opts=True) 78 defapp.App.__init__(self, options, defaults, no_std_opts=True)
77 79
78 def plot(self, graphs, title, name, conf): 80 def plot(self, graphs, title, name, conf, **xtra):
79 gnuplot(graphs, title=title, 81 gnuplot(graphs, title=title,
80 xlabel=self.options.xlabel, 82 xlabel=self.options.xlabel,
81 ylabel=self.options.ylabel + 83 ylabel=self.options.ylabel +
@@ -85,10 +87,26 @@ class SchedPlotter(defapp.App):
85 xticks=self.options.xticks, 87 xticks=self.options.xticks,
86 yticks=self.options.yticks, 88 yticks=self.options.yticks,
87 format=self.options.format, 89 format=self.options.format,
88 fname=name) 90 fname=name, **xtra)
91
92 def plot_paper(self, graphs, title, name, conf, **xtra):
93 tops = 'color solid font "Helvetica,12" linewidth 1.0 rounded size 16cm,8.5cm'
94 gnuplot(graphs, title=title,
95 xlabel=self.options.xlabel,
96 ylabel=self.options.ylabel +
97 (' [soft]' if 'soft' in conf else ' [hard]'),
98 xrange=self.options.xrange,
99 yrange=self.options.yrange,
100 xticks=self.options.xticks,
101 yticks=self.options.yticks,
102 format=self.options.format,
103 fname=name,
104 key='off',
105 style='lines lw 7',
106 term_opts=tops)
89 107
90 def plot_spec(self, tmpfile, name, conf): 108 def plot_spec(self, tmpfile, name, conf):
91 title = 'release overhead speculation: ' + scenario_heading(conf) 109 title = 'G-EDF overhead speculation: ' + scenario_heading(conf)
92 graphs = [ 110 graphs = [
93 (tmpfile, 1, 2, 'G-EDF (100% release)'), 111 (tmpfile, 1, 2, 'G-EDF (100% release)'),
94 (tmpfile, 1, 3, 'G-EDF ( 75% release)'), 112 (tmpfile, 1, 3, 'G-EDF ( 75% release)'),
@@ -97,7 +115,10 @@ class SchedPlotter(defapp.App):
97 (tmpfile, 1, 6, 'G-EDF ( 0% release)'), 115 (tmpfile, 1, 6, 'G-EDF ( 0% release)'),
98 (tmpfile, 1, 7, 'G-EDF (no overheads)'), 116 (tmpfile, 1, 7, 'G-EDF (no overheads)'),
99 ] 117 ]
100 self.plot(graphs, title, name, conf) 118 if self.options.paper and self.options.format == 'pdf':
119 self.plot_paper(graphs, title, name, conf)
120 else:
121 self.plot(graphs, title, name, conf)
101 122
102 def plot_spec2(self, tmpfile, name, conf): 123 def plot_spec2(self, tmpfile, name, conf):
103 title = 'service processor speculation: ' + scenario_heading(conf) 124 title = 'service processor speculation: ' + scenario_heading(conf)
@@ -109,6 +130,43 @@ class SchedPlotter(defapp.App):
109 ] 130 ]
110 self.plot(graphs, title, name, conf) 131 self.plot(graphs, title, name, conf)
111 132
133 def plot_spec3(self, tmpfile, name, conf):
134 title = 'linear overhead charge speculation: ' + scenario_heading(conf)
135 graphs = [
136 (tmpfile, 1, 2, 'G-EDF (100% release)'),
137 (tmpfile, 1, 3, 'G-EDF ( 25% release)'),
138 (tmpfile, 1, 4, 'G-EDF ( Lin release)'),
139 ]
140 self.plot(graphs, title, name, conf)
141
142 def plot_spec4(self, tmpfile, name, conf):
143 title = 'linear overhead charge speculation: ' + scenario_heading(conf)
144 graphs = [
145 (tmpfile, 1, 2, 'G-EDF (100% release)'),
146 (tmpfile, 1, 3, 'G-EDF-S (100% release, all cpus)'),
147 (tmpfile, 1, 4, 'G-EDF-S (100% release, one cpu)'),
148 (tmpfile, 1, 5, 'G-EDF (25% release)'),
149 (tmpfile, 1, 6, 'G-EDF-S (25% release, all cpus)'),
150 (tmpfile, 1, 7, 'G-EDF-S (25% release, one cpu)'),
151 ]
152 self.plot(graphs, title, name, conf)
153
154 def plot_irq(self, tmpfile, name, conf):
155 graphs = [
156 (tmpfile, 1, 2, 'quantum-centric (100% overhead)'),
157 (tmpfile, 1, 3, 'task-centric (100% overhead)'),
158 (tmpfile, 1, 4, 'processor-centric (100% overhead)'),
159 (tmpfile, 1, 5, 'quantum-centric (20% overhead)'),
160 (tmpfile, 1, 6, 'task-centric (20% overhead)'),
161 (tmpfile, 1, 7, 'processor-centric (20% overhead)'),
162 ]
163 if self.options.paper and self.options.format == 'pdf':
164 title = scenario_heading(conf)
165 self.plot_paper(graphs, title, name, conf)
166 else:
167 title = 'Interrupt accounting under G-EDF: utilization ' + scenario_heading(conf)
168 self.plot(graphs, title, name, conf)
169
112 def plot_file(self, datafile): 170 def plot_file(self, datafile):
113 bname = basename(datafile) 171 bname = basename(datafile)
114 name, ext = splitext(bname) 172 name, ext = splitext(bname)
@@ -122,6 +180,12 @@ class SchedPlotter(defapp.App):
122 self.plot_spec(tmpfile.name, name, conf) 180 self.plot_spec(tmpfile.name, name, conf)
123 elif 'spec2' in conf: 181 elif 'spec2' in conf:
124 self.plot_spec2(tmpfile.name, name, conf) 182 self.plot_spec2(tmpfile.name, name, conf)
183 elif 'spec3' in conf:
184 self.plot_spec3(tmpfile.name, name, conf)
185 elif 'spec4' in conf:
186 self.plot_spec4(tmpfile.name, name, conf)
187 elif 'irq' in conf:
188 self.plot_irq(tmpfile.name, name, conf)
125 else: 189 else:
126 self.err("Skipped '%s'; unkown experiment type." 190 self.err("Skipped '%s'; unkown experiment type."
127 % bname) 191 % bname)