-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread_qe_out_all.py
36 lines (33 loc) · 1.13 KB
/
read_qe_out_all.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
import sys
depth=1
str_in_dir=[]
stuff = os.path.abspath(os.path.expanduser(os.path.expandvars(".")))
for root,dirnames,filenames in os.walk(stuff):
if root[len(stuff):].count(os.sep) < depth:
for filename in filenames:
if ".vasp" in filename:
str_in_dir.append(filename.split(".vasp")[0])
#print(str_in_dir)
str_in_dir=sorted(str_in_dir,key=len,reverse=True)
report=[]
for i in str_in_dir:
if os.path.isfile("%s/out_relax_%s"%(i,i))==1:
f=open("%s/out_relax_%s"%(i,i)).readlines()
if "JOB DONE" in f[-2]:
report.append([i,"success"])
os.system("python /hpc/data/home/spst/zhengfan/open/replace/read_qeout_relax.py %s/out_relax_%s"%(i,i))
else:
err=0
for j in f:
if "Error" in j:
err=1
if err==0:
report.append([i,"running"])
else:
report.append([i,"Error"])
else:
report.append([i,"waiting"])
print("you can use following code to download the files:\nsz ./*/*.xsf\n")
for i in range(len(report)):
print(report[i])