-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_run_status.py
128 lines (116 loc) · 5.97 KB
/
check_run_status.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import os
os.chdir("Ram_scripts")
import pandas as pd
from Ram_scripts.utils_runs import *
num_exp = len(SINGLECORE_TRACES) + len(MULTICORE_TRACES)
num_finished = 0
num_failed = 0
num_running = 0
for trace in SINGLECORE_TRACES:
output_path = f"{RAM_SRC}/../../Ram_results/singlecore/nodefense/"
result_filename = output_path + "/stats/" + trace + ".txt"
if get_run_status(result_filename) == "finished":
num_finished += 1
elif get_run_status(result_filename) == "running":
num_running += 1
elif get_run_status(result_filename) == "error":
num_failed += 1
for trace_name, trace_mix in MULTICORE_TRACES.items():
output_path = f"{RAM_SRC}/../../Ram_results/multicore/nodefense/"
checkpoint_filename = f"{RAM_SRC}/checkpoints/multicore/llcs/" + trace_name + ".llc.txt"
result_filename = output_path + "/stats/" + trace_name + ".txt"
if get_run_status(result_filename) == "finished":
num_finished += 1
elif get_run_status(result_filename) == "running":
num_running += 1
elif get_run_status(result_filename) == "error":
num_failed += 1
not_found = num_exp - num_finished - num_failed - num_running
if num_exp == num_finished:
print("[INFO-nodefense] All nodefense runs are finished.")
elif num_failed > 0:
print("[INFO-nodefense] There are failed runs. Please rerun './run_ramulator_all.sh'")
else:
print(f"[INFO-nodefense] {num_running} runs are running. {not_found} runs are not found.")
num_exp = (len(SINGLECORE_TRACES) + len(MULTICORE_TRACES)) * len(MITIGATION_LIST) * len(NRH_VALUES)
num_finished = 0
num_failed = 0
num_running = 0
for trace_name in SINGLECORE_TRACES:
for mitigation in MITIGATION_LIST:
for tRH in NRH_VALUES:
output_path = f"{RAM_SRC}/../../Ram_results/singlecore/default/" + mitigation + "/" + str(tRH) + "/"
result_filename = output_path + "/stats/" + trace_name + ".txt"
if get_run_status(result_filename) == "finished":
num_finished += 1
elif get_run_status(result_filename) == "running":
num_running += 1
elif get_run_status(result_filename) == "error":
num_failed += 1
for trace_name, trace_mix in MULTICORE_TRACES.items():
for mitigation in MITIGATION_LIST:
for tRH in NRH_VALUES:
output_path = f"{RAM_SRC}/../../Ram_results/multicore/default/" + mitigation + "/" + str(tRH) + "/"
result_filename = output_path + "/stats/" + trace_name + ".txt"
if get_run_status(result_filename) == "finished":
num_finished += 1
elif get_run_status(result_filename) == "running":
num_running += 1
elif get_run_status(result_filename) == "error":
num_failed += 1
not_found = num_exp - num_finished - num_failed - num_running
if num_exp == num_finished:
print("[INFO-default] All default runs are finished.")
elif num_failed > 0:
print("[INFO-default] There are failed runs. Please rerun './run_ramulator_all.sh'")
else:
print(f"[INFO-default] {num_running} runs are running. {not_found} runs are not found.")
num_exp = (len(SINGLECORE_TRACES) + len(MULTICORE_TRACES)) * len(MITIGATION_LIST) * len(NRH_VALUES) * sum(len(values) for values in MFR_DICT.values())
num_finished = 0
num_failed = 0
num_running = 0
for mfr in MFR_DICT.keys():
mech_csv = f"{RAM_SRC}/PaCRAM_config_mfr{mfr[-1]}.csv"
conf_df = pd.read_csv(mech_csv)
conf_df = conf_df[conf_df["norm_tras"].isin(MFR_DICT[mfr])]
latency_factor_list = conf_df["norm_tras"].tolist()
nRH_factor_list = conf_df["n_nRH"].tolist()
th_pcr_list = conf_df["th_pcr"].tolist()
for latency_factor, nRH_factor, th_pcr in zip(latency_factor_list, nRH_factor_list, th_pcr_list):
for trace_name in SINGLECORE_TRACES:
for mitigation in MITIGATION_LIST:
for base_tRH in NRH_VALUES:
output_path = f"{RAM_SRC}/../../Ram_results/singlecore/PaCRAM-{mfr[-1]}/" + mitigation + "/" + str(base_tRH) + "/" + str(latency_factor).replace(".", "_") + "/"
result_filename = output_path + "/stats/" + trace_name + ".txt"
if get_run_status(result_filename) == "finished":
num_finished += 1
elif get_run_status(result_filename) == "running":
num_running += 1
elif get_run_status(result_filename) == "error":
num_failed += 1
for mfr in MFR_DICT.keys():
mech_csv = f"{RAM_SRC}/PaCRAM_config_mfr{mfr[-1]}.csv"
conf_df = pd.read_csv(mech_csv)
conf_df = conf_df[conf_df["norm_tras"].isin(MFR_DICT[mfr])]
latency_factor_list = conf_df["norm_tras"].tolist()
nRH_factor_list = conf_df["n_nRH"].tolist()
th_pcr_list = conf_df["th_pcr"].tolist()
for latency_factor, nRH_factor, th_pcr in zip(latency_factor_list, nRH_factor_list, th_pcr_list):
for trace_name, trace_mix in MULTICORE_TRACES.items():
for mitigation in MITIGATION_LIST:
for base_tRH in NRH_VALUES:
output_path = f"{RAM_SRC}/../../Ram_results/multicore/PaCRAM-{mfr[-1]}/" + mitigation + "/" + str(base_tRH) + "/" + str(latency_factor).replace(".", "_") + "/"
result_filename = output_path + "/stats/" + trace_name + ".txt"
if get_run_status(result_filename) == "finished":
num_finished += 1
elif get_run_status(result_filename) == "running":
num_running += 1
elif get_run_status(result_filename) == "error":
num_failed += 1
not_found = num_exp - num_finished - num_failed - num_running
if num_exp == num_finished:
print("[INFO-mechanism] All mechanism runs are finished.")
elif num_failed > 0:
print("[INFO-mechanism] There are failed runs. Please rerun './run_ramulator_all.sh'")
else:
print(f"[INFO-mechanism] {num_running} runs are running. {not_found} runs are not found.")