diff options
| -rwxr-xr-x | gnuplot.py | 4 | ||||
| -rwxr-xr-x | plot.py | 135 | ||||
| -rwxr-xr-x | wsched.py | 1 |
3 files changed, 128 insertions, 12 deletions
| @@ -147,6 +147,7 @@ class Plot(object): | |||
| 147 | self.style = {} | 147 | self.style = {} |
| 148 | 148 | ||
| 149 | self.default_style = None # for plotted curves | 149 | self.default_style = None # for plotted curves |
| 150 | self.line_styles = [] | ||
| 150 | 151 | ||
| 151 | def setup_histogram(self, gap=None, boxwidth=0.9): | 152 | def setup_histogram(self, gap=None, boxwidth=0.9): |
| 152 | self.style['data'] = 'histogram' | 153 | self.style['data'] = 'histogram' |
| @@ -232,6 +233,9 @@ class Plot(object): | |||
| 232 | for s in self.style: | 233 | for s in self.style: |
| 233 | g("set style %s %s" % (s, self.style[s])) | 234 | g("set style %s %s" % (s, self.style[s])) |
| 234 | 235 | ||
| 236 | for ls in self.line_styles: | ||
| 237 | g("set style line %d %s" % (ls[0], ls[1])) | ||
| 238 | |||
| 235 | plots = [c.gnuplot_cmd(self.default_style) for c in self.curves] | 239 | plots = [c.gnuplot_cmd(self.default_style) for c in self.curves] |
| 236 | if plots: | 240 | if plots: |
| 237 | g("plot " + ", ".join(plots)) | 241 | g("plot " + ", ".join(plots)) |
| @@ -541,12 +541,12 @@ class SchedPlotter(defapp.App): | |||
| 541 | 541 | ||
| 542 | npsf_comp = [ | 542 | npsf_comp = [ |
| 543 | ('NPS-F (idle, delta=1)', 9), | 543 | ('NPS-F (idle, delta=1)', 9), |
| 544 | ('NPS-F (idle, delta=4)', 10), | ||
| 545 | ('NPS-F (load, delta=1)', 7), | ||
| 546 | ('C-NPS-F (idle, delta=1)', 13), | 544 | ('C-NPS-F (idle, delta=1)', 13), |
| 545 | ('NPS-F (idle, delta=4)', 10), | ||
| 547 | ('C-NPS-F (idle, delta=4)', 14), | 546 | ('C-NPS-F (idle, delta=4)', 14), |
| 548 | ('NPS-F (load, delta=4)', 8), | 547 | ('NPS-F (load, delta=1)', 7), |
| 549 | ('C-NPS-F (load, delta=1)', 11), | 548 | ('C-NPS-F (load, delta=1)', 11), |
| 549 | ('NPS-F (load, delta=4)', 8), | ||
| 550 | ('C-NPS-F (load, delta=4)', 12), | 550 | ('C-NPS-F (load, delta=4)', 12), |
| 551 | ] | 551 | ] |
| 552 | 552 | ||
| @@ -594,27 +594,49 @@ class SchedPlotter(defapp.App): | |||
| 594 | xcol = 1 | 594 | xcol = 1 |
| 595 | p.xlabel = "working set size (WSS)" | 595 | p.xlabel = "working set size (WSS)" |
| 596 | p.ylabel = "weighted schedulability" | 596 | p.ylabel = "weighted schedulability" |
| 597 | p.xticks = (0, 64) | 597 | if self.options.wide: |
| 598 | p.xrange = (-1, 1025) | 598 | # tail plot WSS > 1024 |
| 599 | if self.options.alternate: | 599 | p.xticks = (0, 256) |
| 600 | p.xrange = (1023, 3073) | ||
| 601 | elif self.options.alternate: | ||
| 602 | # NPS-F comparison | ||
| 600 | p.xrange = (-1, 257) | 603 | p.xrange = (-1, 257) |
| 601 | p.xticks = (0, 32) | 604 | p.xticks = (0, 32) |
| 605 | else: | ||
| 606 | # regular plot | ||
| 607 | p.xticks = (0, 64) | ||
| 608 | p.xrange = (-1, 1025) | ||
| 602 | else: | 609 | else: |
| 603 | self.err("What kind of semipart experiment is this?") | 610 | self.err("What kind of semipart experiment is this?") |
| 604 | return | 611 | return |
| 605 | 612 | ||
| 606 | p.curves += [curve(fname=tmpfile, xcol=xcol, ycol=idx, title=t) | 613 | p.curves += [curve(fname=tmpfile, xcol=xcol, ycol=idx, title=t) |
| 607 | for (t, idx) in titles] | 614 | for (i, (t, idx)) in enumerate(titles)] |
| 608 | 615 | ||
| 609 | p.yrange = (-0.05, 1.05) | 616 | p.yrange = (-0.05, 1.05) |
| 610 | p.yticks = (0, 0.1) | 617 | p.yticks = (0, 0.1) |
| 611 | 618 | ||
| 612 | #### Styling. | 619 | #### Styling. |
| 613 | 620 | ||
| 621 | |||
| 614 | if not self.setup_png(p): | 622 | if not self.setup_png(p): |
| 615 | p.rounded_caps = True | 623 | p.rounded_caps = True |
| 616 | p.font = 'Helvetica' | 624 | p.font = 'Helvetica' |
| 617 | 625 | ||
| 626 | if self.options.paper or self.options.appendix: | ||
| 627 | for i, c in enumerate(p.curves): | ||
| 628 | c.style = "linespoints ls %d" % (i + 1) | ||
| 629 | |||
| 630 | p.line_styles = [ | ||
| 631 | (1, "lw 2.5"), | ||
| 632 | (2, "lw 2.5"), | ||
| 633 | (3, "lw 2.5"), | ||
| 634 | (4, "lw 2.5"), | ||
| 635 | (5, 'lw 2.5 lc rgbcolor "#ff910d"'), | ||
| 636 | (6, "lw 2.5"), | ||
| 637 | (7, 'lw 2.5 lc rgbcolor "#000000"'), | ||
| 638 | (8, "lw 2.5"), | ||
| 639 | ] | ||
| 618 | 640 | ||
| 619 | if self.options.paper: | 641 | if self.options.paper: |
| 620 | p.default_style = 'lines lw 2.5' | 642 | p.default_style = 'lines lw 2.5' |
| @@ -623,11 +645,10 @@ class SchedPlotter(defapp.App): | |||
| 623 | p.monochrome = False | 645 | p.monochrome = False |
| 624 | p.dashed_lines = False | 646 | p.dashed_lines = False |
| 625 | if not self.options.alternate: | 647 | if not self.options.alternate: |
| 626 | p.key ='below' | 648 | p.key ='off' |
| 627 | p.size = ('14.5cm', '4cm') | 649 | p.size = ('8.5cm', '5.5cm') |
| 628 | p.yticks = (0, 0.2) | 650 | p.yticks = (0, 0.1) |
| 629 | 651 | p.key = 'below' | |
| 630 | # p.key = 'below' | ||
| 631 | p.default_style = 'linespoints lw 2.5' | 652 | p.default_style = 'linespoints lw 2.5' |
| 632 | elif self.options.slides: | 653 | elif self.options.slides: |
| 633 | p.dashed_lines = False | 654 | p.dashed_lines = False |
| @@ -666,6 +687,95 @@ class SchedPlotter(defapp.App): | |||
| 666 | p.gnuplot_exec() | 687 | p.gnuplot_exec() |
| 667 | 688 | ||
| 668 | 689 | ||
| 690 | def plot_mpcp_omlp(self, tmpfile, name, conf): | ||
| 691 | curves = [ | ||
| 692 | ('MPCP (virtual spinning)', 5), | ||
| 693 | ('MPCP (suspension-based)', 4), | ||
| 694 | ('OMLP (mutex, c=1)', 6), | ||
| 695 | ] | ||
| 696 | |||
| 697 | p = self.make_plot(name) | ||
| 698 | |||
| 699 | if 'ucap' in conf and 'pacc' in conf: | ||
| 700 | xcol = 1 | ||
| 701 | p.xlabel = 'resource probability' | ||
| 702 | p.xrange = (0, 1) | ||
| 703 | tinfo = ' utilization=%s request-probability=%s' % \ | ||
| 704 | (conf['ucap'], conf['pacc']) | ||
| 705 | elif 'ucap' in conf and 'pres' in conf: | ||
| 706 | xcol = 2 | ||
| 707 | p.xlabel = 'request probability' | ||
| 708 | p.xrange = (0, 0.8) | ||
| 709 | tinfo = ' utilization=%s resource-probability=%s' % \ | ||
| 710 | (conf['ucap'], conf['pres']) | ||
| 711 | else: | ||
| 712 | xcol = 3 | ||
| 713 | p.xlabel = 'per-processor utilization (prior to blocking accounting)' | ||
| 714 | p.xrange = (0.2, 1) | ||
| 715 | tinfo = ' request-probability=%s resource-probability=%s' % \ | ||
| 716 | (conf['pacc'], conf['pres']) | ||
| 717 | |||
| 718 | pinfo = " m=%s" % conf['m'] | ||
| 719 | |||
| 720 | p.title = scenario_heading(conf, True) + r'\n' + tinfo + pinfo | ||
| 721 | |||
| 722 | p.ylabel = "ratio of schedulable task sets" | ||
| 723 | p.yrange = (-0.05, 1.05) | ||
| 724 | p.yticks = (0, 0.1) | ||
| 725 | p.xticks = (0, 0.1) | ||
| 726 | |||
| 727 | p.curves += [curve(fname=tmpfile, xcol=xcol, ycol=idx, title=t) | ||
| 728 | for (t, idx) in curves] | ||
| 729 | |||
| 730 | #### Styling. | ||
| 731 | |||
| 732 | if not self.setup_png(p): | ||
| 733 | p.rounded_caps = True | ||
| 734 | p.font = 'Helvetica' | ||
| 735 | |||
| 736 | if self.options.paper: | ||
| 737 | p.default_style = 'lines lw 2.5' | ||
| 738 | p.font_size = '5pt' | ||
| 739 | p.size = ('8.5cm', '5.25cm') | ||
| 740 | p.monochrome = False | ||
| 741 | p.dashed_lines = False | ||
| 742 | if not self.options.alternate: | ||
| 743 | p.key ='off' | ||
| 744 | p.size = ('9cm', '4.0cm') | ||
| 745 | p.yticks = (0, 0.1) | ||
| 746 | p.key = 'bottom left' | ||
| 747 | p.default_style = 'linespoints lw 3.5' | ||
| 748 | elif self.options.slides: | ||
| 749 | p.dashed_lines = False | ||
| 750 | p.monochrome = False | ||
| 751 | p.rounded_caps = True | ||
| 752 | p.default_style = 'lines lw 10' | ||
| 753 | p.key = 'below' | ||
| 754 | elif self.options.appendix: | ||
| 755 | # for the appendix | ||
| 756 | p.font_size = '8' | ||
| 757 | p.size = ('17cm', '9cm') | ||
| 758 | p.key = 'below' | ||
| 759 | p.monochrome = False | ||
| 760 | p.dashed_lines = False | ||
| 761 | p.default_style = 'linespoints lw 3.5' | ||
| 762 | else: | ||
| 763 | p.font_size = '10' | ||
| 764 | p.size = ('20cm', '10cm') | ||
| 765 | p.monochrome = False | ||
| 766 | p.dashed_lines = False | ||
| 767 | p.key = 'below' | ||
| 768 | p.default_style = 'linespoints lw 1' | ||
| 769 | |||
| 770 | if self.options.smooth: | ||
| 771 | p.default_style += " smooth bezier" | ||
| 772 | |||
| 773 | if self.options.save_script: | ||
| 774 | p.gnuplot_save(p.output + '.plot') | ||
| 775 | else: | ||
| 776 | p.gnuplot_exec() | ||
| 777 | |||
| 778 | |||
| 669 | def plot_file(self, datafile): | 779 | def plot_file(self, datafile): |
| 670 | bname = basename(datafile) | 780 | bname = basename(datafile) |
| 671 | name, ext = splitext(bname) | 781 | name, ext = splitext(bname) |
| @@ -691,6 +801,7 @@ class SchedPlotter(defapp.App): | |||
| 691 | 'rtss09' : self.plot_rtss09_split if self.options.split else self.plot_rtss09, | 801 | 'rtss09' : self.plot_rtss09_split if self.options.split else self.plot_rtss09, |
| 692 | 'ospert10' : self.plot_ospert10, | 802 | 'ospert10' : self.plot_ospert10, |
| 693 | 'eurosys11' : self.plot_semipart, | 803 | 'eurosys11' : self.plot_semipart, |
| 804 | 'emsoft11-part' : self.plot_mpcp_omlp, | ||
| 694 | } | 805 | } |
| 695 | 806 | ||
| 696 | if self.options.experiment: | 807 | if self.options.experiment: |
| @@ -83,6 +83,7 @@ options = [ | |||
| 83 | o(None, '--no-comments', action='store_true', dest='no_comments'), | 83 | o(None, '--no-comments', action='store_true', dest='no_comments'), |
| 84 | o('-w', '--col-width', action='store', type='int', dest='colwidth'), | 84 | o('-w', '--col-width', action='store', type='int', dest='colwidth'), |
| 85 | o(None, '--split', action='store_true', dest='want_split'), | 85 | o(None, '--split', action='store_true', dest='want_split'), |
| 86 | o('-f', '--key-format', action='store', dest='key_fmt'), | ||
| 86 | ] | 87 | ] |
| 87 | 88 | ||
| 88 | defaults = { | 89 | defaults = { |
