diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-07-03 16:46:29 -0400 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-07-03 16:46:29 -0400 |
| commit | 844b3328f5c7d00db6950de5fca519bf143bf232 (patch) | |
| tree | 254595db167278df70bae82660760fd2999959fc | |
| parent | 171f441a1194d784d03f50a82cd92b466b6c52fe (diff) | |
support CPMD plottingwip-bbb
| -rwxr-xr-x | dplot.py | 91 |
1 files changed, 91 insertions, 0 deletions
| @@ -46,8 +46,12 @@ options = [ | |||
| 46 | o('-m', '--max-tardiness', action='store_true', dest='max_tard', | 46 | o('-m', '--max-tardiness', action='store_true', dest='max_tard', |
| 47 | help='plot maximum and not average tardiness'), | 47 | help='plot maximum and not average tardiness'), |
| 48 | 48 | ||
| 49 | o(None, '--metric', action='store', dest='metric', | ||
| 50 | help='which metric to use for CPMD plot', choices=['avg', 'max', 'std']), | ||
| 51 | |||
| 49 | o(None, '--slides', action='store_true', dest='slides'), | 52 | o(None, '--slides', action='store_true', dest='slides'), |
| 50 | o(None, '--smooth', action='store_true', dest='smooth'), | 53 | o(None, '--smooth', action='store_true', dest='smooth'), |
| 54 | o(None, '--zoom', action='store_true', dest='zoom'), | ||
| 51 | ] | 55 | ] |
| 52 | 56 | ||
| 53 | defaults = { | 57 | defaults = { |
| @@ -59,6 +63,7 @@ defaults = { | |||
| 59 | 'slides' : False, | 63 | 'slides' : False, |
| 60 | 'smooth' : False, | 64 | 'smooth' : False, |
| 61 | 'lines' : True, | 65 | 'lines' : True, |
| 66 | 'zoom' : False, | ||
| 62 | 67 | ||
| 63 | 'schedulers' : None, | 68 | 'schedulers' : None, |
| 64 | 'pd2_only' : False, | 69 | 'pd2_only' : False, |
| @@ -66,6 +71,7 @@ defaults = { | |||
| 66 | 'ed_only' : False, | 71 | 'ed_only' : False, |
| 67 | 72 | ||
| 68 | 'max_tard' : False, | 73 | 'max_tard' : False, |
| 74 | 'metric' : 'avg', | ||
| 69 | 75 | ||
| 70 | 'cpmd' : None, | 76 | 'cpmd' : None, |
| 71 | 77 | ||
| @@ -446,6 +452,90 @@ class DissPlotter(defapp.App): | |||
| 446 | self.render(p) | 452 | self.render(p) |
| 447 | 453 | ||
| 448 | 454 | ||
| 455 | def plot_cpmd(self, datafile, name, conf): | ||
| 456 | |||
| 457 | # index avg, std, max | ||
| 458 | L1 = [32, 33, 34] | ||
| 459 | L2 = [35, 36, 37] | ||
| 460 | L3 = [38, 39, 40] | ||
| 461 | MEM = [41, 42, 43] | ||
| 462 | |||
| 463 | NAMES = ["preemption", "L2 migration", "L3 migration", "memory migration" ] | ||
| 464 | INDICES = [L1, L2, L3, MEM] | ||
| 465 | |||
| 466 | tmpfile = self.prepare(name, datafile) | ||
| 467 | |||
| 468 | p = self.make_plot(name) | ||
| 469 | |||
| 470 | if self.options.metric == 'max': | ||
| 471 | col = 2 | ||
| 472 | tag = 'maximum observed delay' | ||
| 473 | elif self.options.metric == 'avg': | ||
| 474 | col = 0 | ||
| 475 | tag = 'average observed delay' | ||
| 476 | elif self.options.metric == 'std': | ||
| 477 | col = 1 | ||
| 478 | tag = 'standard deviation of observed delays' | ||
| 479 | else: | ||
| 480 | assert False # what metric? | ||
| 481 | |||
| 482 | for (name, index) in zip(NAMES, INDICES): | ||
| 483 | p.curves += [curve(fname=tmpfile, | ||
| 484 | xcol=1, ycol=index[col], | ||
| 485 | title=name)] | ||
| 486 | |||
| 487 | perc = int((1.0 / int(conf['wcycle'])) * 100) | ||
| 488 | |||
| 489 | if conf['bg'] == 'idle': | ||
| 490 | bg = 'no background workload (idle CPMD)' | ||
| 491 | else: | ||
| 492 | bg = 'with cache polluters (load CPMD)' | ||
| 493 | |||
| 494 | p.title = "%s; %d%% writes; %s" % (tag, perc, bg) | ||
| 495 | p.xlabel = "working set size (in KB)" | ||
| 496 | |||
| 497 | if self.options.metric == 'std': | ||
| 498 | p.ylabel = "standard deviation of measurements" | ||
| 499 | else: | ||
| 500 | p.ylabel = "measured cache-related delay (in us)" | ||
| 501 | |||
| 502 | if self.options.zoom: | ||
| 503 | p.xticks = (0, 64) | ||
| 504 | p.xrange = (0, 1024) | ||
| 505 | else: | ||
| 506 | p.xticks = (0, 1024) | ||
| 507 | p.xrange = (0, 12288) | ||
| 508 | |||
| 509 | if self.options.metric in ['max'] and conf['bg'] == 'load': | ||
| 510 | if self.options.zoom: | ||
| 511 | p.yrange = (0, 5000) | ||
| 512 | p.yticks = (0, 500) | ||
| 513 | else: | ||
| 514 | p.yrange = (0, 40000) | ||
| 515 | p.yticks = (0, 5000) | ||
| 516 | elif self.options.metric in ['std'] and conf['bg'] == 'load': | ||
| 517 | if self.options.zoom: | ||
| 518 | p.yrange = (0, 1000) | ||
| 519 | p.yticks = (0, 100) | ||
| 520 | else: | ||
| 521 | p.yrange = (-150, 10000) | ||
| 522 | p.yticks = (0, 1000) | ||
| 523 | else: | ||
| 524 | if self.options.zoom: | ||
| 525 | p.yrange = (-50, 1000) | ||
| 526 | p.yticks = (0, 100) | ||
| 527 | else: | ||
| 528 | p.yrange = (-150, 3000) | ||
| 529 | p.yticks = (0, 250) | ||
| 530 | |||
| 531 | self.diss_style(p) | ||
| 532 | if self.options.zoom or \ | ||
| 533 | (conf['bg'] == 'load' and self.options.metric in ['max', 'std']): | ||
| 534 | p.key = 'top left' | ||
| 535 | |||
| 536 | self.render(p) | ||
| 537 | |||
| 538 | |||
| 449 | def plot_file(self, datafile): | 539 | def plot_file(self, datafile): |
| 450 | bname = basename(datafile) | 540 | bname = basename(datafile) |
| 451 | name, ext = splitext(bname) | 541 | name, ext = splitext(bname) |
| @@ -455,6 +545,7 @@ class DissPlotter(defapp.App): | |||
| 455 | 'sched' : self.plot_sched, | 545 | 'sched' : self.plot_sched, |
| 456 | 'rel-tard' : self.plot_tardiness, | 546 | 'rel-tard' : self.plot_tardiness, |
| 457 | 'abs-tard' : self.plot_tardiness, | 547 | 'abs-tard' : self.plot_tardiness, |
| 548 | 'cpmd' : self.plot_cpmd, | ||
| 458 | } | 549 | } |
| 459 | 550 | ||
| 460 | for plot_type in plotters: | 551 | for plot_type in plotters: |
