deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
173 stars 132 forks source link

Segmentation fault pops when `dft_functional hse` if using arbitrary configuration numerical orbitals #3188

Closed kirk0830 closed 1 month ago

kirk0830 commented 1 year ago

Describe the bug

Due to pslibrary norm-conserving version 0.3.1 only keep one s and one p orbitals treated as valence electrons, unlike SG15 which keeps one s, one p and one d, numerical atomic orbitals configuration may need to change from 2s2p2d1f (SG15) to 2s2p1d for DZP and 3s3p3d2f to 3s3p2d for TZDP. However, after changing the configuration, dft_functional pbe can still run smoothly but for dft_functional hse it fails. stdout is like:


                              ABACUS v3.4.2

               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         
                      Commit: 5eeb972 (Thu Nov 9 17:55:37 2023 +0800)

 Thu Nov  9 19:59:22 2023
 MAKE THE DIR         : OUT.ABACUS/
 RUNNING WITH DEVICE     : CPU / Intel(R) Xeon(R) Platinum 8269CY CPU @ 2.50GHz
 dft_functional readin is: hse
 dft_functional in pseudopot file is: PBE
 Please make sure this is what you need
 dft_functional readin is: hse
 dft_functional in pseudopot file is: PBE
 Please make sure this is what you need
 UNIFORM GRID DIM        : 54 * 54 * 54
 UNIFORM GRID DIM(BIG)   : 18 * 18 * 18
 DONE(0.106163   SEC) : SETUP UNITCELL
 DONE(0.119278   SEC) : INIT K-POINTS
 ---------------------------------------------------------
 Self-consistent calculations for electrons
 ---------------------------------------------------------
 SPIN    KPOINTS         PROCESSORS  NBASE       
 1       260             1           44          
 ---------------------------------------------------------
 Use Systematically Improvable Atomic bases
 ---------------------------------------------------------
 ELEMENT ORBITALS        NBASE       NATOM       XC          
 In      3s3p2d0f-9au    22          1           
 P       3s3p2d-9au      22          1           
 ---------------------------------------------------------
 Initial plane wave basis and FFT box
 ---------------------------------------------------------
 DONE(0.250525   SEC) : INIT PLANEWAVE

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 0 PID 38 RUNNING AT dp-lbg-471-9607495
=   KILLED BY SIGNAL: 11 (Segmentation fault)
===================================================================================

for HSE, running_scf.log printed memory warnings

 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Setup numerical orbitals:                                          |
 | This part setup: numerical atomic orbitals, non-local projectors   |
 | and neutral potential (1D). The atomic orbitals information        |
 | including the radius, angular momentum and zeta number.            |
 | The neutral potential is the sum of local part of pseudopotential  |
 | and potential given by atomic charge, they will cancel out beyond  |
 | a certain radius cutoff, because the Z/r character.                |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 SETUP ONE DIMENSIONAL ORBITALS/POTENTIAL
                        delta k  (1/Bohr) = 0.01
                        delta r    (Bohr) = 0.01
                        dr_uniform (Bohr) = 0.001
                        rmax       (Bohr) = 30
                                    kmesh = 4477
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     901    0.01       9           1           1
            2  0  1     901    0.01       9           1           1
            3  0  2     901    0.01       9           1           1
            4  1  0     901    0.01       9           1           1
            5  1  1     901    0.01       9           1           1
            6  1  2     901    0.01       9           1           1
            7  2  0     901    0.01       9           1           1
            8  2  1     901    0.01       9           1           1
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     901    0.01       9           1           1
            2  0  1     901    0.01       9           1           1
            3  0  2     901    0.01       9           1           1
            4  1  0     901    0.01       9           1           1
            5  1  1     901    0.01       9           1           1
            6  1  2     901    0.01       9           1           1
            7  2  0     901    0.01       9           1           1
            8  2  1     901    0.01       9           1           1
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 max number of nonlocal projetors among all species is 4

 Warning_Memory_Consuming allocated:  TwoCenterTable: Kinetic 5.15 MB

 Warning_Memory_Consuming allocated:  TwoCenterTable: Overlap 5.15 MB

 SETUP THE DIVISION OF H/S MATRIX
 divide the H&S matrix using 2D block algorithms.
                                     nb2d = 1
               global2local_row dimension = 44
               global2local_col dimension = 44

 Warning_Memory_Consuming allocated:  DensityMatrix::DMK 7.68 MB
                                     nloc = 1936

 Warning_Memory_Consuming allocated:  ORB::Jl(x) 5.75e+03 MB

