-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_tests.py
189 lines (170 loc) · 5.96 KB
/
run_tests.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import cif2crystal
import runcrystal
import process_record as pr
import runqwalk
import copy
import job_control as jc
import os
import json
import cryfiles_io as cry
import veritas
element_list=[]
element_list.append(cif2crystal.Cif2Crystal())
element_list.append(runcrystal.RunCrystal(
submitter=veritas.LocalVeritasCrystalSubmitter(
nn=1,np=8,time="100:00:00",queue="batch")))
element_list.append(runcrystal.RunProperties(
submitter=veritas.LocalVeritasPropertiesSubmitter(
nn=1,np=1,time="100:00:00",queue="batch")))
element_list.append(runqwalk.Crystal2QWalk())
element_list.append(runqwalk.QWalkVarianceOptimize(
submitter=veritas.LocalVeritasQwalkSubmitter(
nn=1,np=8,time="100:00:00",queue="batch")))
#element_list.append(runqwalk.QWalkEnergyOptimize(
# submitter=veritas.LocalVeritasQwalkSubmitter(
# nn=1,np=8,time="100:00:00",queue="batch")))
#element_list.append(runqwalk.QWalkRunVMC(
# submitter=veritas.LocalVeritasQwalkSubmitter(
# nn=1,np=8,time="100:0:00",queue="batch")))
element_list.append(runqwalk.QWalkRunDMC(
submitter=veritas.LocalVeritasQwalkSubmitter(
nn=1,np=8,time="100:00:00",queue="batch")))
element_list.append(runqwalk.QWalkRunPostProcess(
submitter=veritas.LocalVeritasQwalkSubmitter(
nn=1,np=2,time="100:00:00",queue="batch")))
default_job=jc.default_job_record("si.cif")
default_job['dft']['kmesh'] = [4,4,4]
default_job['dft']['functional']['hybrid'] = 0
default_job['dft']['tolinteg'] = [8,8,8,8,12]
default_job['dft']['basis']=[0.4,1,1]
default_job['dft']['maxcycle'] = 100
default_job['dft']['fmixing'] = 80
default_job['dft']['edifftol'] = 6
default_job['dft']['broyden'] = [0.001,60,20]
default_job['qmc']['variance_optimize']['reltol']=0.1
default_job['qmc']['variance_optimize']['abstol']=10
default_job['qmc']['dmc']['save_trace'] = True
default_job['qmc']['dmc']['nblock']=5
default_job['qmc']['dmc']['target_error']=0.1
default_job['qmc']['dmc']['timestep']=[0.1,0.2]
default_job['total_spin'] = 0
idbase = "si_ag_"
count=1
checking_this = False
results = []
# Simple run.
name = idbase+"simple"
job_record = copy.deepcopy(default_job)
job_record['control']['id']=name
job_record['qmc']['postprocess']['obdm'] = True
job_record['qmc']['postprocess']['density'] = True
job_record['qmc']['postprocess']['basis'] = "../atomic.basis"
job_record['qmc']['postprocess']['orb'] = "../atomic.orb"
job_record['qmc']['postprocess']['lowdin'] = True
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
checking_this = False
element_list.pop()
# Simple run copying basis.
name = idbase+"copy"
job_record = copy.deepcopy(default_job)
job_record['control']['id']=name
job_record['dft']['basis'] = \
cry.read_cryinp(open("si_ag_simple/autogen.d12",'r'))['basis']
job_record['qmc']['postprocess']['obkdm'] = True
job_record['qmc']['postprocess']['density'] = True
job_record['qmc']['postprocess']['basis'] = "../atomic.basis"
job_record['qmc']['postprocess']['orb'] = "../atomic.orb"
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
checking_this = True
# Supercell run.
name = idbase+"super"
job_record = copy.deepcopy(default_job)
job_record['control']['id']=name
job_record['supercell'] = [[2,0,0],[0,2,0],[0,0,2]]
job_record['assert_nochanges'] = False
job_record['dft']['kmesh'] = [4,4,4]
job_record['dft']['tolinteg'] = [8,8,8,8,12]
job_record['dft']['basis']=[0.4,1,1]
job_record['dft']['edifftol'] = 8
job_record['dft']['broyden'] = [0.001,60,20]
job_record['qmc']['dmc']['save_trace'] = True
job_record['qmc']['dmc']['nblock']=5
job_record['qmc']['dmc']['target_error']=0.1
job_record['qmc']['dmc']['timestep']=[0.02]
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
checking_this = False
# Restart and change something.
name = idbase+"edit"
job_record = copy.deepcopy(default_job)
job_record['dft']['basis']=[0.6,1,1]
job_record['dft']['restart_from'] = "../%s/fort.9"%(idbase+"simple")
job_record['control']['id']=name
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
# Too-many cycles case.
name = idbase+"toomany"
job_record = copy.deepcopy(default_job)
job_record['control']['id'] = name
job_record['dft']['maxcycle'] = 10
job_record['dft']['edifftol'] = 10
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
name = idbase+"toomany_resumed"
job_record = copy.deepcopy(default_job)
job_record['control']['id'] = name
job_record['dft']['maxcycle'] = 10
job_record['dft']['edifftol'] = 10
job_record['dft']['resume_mode'] = 'stubborn'
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
# Reduce allowed run time.
element_list[1] = runcrystal.RunCrystal(
submitter=veritas.LocalVeritasCrystalSubmitter(
nn=1,np=8,time="0:00:20",queue="batch"
))
# Demonstrate dft killed-job error correction.
name = idbase+"killed"
job_record = copy.deepcopy(default_job)
job_record['control']['id'] = name
job_record['dft']['edifftol'] = 14
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
name = idbase+"killed_revived"
job_record = copy.deepcopy(default_job)
job_record['control']['id'] = name
job_record['dft']['resume_mode'] = 'optimistic'
job_record['dft']['edifftol'] = 14
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
# Reduce allowed run time.
element_list[1] = runcrystal.RunCrystal(
submitter=veritas.LocalVeritasCrystalSubmitter(
nn=1,np=8,time="0:20:00",queue="batch"
))
# Variance optimize takes two tries.
name = idbase+"varx2"
job_record = copy.deepcopy(default_job)
job_record['control']['id']=name
job_record['dft']['restart_from'] = "../si_ag_simple/fort.79"
job_record['qmc']['variance_optimize']['reltol']=0.001
if checking_this:
results.append(jc.execute(job_record,element_list))
count+=1
print("Analyzing...")
data = []
for result in results:
data.append(pr.process_record(result))
print("Dumping to test_results.json...")
json.dump(data,open("test_results.json",'w'))
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")