summaryrefslogtreecommitdiffstats
path: root/run_case_study_dag.py
diff options
context:
space:
mode:
Diffstat (limited to 'run_case_study_dag.py')
-rwxr-xr-xrun_case_study_dag.py38
1 files changed, 21 insertions, 17 deletions
diff --git a/run_case_study_dag.py b/run_case_study_dag.py
index f098e9e..d9a0563 100755
--- a/run_case_study_dag.py
+++ b/run_case_study_dag.py
@@ -78,6 +78,7 @@ def main(pathName):
78 78
79 task_launches = [] 79 task_launches = []
80 max_core = 0 80 max_core = 0
81 all_cores = set()
81 # Load task specifications 82 # Load task specifications
82 with open(pathName, "r") as file: 83 with open(pathName, "r") as file:
83 for line in file: 84 for line in file:
@@ -86,6 +87,7 @@ def main(pathName):
86 core_num = int(parameters[CORE_NUM]) % 16 87 core_num = int(parameters[CORE_NUM]) % 16
87 if max_core < core_num: 88 if max_core < core_num:
88 max_core = core_num 89 max_core = core_num
90 all_cores.add(core_num)
89 # if parameters[0] == '1': 91 # if parameters[0] == '1':
90 # other_core_num = int(parameters[OTHER_CORE_NUM]) % 16 92 # other_core_num = int(parameters[OTHER_CORE_NUM]) % 16
91 # if other_core_num > max_core: 93 # if other_core_num > max_core:
@@ -97,20 +99,22 @@ def main(pathName):
97 ### Allocate Cache Ways ### 99 ### Allocate Cache Ways ###
98 run('mount -t resctrl resctrl /sys/fs/resctrl') 100 run('mount -t resctrl resctrl /sys/fs/resctrl')
99# run('echo "L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') 101# run('echo "L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata')
100 # for core in range(16): 102 for core in range(16):
101 # run("mkdir -p /sys/fs/resctrl/core-{}".format(core)) 103 if core not in all_cores:
102 # ccx = core // 4 104 continue
103 # in_ccx = core % 4 105 run("mkdir -p /sys/fs/resctrl/core-{}".format(core))
104 # mask = "0000" 106 ccx = core // 4
105 # mask = mask[:in_ccx] +'f'+ mask[in_ccx+1:] 107 in_ccx = core % 4
106 # if ccx == 0: 108 mask = "0000"
107 # run('echo "L3:0=' + mask + ';1=0000;2=0000;3=0000" > /sys/fs/resctrl/core-{}/schemata'.format(core)) 109 mask = mask[:in_ccx] +'f'+ mask[in_ccx+1:]
108 # if ccx == 1: 110 if ccx == 0:
109 # run('echo "L3:0=0000;1=' + mask + ';2=0000;3=0000" > /sys/fs/resctrl/core-{}/schemata'.format(core)) 111 run('echo "L3:0=' + mask + ';1=0000;2=0000;3=0000" > /sys/fs/resctrl/core-{}/schemata'.format(core))
110 # if ccx == 2: 112 if ccx == 1:
111 # run('echo "L3:0=0000;1=0000;2='+ mask +';3=0000" > /sys/fs/resctrl/core-{}/schemata'.format(core)) 113 run('echo "L3:0=0000;1=' + mask + ';2=0000;3=0000" > /sys/fs/resctrl/core-{}/schemata'.format(core))
112 # if ccx == 3: 114 if ccx == 2:
113 # run('echo "L3:0=0000;1=0000;2=0000;3=' + mask + '" > /sys/fs/resctrl/core-{}/schemata'.format(core)) 115 run('echo "L3:0=0000;1=0000;2='+ mask +';3=0000" > /sys/fs/resctrl/core-{}/schemata'.format(core))
116 if ccx == 3:
117 run('echo "L3:0=0000;1=0000;2=0000;3=' + mask + '" > /sys/fs/resctrl/core-{}/schemata'.format(core))
114 118
115 # return 1 119 # return 1
116 run("rm -rf /dev/shm/*") 120 run("rm -rf /dev/shm/*")
@@ -145,7 +149,7 @@ def main(pathName):
145 if not pid_str: 149 if not pid_str:
146 print("Unable to launch {} as a solo task! Exiting...".format(task_name)) 150 print("Unable to launch {} as a solo task! Exiting...".format(task_name))
147 return 1 151 return 1
148 # run("echo " + pid_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") 152 run("echo " + pid_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks")
149 else: 153 else:
150 # Paried tasks 154 # Paried tasks
151 other_binary_name = launch[OTHER_BINARY_NAME].strip() 155 other_binary_name = launch[OTHER_BINARY_NAME].strip()
@@ -171,8 +175,8 @@ def main(pathName):
171 if not pid1_str or not pid2_str: 175 if not pid1_str or not pid2_str:
172 print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name)) 176 print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name))
173 return 1 177 return 1
174 # run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") 178 run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks")
175 # run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") 179 run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks")
176 pairID += 1 180 pairID += 1
177 181
178if __name__ == "__main__": 182if __name__ == "__main__":