From 1f94b49d8f5bbe88286992f2b0bdc740e676ea44 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Fri, 22 Oct 2021 16:36:26 -0400 Subject: L3 and irqs --- run_case_study_dag.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'run_case_study_dag.py') diff --git a/run_case_study_dag.py b/run_case_study_dag.py index d9a0563..0a5c5fe 100755 --- a/run_case_study_dag.py +++ b/run_case_study_dag.py @@ -44,7 +44,7 @@ def ID2PID(lookupID): res = None # Find benchmark PID (avoid getting shell or numactl PID) try: - res = subprocess.check_output("pgrep -af ' " + lookupID + " ' | grep -v numactl", shell=True) + res = subprocess.check_output("pgrep -af '" + lookupID + "' | grep -v numactl", shell=True) except: res = None if res: @@ -56,14 +56,6 @@ def ID2PID(lookupID): def main(pathName): with open("./pids.txt", "w") as f: f.write("") - - tacle_pairs_path = "./all_pairs" - tacle_baseline_path = "./baseline" - dis_path = "./dis" - # List of lists - # Each list represents the parameters for a task as: - # [id, suite, binary name, criticality level (0-base), pet us (unused), period ms, wss (unused)] - all_tasks = [] input_cmd = {} # Load input command for each binary @@ -72,9 +64,6 @@ def main(pathName): for line in f: name, cmd = line.split(maxsplit=1) input_cmd[name.replace("./", "")] = cmd.replace("./", "./SD-VBS/").strip() - # for k in input_cmd: - # print(k, input_cmd[k]) - # return 1 task_launches = [] max_core = 0 @@ -85,8 +74,8 @@ def main(pathName): parameters = line.split(",") task_launches.append(parameters) core_num = int(parameters[CORE_NUM]) % 16 - if max_core < core_num: - max_core = core_num + # if max_core < core_num: + # max_core = core_num all_cores.add(core_num) # if parameters[0] == '1': # other_core_num = int(parameters[OTHER_CORE_NUM]) % 16 @@ -98,7 +87,7 @@ def main(pathName): ### Allocate Cache Ways ### run('mount -t resctrl resctrl /sys/fs/resctrl') -# run('echo "L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') + run('sudo echo "L3:0=0000;1=0000;2=0000;3=000f" | sudo tee /sys/fs/resctrl/schemata') for core in range(16): if core not in all_cores: continue @@ -145,7 +134,7 @@ def main(pathName): arg = " " + task_name + " " + num_iters +" " + core_num +" " + run_id +" " + save_result+" " + period +" " + crt_level + " "+ phase # print(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg) bench_tsk = subprocess.Popen(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg, shell=True, executable='/bin/bash', stderr=stderr_file) - pid_str = ID2PID(task_name) + pid_str = ID2PID(binary + " " + task_name) if not pid_str: print("Unable to launch {} as a solo task! Exiting...".format(task_name)) return 1 @@ -170,11 +159,13 @@ def main(pathName): # print(input_cmd[other_binary_name] + " | numactl --membind=1 " + other_binary + arg2) bench_tsk1 = subprocess.Popen(input_cmd[binary_name] + " | numactl --membind=0 " + binary + arg1, shell=True, executable='/bin/bash', stderr=stderr_file) bench_tsk2 = subprocess.Popen(input_cmd[other_binary_name] + " | numactl --membind=1 " + other_binary + arg2, shell=True, executable='/bin/bash', stderr=stderr_file) - pid1_str = ID2PID(task_name) - pid2_str = ID2PID(other_task_name) + # print(binary + " " + task_name,other_binary + " " +other_task_name) + pid1_str = ID2PID(binary + " " + task_name) + pid2_str = ID2PID(other_binary + " " +other_task_name) if not pid1_str or not pid2_str: print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name)) return 1 + run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") pairID += 1 -- cgit v1.2.2