Skip to content

Commit 29a1bf8

Browse files
fix(abacus): do not write to deepmd raw/npy, if no abacus data in post_fp_abacus_scf() (#1153)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 4471d17 commit 29a1bf8

File tree

8 files changed

+334
-16
lines changed

8 files changed

+334
-16
lines changed

dpgen/generator/run.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,27 +4061,21 @@ def post_fp_abacus_scf(iter_index, jdata):
40614061
sys_output.sort()
40624062
sys_input.sort()
40634063

4064-
flag = True
4064+
all_sys = None
40654065
for ii, oo in zip(sys_input, sys_output):
4066-
if flag:
4067-
_sys = dpdata.LabeledSystem(
4068-
oo, fmt="abacus/scf", type_map=jdata["type_map"]
4069-
)
4070-
if len(_sys) > 0:
4066+
_sys = dpdata.LabeledSystem(
4067+
oo, fmt="abacus/scf", type_map=jdata["type_map"]
4068+
)
4069+
if len(_sys) > 0:
4070+
if all_sys == None:
40714071
all_sys = _sys
4072-
flag = False
40734072
else:
4074-
pass
4075-
else:
4076-
_sys = dpdata.LabeledSystem(
4077-
oo, fmt="abacus/scf", type_map=jdata["type_map"]
4078-
)
4079-
if len(_sys) > 0:
40804073
all_sys.append(_sys)
40814074

4082-
sys_data_path = os.path.join(work_path, "data.%s" % ss)
4083-
all_sys.to_deepmd_raw(sys_data_path)
4084-
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))
4075+
if all_sys != None:
4076+
sys_data_path = os.path.join(work_path, "data.%s" % ss)
4077+
all_sys.to_deepmd_raw(sys_data_path)
4078+
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))
40854079

40864080

