diff options
Diffstat (limited to 'plot.py')
-rwxr-xr-x | plot.py | 62 |
1 files changed, 44 insertions, 18 deletions
@@ -10,6 +10,7 @@ options = [ | |||
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 | o(None, '--paper', action='store_true', dest='paper'), |
13 | o(None, '--wide', action='store_true', dest='wide'), | ||
13 | o(None, '--split', action='store_true', dest='split'), | 14 | o(None, '--split', action='store_true', dest='split'), |
14 | ] | 15 | ] |
15 | 16 | ||
@@ -24,6 +25,7 @@ defaults = { | |||
24 | 'ylabel' : 'ratio of schedulable task sets', | 25 | 'ylabel' : 'ratio of schedulable task sets', |
25 | 'paper' : False, | 26 | 'paper' : False, |
26 | 'split' : False, | 27 | 'split' : False, |
28 | 'wide' : False, | ||
27 | } | 29 | } |
28 | 30 | ||
29 | def decode(name): | 31 | def decode(name): |
@@ -98,6 +100,21 @@ class SchedPlotter(defapp.App): | |||
98 | format=self.options.format, | 100 | format=self.options.format, |
99 | fname=name, **xtra) | 101 | fname=name, **xtra) |
100 | 102 | ||
103 | def plot_wide(self, graphs, title, name, conf, **xtra): | ||
104 | tops = 'rounded size 16cm,6.5cm' | ||
105 | gnuplot(graphs, title=title, | ||
106 | xlabel=self.options.xlabel, | ||
107 | ylabel=self.options.ylabel + | ||
108 | (' [soft]' if 'soft' in conf else ' [hard]'), | ||
109 | xrange=self.options.xrange, | ||
110 | yrange=self.options.yrange, | ||
111 | xticks=self.options.xticks, | ||
112 | yticks=self.options.yticks, | ||
113 | format=self.options.format, | ||
114 | fname=name, | ||
115 | term_opts=tops, | ||
116 | **xtra) | ||
117 | |||
101 | def plot_paper(self, graphs, title, name, conf, **xtra): | 118 | def plot_paper(self, graphs, title, name, conf, **xtra): |
102 | tops = 'color solid font "Helvetica,10" linewidth 1.0 rounded size 16cm,8.5cm' | 119 | tops = 'color solid font "Helvetica,10" linewidth 1.0 rounded size 16cm,8.5cm' |
103 | gnuplot(graphs, title=title, | 120 | gnuplot(graphs, title=title, |
@@ -179,54 +196,61 @@ class SchedPlotter(defapp.App): | |||
179 | def plot_rtss09(self, tmpfile, name, conf): | 196 | def plot_rtss09(self, tmpfile, name, conf): |
180 | title = scenario_heading(conf, want_period=True) | 197 | title = scenario_heading(conf, want_period=True) |
181 | graphs = [ | 198 | graphs = [ |
182 | (tmpfile, 1, 2, 'ideal'), | 199 | (tmpfile, 1, 2, 'G-EDF'), |
183 | (tmpfile, 1, 3, 'SEm'), | 200 | (tmpfile, 1, 3, 'CEm'), |
184 | (tmpfile, 1, 4, 'SE1'), | 201 | (tmpfile, 1, 4, 'CE1'), |
185 | (tmpfile, 1, 5, 'FEm'), | 202 | (tmpfile, 1, 5, 'FEm'), |
186 | (tmpfile, 1, 6, 'FE1'), | 203 | (tmpfile, 1, 6, 'FE1'), |
187 | (tmpfile, 1, 7, 'HEm'), | 204 | (tmpfile, 1, 7, 'HEm'), |
188 | (tmpfile, 1, 8, 'SQm'), | 205 | (tmpfile, 1, 8, 'CQm'), |
189 | (tmpfile, 1, 9, 'SQ1'), | 206 | (tmpfile, 1, 9, 'CQ1'), |
190 | ] | 207 | ] |
191 | staggered = [ | 208 | staggered = [ |
192 | (tmpfile, 1, 10, 'S-SQm'), | 209 | (tmpfile, 1, 10, 'S-CQm'), |
193 | (tmpfile, 1, 11, 'S-SQ1'), | 210 | (tmpfile, 1, 11, 'S-CQ1'), |
194 | ] | 211 | ] |
195 | if 'hard' in conf: | 212 | if 'hard' in conf: |
196 | graphs += staggered | 213 | graphs += staggered |
197 | if self.options.paper and self.options.format == 'pdf': | 214 | if self.options.paper and self.options.format == 'pdf': |
198 | self.plot_paper(graphs, title, name, conf) | 215 | self.plot_paper(graphs, title, name, conf) |
216 | elif self.options.wide and self.options.format == 'pdf': | ||
217 | self.plot_wide(graphs, title, name, conf) | ||
199 | else: | 218 | else: |
200 | self.plot(graphs, title, name, conf) | 219 | self.plot(graphs, title, name, conf) |
201 | 220 | ||
202 | def plot_rtss09_split(self, tmpfile, name, conf): | 221 | def plot_rtss09_split(self, tmpfile, name, conf): |
203 | title = scenario_heading(conf, want_period=True) | 222 | title = scenario_heading(conf, want_period=True) |
204 | ideal = (tmpfile, 1, 2, 'ideal') | 223 | ideal = (tmpfile, 1, 2, 'G-EDF') |
205 | 224 | ||
206 | subgraphs = [ | 225 | subgraphs = [ |
207 | # dedicated vs. non-dedicated | 226 | # dedicated vs. non-dedicated |
208 | [(tmpfile, 1, 3, 'SEm'), (tmpfile, 1, 4, 'SE1')], | 227 | [(tmpfile, 1, 3, 'CEm'), (tmpfile, 1, 4, 'CE1')], |
209 | [(tmpfile, 1, 5, 'FEm'), (tmpfile, 1, 6, 'FE1')], | 228 | [(tmpfile, 1, 5, 'FEm'), (tmpfile, 1, 6, 'FE1')], |
210 | [(tmpfile, 1, 8, 'SQm'), (tmpfile, 1, 9, 'SQ1')], | 229 | [(tmpfile, 1, 8, 'CQm'), (tmpfile, 1, 9, 'CQ1')], |
211 | 230 | ||
212 | # fine-grained vs. sequential | 231 | # fine-grained vs. sequential |
213 | [(tmpfile, 1, 3, 'SEm'), (tmpfile, 1, 5, 'FEm')], | 232 | [(tmpfile, 1, 3, 'CEm'), (tmpfile, 1, 5, 'FEm')], |
214 | [(tmpfile, 1, 4, 'SE1'), (tmpfile, 1, 6, 'FE1')], | 233 | [(tmpfile, 1, 4, 'CE1'), (tmpfile, 1, 6, 'FE1')], |
215 | 234 | ||
216 | # hierarchical vs. sequential | 235 | # hierarchical vs. sequential |
217 | [(tmpfile, 1, 3, 'SEm'), (tmpfile, 1, 7, 'HEm')], | 236 | [(tmpfile, 1, 3, 'CEm'), (tmpfile, 1, 7, 'HEm')], |
218 | 237 | ||
219 | # quantum vs. event | 238 | # quantum vs. event |
220 | [(tmpfile, 1, 3, 'SEm'), (tmpfile, 1, 8, 'SQm')], | 239 | [(tmpfile, 1, 3, 'CEm'), (tmpfile, 1, 8, 'CQm')], |
221 | [(tmpfile, 1, 6, 'FE1'), (tmpfile, 1, 9, 'SQ1')], | 240 | [(tmpfile, 1, 6, 'FE1'), (tmpfile, 1, 9, 'CQ1')], |
222 | ] | 241 | ] |
223 | staggered = [ | 242 | staggered = [ |
224 | # dedicated vs. non-dedicated | 243 | # dedicated vs. non-dedicated |
225 | [(tmpfile, 1, 10, 'S-SQm'), (tmpfile, 1, 11, 'S-SQ1')], | 244 | [(tmpfile, 1, 10, 'S-CQm'), (tmpfile, 1, 11, 'S-CQ1')], |
226 | 245 | ||
227 | # staggered vs. non-staggered | 246 | # staggered vs. non-staggered |
228 | [(tmpfile, 1, 8, 'SQm'), (tmpfile, 1, 10, 'S-SQm')], | 247 | [(tmpfile, 1, 8, 'CQm'), (tmpfile, 1, 10, 'S-CQm')], |
229 | [(tmpfile, 1, 9, 'SQ1'), (tmpfile, 1, 11, 'S-SQ1')], | 248 | [(tmpfile, 1, 9, 'CQ1'), (tmpfile, 1, 11, 'S-CQ1')], |
249 | |||
250 | # quantum vs. event | ||
251 | [(tmpfile, 1, 3, 'CEm'), (tmpfile, 1, 10, 'S-CQm')], | ||
252 | [(tmpfile, 1, 6, 'FE1'), (tmpfile, 1, 11, 'S-CQ1')], | ||
253 | |||
230 | ] | 254 | ] |
231 | if 'hard' in conf: | 255 | if 'hard' in conf: |
232 | subgraphs += staggered | 256 | subgraphs += staggered |
@@ -235,6 +259,8 @@ class SchedPlotter(defapp.App): | |||
235 | xname = name + '_' + '-vs-'.join([x[3] for x in g]) | 259 | xname = name + '_' + '-vs-'.join([x[3] for x in g]) |
236 | if self.options.paper and self.options.format == 'pdf': | 260 | if self.options.paper and self.options.format == 'pdf': |
237 | self.plot_paper(graphs, title, xname, conf) | 261 | self.plot_paper(graphs, title, xname, conf) |
262 | elif self.options.wide and self.options.format == 'pdf': | ||
263 | self.plot_wide(graphs, title, xname, conf) | ||
238 | else: | 264 | else: |
239 | self.plot(graphs, title, xname, conf) | 265 | self.plot(graphs, title, xname, conf) |
240 | 266 | ||