From 844b3328f5c7d00db6950de5fca519bf143bf232 Mon Sep 17 00:00:00 2001 From: "Bjoern B. Brandenburg" Date: Sun, 3 Jul 2011 16:46:29 -0400 Subject: support CPMD plotting --- dplot.py | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) (limited to 'dplot.py') diff --git a/dplot.py b/dplot.py index ec37761..d0107b2 100755 --- a/dplot.py +++ b/dplot.py @@ -46,8 +46,12 @@ options = [ o('-m', '--max-tardiness', action='store_true', dest='max_tard', help='plot maximum and not average tardiness'), + o(None, '--metric', action='store', dest='metric', + help='which metric to use for CPMD plot', choices=['avg', 'max', 'std']), + o(None, '--slides', action='store_true', dest='slides'), o(None, '--smooth', action='store_true', dest='smooth'), + o(None, '--zoom', action='store_true', dest='zoom'), ] defaults = { @@ -59,6 +63,7 @@ defaults = { 'slides' : False, 'smooth' : False, 'lines' : True, + 'zoom' : False, 'schedulers' : None, 'pd2_only' : False, @@ -66,6 +71,7 @@ defaults = { 'ed_only' : False, 'max_tard' : False, + 'metric' : 'avg', 'cpmd' : None, @@ -446,6 +452,90 @@ class DissPlotter(defapp.App): self.render(p) + def plot_cpmd(self, datafile, name, conf): + + # index avg, std, max + L1 = [32, 33, 34] + L2 = [35, 36, 37] + L3 = [38, 39, 40] + MEM = [41, 42, 43] + + NAMES = ["preemption", "L2 migration", "L3 migration", "memory migration" ] + INDICES = [L1, L2, L3, MEM] + + tmpfile = self.prepare(name, datafile) + + p = self.make_plot(name) + + if self.options.metric == 'max': + col = 2 + tag = 'maximum observed delay' + elif self.options.metric == 'avg': + col = 0 + tag = 'average observed delay' + elif self.options.metric == 'std': + col = 1 + tag = 'standard deviation of observed delays' + else: + assert False # what metric? + + for (name, index) in zip(NAMES, INDICES): + p.curves += [curve(fname=tmpfile, + xcol=1, ycol=index[col], + title=name)] + + perc = int((1.0 / int(conf['wcycle'])) * 100) + + if conf['bg'] == 'idle': + bg = 'no background workload (idle CPMD)' + else: + bg = 'with cache polluters (load CPMD)' + + p.title = "%s; %d%% writes; %s" % (tag, perc, bg) + p.xlabel = "working set size (in KB)" + + if self.options.metric == 'std': + p.ylabel = "standard deviation of measurements" + else: + p.ylabel = "measured cache-related delay (in us)" + + if self.options.zoom: + p.xticks = (0, 64) + p.xrange = (0, 1024) + else: + p.xticks = (0, 1024) + p.xrange = (0, 12288) + + if self.options.metric in ['max'] and conf['bg'] == 'load': + if self.options.zoom: + p.yrange = (0, 5000) + p.yticks = (0, 500) + else: + p.yrange = (0, 40000) + p.yticks = (0, 5000) + elif self.options.metric in ['std'] and conf['bg'] == 'load': + if self.options.zoom: + p.yrange = (0, 1000) + p.yticks = (0, 100) + else: + p.yrange = (-150, 10000) + p.yticks = (0, 1000) + else: + if self.options.zoom: + p.yrange = (-50, 1000) + p.yticks = (0, 100) + else: + p.yrange = (-150, 3000) + p.yticks = (0, 250) + + self.diss_style(p) + if self.options.zoom or \ + (conf['bg'] == 'load' and self.options.metric in ['max', 'std']): + p.key = 'top left' + + self.render(p) + + def plot_file(self, datafile): bname = basename(datafile) name, ext = splitext(bname) @@ -455,6 +545,7 @@ class DissPlotter(defapp.App): 'sched' : self.plot_sched, 'rel-tard' : self.plot_tardiness, 'abs-tard' : self.plot_tardiness, + 'cpmd' : self.plot_cpmd, } for plot_type in plotters: -- cgit v1.2.2