Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(abacus): do not write to deepmd raw/npy, if no abacus data in post_fp_abacus_scf() #1153

Merged
merged 5 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4061,27 +4061,21 @@ def post_fp_abacus_scf(iter_index, jdata):
sys_output.sort()
sys_input.sort()

flag = True
all_sys = None
for ii, oo in zip(sys_input, sys_output):
if flag:
_sys = dpdata.LabeledSystem(
oo, fmt="abacus/scf", type_map=jdata["type_map"]
)
if len(_sys) > 0:
_sys = dpdata.LabeledSystem(
oo, fmt="abacus/scf", type_map=jdata["type_map"]
)
if len(_sys) > 0:
if all_sys == None:
all_sys = _sys
flag = False
else:
pass
else:
_sys = dpdata.LabeledSystem(
oo, fmt="abacus/scf", type_map=jdata["type_map"]
)
if len(_sys) > 0:
all_sys.append(_sys)

sys_data_path = os.path.join(work_path, "data.%s" % ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))
if all_sys != None:
sys_data_path = os.path.join(work_path, "data.%s" % ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))


def post_fp_siesta(iter_index, jdata):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
INPUT_PARAMETERS
ntype 2
pseudo_dir ./
ecutwfc 80.000000
mixing_type pulay
mixing_beta 0.400000
symmetry 1
nbands 5.000000
nspin 1
ks_solver cg
smearing fixed
sigma 0.001000
force 1
stress 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Gamma
1 1 1 0 0 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@

ABACUS v3.1

Atomic-orbital Based Ab-initio Computation at UStc

Website: http://abacus.ustc.edu.cn/
Documentation: https://abacus.deepmodeling.com/
Repository: https://github.com/abacusmodeling/abacus-develop
https://github.com/deepmodeling/abacus-develop

Start Time is Wed Mar 15 18:24:30 2023

------------------------------------------------------------------------------------

READING GENERAL INFORMATION
global_out_dir = OUT.ABACUS/
global_in_card = INPUT
pseudo_dir =
orbital_dir =
DRANK = 1
DSIZE = 8
DCOLOR = 1
GRANK = 1
GSIZE = 1
The esolver type has been set to : ksdft_lcao




>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
| |
| Reading atom information in unitcell: |
| From the input file and the structure file we know the number of |
| different elments in this unitcell, then we list the detail |
| information for each element, especially the zeta and polar atomic |
| orbital number for each element. The total atom number is counted. |
| We calculate the nearest atom distance for each atom and show the |
| Cartesian and Direct coordinates for each atom. We list the file |
| address for atomic orbitals. The volume and the lattice vectors |
| in real and reciprocal space is also shown. |
| |
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




READING UNITCELL INFORMATION
ntype = 2
atom label for species 1 = H
atom label for species 2 = O
lattice constant (Bohr) = 1.88973
lattice constant (Angstrom) = 1

READING ATOM TYPE 1
atom label = H
L=0, number of zeta = 2
L=1, number of zeta = 1
number of atom for this type = 2
start magnetization = FALSE
start magnetization = FALSE

READING ATOM TYPE 2
atom label = O
L=0, number of zeta = 2
L=1, number of zeta = 2
L=2, number of zeta = 1
number of atom for this type = 1
start magnetization = FALSE

TOTAL ATOM NUMBER = 3

CARTESIAN COORDINATES ( UNIT = 1.88973 Bohr ).
atom x y z mag vx vy vz
tauc_H1 10.1236 0.358121000009 2.96728000001 0 0 0 0
tauc_H2 10.097 0.457652000002 1.52015 0 0 0 0
tauc_O1 10.263 0.407492999997 3.07706999999 0 0 0 0


READING ORBITAL FILE NAMES FOR LCAO
orbital file: H_gga_6au_60Ry_2s1p.orb
orbital file: O_gga_6au_60Ry_2s2p1d.orb

Volume (Bohr^3) = 22712.4312372
Volume (A^3) = 3365.6310456

Lattice vectors: (Cartesian coordinate: in unit of a_0)
+14.9758141613 +0 +0
-0.1998739632 +14.9158454229 +0
+0.0479160432 +0.2573204003 +15.0670665885
Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0)
+0.066774332883 +0.000894783378008 -0.00022763607076
-0 +0.0670427972165 -0.00114497930408
+0 -0 +0.066369919727




>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
| |
| Reading pseudopotentials files: |
| The pseudopotential file is in UPF format. The 'NC' indicates that |
| the type of pseudopotential is 'norm conserving'. Functional of |
| exchange and correlation is decided by 4 given parameters in UPF |
| file. We also read in the 'core correction' if there exists. |
| Also we can read the valence electrons number and the maximal |
| angular momentum used in this pseudopotential. We also read in the |
| trail wave function, trail atomic density and local-pseudopotential|
| on logrithmic grid. The non-local pseudopotential projector is also|
| read in if there is any. |
| |
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




PAO radial cut off (Bohr) = 15

