-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_warmup_status.py
36 lines (32 loc) · 1.27 KB
/
check_warmup_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
import os
os.chdir("Ram_scripts")
from Ram_scripts.utils_runs import *
num_exp = len(SINGLECORE_TRACES) + len(MULTICORE_TRACES)
num_finished = 0
num_running = 0
num_failed = 0
for trace in SINGLECORE_TRACES:
output_path = f"{RAM_SRC}/checkpoints/singlecore/"
log_filename = output_path + "logs/" + trace + ".log"
if get_run_status(log_filename) == "finished":
num_finished += 1
elif get_run_status(log_filename) == "running":
num_running += 1
elif get_run_status(log_filename) == "error":
num_failed += 1
for trace_name, trace_mix in MULTICORE_TRACES.items():
output_path = f"{RAM_SRC}/checkpoints/multicore/"
log_filename = output_path + "logs/" + trace_name + ".log"
if get_run_status(log_filename) == "finished":
num_finished += 1
elif get_run_status(log_filename) == "running":
num_running += 1
elif get_run_status(log_filename) == "error":
num_failed += 1
not_found = num_exp - num_finished - num_failed - num_running
if num_exp == num_finished:
print("[INFO-warmup] All warmup runs are finished.")
elif num_failed > 0:
print("[INFO-warmup] There are failed runs. Please rerun './prepare_warmups.sh'")
else:
print(f"[INFO-warmup] {num_running} runs are running. {not_found} runs are not found.")