while PBE does not have such warnings:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Setup numerical orbitals:                                          |
 | This part setup: numerical atomic orbitals, non-local projectors   |
 | and neutral potential (1D). The atomic orbitals information        |
 | including the radius, angular momentum and zeta number.            |
 | The neutral potential is the sum of local part of pseudopotential  |
 | and potential given by atomic charge, they will cancel out beyond  |
 | a certain radius cutoff, because the Z/r character.                |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

 SETUP ONE DIMENSIONAL ORBITALS/POTENTIAL
                        delta k  (1/Bohr) = 0.01
                        delta r    (Bohr) = 0.01
                        dr_uniform (Bohr) = 0.001
                        rmax       (Bohr) = 30
                                    kmesh = 4477
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     901    0.01       9           1           1
            2  0  1     901    0.01       9           1           1
            3  0  2     901    0.01       9           1           1
            4  1  0     901    0.01       9           1           1
            5  1  1     901    0.01       9           1           1
            6  1  2     901    0.01       9           1           1
            7  2  0     901    0.01       9           1           1
            8  2  1     901    0.01       9           1           1
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     901    0.01       9           1           1
            2  0  1     901    0.01       9           1           1
            3  0  2     901    0.01       9           1           1
            4  1  0     901    0.01       9           1           1
            5  1  1     901    0.01       9           1           1
            6  1  2     901    0.01       9           1           1
            7  2  0     901    0.01       9           1           1
            8  2  1     901    0.01       9           1           1
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 max number of nonlocal projetors among all species is 4

 Warning_Memory_Consuming allocated:  TwoCenterTable: Kinetic 5.15 MB

 Warning_Memory_Consuming allocated:  TwoCenterTable: Overlap 5.15 MB

 SETUP THE DIVISION OF H/S MATRIX
 divide the H&S matrix using 2D block algorithms.
                                     nb2d = 1
               global2local_row dimension = 44
               global2local_col dimension = 44
                                     nloc = 1936

for more detailed results, see abacustest: PBE (success): https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-319827 HSE (fail): https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-23383e HSE (try again but still fail): https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-3d06c5

Expected behavior

I dont think it is an expected behavior, because I also have generated orbitals with electronic configuration 2s2p2d1f and 3s3p3d2f, instead of 2s2p1d or 3s3p2d. For HSE these jobs run smoothly: https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-89f65e

To Reproduce

PBE (success): https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-319827 HSE (fail): https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-23383e HSE (try again but still fail): https://labs.dp.tech/projects/abacustest/?request=GET%3A%2Fapplications%2Fabacustest%2Fjobs%2Fjob-abacustest-v0.3.53-3d06c5

Environment

{
  "IO_output_path": "__INTERNAL_PLACEHOLDER__{{output_directory}}",
  "PrepareExampleSource_local": "./inputs/PrepareExampleSource_local/t_hse_pslnc031sg1510_DDTT.zip",
  "PrepareExample": "*",
  "predft_command": "",
  "rundft_group_size": 1,
  "rundft_command": "OMP_NUM_THREADS=16 mpirun -np 1 abacus | tee out.log",
  "postdft_command": "",
  "metrics": [
    "version",
    "INPUT:ks_solver",
    "normal_end",
    "converge",
    "energy",
    "total_time",
    "scf_steps",
    "band_gap"
  ],
  "Tracking_metrics": false,
  "prepare_mix_input": {
    "out_bandgap": "1"
  },
  "prepare_mix_kpt": "",
  "predft_image_set": {
    "type": "Local Image",
    "image": "registry.dp.tech/dptech/abacustest:latest"
  },
  "rundft_image_set": {
    "type": "Use Bohrium Image",
    "image": "registry.dp.tech/deepmodeling/abacus-intel:latest",
    "bohrium_machine_type": "c32_m128_cpu",
    "bohrium_job_type": "container",
    "bohrium_plat_form": "ali"
  },
  "postdft_image_set": {
    "type": "Local Image",
    "image": "registry.dp.tech/dptech/abacustest:latest"
  },
  "super_metrics": null,
  "metrics_savefile": "",
  "super_metrics_savefile": "",
  "Tracking_token": "",
  "rundft_image_set-Image Bohrium": {
    "type": "Use Bohrium Image",
    "image": "registry.dp.tech/deepmodeling/abacus-intel:latest",
    "bohrium_machine_type": "c32_m128_cpu",
    "bohrium_job_type": "container",
    "bohrium_plat_form": "xxx"
  }
}

Additional Context

NaN

Task list for Issue attackers (only for developers)

kirk0830 commented 1 year ago

@PeizeLin I think it makes scence (at least partially) to always keep consistency between numerical orbitals and pseudopotentials especially in aspect of how many electrons are treated as valence electrons. So it seems for big-core pseudopotentials my way to generate orbitals is reasonable. Do you have any idea about why this segfault happens?

PeizeLin commented 11 months ago

@PeizeLin I think it makes scence (at least partially) to always keep consistency between numerical orbitals and pseudopotentials especially in aspect of how many electrons are treated as valence electrons. So it seems for big-core pseudopotentials my way to generate orbitals is reasonable. Do you have any idea about why this segfault happens?

Could you upload the input files please? I can't login Bohrium due to the restricted permissions.

kirk0830 commented 10 months ago

@PeizeLin I think it makes scence (at least partially) to always keep consistency between numerical orbitals and pseudopotentials especially in aspect of how many electrons are treated as valence electrons. So it seems for big-core pseudopotentials my way to generate orbitals is reasonable. Do you have any idea about why this segfault happens?

Could you upload the input files please? I can't login Bohrium due to the restricted permissions.

Hi Peize, sorry for this late reply, following I attach my test suites: t_pbe_pslnc031sg1510_DDTT.zip t_hse_pslnc031sg1510_DDTT.zip You can try any one of them. Regards!