summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-23 12:44:50 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-02-23 12:44:50 -0500
commit38c8f0ad0b5fafbdf6f956eb6c489710e56f569f (patch)
treec2f8bbb9444c44a30d9137340c027f6aa0690387
parent6adad879ebc6e5530591d7a1272b2471fde26f3d (diff)
multiply by scheduling domain cpu count
-rwxr-xr-xdistill_schedcat_profiles.py24
1 files changed, 23 insertions, 1 deletions
diff --git a/distill_schedcat_profiles.py b/distill_schedcat_profiles.py
index fa3c482..8d34904 100755
--- a/distill_schedcat_profiles.py
+++ b/distill_schedcat_profiles.py
@@ -22,6 +22,23 @@ defaults = {
22 'tag' : '', 22 'tag' : '',
23} 23}
24 24
25def ludwig_cpu_count(sched):
26 if 'L3' in sched:
27 cpus = 6
28 elif 'L2' in sched:
29 cpus = 2
30 elif 'P-' in sched:
31 cpus= 1
32 else:
33 # global
34 cpus = 24
35 if '-RM' in sched and cpus == 24:
36 cpus -=1
37 return cpus
38
39HOSTS = {
40 'ludwig' : ludwig_cpu_count,
41}
25 42
26class DataFile(object): 43class DataFile(object):
27 def __init__(self, fname): 44 def __init__(self, fname):
@@ -50,8 +67,13 @@ def write_profiles(files):
50 sched = files[0].sched 67 sched = files[0].sched
51 num = len(files[0].data) 68 num = len(files[0].data)
52 69
70 if host in HOSTS:
71 cpus = HOSTS[host](sched)
72 else:
73 cpus = 1
74
53 def row(i, idx): 75 def row(i, idx):
54 return [int(files[0].data[i][NUM_INDEX])] + [f.data[i][idx] for f in files] 76 return [int(files[0].data[i][NUM_INDEX]) * cpus] + [f.data[i][idx] for f in files]
55 77
56 avg = [row(i, AVG_INDEX) for i in xrange(num)] 78 avg = [row(i, AVG_INDEX) for i in xrange(num)]
57 wc = [row(i, WC_INDEX) for i in xrange(num)] 79 wc = [row(i, WC_INDEX) for i in xrange(num)]