diff options
Diffstat (limited to 'plot_rtas12.py')
-rwxr-xr-x | plot_rtas12.py | 57 |
1 files changed, 50 insertions, 7 deletions
diff --git a/plot_rtas12.py b/plot_rtas12.py index abfa8b2..5942a88 100755 --- a/plot_rtas12.py +++ b/plot_rtas12.py | |||
@@ -9,7 +9,6 @@ from plot import decode, Plot | |||
9 | from gnuplot import curve | 9 | from gnuplot import curve |
10 | 10 | ||
11 | SCHEDULERS = ['MC', 'MC-MERGE', 'MC-MERGE-REDIR'] | 11 | SCHEDULERS = ['MC', 'MC-MERGE', 'MC-MERGE-REDIR'] |
12 | OVERHEADS = ['SCHED', 'RELEASE', 'LVLA-RELEASE'] | ||
13 | COLS = {'plugin': 0, | 12 | COLS = {'plugin': 0, |
14 | 'overhead': 1, | 13 | 'overhead': 1, |
15 | 'n_tasks': 2, | 14 | 'n_tasks': 2, |
@@ -41,20 +40,61 @@ def gnuplot_col(col_name): | |||
41 | # gnuplot is 1-indexed | 40 | # gnuplot is 1-indexed |
42 | return 1 + COLS[col_name] | 41 | return 1 + COLS[col_name] |
43 | 42 | ||
43 | def get_sched_title(sched): | ||
44 | SCHEDULERS = {'MC': 'MC', | ||
45 | 'MC-MERGE': 'MC + MT', | ||
46 | 'MC-MERGE-REDIR': 'MC + MT + REDIR'} | ||
47 | return SCHEDULERS[sched] | ||
48 | |||
49 | def get_overhead_title(ov): | ||
50 | OV = {'SCHED': '', | ||
51 | 'LVLA-SCHED': ' level-A', | ||
52 | 'RELEASE': '', | ||
53 | 'LVLA-RELEASE': ' level-A'} | ||
54 | return OV[ov] | ||
55 | |||
56 | def set_plot_opts(p): | ||
57 | p.rounded_caps = True | ||
58 | p.font = 'Helvetica' | ||
59 | p.font_size = '5pt' | ||
60 | p.size = ('8.5cm', '5.25cm') | ||
61 | p.default_style = 'linespoints lw 2.5' | ||
62 | p.default_style += ' smooth bezier' | ||
63 | p.key = 'below' | ||
64 | p.monochrome = False | ||
65 | p.dashed_lines = False | ||
66 | p.xrange = (18, 122) | ||
67 | |||
68 | for i, c in enumerate(p.curves): | ||
69 | c.style = "linespoints ls %d" % (i + 1) | ||
70 | |||
71 | p.line_styles = [ | ||
72 | (1, "lw 1.5 ps 0.3"), | ||
73 | (2, "lw 1.5 ps 0.3"), | ||
74 | (3, "lw 1.5 ps 0.3"), | ||
75 | (4, "lw 1.5 ps 0.3"), | ||
76 | (5, 'pt 6 lw 1.5 ps 0.3 lc rgbcolor "#ff910d"'), | ||
77 | (6, "pt 7 lw 1.5 ps 0.3"), | ||
78 | (7, 'lw 1.5 ps 0.3 lc rgbcolor "#000000"'), | ||
79 | (8, "lw 1.5 ps 0.3"), | ||
80 | ] | ||
81 | |||
82 | |||
44 | def plot_release(data_dir): | 83 | def plot_release(data_dir): |
45 | p = Plot() | 84 | p = Plot() |
46 | p.output = '{0}/overhead=RELEASE.pdf'.format(data_dir) | 85 | p.output = '{0}/overhead=RELEASE.pdf'.format(data_dir) |
47 | p.format = 'pdf' | 86 | p.format = 'pdf' |
48 | p.key = 'top left' | ||
49 | 87 | ||
50 | for rel_type in ['RELEASE', 'LVLA-RELEASE']: | 88 | for rel_type in ['RELEASE', 'LVLA-RELEASE']: |
51 | for sched in SCHEDULERS: | 89 | for sched in SCHEDULERS: |
52 | fname = '{0}/scheduler={1}_overhead={2}.csv'.format(data_dir, sched, rel_type) | 90 | fname = '{0}/scheduler={1}_overhead={2}.csv'.format(data_dir, sched, rel_type) |
91 | ti = '{0}{1}'.format(get_sched_title(sched), get_overhead_title(rel_type)) | ||
53 | p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), | 92 | p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), |
54 | ycol=gnuplot_col('avg'), title='{0} {1}'.format(sched, rel_type))] | 93 | ycol=gnuplot_col('avg'), title=ti)] |
55 | p.xlabel = 'number of tasks' | 94 | p.xlabel = 'number of tasks' |
56 | p.ylabel = 'overhead (microseconds)' | 95 | p.ylabel = 'overhead (microseconds)' |
57 | p.title = 'release overheads' | 96 | p.title = 'release overheads' |
97 | set_plot_opts(p) | ||
58 | p.gnuplot_exec() | 98 | p.gnuplot_exec() |
59 | 99 | ||
60 | def plot_sched(data_dir): | 100 | def plot_sched(data_dir): |
@@ -63,13 +103,16 @@ def plot_sched(data_dir): | |||
63 | p.format = 'pdf' | 103 | p.format = 'pdf' |
64 | p.key = 'top left' | 104 | p.key = 'top left' |
65 | 105 | ||
66 | for sched in SCHEDULERS: | 106 | for sched_type in ['SCHED', 'LVLA-SCHED']: |
67 | fname = '{0}/scheduler={1}_overhead=SCHED.csv'.format(data_dir, sched) | 107 | for sched in SCHEDULERS: |
68 | p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), | 108 | fname = '{0}/scheduler={1}_overhead=SCHED.csv'.format(data_dir, sched) |
69 | ycol=gnuplot_col('avg'), title='{0}'.format(sched))] | 109 | ti = '{0}{1}'.format(get_sched_title(sched), get_overhead_title(sched_type)) |
110 | p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), | ||
111 | ycol=gnuplot_col('avg'), title=ti)] | ||
70 | p.xlabel = 'number of tasks' | 112 | p.xlabel = 'number of tasks' |
71 | p.ylabel = 'overhead (microseconds)' | 113 | p.ylabel = 'overhead (microseconds)' |
72 | p.title = 'scheduling overheads' | 114 | p.title = 'scheduling overheads' |
115 | set_plot_opts(p) | ||
73 | p.gnuplot_exec() | 116 | p.gnuplot_exec() |
74 | 117 | ||
75 | 118 | ||