diff options
author | leochanj <jbakita@cs.unc.edu> | 2020-10-23 02:11:48 -0400 |
---|---|---|
committer | leochanj <jbakita@cs.unc.edu> | 2020-10-23 02:11:48 -0400 |
commit | e0217a963c6c0e0667d41d075038685956bcfacf (patch) | |
tree | faf3963cc501f103cd2554553ec74ce21157b42e /run_case_study.py | |
parent | d427b910baffcc330b0b24d87c9b3216f306d0fb (diff) |
wip
Diffstat (limited to 'run_case_study.py')
-rw-r--r-- | run_case_study.py | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/run_case_study.py b/run_case_study.py index b960d38..d715644 100644 --- a/run_case_study.py +++ b/run_case_study.py | |||
@@ -28,8 +28,32 @@ def main(): | |||
28 | if line > 0: | 28 | if line > 0: |
29 | levelC.append(row) | 29 | levelC.append(row) |
30 | line += 1 | 30 | line += 1 |
31 | #os.system('echo "L3:0=L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') | ||
31 | 32 | ||
32 | for task in all_tasks: | 33 | with open(pathName+"/l3alloc.csv", "r") as csv_file: |
33 | print(task[0]) | 34 | csv_reader = csv.reader(csv_file, delimiter = ',') |
35 | line = 0 | ||
36 | ccx = 0 | ||
37 | for row in csv_reader: | ||
38 | if line > 0: | ||
39 | core = int(row[0]) | ||
40 | way_AB = int(row[1]) | ||
41 | way_C = int(row[3]) | ||
42 | # Level C allocation | ||
43 | if(core == 1): | ||
44 | os.system("mkdir /sys/fs/resctrl/level-c-ccx-0") | ||
45 | os.system('echo "L3:0=' + ("%0.4x" % (int("1"*way_C, 2))) + ',1=0000,2=0000,3=0000" > /sys/fs/resctrl/level-c-ccx-0/schemata') | ||
46 | |||
47 | if(core == 4): | ||
48 | os.system("mkdir /sys/fs/resctrl/level-c-ccx-1") | ||
49 | os.system('echo "L3:0=0000, 1=' + ("%0.4x" % (int("1"*way_C, 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-c-ccx-0/schemata') | ||
50 | os.system('mkdir /sys/fs/resctrl/level-ab-core-' + core) | ||
51 | if(core < 4): | ||
52 | os.system('echo "L3:0=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',1=0000,2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') | ||
53 | else: | ||
54 | os.system('echo "L3:0=0000,1=' + ("%0.4x" % (int("1"*way_C + "0"*(16-way_AB), 2))) + ',2=0000,3=0000" > /sys/fs/resctrl/level-ab-core-' + core + '/schemata') | ||
55 | for task in levelAB: | ||
56 | |||
57 | #os.system("ls") | ||
34 | if __name__ == "__main__": | 58 | if __name__ == "__main__": |
35 | main() | 59 | main() |