40874081
def post_fp_siesta(iter_index, jdata):
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
INPUT_PARAMETERS
2+
ntype 2
3+
pseudo_dir ./
4+
ecutwfc 80.000000
5+
mixing_type pulay
6+
mixing_beta 0.400000
7+
symmetry 1
8+
nbands 5.000000
9+
nspin 1
10+
ks_solver cg
11+
smearing fixed
12+
sigma 0.001000
13+
force 1
14+
stress 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
K_POINTS
2+
0
3+
Gamma
4+
1 1 1 0 0 0
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
2+
ABACUS v3.1
3+
4+
Atomic-orbital Based Ab-initio Computation at UStc
5+
6+
Website: http://abacus.ustc.edu.cn/
7+
Documentation: https://abacus.deepmodeling.com/
8+
Repository: https://github.com/abacusmodeling/abacus-develop
9+
https://github.com/deepmodeling/abacus-develop
10+
11+
Start Time is Wed Mar 15 18:24:30 2023
12+
13+
------------------------------------------------------------------------------------
14+
15+
READING GENERAL INFORMATION
16+
global_out_dir = OUT.ABACUS/
17+
global_in_card = INPUT
18+
pseudo_dir =
19+
orbital_dir =
20+
DRANK = 1
21+
DSIZE = 8
22+
DCOLOR = 1
23+
GRANK = 1
24+
GSIZE = 1
25+
The esolver type has been set to : ksdft_lcao
26+
27+
28+
29+
30+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
31+
| |
32+
| Reading atom information in unitcell: |
33+
| From the input file and the structure file we know the number of |
34+
| different elments in this unitcell, then we list the detail |
35+
| information for each element, especially the zeta and polar atomic |
36+
| orbital number for each element. The total atom number is counted. |
37+
| We calculate the nearest atom distance for each atom and show the |
38+
| Cartesian and Direct coordinates for each atom. We list the file |
39+
| address for atomic orbitals. The volume and the lattice vectors |
40+
| in real and reciprocal space is also shown. |
41+
| |
42+
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
43+
44+
45+
46+
47+
READING UNITCELL INFORMATION
48+
ntype = 2
49+
atom label for species 1 = H
50+
atom label for species 2 = O
51+
lattice constant (Bohr) = 1.88973
52+
lattice constant (Angstrom) = 1
53+
54+
READING ATOM TYPE 1
55+
atom label = H
56+
L=0, number of zeta = 2
57+
L=1, number of zeta = 1
58+
number of atom for this type = 2
59+
start magnetization = FALSE
60+
start magnetization = FALSE
61+
62+
READING ATOM TYPE 2
63+
atom label = O
64+
L=0, number of zeta = 2
65+
L=1, number of zeta = 2
66+
L=2, number of zeta = 1
67+
number of atom for this type = 1
68+
start magnetization = FALSE
69+
70+
TOTAL ATOM NUMBER = 3
71+
72+
CARTESIAN COORDINATES ( UNIT = 1.88973 Bohr ).
73+
atom x y z mag vx vy vz
74+
tauc_H1 10.1236 0.358121000009 2.96728000001 0 0 0 0
75+
tauc_H2 10.097 0.457652000002 1.52015 0 0 0 0
76+
tauc_O1 10.263 0.407492999997 3.07706999999 0 0 0 0
77+
78+
79+
READING ORBITAL FILE NAMES FOR LCAO
80+
orbital file: H_gga_6au_60Ry_2s1p.orb
81+
orbital file: O_gga_6au_60Ry_2s2p1d.orb
82+
83+
Volume (Bohr^3) = 22712.4312372
84+
Volume (A^3) = 3365.6310456
85+
86+
Lattice vectors: (Cartesian coordinate: in unit of a_0)
87+
+14.9758141613 +0 +0
88+
-0.1998739632 +14.9158454229 +0
89+
+0.0479160432 +0.2573204003 +15.0670665885
90+
Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0)
91+
+0.066774332883 +0.000894783378008 -0.00022763607076
92+
-0 +0.0670427972165 -0.00114497930408
93+
+0 -0 +0.066369919727
94+
95+
96+
97+
98+
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
99+
| |
100+
| Reading pseudopotentials files: |
101+
| The pseudopotential file is in UPF format. The 'NC' indicates that |
102+
| the type of pseudopotential is 'norm conserving'. Functional of |
103+
| exchange and correlation is decided by 4 given parameters in UPF |
104+
| file. We also read in the 'core correction' if there exists. |
105+
| Also we can read the valence electrons number and the maximal |
106+
| angular momentum used in this pseudopotential. We also read in the |
107+
| trail wave function, trail atomic density and local-pseudopotential|
108+
| on logrithmic grid. The non-local pseudopotential projector is also|
109+
| read in if there is any. |
110+
| |
111+
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
112+
113+
114+
115+
116+
PAO radial cut off (Bohr) = 15
117+
118+
Read in pseudopotential file is H_ONCV_PBE-1.0.upf
119+
pseudopotential type = NC
120+
exchange-correlation functional = PBE
121+
nonlocal core correction = 0
122+
valence electrons = 1
123+
lmax = 0
124+
number of zeta = 0
125+
number of projectors = 2
126+
L of projector = 0
127+
L of projector = 0
128+
129+
In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
130+
Please make sure this is what you need
131+
XC functional updated to : lda
132+
exchange-correlation functional = LDA
133+
PAO radial cut off (Bohr) = 15
134+
135+
Read in pseudopotential file is O_ONCV_PBE-1.0.upf
136+
pseudopotential type = NC
137+
exchange-correlation functional = PBE
138+
nonlocal core correction = 0
139+
valence electrons = 6
140+
lmax = 1
141+
number of zeta = 0
142+
number of projectors = 4
143+
L of projector = 0
144+
L of projector = 0
145+
L of projector = 1
146+
L of projector = 1
147+
148+
In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
149+
Please make sure this is what you need
150+
XC functional updated to : lda
151+
exchange-correlation functional = LDA
152+
153+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
155+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
156+
!!! WARNING: Some atoms are too close!!!
157+
!!! Please check the nearest-neighbor list in log file.
158+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
160+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161+
162+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
163+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
164+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165+
!!! WARNING: Some atoms are too close!!!
166+
!!! Please check the nearest-neighbor list in log file.
167+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
168+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
169+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
170+
171+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
172+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
173+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
174+
!!! WARNING: Some atoms are too close!!!
175+
!!! Please check the nearest-neighbor list in log file.
176+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
178+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
179+
1-th H, 1-th O (cell: 0 0 0), distance= 0.348 Bohr (0.184 Angstrom)
180+
If this structure is what you want, you can set 'min_dist_coef'
181+
as a smaller value (the current value is 0.2) in INPUT file.
182+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
183+
NOTICE
184+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
185+
186+
The structure is unreasonable!
187+
CHECK IN FILE : OUT.ABACUS/warning.log
188+
189+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
190+
NOTICE
191+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
192+
Check in file : OUT.ABACUS/warning.log
193+
194+
195+
196+
197+
|CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%-------
198+
----------------------------------------------------------------------------------------
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
H4 C1
2+
1.0
3+
1.0256560185400000e+01 0.0000000000000000e+00 0.0000000000000000e+00
4+
-2.4531774970000000e-01 9.8128484190999998e+00 0.0000000000000000e+00
5+
-2.5710315189999999e-01 -3.0129123369999999e-01 9.8293471193999995e+00
6+
H C
7+
4 1
8+
Cartesian
9+
5.3475200000 4.1329900000 3.4240900000
10+
4.0099600000 5.0100700000 4.1737100000
11+
5.5891800000 5.0824200000 4.8661200000
12+
4.7052500000 3.5190100000 4.8860700000
13+
4.9222700000 4.4726500000 4.3767300000
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ATOMIC_SPECIES
2+
H 1.00 H_ONCV_PBE-1.0.upf
3+
C 1.00 C_ONCV_PBE-1.0.upf
4+
5+
LATTICE_CONSTANT
6+
1.8897261254578281
7+
8+
LATTICE_VECTORS
9+
10.2565601854 0.0 0.0
10+
-0.2453177497 9.8128484191 0.0
11+
-0.2571031519 -0.3012912337 9.8293471194
12+
13+
ATOMIC_POSITIONS
14+
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
15+
H
16+
0.0
17+
4
18+
5.347520000000 4.132990000000 3.424090000000 0 0 0
19+
4.009960000000 5.010070000000 4.173710000000 0 0 0
20+
5.589180000000 5.082420000000 4.866120000000 0 0 0
21+
4.705250000000 3.519010000000 4.886070000000 0 0 0
22+
C
23+
0.0
24+
1
25+
4.922270000000 4.472650000000 4.376730000000 0 0 0
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
WARNING: Total thread number on this node mismatches with hardware availability. This may cause poor performance.
2+
Info: Local MPI proc number: 8,OpenMP thread number: 1,Total thread number: 8,Local thread limit: 16
3+
4+
ABACUS v3.1
5+
6+
Atomic-orbital Based Ab-initio Computation at UStc
7+
8+
Website: http://abacus.ustc.edu.cn/
9+
Documentation: https://abacus.deepmodeling.com/
10+
Repository: https://github.com/abacusmodeling/abacus-develop
11+
https://github.com/deepmodeling/abacus-develop
12+
13+
Wed Mar 15 18:24:30 2023
14+
MAKE THE DIR : OUT.ABACUS/
15+
dft_functional readin is: lda
16+
dft_functional in pseudopot file is: PBE
17+
In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
18+
Please make sure this is what you need
19+
dft_functional readin is: lda
20+
dft_functional in pseudopot file is: PBE
21+
In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
22+
Please make sure this is what you need
23+
24+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
26+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27+
!!! WARNING: Some atoms are too close!!!
28+
!!! Please check the nearest-neighbor list in log file.
29+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
31+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32+
33+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
35+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36+
!!! WARNING: Some atoms are too close!!!
37+
!!! Please check the nearest-neighbor list in log file.
38+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
40+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
41+
42+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
44+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45+
!!! WARNING: Some atoms are too close!!!
46+
!!! Please check the nearest-neighbor list in log file.
47+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48+
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
49+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
50+
51+
If this structure is what you want, you can set 'min_dist_coef'
52+
as a smaller value (the current value is 0.2) in INPUT file.
53+
54+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
55+
NOTICE
56+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
57+
58+
The structure is unreasonable!
59+
CHECK IN FILE : OUT.ABACUS/warning.log
60+
61+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
62+
NOTICE
63+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
64+
65+
|CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%-------
66+
----------------------------------------------------------------------------------------
67+
See output information in : OUT.ABACUS/

tests/generator/test_post_fp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ def setUp(self):
223223
"iter.000000/02.fp/data.000", fmt="deepmd/raw"
224224
)
225225

226+
def test_nframs_with_failed_job(self):
227+
self.assertEqual(self.system_2.get_nframes(), 2)
228+
226229

227230
class TestPostFPSIESTA(unittest.TestCase, CompLabeledSys):
228231
def setUp(self):

0 commit comments

Comments
 (0)