summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2011-12-28 15:56:54 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2011-12-28 15:56:54 -0500
commit2470de183d571aeed91f979315068e313d7fbd32 (patch)
treeb8540f0174cc0b5e541b521eb1015e6c25947520
parent764d056fe17129fd312a55a1f84b1e8a892dd7d2 (diff)
Hackity hack method for merging different sets
-rwxr-xr-xanalyze45
-rwxr-xr-xsplit10
2 files changed, 47 insertions, 8 deletions
diff --git a/analyze b/analyze
index 3ebb1b4..0c72740 100755
--- a/analyze
+++ b/analyze
@@ -33,6 +33,7 @@ defaults = {
33 } 33 }
34 34
35options = None 35options = None
36iters = None
36 37
37def fmt_cell(x): 38def fmt_cell(x):
38 if type(x) == str: 39 if type(x) == str:
@@ -51,7 +52,7 @@ def write_header():
51 print '#%s' % header[1:] 52 print '#%s' % header[1:]
52 53
53 54
54def stats_file(fname): 55def stats_file(fname, res):
55 name, ext = splitext(fname) 56 name, ext = splitext(fname)
56 conf = decode(name) 57 conf = decode(name)
57 58
@@ -74,13 +75,32 @@ def stats_file(fname):
74 cutoff=options.cutoff, 75 cutoff=options.cutoff,
75 manual=take_off) 76 manual=take_off)
76 info = [conf['scheduler'], conf['overhead'], conf['n']] 77 info = [conf['scheduler'], conf['overhead'], conf['n']]
77 print ", ".join([fmt_cell(x) for x in info + stats]) 78 res.append([x for x in info + stats])
79
80def merge(x, y):
81 x[3] = x[3] + y[3] # samples
82 x[4] = x[4] + y[4] # filtered
83 x[5] = x[5] + y[5] / iters # max
84 x[6] = x[6] + y[6] / iters # avg
85 x[7] = x[7] + y[7] / iters # min
86 x[8] = x[8] + y[8] / iters # med
87 # The following are kinda nonsense
88 # x[9] = x[9] + y[9] / iters # std
89 # x[10] = x[10] + y[10] / iters # var
90 # # Back to rational
91 # x[11] = x[11] + y[11] / iters # iqrmax
92 # x[12] = x[12] + y[12] / iters # iqrmin
93 return x
78 94
79if __name__ == '__main__': 95if __name__ == '__main__':
80 parser = optparse.OptionParser(option_list=opts) 96 parser = optparse.OptionParser(option_list=opts)
81 parser.set_defaults(**defaults) 97 parser.set_defaults(**defaults)
82 (options, files) = parser.parse_args() 98 (options, files) = parser.parse_args()
83 99
100 stats = []
101 confs = []
102 res = []
103
84 try: 104 try:
85 if options.outlier_file: 105 if options.outlier_file:
86 options.outliers = load_outliers(options.outlier_file) 106 options.outliers = load_outliers(options.outlier_file)
@@ -88,8 +108,27 @@ if __name__ == '__main__':
88 write_header() 108 write_header()
89 for f in files: 109 for f in files:
90 try: 110 try:
91 stats_file(f) 111 stats_file(f, res)
92 except IOError, msg: 112 except IOError, msg:
93 print >> sys.stderr, msg 113 print >> sys.stderr, msg
114
115 # Collect configurations
116 for i in res:
117 conf = [i[0], i[1], i[2]]
118 if not conf in confs:
119 # print "Adding %s to res" % (", ".join([fmt_cell(x) for x in conf]))
120 confs.append(conf)
121
122 # Reduce configurations
123 for conf in confs:
124 conf_dat = [x for x in res if x[0] == conf[0] and\
125 x[1] == conf[1] and x[2] == conf[2]]
126 iters = len(conf_dat)
127 print "found %d things" % (iters)
128 first = [conf[0], conf[1], conf[2],0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
129 stats.append(reduce(merge, conf_dat, first))
130
131 for r in stats:
132 print ", ".join([fmt_cell(x) for x in r])
94 except KeyboardInterrupt: 133 except KeyboardInterrupt:
95 pass 134 pass
diff --git a/split b/split
index 49a433c..04c5bb3 100755
--- a/split
+++ b/split
@@ -16,11 +16,11 @@ function do_split() {
16 TARGET="${WHERE}_overhead=$EP.$EXT" 16 TARGET="${WHERE}_overhead=$EP.$EXT"
17 LOCAL_OPTS="" 17 LOCAL_OPTS=""
18 echo $1 $E ">>" $TARGET 18 echo $1 $E ">>" $TARGET
19 if [[ "$E" = "LVLA_SCHED" ]] 19 # if [[ "$E" = "LVLA_SCHED" ]]
20 then 20 # then
21 # Don't include CPU 0 in level-A scheduling overheads 21 # # Don't include CPU 0 in level-A scheduling overheads
22 LOCAL_OPTS="-a 0" 22 # LOCAL_OPTS="-a 0"
23 fi 23 # fi
24 $SPLITTER $OPTS ${LOCAL_OPTS} $E "$1" >> $TARGET 24 $SPLITTER $OPTS ${LOCAL_OPTS} $E "$1" >> $TARGET
25 done 25 done
26 for E in $BE_EVENTS; do 26 for E in $BE_EVENTS; do