Skip to content

Commit 4e3d9a9

Browse files
committed
Merge branch 'develop' into io_libxc
Conflicts: source/module_esolver/esolver_fp.cpp source/module_hamilt_general/module_xc/xc_functional_gradcorr.cpp source/module_hamilt_general/module_xc/xc_functional_libxc.h source/module_hamilt_general/module_xc/xc_functional_libxc_tools.cpp source/module_hamilt_general/module_xc/xc_functional_libxc_vxc.cpp source/module_hamilt_general/module_xc/xc_functional_libxc_wrapper_gcxc.cpp source/module_hamilt_general/module_xc/xc_functional_libxc_wrapper_tauxc.cpp source/module_hamilt_general/module_xc/xc_functional_vxc.cpp source/module_io/cube_io.h source/module_io/write_cube.cpp
2 parents 528041b + e9250db commit 4e3d9a9

File tree

563 files changed

+11647
-6380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

563 files changed

+11647
-6380
lines changed

.github/workflows/coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Install Requirements for Coverage Testing
1717
run: |
18-
apt update && apt install -y lcov
18+
apt update && apt install -y lcov gpg
1919
- name: Building
2020
run: |
21-
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DBUILD_TESTING=ON -DENABLE_COVERAGE=ON
21+
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
2222
cmake --build build -j`nproc`
2323
cmake --install build
2424
- name: Testing

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
--from-ref ${{ github.event.pull_request.base.sha }}
4040
--to-ref ${{ github.event.pull_request.head.sha }}
4141
continue-on-error: true
42-
- uses: pre-commit-ci/lite-action@v1.0.2
42+
- uses: pre-commit-ci/lite-action@v1.1.0
4343

4444
- name: Build
4545
run: |

docs/advanced/acceleration/cuda.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ To compile and use ABACUS in CUDA mode, you currently need to have an NVIDIA GPU
2929

