From ab10712341f610cb528d23fa7208203da5f7d294 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 18 Nov 2004 16:23:29 -0500 Subject: stats python fixes for dealing with vectors better. graph tweaking ipkb stat and formulas from the command line. util/stats/info.py: no need to raise an attribute error if two values aren't found in the exact same set of runs. Would be good to check that each run is the same though. util/stats/stats.py: more graph tweaking command to execute a formula from the command line. add interrupts per kilobyte of data --HG-- extra : convert_revision : 78d6b14d340d08edcbc69e4c1c5a4c1dd9bb10dd --- util/stats/info.py | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'util/stats/info.py') diff --git a/util/stats/info.py b/util/stats/info.py index 15a4a7d73..fa318a650 100644 --- a/util/stats/info.py +++ b/util/stats/info.py @@ -47,28 +47,21 @@ def wrapop(op, lv, rv): return op(lv, rv) -def same(lv, rv): - for lrun,rrun in zip(lv.keys(),rv.keys()): - if lrun != rrun: - print 'lrun != rrun' - print lrun, rrun - print lv.keys() - print rv.keys() +def same(lrun, rrun): + for lx,rx in zip(lrun.keys(),rrun.keys()): + if lx != rx: + print 'lx != rx' + print lx, rx + print lrun.keys() + print rrun.keys() return False - for lx,rx in zip(lv[lrun].keys(),rv[rrun].keys()): - if lx != rx: - print 'lx != rx' - print lx, rx - print lv[lrun].keys() - print rv[rrun].keys() + for ly,ry in zip(lrun[lx].keys(),rrun[rx].keys()): + if ly != ry: + print 'ly != ry' + print ly, ry + print lrun[lx].keys() + print rrun[rx].keys() return False - for ly,ry in zip(lv[lrun][lx].keys(),rv[rrun][rx].keys()): - if ly != ry: - print 'ly != ry' - print ly, ry - print lv[lrun][lx].keys() - print rv[rrun][rx].keys() - return False return True @@ -79,10 +72,15 @@ def binaryop(op, lf, rf): lv = lf.value rv = rf.value - if not same(lv, rv): - raise AttributeError, "run,x,y not identical" + theruns = [] + for r in lv.keys(): + if rv.has_key(r): + if same(lv[r], rv[r]): + theruns.append(r) + else: + raise AttributeError - for run in lv.keys(): + for run in theruns: result[run] = {} for x in lv[run].keys(): result[run][x] = {} -- cgit v1.2.3