diff options
| -rwxr-xr-x | analyze | 20 | ||||
| -rwxr-xr-x | distill_schedcat_profiles.py | 21 | ||||
| -rwxr-xr-x | extract-trends.sh | 1 |
3 files changed, 33 insertions, 9 deletions
| @@ -22,11 +22,16 @@ opts = [ | |||
| 22 | 22 | ||
| 23 | o('-o', '--outlier-list', action='store', dest='outlier_file', | 23 | o('-o', '--outlier-list', action='store', dest='outlier_file', |
| 24 | help='list of outliers to remove'), | 24 | help='list of outliers to remove'), |
| 25 | |||
| 26 | o('-m', '--max-value', action='store', dest='maxval', type='float', | ||
| 27 | help='maximum sample threshold (higher values discarded)'), | ||
| 28 | |||
| 25 | ] | 29 | ] |
| 26 | 30 | ||
| 27 | defaults = { | 31 | defaults = { |
| 28 | 'cycles' : 2128, | 32 | 'cycles' : 2128, |
| 29 | 'extent' : 0, | 33 | 'extent' : 0, |
| 34 | 'maxval' : 1000.0, | ||
| 30 | 'cutoff' : None, | 35 | 'cutoff' : None, |
| 31 | 'outlier_file' : None, | 36 | 'outlier_file' : None, |
| 32 | 'outliers' : {}, | 37 | 'outliers' : {}, |
| @@ -36,11 +41,11 @@ options = None | |||
| 36 | 41 | ||
| 37 | def fmt_cell(x): | 42 | def fmt_cell(x): |
| 38 | if type(x) == str: | 43 | if type(x) == str: |
| 39 | return "%15s" % x | 44 | return "%25s" % x |
| 40 | if type(x) == int: | 45 | if type(x) == int: |
| 41 | return "%15d" % x | 46 | return "%25d" % x |
| 42 | else: | 47 | else: |
| 43 | return "%15.5f" % x | 48 | return "%25.5f" % x |
| 44 | 49 | ||
| 45 | def write_header(): | 50 | def write_header(): |
| 46 | labels = ["Plugin", "Overhead", "#tasks", | 51 | labels = ["Plugin", "Overhead", "#tasks", |
| @@ -71,10 +76,17 @@ def stats_file(fname): | |||
| 71 | stats = bd.compact_file(fname, | 76 | stats = bd.compact_file(fname, |
| 72 | extent=options.extent, | 77 | extent=options.extent, |
| 73 | scale=scale, | 78 | scale=scale, |
| 79 | maxval=options.maxval, | ||
| 74 | cutoff=options.cutoff, | 80 | cutoff=options.cutoff, |
| 75 | manual=take_off) | 81 | manual=take_off) |
| 76 | info = [conf['scheduler'], conf['overhead'], conf['n']] | 82 | if 'locks' in conf: |
| 83 | sched = '%s_locks=%s' % (conf['scheduler'], conf['locks']) | ||
| 84 | else: | ||
| 85 | sched = conf['scheduler'] | ||
| 86 | |||
| 87 | info = [sched, conf['overhead'], conf['n']] | ||
| 77 | print ", ".join([fmt_cell(x) for x in info + stats]) | 88 | print ", ".join([fmt_cell(x) for x in info + stats]) |
| 89 | sys.stdout.flush() | ||
| 78 | 90 | ||
| 79 | if __name__ == '__main__': | 91 | if __name__ == '__main__': |
| 80 | parser = optparse.OptionParser(option_list=opts) | 92 | parser = optparse.OptionParser(option_list=opts) |
diff --git a/distill_schedcat_profiles.py b/distill_schedcat_profiles.py index 8d34904..83c90cb 100755 --- a/distill_schedcat_profiles.py +++ b/distill_schedcat_profiles.py | |||
| @@ -48,14 +48,21 @@ class DataFile(object): | |||
| 48 | self.sched = self.conf['scheduler'] | 48 | self.sched = self.conf['scheduler'] |
| 49 | self.overhead = self.conf['overhead'] | 49 | self.overhead = self.conf['overhead'] |
| 50 | self.host = self.conf['host'] | 50 | self.host = self.conf['host'] |
| 51 | self.locks = self.conf['locks'] if 'locks' in self.conf else None | ||
| 51 | self.name = name | 52 | self.name = name |
| 52 | self.data = load_csv_file(fname) | 53 | self.data = load_csv_file(fname) |
| 53 | 54 | ||
| 55 | def key(self): | ||
| 56 | if self.locks: | ||
| 57 | return "%s/%s" % (self.sched, self.locks) | ||
| 58 | else: | ||
| 59 | return self.sched | ||
| 60 | |||
| 54 | 61 | ||
| 55 | def group_by_scheduler(files): | 62 | def group_by_scheduler(files): |
| 56 | g = defaultdict(list) | 63 | g = defaultdict(list) |
| 57 | for f in files: | 64 | for f in files: |
| 58 | g[f.sched].append(f) | 65 | g[f.key()].append(f) |
| 59 | return g | 66 | return g |
| 60 | 67 | ||
| 61 | NUM_INDEX = 2 | 68 | NUM_INDEX = 2 |
| @@ -79,10 +86,14 @@ def write_profiles(files): | |||
| 79 | wc = [row(i, WC_INDEX) for i in xrange(num)] | 86 | wc = [row(i, WC_INDEX) for i in xrange(num)] |
| 80 | header = ['NUM_TASKS'] + [f.overhead.replace('-', '_') for f in files] | 87 | header = ['NUM_TASKS'] + [f.overhead.replace('-', '_') for f in files] |
| 81 | 88 | ||
| 82 | avg_name = '%soh_host=%s_scheduler=%s_stat=avg%s.csv' % \ | 89 | if files[0].locks: |
| 83 | (options.prefix, host, sched, options.tag) | 90 | lock_str = '_locks=%s' % files[0].locks |
| 84 | wc_name = '%soh_host=%s_scheduler=%s_stat=wc%s.csv' % \ | 91 | else: |
| 85 | (options.prefix, host, sched, options.tag) | 92 | lock_str = '' |
| 93 | avg_name = '%soh_host=%s_scheduler=%s%s_stat=avg%s.csv' % \ | ||
| 94 | (options.prefix, host, sched, lock_str, options.tag) | ||
| 95 | wc_name = '%soh_host=%s_scheduler=%s%s_stat=wc%s.csv' % \ | ||
| 96 | (options.prefix, host, sched, lock_str, options.tag) | ||
| 86 | 97 | ||
| 87 | print 'Generating %s.' % (avg_name) | 98 | print 'Generating %s.' % (avg_name) |
| 88 | write_csv_file(avg_name, [header] + avg, width=15) | 99 | write_csv_file(avg_name, [header] + avg, width=15) |
diff --git a/extract-trends.sh b/extract-trends.sh index 60fa95e..bbcee67 100755 --- a/extract-trends.sh +++ b/extract-trends.sh | |||
| @@ -12,6 +12,7 @@ OVERHEADS=`cat $FILE | awk '/^[^#]/ { print $2 }' | sed 's/,//' | sort | uniq` | |||
| 12 | SCHEDULERS=`cat $FILE | awk '/^[^#]/ { print $1 }' | sed 's/,//' | sort | uniq` | 12 | SCHEDULERS=`cat $FILE | awk '/^[^#]/ { print $1 }' | sed 's/,//' | sort | uniq` |
| 13 | 13 | ||
| 14 | #echo "(ii) Dataset contains $OVERHEADS for $SCHEDULERS." | 14 | #echo "(ii) Dataset contains $OVERHEADS for $SCHEDULERS." |
| 15 | #exit 1 | ||
| 15 | 16 | ||
| 16 | for S in $SCHEDULERS | 17 | for S in $SCHEDULERS |
| 17 | do | 18 | do |
