diff options
Diffstat (limited to 'distill_schedcat_profiles.py')
-rwxr-xr-x | distill_schedcat_profiles.py | 21 |
1 files changed, 16 insertions, 5 deletions
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) |