From eed568c195c27338aa4c06c60bf3b824d63d2565 Mon Sep 17 00:00:00 2001 From: Christopher Kenna Date: Wed, 12 Oct 2011 03:07:26 -0400 Subject: update plot script --- plot_rtas12.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 7 deletions(-) (limited to 'plot_rtas12.py') 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 from gnuplot import curve SCHEDULERS = ['MC', 'MC-MERGE', 'MC-MERGE-REDIR'] -OVERHEADS = ['SCHED', 'RELEASE', 'LVLA-RELEASE'] COLS = {'plugin': 0, 'overhead': 1, 'n_tasks': 2, @@ -41,20 +40,61 @@ def gnuplot_col(col_name): # gnuplot is 1-indexed return 1 + COLS[col_name] +def get_sched_title(sched): + SCHEDULERS = {'MC': 'MC', + 'MC-MERGE': 'MC + MT', + 'MC-MERGE-REDIR': 'MC + MT + REDIR'} + return SCHEDULERS[sched] + +def get_overhead_title(ov): + OV = {'SCHED': '', + 'LVLA-SCHED': ' level-A', + 'RELEASE': '', + 'LVLA-RELEASE': ' level-A'} + return OV[ov] + +def set_plot_opts(p): + p.rounded_caps = True + p.font = 'Helvetica' + p.font_size = '5pt' + p.size = ('8.5cm', '5.25cm') + p.default_style = 'linespoints lw 2.5' + p.default_style += ' smooth bezier' + p.key = 'below' + p.monochrome = False + p.dashed_lines = False + p.xrange = (18, 122) + + for i, c in enumerate(p.curves): + c.style = "linespoints ls %d" % (i + 1) + + p.line_styles = [ + (1, "lw 1.5 ps 0.3"), + (2, "lw 1.5 ps 0.3"), + (3, "lw 1.5 ps 0.3"), + (4, "lw 1.5 ps 0.3"), + (5, 'pt 6 lw 1.5 ps 0.3 lc rgbcolor "#ff910d"'), + (6, "pt 7 lw 1.5 ps 0.3"), + (7, 'lw 1.5 ps 0.3 lc rgbcolor "#000000"'), + (8, "lw 1.5 ps 0.3"), + ] + + def plot_release(data_dir): p = Plot() p.output = '{0}/overhead=RELEASE.pdf'.format(data_dir) p.format = 'pdf' - p.key = 'top left' for rel_type in ['RELEASE', 'LVLA-RELEASE']: for sched in SCHEDULERS: fname = '{0}/scheduler={1}_overhead={2}.csv'.format(data_dir, sched, rel_type) + ti = '{0}{1}'.format(get_sched_title(sched), get_overhead_title(rel_type)) p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), - ycol=gnuplot_col('avg'), title='{0} {1}'.format(sched, rel_type))] + ycol=gnuplot_col('avg'), title=ti)] p.xlabel = 'number of tasks' p.ylabel = 'overhead (microseconds)' p.title = 'release overheads' + set_plot_opts(p) p.gnuplot_exec() def plot_sched(data_dir): @@ -63,13 +103,16 @@ def plot_sched(data_dir): p.format = 'pdf' p.key = 'top left' - for sched in SCHEDULERS: - fname = '{0}/scheduler={1}_overhead=SCHED.csv'.format(data_dir, sched) - p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), - ycol=gnuplot_col('avg'), title='{0}'.format(sched))] + for sched_type in ['SCHED', 'LVLA-SCHED']: + for sched in SCHEDULERS: + fname = '{0}/scheduler={1}_overhead=SCHED.csv'.format(data_dir, sched) + ti = '{0}{1}'.format(get_sched_title(sched), get_overhead_title(sched_type)) + p.curves += [curve(fname=fname, xcol=gnuplot_col('n_tasks'), + ycol=gnuplot_col('avg'), title=ti)] p.xlabel = 'number of tasks' p.ylabel = 'overhead (microseconds)' p.title = 'scheduling overheads' + set_plot_opts(p) p.gnuplot_exec() -- cgit v1.2.2