summaryrefslogtreecommitdiffstats
path: root/run_case_study_dag.py
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2021-10-28 11:15:36 -0400
committerleochanj105 <leochanj@live.unc.edu>2021-10-28 11:15:36 -0400
commitedfb01f94b56fcc3e3bc7098e233fcbbb862b462 (patch)
tree1328ed4594a2fea8ac3d1abae6bd53006e59ca8f /run_case_study_dag.py
parent14c854543b1a3cf344a371a5b45595657f95786b (diff)
fix stitch and loc, added flush
Diffstat (limited to 'run_case_study_dag.py')
-rwxr-xr-xrun_case_study_dag.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/run_case_study_dag.py b/run_case_study_dag.py
index df44cb4..716c89b 100755
--- a/run_case_study_dag.py
+++ b/run_case_study_dag.py
@@ -107,6 +107,7 @@ def main(pathName):
107 ccx = core // 4 107 ccx = core // 4
108 in_ccx = core % 4 108 in_ccx = core % 4
109 mask = "0000" 109 mask = "0000"
110 # mask = "ffff"
110 mask = mask[:in_ccx] +'f'+ mask[in_ccx+1:] 111 mask = mask[:in_ccx] +'f'+ mask[in_ccx+1:]
111 run('echo {},{} > /sys/fs/resctrl/core-{}/cpus_list'.format(core,core+16, core)) 112 run('echo {},{} > /sys/fs/resctrl/core-{}/cpus_list'.format(core,core+16, core))
112 # run('echo {} > /sys/fs/resctrl/core-{}/cpus_list'.format(core, core)) 113 # run('echo {} > /sys/fs/resctrl/core-{}/cpus_list'.format(core, core))
@@ -156,7 +157,7 @@ def main(pathName):
156 if launch[0] == '0': 157 if launch[0] == '0':
157 if LITMUS: 158 if LITMUS:
158 binary = binary_path + binary_name + "_single" 159 binary = binary_path + binary_name + "_single"
159 # Arg format: <unique name> <num_iters> <core> <NULL runID> <save?> <period> <crit lvl> <phase> 160 # Arg format: <unique name> <num_iters> <core> <NULL runID> <save?> <period> <crit lvl> <phase> <cost> <deadline>
160 arg = " " + task_name + " " + num_iters +" " + core_num +" " + run_id +" " + save_result+" " + period +" " + crt_level + " "+ phase + " " + cost + " " + deadline 161 arg = " " + task_name + " " + num_iters +" " + core_num +" " + run_id +" " + save_result+" " + period +" " + crt_level + " "+ phase + " " + cost + " " + deadline
161 bench_tsk = subprocess.Popen(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg, shell=True, executable='/bin/bash', stderr=stderr_file) 162 bench_tsk = subprocess.Popen(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg, shell=True, executable='/bin/bash', stderr=stderr_file)
162 163
@@ -173,7 +174,7 @@ def main(pathName):
173 if not pid_str: 174 if not pid_str:
174 print("Unable to launch {} as a solo task! Exiting...".format(task_name)) 175 print("Unable to launch {} as a solo task! Exiting...".format(task_name))
175 return 1 176 return 1
176 run("echo " + pid_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") 177 # run("echo " + pid_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks")
177 else: 178 else:
178 # Paried tasks 179 # Paried tasks
179 other_binary_name = launch[OTHER_BINARY_NAME].strip() 180 other_binary_name = launch[OTHER_BINARY_NAME].strip()
@@ -193,7 +194,7 @@ def main(pathName):
193 if LITMUS: 194 if LITMUS:
194 binary = binary_path + binary_name + "_pair" 195 binary = binary_path + binary_name + "_pair"
195 other_binary = binary_path + other_binary_name + "_pair" 196 other_binary = binary_path + other_binary_name + "_pair"
196 # Arg format: <unique name> <num iters> <core> <0 other core> <other name> <runID> <save?> <pairID> <period> <crit lvl> <phase> 197 # Arg format: <unique name> <num iters> <core> <0 other core> <other name> <runID> <save?> <pairID> <period> <crit lvl> <phase> <other_cost> <other_deadline>
197 arg1 = " " + task_name + " " + num_iters +" " + core_num +" " + other_core_num+" "+ other_task_name+" "+ run_id +" " + save_result+" " +str(pairID) +" "+ period +" " + crt_level +" "+phase + " " + cost + " " + deadline 198 arg1 = " " + task_name + " " + num_iters +" " + core_num +" " + other_core_num+" "+ other_task_name+" "+ run_id +" " + save_result+" " +str(pairID) +" "+ period +" " + crt_level +" "+phase + " " + cost + " " + deadline
198 arg2 = " " + other_task_name + " " + num_iters +" " + other_core_num +" " + core_num+" "+ task_name+" "+ run_id +" " + save_result+" " +str(pairID) +" "+ period +" " + crt_level+" " +phase + " " + other_cost + " " + other_deadline 199 arg2 = " " + other_task_name + " " + num_iters +" " + other_core_num +" " + core_num+" "+ task_name+" "+ run_id +" " + save_result+" " +str(pairID) +" "+ period +" " + crt_level+" " +phase + " " + other_cost + " " + other_deadline
199 # print(input_cmd[binary_name] + " | numactl --membind=0 " + binary + arg1) 200 # print(input_cmd[binary_name] + " | numactl --membind=0 " + binary + arg1)
@@ -207,7 +208,7 @@ def main(pathName):
207 arg1 = " " + task_name + " " + num_iters +" " + core_num +" " + other_core_num+" "+ other_task_name+" "+ run_id +" " + save_result+" " +str(pairID) 208 arg1 = " " + task_name + " " + num_iters +" " + core_num +" " + other_core_num+" "+ other_task_name+" "+ run_id +" " + save_result+" " +str(pairID)
208 arg2 = " " + other_task_name + " " + num_iters +" " + other_core_num +" " + core_num+" "+ task_name+" "+ run_id +" " + save_result+" " +str(pairID) 209 arg2 = " " + other_task_name + " " + num_iters +" " + other_core_num +" " + core_num+" "+ task_name+" "+ run_id +" " + save_result+" " +str(pairID)
209 bench_tsk1 = subprocess.Popen(input_cmd[binary_name] + " | numactl --membind=0 taskset -c " + core_num + " " + binary + arg1, shell=True, executable='/bin/bash', stderr=stderr_file) 210 bench_tsk1 = subprocess.Popen(input_cmd[binary_name] + " | numactl --membind=0 taskset -c " + core_num + " " + binary + arg1, shell=True, executable='/bin/bash', stderr=stderr_file)
210 bench_tsk2 = subprocess.Popen(input_cmd[other_binary_name] + " | numactl --membind=1 taskset -c " + core_num + " " + other_binary + arg2, shell=True, executable='/bin/bash', stderr=stderr_file) 211 bench_tsk2 = subprocess.Popen(input_cmd[other_binary_name] + " | numactl --membind=1 taskset -c " + other_core_num + " " + other_binary + arg2, shell=True, executable='/bin/bash', stderr=stderr_file)
211 # print(binary + " " + task_name,other_binary + " " +other_task_name) 212 # print(binary + " " + task_name,other_binary + " " +other_task_name)
212 pid1_str = ID2PID(binary + " " + task_name) 213 pid1_str = ID2PID(binary + " " + task_name)
213 pid2_str = ID2PID(other_binary + " " +other_task_name) 214 pid2_str = ID2PID(other_binary + " " +other_task_name)
@@ -215,8 +216,8 @@ def main(pathName):
215 print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name)) 216 print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name))
216 return 1 217 return 1
217 218
218 run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") 219 # run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks")
219 run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") 220 # run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks")
220 # run("wait " + pid1_str) 221 # run("wait " + pid1_str)
221 # run("wait " + pid2_str) 222 # run("wait " + pid2_str)
222 pairID += 1 223 pairID += 1