diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-03-23 14:58:21 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-03-23 14:58:21 -0400 |
commit | 36a1d6ef801fe2ade27e173b23bb13fe29213d11 (patch) | |
tree | 86ca03dae496470921c83d2713ad61e5db2bcb23 | |
parent | 9c613968ee815c1f4c32d594ddc67a5cabccce81 (diff) |
Change format from [hard|soft]_pm.. to pm...
- Requested plot type (default hard rt) is specified through option
--type
- Add overhead type in csv files as a comment
- Fix wrong compacting (columns shuffling)
- Minor fixes
-rwxr-xr-x | compact_pm_ovd.py | 11 | ||||
-rwxr-xr-x | plot_pm.py | 26 |
2 files changed, 20 insertions, 17 deletions
diff --git a/compact_pm_ovd.py b/compact_pm_ovd.py index 0a25e0c..3b646ca 100755 --- a/compact_pm_ovd.py +++ b/compact_pm_ovd.py | |||
@@ -18,11 +18,7 @@ def build_name(dirname, conf, wss_list): | |||
18 | if dirname == '': | 18 | if dirname == '': |
19 | dirname = '.' | 19 | dirname = '.' |
20 | outname = dirname + '/' | 20 | outname = dirname + '/' |
21 | if 'hard' in conf: | 21 | outname += 'pm_plugin=' + conf['plugin'] + '_dist=' + conf['dist'] |
22 | outname += 'hard' | ||
23 | else: | ||
24 | outname += 'soft' | ||
25 | outname += '_pm_plugin=' + conf['plugin'] + '_dist=' + conf['dist'] | ||
26 | # atm we use only uniform for PM (we also use only light, but...) | 22 | # atm we use only uniform for PM (we also use only light, but...) |
27 | if 'light' in conf: | 23 | if 'light' in conf: |
28 | outname += '_light' | 24 | outname += '_light' |
@@ -64,8 +60,7 @@ class WSSCompactor(): | |||
64 | self.wss_list.sort() | 60 | self.wss_list.sort() |
65 | outname = build_name(dirname, conf, self.wss_list) | 61 | outname = build_name(dirname, conf, self.wss_list) |
66 | csvf = open(outname, 'w') | 62 | csvf = open(outname, 'w') |
67 | csvf.write('# preemption and migration overhead for ' + \ | 63 | csvf.write('# ' + conf['plugin'] + ' ' + conf['ovd'] + '\n') |
68 | conf['plugin'] + '\n') | ||
69 | 64 | ||
70 | wstr = '# tssize, ' | 65 | wstr = '# tssize, ' |
71 | for wss in self.wss_list: | 66 | for wss in self.wss_list: |
@@ -82,6 +77,8 @@ class WSSCompactor(): | |||
82 | for value in self.ovhead_table[str(key)]: | 77 | for value in self.ovhead_table[str(key)]: |
83 | if float(value) > 0: | 78 | if float(value) > 0: |
84 | wstr += value + ', ' | 79 | wstr += value + ', ' |
80 | else: | ||
81 | wstr += '0.00000, ' | ||
85 | wstr = wstr[0:-2] | 82 | wstr = wstr[0:-2] |
86 | csvf.write(wstr + '\n') | 83 | csvf.write(wstr + '\n') |
87 | 84 | ||
@@ -24,9 +24,10 @@ output WHEN using --all'), | |||
24 | defaults = { | 24 | defaults = { |
25 | 'sharedL3' : False, | 25 | 'sharedL3' : False, |
26 | 'alloh' : False, | 26 | 'alloh' : False, |
27 | 'type' : 'hard', | ||
27 | 'format' : 'show', | 28 | 'format' : 'show', |
28 | 'xrange' : (74.5, 250.5), | 29 | 'xrange' : (74.5, 250.5), |
29 | 'yrange' : (0, 4300.05), | 30 | 'yrange' : (0, 4350.05), |
30 | 'xticks' : (0, 10), | 31 | 'xticks' : (0, 10), |
31 | 'yticks' : (0, 100), | 32 | 'yticks' : (0, 100), |
32 | 'title' : None, | 33 | 'title' : None, |
@@ -167,12 +168,16 @@ class PmPlotter(defapp.App): | |||
167 | title = overhead_heading(conf, sharedL3=self.options.sharedL3) | 168 | title = overhead_heading(conf, sharedL3=self.options.sharedL3) |
168 | title += ' ; ' + scenario_heading(conf, want_period=True) | 169 | title += ' ; ' + scenario_heading(conf, want_period=True) |
169 | plugin = conf['plugin'] | 170 | plugin = conf['plugin'] |
171 | if 'soft' in conf: | ||
172 | name = 'soft_' + name | ||
173 | else: | ||
174 | name = 'hard_' + name | ||
170 | wsslist = conf['wss'].split(',') | 175 | wsslist = conf['wss'].split(',') |
171 | graphs = [] | 176 | graphs = [] |
172 | wsspos = 2 | 177 | wsspos = 2 |
178 | if 'soft' in conf: | ||
179 | wsspos += 1 | ||
173 | for i in wsslist: | 180 | for i in wsslist: |
174 | if 'soft' in conf: | ||
175 | wsspos += 1 | ||
176 | label = plugin + ' WSS=' + i | 181 | label = plugin + ' WSS=' + i |
177 | graphs.append((tmpfile, 1, wsspos, label)) | 182 | graphs.append((tmpfile, 1, wsspos, label)) |
178 | wsspos += 2 | 183 | wsspos += 2 |
@@ -189,21 +194,21 @@ class PmPlotter(defapp.App): | |||
189 | self.title += ' ; ' | 194 | self.title += ' ; ' |
190 | wsslist = conf['wss'].split(',') | 195 | wsslist = conf['wss'].split(',') |
191 | wsspos = 2 | 196 | wsspos = 2 |
197 | if 'soft' in conf: | ||
198 | wsspos += 1 | ||
192 | for i in wsslist: | 199 | for i in wsslist: |
193 | if 'soft' in conf: | ||
194 | wsspos += 1 | ||
195 | label = conf['plugin'] + ' ' + conf['ovd'] + ' WSS=' + i | 200 | label = conf['plugin'] + ' ' + conf['ovd'] + ' WSS=' + i |
196 | self.graphs_list.append((tmpfile, 1, wsspos, label)) | 201 | self.graphs_list.append((tmpfile, 1, wsspos, label)) |
197 | wsspos += 2 | 202 | wsspos += 2 |
198 | 203 | ||
199 | def plot_graph_list(self, name='blob', conf='hard'): | 204 | def plot_graph_list(self, type, name='blob'): |
200 | self.title = self.title[0:-3] | 205 | self.title = self.title[0:-3] |
201 | if self.options.paper and self.options.format == 'pdf': | 206 | if self.options.paper and self.options.format == 'pdf': |
202 | self.plot_paper(self.graphs_list, self.title, name, conf) | 207 | self.plot_paper(self.graphs_list, self.title, name, type) |
203 | elif self.options.wide and self.options.format == 'pdf': | 208 | elif self.options.wide and self.options.format == 'pdf': |
204 | self.plot_wide(self.graphs_list, self.title, name, conf) | 209 | self.plot_wide(self.graphs_list, self.title, name, type) |
205 | else: | 210 | else: |
206 | self.plot(self.graphs_list, self.title, name, conf) | 211 | self.plot(self.graphs_list, self.title, name, type) |
207 | 212 | ||
208 | # delete temporary data files | 213 | # delete temporary data files |
209 | for tmp in self.tmpfile_list: | 214 | for tmp in self.tmpfile_list: |
@@ -220,6 +225,7 @@ class PmPlotter(defapp.App): | |||
220 | tmpfile = get_data_tmpfile(datafile) | 225 | tmpfile = get_data_tmpfile(datafile) |
221 | if tmpfile: | 226 | if tmpfile: |
222 | if 'pm' in conf: | 227 | if 'pm' in conf: |
228 | conf[self.options.type] = None | ||
223 | if self.options.alloh: | 229 | if self.options.alloh: |
224 | self.add_to_graph_list(tmpfile.name, name, conf) | 230 | self.add_to_graph_list(tmpfile.name, name, conf) |
225 | else: | 231 | else: |
@@ -244,7 +250,7 @@ class PmPlotter(defapp.App): | |||
244 | 250 | ||
245 | if self.options.alloh: | 251 | if self.options.alloh: |
246 | # also clean up tmp data files | 252 | # also clean up tmp data files |
247 | self.plot_graph_list(self.options.name, self.options.type) | 253 | self.plot_graph_list(self.options.type, self.options.name) |
248 | 254 | ||
249 | if __name__ == "__main__": | 255 | if __name__ == "__main__": |
250 | PmPlotter().launch() | 256 | PmPlotter().launch() |