Skip to content

Commit c1bc1b1

Browse files
committed
Merge branch 'fix_scf_MPI_ERR_TRUNCATE' of https://github.com/AsTonyshment/abacus-develop into fix_scf_MPI_ERR_TRUNCATE
2 parents a866f4c + ee2919c commit c1bc1b1

File tree

106 files changed

+1113
-212
lines changed

Some content is hidden

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

106 files changed

+1113
-212
lines changed

.github/workflows/test.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,27 @@ jobs:
8383
OMP_NUM_THREADS: '2'
8484
run: |
8585
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_CELL"
86+
87+
- name: Module_MD Unittests
88+
env:
89+
GTEST_COLOR: 'yes'
90+
OMP_NUM_THREADS: '2'
91+
run: |
92+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_MD"
93+
94+
- name: Module_Psi Unittests
95+
env:
96+
GTEST_COLOR: 'yes'
97+
OMP_NUM_THREADS: '2'
98+
run: |
99+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_PSI"
100+
101+
- name: Module_RI Unittests
102+
env:
103+
GTEST_COLOR: 'yes'
104+
OMP_NUM_THREADS: '2'
105+
run: |
106+
cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_RI"
86107
87108
- name: 01_PW Test
88109
env:
@@ -159,4 +180,4 @@ jobs:
159180
GTEST_COLOR: 'yes'
160181
OMP_NUM_THREADS: '2'
161182
run: |
162-
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_LJ_DP|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|12_NAO_Gamma_GPU|13_NAO_multik_GPU|15_rtTDDFT_GPU|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL'"
183+
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_LJ_DP|05_rtTDDFT|06_SDFT|07_OFDFT|08_EXX|09_DeePKS|10_others|11_PW_GPU|12_NAO_Gamma_GPU|13_NAO_multik_GPU|15_rtTDDFT_GPU|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL|MODULE_MD|MODULE_PSI|MODULE_RI'"

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ if(ENABLE_MPI)
269269
list(APPEND math_libs MPI::MPI_CXX)
270270
endif()
271271

272+
272273
if (USE_DSP)
273274
add_compile_definitions(__DSP)
274275
target_link_libraries(${ABACUS_BIN_NAME} ${OMPI_LIBRARY1})

