diff options
| -rw-r--r-- | dag_example | 8 | ||||
| -rw-r--r-- | deadline_misses | 24 | ||||
| -rw-r--r-- | redirect_irq.sh | 13 | ||||
| -rwxr-xr-x | run_case_study_dag.py | 27 |
4 files changed, 37 insertions, 35 deletions
diff --git a/dag_example b/dag_example index 233528f..ce39489 100644 --- a/dag_example +++ b/dag_example | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | 1, mser_qcif, mser001, 5, 0, 1, 1, 100, 1, 0, sift_qcif, sift001 | 1 | 1, mser_qcif, mser001, 5, 1, 1, 1, 100, 1, 0, sift_qcif, sift001 |
| 2 | 0, mser_qcif, mser002, 3, 1, 2, 1, 10, 1, 0 | 2 | 0, mser_qcif, mser002, 3, 2, 2, 1, 10, 1, 0 |
| 3 | 1, svm_qcif, svm001, 6, 0, 3, 1, 50, 1, 0, localization_qcif, localization001 | 3 | 1, svm_qcif, svm001, 6, 2, 3, 1, 50, 1, 0, localization_qcif, localization001 |
| 4 | 0, tracking_qcif, tracking001, 3, 2, 4, 1, 9, 1, 0 | 4 | 0, tracking_qcif, tracking001, 3, 3, 4, 1, 20, 1, 17 |
diff --git a/deadline_misses b/deadline_misses index a6fe6a8..7025d8b 100644 --- a/deadline_misses +++ b/deadline_misses | |||
| @@ -1,13 +1,11 @@ | |||
| 1 | (tracking001/2814:2) HAZARDOUS: Level-B tardy 1763167 ns, relative tardiness 0.195907 | 1 | (svm001/7932:2) HAZARDOUS: Level-B tardy 105144502 ns, relative tardiness 2.102890 |
| 2 | (tracking001/2814:3) HAZARDOUS: Level-B tardy 403976 ns, relative tardiness 0.044886 | 2 | (localization001/7935:3) HAZARDOUS: Level-B tardy 121353473 ns, relative tardiness 2.427069 |
| 3 | (svm001/2797:2) HAZARDOUS: Level-B tardy 102712074 ns, relative tardiness 2.054241 | 3 | (svm001/7932:3) HAZARDOUS: Level-B tardy 121694991 ns, relative tardiness 2.433900 |
| 4 | (svm001/2797:3) HAZARDOUS: Level-B tardy 139940064 ns, relative tardiness 2.798801 | 4 | (localization001/7935:4) HAZARDOUS: Level-B tardy 137671344 ns, relative tardiness 2.753427 |
| 5 | (localization001/2800:3) HAZARDOUS: Level-B tardy 178370600 ns, relative tardiness 3.567412 | 5 | (svm001/7932:4) HAZARDOUS: Level-B tardy 138065691 ns, relative tardiness 2.761314 |
| 6 | (svm001/2797:4) HAZARDOUS: Level-B tardy 196180824 ns, relative tardiness 3.923616 | 6 | (localization001/7935:5) HAZARDOUS: Level-B tardy 154064855 ns, relative tardiness 3.081297 |
| 7 | (localization001/2800:4) HAZARDOUS: Level-B tardy 232648236 ns, relative tardiness 4.652965 | 7 | (svm001/7932:5) HAZARDOUS: Level-B tardy 154402852 ns, relative tardiness 3.088057 |
| 8 | (svm001/2797:5) HAZARDOUS: Level-B tardy 250110392 ns, relative tardiness 5.002208 | 8 | (localization001/7935:6) HAZARDOUS: Level-B tardy 170382265 ns, relative tardiness 3.407645 |
| 9 | (localization001/2800:5) HAZARDOUS: Level-B tardy 286745163 ns, relative tardiness 5.734903 | 9 | (svm001/7932:6) HAZARDOUS: Level-B tardy 170731922 ns, relative tardiness 3.414638 |
| 10 | (svm001/2797:6) HAZARDOUS: Level-B tardy 304772054 ns, relative tardiness 6.095441 | 10 | (localization001/7935:7) HAZARDOUS: Level-B tardy 186729966 ns, relative tardiness 3.734599 |
| 11 | (localization001/2800:6) HAZARDOUS: Level-B tardy 341417704 ns, relative tardiness 6.828354 | 11 | (svm001/7932:7) HAZARDOUS: Level-B tardy 187062334 ns, relative tardiness 3.741247 |
| 12 | (localization001/2800:7) HAZARDOUS: Level-B tardy 351348831 ns, relative tardiness 7.026977 | ||
| 13 | (svm001/2797:7) HAZARDOUS: Level-B tardy 351960956 ns, relative tardiness 7.039219 | ||
diff --git a/redirect_irq.sh b/redirect_irq.sh new file mode 100644 index 0000000..8435abf --- /dev/null +++ b/redirect_irq.sh | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | #!/bin/bash | ||
| 2 | # Redirect all interrupts to core 0 | ||
| 3 | # i=0 | ||
| 4 | for IRQ in /proc/irq/* | ||
| 5 | do | ||
| 6 | # Skip default_smp_affinity | ||
| 7 | if [ -d $IRQ ]; then | ||
| 8 | irqList[$i]=$(cat $IRQ/smp_affinity_list) | ||
| 9 | echo 0 2> /dev/null > $IRQ/smp_affinity_list | ||
| 10 | echo $IRQ: $(cat $IRQ/smp_affinity_list) | ||
| 11 | fi | ||
| 12 | i=$(( $i + 1 )) | ||
| 13 | done \ No newline at end of file | ||
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): | |||
| 44 | res = None | 44 | res = None |
| 45 | # Find benchmark PID (avoid getting shell or numactl PID) | 45 | # Find benchmark PID (avoid getting shell or numactl PID) |
| 46 | try: | 46 | try: |
| 47 | res = subprocess.check_output("pgrep -af ' " + lookupID + " ' | grep -v numactl", shell=True) | 47 | res = subprocess.check_output("pgrep -af '" + lookupID + "' | grep -v numactl", shell=True) |
| 48 | except: | 48 | except: |
| 49 | res = None | 49 | res = None |
| 50 | if res: | 50 | if res: |
| @@ -56,14 +56,6 @@ def ID2PID(lookupID): | |||
| 56 | def main(pathName): | 56 | def main(pathName): |
| 57 | with open("./pids.txt", "w") as f: | 57 | with open("./pids.txt", "w") as f: |
| 58 | f.write("") | 58 | f.write("") |
| 59 | |||
| 60 | tacle_pairs_path = "./all_pairs" | ||
| 61 | tacle_baseline_path = "./baseline" | ||
| 62 | dis_path = "./dis" | ||
| 63 | # List of lists | ||
| 64 | # Each list represents the parameters for a task as: | ||
| 65 | # [id, suite, binary name, criticality level (0-base), pet us (unused), period ms, wss (unused)] | ||
| 66 | all_tasks = [] | ||
| 67 | 59 | ||
| 68 | input_cmd = {} | 60 | input_cmd = {} |
| 69 | # Load input command for each binary | 61 | # Load input command for each binary |
| @@ -72,9 +64,6 @@ def main(pathName): | |||
| 72 | for line in f: | 64 | for line in f: |
| 73 | name, cmd = line.split(maxsplit=1) | 65 | name, cmd = line.split(maxsplit=1) |
| 74 | input_cmd[name.replace("./", "")] = cmd.replace("./", "./SD-VBS/").strip() | 66 | input_cmd[name.replace("./", "")] = cmd.replace("./", "./SD-VBS/").strip() |
| 75 | # for k in input_cmd: | ||
| 76 | # print(k, input_cmd[k]) | ||
| 77 | # return 1 | ||
| 78 | 67 | ||
| 79 | task_launches = [] | 68 | task_launches = [] |
| 80 | max_core = 0 | 69 | max_core = 0 |
| @@ -85,8 +74,8 @@ def main(pathName): | |||
| 85 | parameters = line.split(",") | 74 | parameters = line.split(",") |
| 86 | task_launches.append(parameters) | 75 | task_launches.append(parameters) |
| 87 | core_num = int(parameters[CORE_NUM]) % 16 | 76 | core_num = int(parameters[CORE_NUM]) % 16 |
| 88 | if max_core < core_num: | 77 | # if max_core < core_num: |
| 89 | max_core = core_num | 78 | # max_core = core_num |
| 90 | all_cores.add(core_num) | 79 | all_cores.add(core_num) |
| 91 | # if parameters[0] == '1': | 80 | # if parameters[0] == '1': |
| 92 | # other_core_num = int(parameters[OTHER_CORE_NUM]) % 16 | 81 | # other_core_num = int(parameters[OTHER_CORE_NUM]) % 16 |
| @@ -98,7 +87,7 @@ def main(pathName): | |||
| 98 | 87 | ||
| 99 | ### Allocate Cache Ways ### | 88 | ### Allocate Cache Ways ### |
| 100 | run('mount -t resctrl resctrl /sys/fs/resctrl') | 89 | run('mount -t resctrl resctrl /sys/fs/resctrl') |
| 101 | # run('echo "L3:0=0000,1=0000,2=0000,3=0000" > /sys/fs/resctrl/schemata') | 90 | run('sudo echo "L3:0=0000;1=0000;2=0000;3=000f" | sudo tee /sys/fs/resctrl/schemata') |
| 102 | for core in range(16): | 91 | for core in range(16): |
| 103 | if core not in all_cores: | 92 | if core not in all_cores: |
| 104 | continue | 93 | continue |
| @@ -145,7 +134,7 @@ def main(pathName): | |||
| 145 | arg = " " + task_name + " " + num_iters +" " + core_num +" " + run_id +" " + save_result+" " + period +" " + crt_level + " "+ phase | 134 | arg = " " + task_name + " " + num_iters +" " + core_num +" " + run_id +" " + save_result+" " + period +" " + crt_level + " "+ phase |
| 146 | # print(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg) | 135 | # print(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg) |
| 147 | bench_tsk = subprocess.Popen(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg, shell=True, executable='/bin/bash', stderr=stderr_file) | 136 | bench_tsk = subprocess.Popen(input_cmd[binary_name] + " | numactl --interleave=all " + binary + arg, shell=True, executable='/bin/bash', stderr=stderr_file) |
| 148 | pid_str = ID2PID(task_name) | 137 | pid_str = ID2PID(binary + " " + task_name) |
| 149 | if not pid_str: | 138 | if not pid_str: |
| 150 | print("Unable to launch {} as a solo task! Exiting...".format(task_name)) | 139 | print("Unable to launch {} as a solo task! Exiting...".format(task_name)) |
| 151 | return 1 | 140 | return 1 |
| @@ -170,11 +159,13 @@ def main(pathName): | |||
| 170 | # print(input_cmd[other_binary_name] + " | numactl --membind=1 " + other_binary + arg2) | 159 | # print(input_cmd[other_binary_name] + " | numactl --membind=1 " + other_binary + arg2) |
| 171 | bench_tsk1 = subprocess.Popen(input_cmd[binary_name] + " | numactl --membind=0 " + binary + arg1, shell=True, executable='/bin/bash', stderr=stderr_file) | 160 | bench_tsk1 = subprocess.Popen(input_cmd[binary_name] + " | numactl --membind=0 " + binary + arg1, shell=True, executable='/bin/bash', stderr=stderr_file) |
| 172 | bench_tsk2 = subprocess.Popen(input_cmd[other_binary_name] + " | numactl --membind=1 " + other_binary + arg2, shell=True, executable='/bin/bash', stderr=stderr_file) | 161 | bench_tsk2 = subprocess.Popen(input_cmd[other_binary_name] + " | numactl --membind=1 " + other_binary + arg2, shell=True, executable='/bin/bash', stderr=stderr_file) |
| 173 | pid1_str = ID2PID(task_name) | 162 | # print(binary + " " + task_name,other_binary + " " +other_task_name) |
| 174 | pid2_str = ID2PID(other_task_name) | 163 | pid1_str = ID2PID(binary + " " + task_name) |
| 164 | pid2_str = ID2PID(other_binary + " " +other_task_name) | ||
| 175 | if not pid1_str or not pid2_str: | 165 | if not pid1_str or not pid2_str: |
| 176 | print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name)) | 166 | print("Unable to launch {} and {} in a pair! Exiting...".format(task_name, other_task_name)) |
| 177 | return 1 | 167 | return 1 |
| 168 | |||
| 178 | run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") | 169 | run("echo " + pid1_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") |
| 179 | run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") | 170 | run("echo " + pid2_str + " > /sys/fs/resctrl/core-" + str(phys_core) + "/tasks") |
| 180 | pairID += 1 | 171 | pairID += 1 |