Read in pseudopotential file is H_ONCV_PBE-1.0.upf
pseudopotential type = NC
exchange-correlation functional = PBE
nonlocal core correction = 0
valence electrons = 1
lmax = 0
number of zeta = 0
number of projectors = 2
L of projector = 0
L of projector = 0

In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
Please make sure this is what you need
XC functional updated to : lda
exchange-correlation functional = LDA
PAO radial cut off (Bohr) = 15

Read in pseudopotential file is O_ONCV_PBE-1.0.upf
pseudopotential type = NC
exchange-correlation functional = PBE
nonlocal core correction = 0
valence electrons = 6
lmax = 1
number of zeta = 0
number of projectors = 4
L of projector = 0
L of projector = 0
L of projector = 1
L of projector = 1

In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
Please make sure this is what you need
XC functional updated to : lda
exchange-correlation functional = LDA

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!!! WARNING: Some atoms are too close!!!
!!! Please check the nearest-neighbor list in log file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!!! WARNING: Some atoms are too close!!!
!!! Please check the nearest-neighbor list in log file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!!! WARNING: Some atoms are too close!!!
!!! Please check the nearest-neighbor list in log file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1-th H, 1-th O (cell: 0 0 0), distance= 0.348 Bohr (0.184 Angstrom)
If this structure is what you want, you can set 'min_dist_coef'
as a smaller value (the current value is 0.2) in INPUT file.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NOTICE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The structure is unreasonable!
CHECK IN FILE : OUT.ABACUS/warning.log

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NOTICE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Check in file : OUT.ABACUS/warning.log




|CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%-------
----------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
H4 C1
1.0
1.0256560185400000e+01 0.0000000000000000e+00 0.0000000000000000e+00
-2.4531774970000000e-01 9.8128484190999998e+00 0.0000000000000000e+00
-2.5710315189999999e-01 -3.0129123369999999e-01 9.8293471193999995e+00
H C
4 1
Cartesian
5.3475200000 4.1329900000 3.4240900000
4.0099600000 5.0100700000 4.1737100000
5.5891800000 5.0824200000 4.8661200000
4.7052500000 3.5190100000 4.8860700000
4.9222700000 4.4726500000 4.3767300000
25 changes: 25 additions & 0 deletions tests/generator/out_data_post_fp_abacus/02.fp/task.001.000002/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ATOMIC_SPECIES
H 1.00 H_ONCV_PBE-1.0.upf
C 1.00 C_ONCV_PBE-1.0.upf

LATTICE_CONSTANT
1.8897261254578281

LATTICE_VECTORS
10.2565601854 0.0 0.0
-0.2453177497 9.8128484191 0.0
-0.2571031519 -0.3012912337 9.8293471194

ATOMIC_POSITIONS
Cartesian # Cartesian(Unit is LATTICE_CONSTANT)
H
0.0
4
5.347520000000 4.132990000000 3.424090000000 0 0 0
4.009960000000 5.010070000000 4.173710000000 0 0 0
5.589180000000 5.082420000000 4.866120000000 0 0 0
4.705250000000 3.519010000000 4.886070000000 0 0 0
C
0.0
1
4.922270000000 4.472650000000 4.376730000000 0 0 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
WARNING: Total thread number on this node mismatches with hardware availability. This may cause poor performance.
Info: Local MPI proc number: 8,OpenMP thread number: 1,Total thread number: 8,Local thread limit: 16

ABACUS v3.1

Atomic-orbital Based Ab-initio Computation at UStc

Website: http://abacus.ustc.edu.cn/
Documentation: https://abacus.deepmodeling.com/
Repository: https://github.com/abacusmodeling/abacus-develop
https://github.com/deepmodeling/abacus-develop

Wed Mar 15 18:24:30 2023
MAKE THE DIR : OUT.ABACUS/
dft_functional readin is: lda
dft_functional in pseudopot file is: PBE
In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
Please make sure this is what you need
dft_functional readin is: lda
dft_functional in pseudopot file is: PBE
In Pseudopot_upf::read_pseudo_header : dft_functional from INPUT does not match that in pseudopot file
Please make sure this is what you need

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!!! WARNING: Some atoms are too close!!!
!!! Please check the nearest-neighbor list in log file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!!! WARNING: Some atoms are too close!!!
!!! Please check the nearest-neighbor list in log file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
!!! WARNING: Some atoms are too close!!!
!!! Please check the nearest-neighbor list in log file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% WARNING WARNING WARNING WARNING WARNING %%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

If this structure is what you want, you can set 'min_dist_coef'
as a smaller value (the current value is 0.2) in INPUT file.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NOTICE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The structure is unreasonable!
CHECK IN FILE : OUT.ABACUS/warning.log

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NOTICE
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

|CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%-------
----------------------------------------------------------------------------------------
See output information in : OUT.ABACUS/
3 changes: 3 additions & 0 deletions tests/generator/test_post_fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ def setUp(self):
"iter.000000/02.fp/data.000", fmt="deepmd/raw"
)

def test_nframs_with_failed_job(self):
self.assertEqual(self.system_2.get_nframes(), 2)


class TestPostFPSIESTA(unittest.TestCase, CompLabeledSys):
def setUp(self):
Expand Down