docs/advanced/input_files/input-main.md

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
- [bessel\_descriptor\_smooth](#bessel_descriptor_smooth)
196196
- [bessel\_descriptor\_sigma](#bessel_descriptor_sigma)
197197
- [deepks\_bandgap](#deepks_bandgap)
198+
- [deepks\_bandgap\_range](#deepks_bandgap_range)
198199
- [deepks\_v\_delta](#deepks_v_delta)
199200
- [deepks\_out\_unittest](#deepks_out_unittest)
200201
- [OFDFT: orbital free density functional theory](#ofdft-orbital-free-density-functional-theory)
@@ -1625,16 +1626,15 @@ These variables are used to control the output of properties.
16251626
- **Type**: Integer
16261627
- **Description**:
16271628
- 1: Output the **total local potential** (i.e., local pseudopotential + Hartree potential + XC potential + external electric field (if exists) + dipole correction potential (if exists) + ...) on real space grids (in Ry) into files in the folder `OUT.${suffix}`. The files are named as:
1628-
- nspin = 1: SPIN1_POT.cube;
1629-
- nspin = 2: SPIN1_POT.cube, and SPIN2_POT.cube;
1630-
- nspin = 4: SPIN1_POT.cube, SPIN2_POT.cube, SPIN3_POT.cube, and SPIN4_POT.cube.
1631-
- 2: Output the **electrostatic potential** on real space grids into `OUT.${suffix}/ElecStaticPot.cube`. The Python script named `tools/average_pot/aveElecStatPot.py` can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE.
1632-
1629+
- nspin = 1: `pots1.cube`;
1630+
- nspin = 2: `pots1.cube` and `pots2.cube`;
1631+
- nspin = 4: `pots1.cube`, `pots2.cube`, `pots3.cube`, and `pots4.cube`
1632+
- 2: Output the **electrostatic potential** on real space grids into `OUT.${suffix}/pot_es.cube`. The Python script named `tools/average_pot/aveElecStatPot.py` can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE.
16331633
Please note that the total local potential refers to the local component of the self-consistent potential, excluding the non-local pseudopotential. The distinction between the local potential and the electrostatic potential is as follows: local potential = electrostatic potential + XC potential.
16341634
- 3: Apart from 1, also output the **total local potential** of the initial charge density. The files are named as:
1635-
- nspin = 1: SPIN1_POT_INI.cube;
1636-
- nspin = 2: SPIN1_POT_INI.cube, and SPIN2_POT_INI.cube;
1637-
- nspin = 4: SPIN1_POT_INI.cube, SPIN2_POT_INI.cube, SPIN3_POT_INI.cube, and SPIN4_POT_INI.cube.
1635+
- nspin = 1: `pots1_ini.cube`;
1636+
- nspin = 2: `pots1_ini.cube` and `pots2_ini.cube`;
1637+
- nspin = 4: `pots1_ini.cube`, `pots2_ini.cube`, `pots3_ini.cube`, and `pots4_ini.cube`
16381638

16391639
In molecular dynamics calculations, the output frequency is controlled by [out_interval](#out_interval).
16401640
- **Default**: 0
@@ -1643,21 +1643,22 @@ These variables are used to control the output of properties.
16431643

16441644
- **Type**: Boolean
16451645
- **Availability**: Numerical atomic orbital basis
1646-
- **Description**: Whether to output the density matrix of localized orbitals into files in the folder `OUT.${suffix}`. The files are named as:
1646+
- **Description**: Whether to output the density matrix for each k-point into files in the folder `OUT.${suffix}`. The files are named as:
16471647
- For gamma only case:
1648-
- nspin = 1: SPIN1_DM;
1649-
- nspin = 2: SPIN1_DM, and SPIN2_DM.
1648+
- nspin = 1: `dms1_nao.csr`;
1649+
- nspin = 2: `dms1_nao.csr` and `dms2_nao.csr` for the two spin channels.
16501650
- For multi-k points case:
1651-
- SPIN\*_K\*_DM, where \* stands for index of spin and kpoints;
1651+
- nspin = 1: `dms1k1_nao.csr`, `dms1k2_nao.csr`, ...;
1652+
- nspin = 2: `dms1k1_nao.csr`... and `dms2k1_nao.csr`... for the two spin channels.
16521653
- **Default**: False
16531654

16541655
### out_dm1
16551656

16561657
- **Type**: Boolean
16571658
- **Availability**: Numerical atomic orbital basis (multi-k points)
1658-
- **Description**: Whether to output the density matrix of localized orbitals into files in the folder `OUT.${suffix}`. The density matrices are written in the format of sparse matrices, as mentioned in [out_mat_hs2](#out_mat_hs2). The files are named as:
1659-
- nspin = 1: data-DMR-sparse_SPIN0.csr;
1660-
- nspin = 2: data-DMR-sparse_SPIN0.csr, and data-DMR-sparse_SPIN1.csr.
1659+
- **Description**: Whether to output the density matrix with Bravias lattice vector R index into files in the folder `OUT.${suffix}`. The files are named as `dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in [out_mat_hs2](#out_mat_hs2). Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optinal 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps:
1660+
- nspin = 1: `dmrs1_nao.csr`;
1661+
- nspin = 2: `dmrs1_nao.csr` and `dmrs2_nao.csr` for the two spin channels.
16611662
- **Default**: False
16621663

16631664
### out_wfc_pw
@@ -2144,10 +2145,24 @@ Warning: this function is not robust enough for the current version. Please try
21442145

21452146
### deepks_bandgap
21462147

2147-
- **Type**: Boolean
2148+
- **Type**: Int
21482149
- **Availability**: numerical atomic orbital basis and `deepks_scf` is true
21492150
- **Description**: include bandgap label for DeePKS training
2150-
- **Default**: False
2151+
- 0: Don't include bandgap label
2152+
- 1: Include HOMO and LOMO for bandgap label
2153+
- 2: Include multiple bandgap label (see [deepks\_bandgap\_range](#deepks_bandgap_range) for more details)
2154+
- 3: Include target bandgap label (see [deepks\_bandgap\_range](#deepks_bandgap_range) for more details)
2155+
- 4: For systems containing H atoms only, HOMO is defined as the max occupation expect H atoms and the bandgap label is the energy between (HOMO, HOMO + 1)
2156+
- **Default**: 0
2157+
2158+
### deepks_bandgap_range
2159+
2160+
- **Type**: Int*2
2161+
- **Availability**: numerical atomic orbital basis, `deepks_scf` is true, and `deepks_bandgap` is 2 or 3
2162+
- **Description**:
2163+
- `deepks_bandgap` is 2: Bandgap labels are energies between (LUMO + deepks_bandgap_range[0], HOMO), (LUMO + deepks_bandgap_range[0] + 1, HOMO), ..., (LUMO + deepks_bandgap_range[1], HOMO) except (HOMO, HOMO)
2164+
- `deepks_bandgap` is 3: Bandgap label is the energy between (LUMO + deepks_bandgap_range[0], LUMO + deepks_bandgap_range[1])
2165+
- **Default**: 0 0
21512166

21522167
### deepks_v_delta
21532168

source/module_base/grid/test/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
remove_definitions(-D__MPI)
22

33
AddTest(
4-
TARGET test_delley
4+
TARGET MODULE_BASE_GRID_test_delley
55
SOURCES test_delley.cpp
66
../delley.cpp
77
../../ylm.cpp
88
)
99

1010
AddTest(
11-
TARGET test_radial
11+
TARGET MODULE_BASE_GRID_test_radial
1212
SOURCES test_radial.cpp
1313
../radial.cpp
1414
)
1515

1616
AddTest(
17-
TARGET test_partition
17+
TARGET MODULE_BASE_GRID_test_partition
1818
SOURCES test_partition.cpp
1919
../partition.cpp
2020
../radial.cpp
2121
../delley.cpp
2222
)
2323

2424
AddTest(
25-
TARGET test_batch
25+
TARGET MODULE_BASE_GRID_test_batch
2626
SOURCES test_batch.cpp
2727
../batch.cpp
2828
LIBS ${math_libs}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
remove_definitions(-D__MPI)
22

33
AddTest(
4-
TARGET Base_Kernels_UTs
4+
TARGET MODULE_BASE_KERNELS_Unittests
55
LIBS parameter ${math_libs} base device
66
SOURCES math_ylm_op_test.cpp math_kernel_test.cpp
77
)

source/module_base/libm/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
remove_definitions(-D__MPI)
22

33
AddTest(
4-
TARGET Base_Libm_UTs
4+
TARGET MODULE_BASE_LIBM_UTs
55
SOURCES libm_test.cpp
66
../branred.cpp
77
../cexp.cpp

source/module_base/module_container/test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
remove_definitions(-D__MPI)
22

33
AddTest(
4-
TARGET container_uts
4+
TARGET MODULE_BASE_CONTAINER_Unittests
55
LIBS parameter container base device ${math_libs}
66
SOURCES tensor_test.cpp tensor_shape_test.cpp allocator_test.cpp
77
tensor_buffer_test.cpp tensor_map_test.cpp
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
AddTest(
2-
TARGET Module_Device_UTs
2+
TARGET MODULE_BASE_DEVICE_Unittests
33
LIBS parameter ${math_libs} base device
44
SOURCES memory_test.cpp device_test.cpp
55
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
remove_definitions(-D__MPI)
22
AddTest(
3-
TARGET test_mixing
3+
TARGET MODULE_BASE_MIXING_unittests
44
LIBS parameter base device ${math_libs}
55
SOURCES mixing_test.cpp
66
)

source/module_basis/module_pw/module_fft/fft_base.h

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class FFT_BASE
1212
virtual ~FFT_BASE() {};
1313

1414
/**
15-
* @brief Initialize the fft parameters As virtual function.
15+
* @brief Initialize the fft parameters as virtual function.
1616
*
1717
* The function is used to initialize the fft parameters.
1818
*/
@@ -30,32 +30,40 @@ class FFT_BASE
3030
virtual __attribute__((weak)) void initfft(int nx_in, int ny_in, int nz_in);
3131

3232
/**
33-
* @brief Setup the fft Plan and data As pure virtual function.
33+
* @brief Setup the fft plan and data as pure virtual function.
3434
*
3535
* The function is set as pure virtual function.In order to
3636
* override the function in the derived class.In the derived
37-
* class, the function is used to setup the fft Plan and data.
37+
* class, the function is used to setup the fft plan and data.
3838
*/
3939
virtual void setupFFT() = 0;
4040

4141
/**
42-
* @brief Clean the fft Plan As pure virtual function.
42+
* @brief Clean the fft plan as pure virtual function.
4343
*
4444
* The function is set as pure virtual function.In order to
4545
* override the function in the derived class.In the derived
46-
* class, the function is used to clean the fft Plan.
46+
* class, the function is used to clean the fft plan.
4747
*/
4848
virtual void cleanFFT() = 0;
4949

5050
/**
51-
* @brief Clear the fft data As pure virtual function.
51+
* @brief Clear the fft data as pure virtual function.
5252
*
5353
* The function is set as pure virtual function.In order to
5454
* override the function in the derived class.In the derived
5555
* class, the function is used to clear the fft data.
5656
*/
5757
virtual void clear() = 0;
58-
58+
/**
59+
* @brief Allocate and destory the resoure in FFT running time,
60+
* Now it only used in the DSP mode.
61+
*
62+
* The function is set as pure virtual function.In order to
63+
* override the function in the derived class.In the derived
64+
* class, the function is used to allocate and destory the
65+
* resoure in FFT running time.
66+
*/
5967
virtual void resource_handler(const int flag) const {};
6068
/**
6169
* @brief Get the real space data in cpu-like fft

0 commit comments

Comments
 (0)