3 import matplotlib.pyplot
as plt
6 from datetime
import datetime,time,timedelta
7 from winnet_class
import winnet
16 use_slurm_times =
False
25 cmd =
"squeue | grep "+user+
" | grep R | wc -l"
26 x = subprocess.check_output(cmd, shell=
True)
27 nr_process = int(x.strip())
35 all_folders = os.listdir(path)
39 tot_path = os.path.join(path,p)
40 if not os.path.isdir(tot_path):
43 w_path = os.path.join(tot_path,
"winnet")
44 b_path = os.path.join(tot_path,
"blocked")
45 f_path = os.path.join(tot_path,
"finab.dat")
46 h_path = os.path.join(tot_path,
"WinNet_data.h5")
47 o_path = os.path.join(tot_path,
"OUT")
48 e_path = os.path.join(tot_path,
"ERR")
50 if not os.path.isfile(w_path)
and not os.path.isfile(b_path):
52 elif not os.path.isfile(w_path)
and os.path.isfile(b_path):
54 if os.path.isfile(f_path):
56 if not use_slurm_times:
59 eltime.append(w.elapsed_time)
61 elif os.path.isfile(h_path):
62 ftmp = h5py.File(h_path,
"r")
70 with open(e_path,
"r")
as f:
72 ecode = lines[1].split()[1].strip()
75 ecodelist.append(ecode)
83 with open(e_path,
"r")
as f:
85 ecode = lines[1].split()[1].strip()
88 ecodelist.append(ecode)
89 elif os.path.isfile(w_path)
and os.path.isfile(o_path):
97 outstr +=
" WinNet monitoring "+
"\n"
98 outstr +=
"===================================="+
"\n"
100 outstr +=
"| List of failed runs: | \n"
101 outstr +=
"|----------------------------------| \n"
102 outstr +=
"| Name | Error code | \n"
104 for ind,p
in enumerate(faillist):
105 lll +=
"| "+p[:19].ljust(19)+
" | "+ecodelist[ind].ljust(10)+
" | \n"
108 outstr +=
"|"+
"_"*34 +
"| \n"
110 outstr +=
'Different error codes: \n'
111 outstr +=
' '.join(list(set(ecodelist)))