3030
Check the [Advanced Installation Options](https://abacus-rtd.readthedocs.io/en/latest/advanced/install.html#build-with-cuda-support) for the installation of CUDA version support.
3131

32-
When the compilation parameter USE_ELPA is ON (which is the default value) and USE_CUDA is also set to ON, the ELPA library needs to [enable GPU support](https://github.com/marekandreas/elpa/blob/master/documentation/INSTALL.md) at compile time.
32+
Setting both USE_ELPA and USE_CUDA to ON does not automatically enable ELPA to run on GPUs. ELPA support for GPUs needs to be enabled when ELPA is compiled. [enable GPU support](https://github.com/marekandreas/elpa/blob/master/documentation/INSTALL.md).
33+
34+
The ABACUS program will automatically determine whether the current ELPA supports GPU based on the elpa/elpa_configured_options.h header file. Users can also check this header file to determine the GPU support of ELPA in their environment. ELPA introduced a new API elpa_setup_gpu in version 2023.11.001. So if you want to enable ELPA GPU in ABACUS, the ELPA version must be greater than or equal to 2023.11.001.
3335

3436
## Run with the GPU support by editing the INPUT script:
3537

3638
In `INPUT` file we need to set the input parameter [device](../input_files/input-main.md#device) to `gpu`. If this parameter is not set, ABACUS will try to determine if there are available GPUs.
37-
- Set `ks_solver`: For the PW basis, CG, BPCG and Davidson methods are supported on GPU; set the input parameter [ks_solver](../input_files/input-main.md#ks_solver) to `cg`, `bpcg` or `dav`. For the LCAO basis, `cusolver` and `elpa` is supported on GPU.
39+
- Set `ks_solver`: For the PW basis, CG, BPCG and Davidson methods are supported on GPU; set the input parameter [ks_solver](../input_files/input-main.md#ks_solver) to `cg`, `bpcg` or `dav`. For the LCAO basis, `cusolver`, `cusolvermp` and `elpa` is supported on GPU.
3840
- **multi-card**: ABACUS allows for multi-GPU acceleration. If you have multiple GPU cards, you can run ABACUS with several MPI processes, and each process will utilize one GPU card. For example, the command `mpirun -n 2 abacus` will by default launch two GPUs for computation. If you only have one card, this command will only start one GPU.
3941

4042
## Examples

docs/advanced/input_files/input-main.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
- [nbands\_istate](#nbands_istate)
162162
- [bands\_to\_print](#bands_to_print)
163163
- [if\_separate\_k](#if_separate_k)
164+
- [out\_elf](#out_elf)
164165
- [Density of states](#density-of-states)
165166
- [dos\_edelta\_ev](#dos_edelta_ev)
166167
- [dos\_sigma](#dos_sigma)
@@ -245,6 +246,7 @@
245246
- [exx\_real\_number](#exx_real_number)
246247
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
247248
- [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times)
249+
- [out\_ri\_cv](#out_ri_cv)
248250
- [Molecular dynamics](#molecular-dynamics)
249251
- [md\_type](#md_type)
250252
- [md\_nstep](#md_nstep)
@@ -424,6 +426,8 @@
424426
- [abs\_wavelen\_range](#abs_wavelen_range)
425427
- [out\_wfc\_lr](#out_wfc_lr)
426428
- [abs\_broadening](#abs_broadening)
429+
- [ri\_hartree\_benchmark](#ri_hartree_benchmark)
430+
- [aims_nbasis](#aims_nbasis)
427431

428432
[back to top](#full-list-of-input-keywords)
429433
## System variables
@@ -663,6 +667,7 @@ These variables are used to control parameters related to input files.
663667
- **Type**: String
664668
- **Description**: the name of the structure file
665669
- Containing various information about atom species, including pseudopotential files, local orbitals files, cell information, atom positions, and whether atoms should be allowed to move.
670+
- When [calculation](#calculation) is set to `md` and [md_restart](#md_restart) is set to `true`, this keyword will NOT work.
666671
- Refer to [Doc](https://github.com/deepmodeling/abacus-develop/blob/develop/docs/advanced/input_files/stru.md)
667672
- **Default**: STRU
668673

@@ -928,6 +933,8 @@ calculations.
928933
- **genelpa**: This method should be used if you choose localized orbitals.
929934
- **scalapack_gvx**: Scalapack can also be used for localized orbitals.
930935
- **cusolver**: This method needs building with CUDA and at least one gpu is available.
936+
- **cusolvermp**: This method supports multi-GPU acceleration and needs building with CUDA。 Note that when using cusolvermp, you should set the number of MPI processes to be equal to the number of GPUs.
937+
- **elpa**: The ELPA solver supports both CPU and GPU. By setting the `device` to GPU, you can launch the ELPA solver with GPU acceleration (provided that you have installed a GPU-supported version of ELPA, which requires you to manually compile and install ELPA, and the ABACUS should be compiled with -DUSE_ELPA=ON and -DUSE_CUDA=ON). The ELPA solver also supports multi-GPU acceleration.
931938

932939
If you set ks_solver=`genelpa` for basis_type=`pw`, the program will be stopped with an error message:
933940

@@ -936,7 +943,13 @@ calculations.
936943
```
937944

938945
Then the user has to correct the input file and restart the calculation.
939-
- **Default**: cg (plane-wave basis), or genelpa (localized atomic orbital basis, if compiling option `USE_ELPA` has been set),lapack (localized atomic orbital basis, if compiling option `ENABLE_MPI` has not been set), scalapack_gvx, (localized atomic orbital basis, if compiling option `USE_ELPA` has not been set and if compiling option `ENABLE_MPI` has been set)
946+
- **Default**:
947+
- **PW basis**: cg.
948+
- **LCAO basis**:
949+
- genelpa (if compiling option `USE_ELPA` has been set)
950+
- lapack (if compiling option `ENABLE_MPI` has not been set)
951+
- scalapack_gvx (if compiling option `USE_ELPA` has not been set and compiling option `ENABLE_MPI` has been set)
952+
- cusolver (if compiling option `USE_CUDA` has been set)
940953

941954
### nbands
942955

@@ -1517,7 +1530,7 @@ These variables are used to control the output of properties.
15171530
- **Type**: Integer \[Integer\](optional)
15181531
- **Description**:
15191532
The first integer controls whether to output the charge density on real space grids:
1520-
- 1. Output the charge density (in Bohr^-3) on real space grids into the density files in the folder `OUT.${suffix}`. The files are named as:
1533+
- 1: Output the charge density (in Bohr^-3) on real space grids into the density files in the folder `OUT.${suffix}`. The files are named as:
15211534
- nspin = 1: SPIN1_CHG.cube;
15221535
- nspin = 2: SPIN1_CHG.cube, and SPIN2_CHG.cube;
15231536
- nspin = 4: SPIN1_CHG.cube, SPIN2_CHG.cube, SPIN3_CHG.cube, and SPIN4_CHG.cube.
@@ -1797,6 +1810,23 @@ The band (KS orbital) energy for each (k-point, spin, band) will be printed in t
17971810
- **Description**: Specifies whether to write the partial charge densities for all k-points to individual files or merge them. **Warning**: Enabling symmetry may produce incorrect results due to incorrect k-point weights. Therefore, when calculating partial charge densities, it is strongly recommended to set `symmetry = -1`.
17981811
- **Default**: false
17991812

1813+
### out_elf
1814+
1815+
- **Type**: Integer \[Integer\](optional)
1816+
- **Availability**: Only for Kohn-Sham DFT and Orbital Free DFT.
1817+
- **Description**: Whether to output the electron localization function (ELF) in the folder `OUT.${suffix}`. The files are named as
1818+
- nspin = 1:
1819+
- ELF.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i}|^2} - \frac{|\nabla\rho|^2}{8\rho}}{\frac{3}{10}(3\pi^2)^{2/3}\rho^{5/3}}$;
1820+
- nspin = 2:
1821+
- ELF_SPIN1.cube, ELF_SPIN2.cube: ${\rm{ELF}}_\sigma = \frac{1}{1+\chi_\sigma^2}$, $\chi_\sigma = \frac{\frac{1}{2}\sum_{i}{f_i |\nabla\psi_{i,\sigma}|^2} - \frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}$;
1822+
- ELF.cube: ${\rm{ELF}} = \frac{1}{1+\chi^2}$, $\chi = \frac{\frac{1}{2}\sum_{i,\sigma}{f_i |\nabla\psi_{i,\sigma}|^2} - \sum_{\sigma}{\frac{|\nabla\rho_\sigma|^2}{8\rho_\sigma}}}{\sum_{\sigma}{\frac{3}{10}(6\pi^2)^{2/3}\rho_\sigma^{5/3}}}$;
1823+
1824+
The second integer controls the precision of the kinetic energy density output, if not given, will use `3` as default. For purpose restarting from this file and other high-precision involved calculation, recommend to use `10`.
1825+
1826+
---
1827+
In molecular dynamics calculations, the output frequency is controlled by [out_interval](#out_interval).
1828+
- **Default**: 0 3
1829+
18001830
[back to top](#full-list-of-input-keywords)
18011831

18021832
## Density of states
@@ -2436,6 +2466,12 @@ These variables are relevant when using hybrid functionals.
24362466
- True: rotate both D(k) and Hexx(R) to accelerate both diagonalization and EXX calculation
24372467
- **Default**: True
24382468

2469+
### out_ri_cv
2470+
2471+
- **Type**: Boolean
2472+
- **Description**: Whether to output the coefficient tensor C(R) and ABFs-representation Coulomb matrix V(R) for each atom pair and cell in real space.
2473+
- **Default**: false
2474+
24392475
[back to top](#full-list-of-input-keywords)
24402476

24412477
## Molecular dynamics
@@ -3946,4 +3982,21 @@ The output files are `OUT.${suffix}/Excitation_Energy.dat` and `OUT.${suffix}/Ex
39463982
- **Description**: The broadening factor $\eta$ for the absorption spectrum calculation.
39473983
- **Default**: 0.01
39483984

3985+
### ri_hartree_benchmark
3986+
- **Type**: String
3987+
- **Description**: Whether to use the localized resolution-of-identity (LRI) approximation for the **Hartree** term of kernel in the $A$ matrix of LR-TDDFT for benchmark (with FHI-aims or another ABACUS calculation). Now it only supports molecular systems running with a single processor, and a large enough supercell should be used to make LRI C, V tensors contain only the R=(0 0 0) cell.
3988+
- `aims`: The `OUT.${suffix}`directory should contain the FHI-aims output files: RI-LVL tensors`Cs_data_0.txt` and `coulomb_mat_0.txt`, and KS eigenstates from FHI-aims: `band_out`and `KS_eigenvectors.out`. The Casida equation will be constructed under FHI-aims' KS eigenpairs.
3989+
- LRI tensor files (`Cs_data_0.txt` and `coulomb_mat_0.txt`)and Kohn-Sham eigenvalues (`bands_out`): run FHI-aims with periodic boundary conditions and with `total_energy_method rpa` and `output librpa`.
3990+
- Kohn-Sham eigenstates under aims NAOs (`KS_eigenvectors.out`): run FHI-aims with `output eigenvectors`.
3991+
- If the number of atomic orbitals of any atom type in FHI-aims is different from that in ABACUS, the `aims_nbasis` should be set.
3992+
- `abacus`: The `OUT.${suffix}`directory should contain the RI-LVL tensors `Cs` and `Vs` (written by setting `out_ri_cv` to 1). The Casida equation will be constructed under ABACUS' KS eigenpairs, with the only difference that the Hartree term is constructed with RI approximation.
3993+
- `none`: Construct the Hartree term by Poisson equation and grid integration as usual.
3994+
- **Default**: none
3995+
3996+
### aims_nbasis
3997+
- **Type**: A number(ntype) of Integers
3998+
- **Availability**: `ri_hartree_benchmark` = `aims`
3999+
- **Description**: Atomic basis set size for each atom type (with the same order as in `STRU`) in FHI-aims.
4000+
- **Default**: {} (empty list, where ABACUS use its own basis set size)
4001+
39494002
[back to top](#full-list-of-input-keywords)

docs/advanced/install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ cmake -B build -DUSE_CUDA=1 -DCMAKE_CUDA_COMPILER=${path to cuda toolkit}/bin/nv
9393

9494
## Build math library from source
9595

96-
> Note: This flag is **enabled by default**. It will get better performance than the standard implementation on `gcc` and `clang`. But it **will be disabled** when using `Intel Compiler` since the math functions will get wrong results and the performance is also unexpectly poor.
96+
> Note: We recommend using the latest available compiler sets, since they offer faster implementations of math functions.
9797
98-
To build math functions from source code, instead of using c++ standard implementation, define `USE_ABACUS_LIBM` flag.
98+
This flag is disabled by default. To build math functions from source code, define `USE_ABACUS_LIBM` flag. It is expected to get a better performance on legacy versions of `gcc` and `clang`.
9999

100100
Currently supported math functions:
101101
`sin`, `cos`, `sincos`, `exp`, `cexp`
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
INPUT_PARAMETERS
2+
#Parameters (1.General)
3+
suffix aims-benchmark-tdhf
4+
pseudo_dir /home/fortneu49/LR-TDDFT/abacus-develop/tests/PP_ORB
5+
orbital_dir /home/fortneu49/LR-TDDFT/abacus-develop/tests/PP_ORB
6+
calculation scf
7+
nbands 4
8+
symmetry 0
9+
10+
#Parameters (2.Iteration)
11+
ecutwfc 50
12+
scf_thr 1e-6
13+
scf_nmax 100
14+
15+
#Parameters (3.Basis)
16+
basis_type lcao
17+
gamma_only 1
18+
nspin 2
19+
20+
#Parameters (4.Smearing)
21+
smearing_method gaussian
22+
smearing_sigma 0.02
23+
24+
#Parameters (5.Mixing)
25+
mixing_type pulay
26+
mixing_beta 0.4
27+
mixing_gg0 0.0
28+
29+
30+
exx_real_number 1
31+
lr_nstates 3
32+
nvirt 3
33+
xc_kernel hf
34+
lr_solver lapack
35+
36+
esolver_type lr
37+
ri_hartree_benchmark aims
38+
aims_nbasis 5
39+
read_file_dir aims-files
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
ATOMIC_SPECIES
2+
H 1.008 H_ONCV_PBE-1.0.upf
3+
4+
NUMERICAL_ORBITAL
5+
H_gga_8au_60Ry_2s1p.orb
6+
7+
LATTICE_CONSTANT
8+
1.889725989
9+
10+
LATTICE_VECTORS
11+
30 0 0
12+
0 30 0
13+
0 0 30
14+
15+
ATOMIC_POSITIONS
16+
Cartesian
17+
18+
H
19+
0
20+
2
21+
0 0 10.37 0 0 0
22+
0 0 9.63 0 0 0

0 commit comments

Comments
 (0)