From 24bfd5ef01039acc344ee623851eb98eec5744fc Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 18 Jan 2005 13:25:55 -0500 Subject: [PATCH 1/4] finished stability stats option --HG-- extra : convert_revision : 3ad0a143f79b116c5b18321846653d627429882a --- util/stats/stats.py | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/util/stats/stats.py b/util/stats/stats.py index 7f3761a922..60c3d8a535 100755 --- a/util/stats/stats.py +++ b/util/stats/stats.py @@ -255,28 +255,43 @@ def commands(options, command, args): #loop through all the stats selected for stat in stats: - avg = float(stat) + print "%s:" % stat.name + print "%-30s %12s %12s %4s %5s %6s" % \ + ("run name", "average", "stdev", ">10%", ">1SDV", "SAMP") + print "%-30s %12s %12s %4s %5s %6s" % \ + ("------------------------------", "------------", "------------", "----", "-----", "------") #loop through all the selected runs for run in runs: info.display_run = run.run; - #print run.name - #print avg runTicks = info.source.retTicks([ run ]) #throw away the first one, it's 0 runTicks.pop(0) + stat.ticks = runTicks + avg = float(stat) + stdev = 0 + numoutsideavg = 0 #loop through all the various ticks for each run for tick in runTicks: stat.ticks = str(tick) val = float(stat) if (val < (avg * .9)) or (val > (avg * 1.1)): - print '%s:%s is %f, which is more than 10%% of the'\ - 'mean %f' % (run.name, stat.name, stat, avg) - - + numoutsideavg += 1 + stdev += pow((val-avg),2) + stdev = pow(stdev / len(runTicks), 0.5) + numoutsidestd = 0 + for tick in runTicks: + stat.ticks = str(tick) + val = float(stat) + if (val < (avg - stdev)) or (val > (avg + stdev)): + numoutsidestd += 1 + print "%-30s %12s %12s %4s %5s %6s" % \ + (run.name, "%.1f" % avg, "%.1f" % stdev, + "%d" % numoutsideavg, "%d" % numoutsidestd, + "%d" % len(runTicks)) return From cbbbc9c57d3eed46cfa6c2c3b69a6acf02a62e1a Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Tue, 18 Jan 2005 13:34:58 -0500 Subject: [PATCH 2/4] now really done with stability stats stuff --HG-- extra : convert_revision : 9bdbcec972f5d06e3ecd99c418fcccfaef7f6f3a --- util/stats/stats.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/util/stats/stats.py b/util/stats/stats.py index 60c3d8a535..62819c3978 100755 --- a/util/stats/stats.py +++ b/util/stats/stats.py @@ -1,6 +1,6 @@ #!/usr/bin/env python from __future__ import division -import re, sys +import re, sys, math def usage(): print '''\ @@ -257,10 +257,11 @@ def commands(options, command, args): for stat in stats: print "%s:" % stat.name - print "%-30s %12s %12s %4s %5s %6s" % \ - ("run name", "average", "stdev", ">10%", ">1SDV", "SAMP") - print "%-30s %12s %12s %4s %5s %6s" % \ - ("------------------------------", "------------", "------------", "----", "-----", "------") + print "%-30s %12s %12s %4s %5s %5s %5s" % \ + ("run name", "average", "stdev", ">10%", ">1SDV", ">2SDV", "SAMP") + print "%-30s %12s %12s %4s %5s %5s %5s" % \ + ("------------------------------", "------------", + "------------", "----", "-----", "-----", "-----") #loop through all the selected runs for run in runs: info.display_run = run.run; @@ -271,6 +272,8 @@ def commands(options, command, args): avg = float(stat) stdev = 0 numoutsideavg = 0 + numoutside1std = 0 + numoutside2std = 0 #loop through all the various ticks for each run for tick in runTicks: @@ -280,18 +283,19 @@ def commands(options, command, args): numoutsideavg += 1 stdev += pow((val-avg),2) - stdev = pow(stdev / len(runTicks), 0.5) - numoutsidestd = 0 + stdev = math.sqrt(stdev / len(runTicks)) for tick in runTicks: stat.ticks = str(tick) val = float(stat) if (val < (avg - stdev)) or (val > (avg + stdev)): - numoutsidestd += 1 + numoutside1std += 1 + if (val < (avg - (2*stdev))) or (val > (avg + (2*stdev))): + numoutside2std += 1 - print "%-30s %12s %12s %4s %5s %6s" % \ + print "%-30s %12s %12s %4s %5s %5s %5s" % \ (run.name, "%.1f" % avg, "%.1f" % stdev, - "%d" % numoutsideavg, "%d" % numoutsidestd, - "%d" % len(runTicks)) + "%d" % numoutsideavg, "%d" % numoutside1std, + "%d" % numoutside2std, "%d" % len(runTicks)) return From d728d44b55541f45b0b1a5d33650c20d260da37a Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 18 Jan 2005 15:28:34 -0500 Subject: [PATCH 3/4] More configuration fixes sim/pyconfig/m5config.py: put panic, AddToPath, and Import here so they're always available. --HG-- extra : convert_revision : 104dba5ccac0d64479b4109d477b5192c4b07a6e --- sim/pyconfig/m5config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sim/pyconfig/m5config.py b/sim/pyconfig/m5config.py index d7c0c65079..4e2a377b0e 100644 --- a/sim/pyconfig/m5config.py +++ b/sim/pyconfig/m5config.py @@ -35,6 +35,19 @@ def defined(key): def define(key, value = True): env[key] = value +def panic(*args, **kwargs): + sys.exit(*args, **kwargs) + +def AddToPath(path): + path = os.path.realpath(path) + if os.path.isdir(path): + sys.path.append(path) + +def Import(path): + AddToPath(os.path.dirname(path)) + exec('from m5config import *') + mpy_exec(file(path, 'r')) + def issequence(value): return isinstance(value, tuple) or isinstance(value, list) From 25f54857c9356b7f8608be8d45fec17d6c26bce5 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Tue, 18 Jan 2005 15:42:52 -0500 Subject: [PATCH 4/4] fix typo --HG-- extra : convert_revision : 7fe0b0b43534020ffd3e5d34a08efd24ba063e5a