Skip to content

Commit 9f95a77

Browse files
authored
Merge branch 'develop' into refactor
2 parents 0df6d34 + 4e37d33 commit 9f95a77

File tree

357 files changed

+4509
-19896
lines changed

Some content is hidden

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

357 files changed

+4509
-19896
lines changed

.github/workflows/version_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
fi
3434
3535
# Verify that the version in version.h matches the tag
36-
if [[ "${{ steps.versions.outputs.current_tag }}" != "v${CODE_VERSION}" ]]; then
36+
if [[ "${{ steps.versions.outputs.current_tag }}" != "${CODE_VERSION}" ]]; then
3737
echo "::error::Version mismatch: tag=${{ steps.versions.outputs.current_tag }} ≠ code=${CODE_VERSION}"
3838
exit 1
3939
fi

CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ if(ENABLE_LCAO)
253253
add_compile_definitions(__PEXSI)
254254
set(CMAKE_CXX_STANDARD 14)
255255
endif()
256-
if(OLD_GINT)
257-
add_compile_definitions(__OLD_GINT)
258-
endif()
259256
else()
260257
set(ENABLE_MLALGO OFF)
261258
set(ENABLE_LIBRI OFF)
@@ -469,7 +466,7 @@ if(MKLROOT)
469466
find_package(MKL REQUIRED)
470467
add_definitions(-D__MKL)
471468
include_directories(${MKL_INCLUDE} ${MKL_INCLUDE}/fftw)
472-
list(APPEND math_libs MKL::MKL MKL::MKL_SCALAPACK)
469+
list(APPEND math_libs MKL::MKL)
473470
if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
474471
list(APPEND math_libs ifcore)
475472
endif()

cmake/FindMKL.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,12 @@ endif()
9191
if(NOT TARGET MKL::MKL_SCALAPACK)
9292
find_library(MKL_SCALAPACK NAMES mkl_scalapack_lp64 HINTS ${MKLROOT}/lib ${MKLROOT}/lib/intel64)
9393
message(STATUS "Found MKL_SCALAPACK: ${MKL_SCALAPACK}")
94-
add_library(MKL::MKL_SCALAPACK OBJECT IMPORTED MKL_SCALAPACK)
94+
if(MKL_SCALAPACK)
95+
# create an IMPORTED target that points to the discovered library file
96+
add_library(MKL::MKL_SCALAPACK UNKNOWN IMPORTED)
97+
set_target_properties(MKL::MKL_SCALAPACK PROPERTIES
98+
IMPORTED_LOCATION "${MKL_SCALAPACK}"
99+
INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE}"
100+
)
101+
endif()
95102
endif()

docs/advanced/input_files/input-main.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@
302302
- [Exact Exchange (PW)](#exact-exchange-pw)
303303
- [exxace](#exxace)
304304
- [exx\_gamma\_extrapolation](#exx_gamma_extrapolation)
305+
- [ecutexx](#ecutexx)
306+
- [exx_thr_type](#exx_thr_type)
307+
- [exx_ene_thr](#exx_ene_thr)
305308
- [Molecular Dynamics](#molecular-dynamics)
306309
- [md\_type](#md_type)
307310
- [md\_nstep](#md_nstep)
@@ -3101,6 +3104,26 @@ These variables are relevant when using hybrid functionals with *[basis_type](#b
31013104
- **Description**: Whether to use the gamma point extrapolation method to calculate the Fock exchange operator. See [https://doi.org/10.1103/PhysRevB.79.205114](https://doi.org/10.1103/PhysRevB.79.205114) for details. Should be set to true most of the time.
31023105
- **Default**: True
31033106

3107+
### ecutexx
3108+
- **Type**: Real
3109+
- **Description**: The energy cutoff for EXX (Fock) exchange operator in plane wave basis calculations. Reducing `ecutexx` below `ecutrho` may significantly accelerate EXX computations. This speed improvement comes with a reduced numerical accuracy in the exchange energy calculation.
3110+
- **Default**: same as *[ecutrho](#ecutrho)*
3111+
- **Unit**: Ry
3112+
3113+
### exx_thr_type
3114+
- **Type**: String
3115+
- **Description**: The type of threshold used to judge whether the outer loop has converged in the separate loop EXX calculation.
3116+
- energy: use the change of exact exchange energy to judge convergence.
3117+
- density: if the change of charge density difference between two successive outer loop iterations is seen as converged according to *[scf_thr](#scf_thr)*, then the outer loop is seen as converged.
3118+
- **Default**: `density`
3119+
3120+
### exx_ene_thr
3121+
- **Type**: Real
3122+
- **Availability**: *[exx_thr_type](#exx_thr_type)*==`energy`
3123+
- **Description**: The threshold for the change of exact exchange energy to judge convergence of the outer loop in the separate loop EXX calculation.
3124+
- **Default**: 1e-5
3125+
- **Unit**: Ry
3126+
31043127
## Molecular dynamics
31053128

31063129
These variables are used to control molecular dynamics calculations. For more information, please refer to [md.md](../md.md#molecular-dynamics) in detail.

source/Makefile.Objects

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ VPATH=./src_global:\
6262
./source_lcao/module_deltaspin:\
6363
./source_lcao/module_operator_lcao:\
6464
./source_lcao/module_gint:\
65-
./source_lcao/module_gint/temp_gint:\
6665
./source_relax:\
6766
./source_hamilt/module_vdw:\
6867
./source_io:\
@@ -229,11 +228,11 @@ OBJS_ELECSTAT=elecstate.o\
229228
elecstate_energy.o\
230229
elecstate_exx.o\
231230
elecstate_print.o\
231+
elecstate_tools.o\
232232
elecstate_pw.o\
233233
elecstate_pw_sdft.o\
234234
elecstate_pw_cal_tau.o\
235235
elecstate_op.o\
236-
elecstate_tools.o\
237236
efield.o\
238237
gatefield.o\
239238
potential_new.o\
@@ -253,8 +252,7 @@ OBJS_ELECSTAT=elecstate.o\
253252
update_pot.o\
254253

255254
OBJS_ELECSTAT_LCAO=elecstate_lcao.o\
256-
elecstate_lcao_cal_tau.o\
257-
setup_dm.o\
255+
init_dm.o\
258256
density_matrix.o\
259257
density_matrix_io.o\
260258
cal_dm_psi.o\
@@ -277,39 +275,12 @@ OBJS_ESOLVER=esolver.o\
277275

278276
OBJS_ESOLVER_LCAO=esolver_ks_lcao.o\
279277
esolver_ks_lcao_tddft.o\
280-
lcao_before_scf.o\
281-
lcao_after_scf.o\
282278
esolver_gets.o\
283279
lcao_others.o\
284280
esolver_dm2rho.o\
285281
esolver_double_xc.o\
286282

287-
OBJS_GINT=gint_old.o\
288-
gint_gamma_env.o\
289-
gint_gamma_vl.o\
290-
gint_fvl_old.o\
291-
gint_rho_old.o\
292-
gint_tau_old.o\
293-
gint_vl_old.o\
294-
gint_k_env.o\
295-
gint_k_sparse1.o\
296-
gint_k_pvpr.o\
297-
gint_k_pvdpr.o\
298-
gint_tools.o\
299-
grid_bigcell.o\
300-
grid_meshball.o\
301-
grid_meshcell.o\
302-
grid_meshk.o\
303-
grid_technique.o\
304-
gint_force_cpu_interface.o\
305-
gint_rho_cpu_interface.o\
306-
gint_vl_cpu_interface.o\
307-
cal_psir_ylm.o\
308-
cal_dpsir_ylm.o\
309-
cal_ddpsir_ylm.o\
310-
mult_psi_dmr.o\
311-
init_orb.o\
312-
batch_biggrid.o\
283+
OBJS_GINT=batch_biggrid.o\
313284
big_grid.o\
314285
biggrid_info.o\
315286
divide_info.o\
@@ -625,7 +596,6 @@ OBJS_IO_LCAO=cal_r_overlap_R.o\
625596
write_dmk.o\
626597
unk_overlap_lcao.o\
627598
read_wfc_nao.o\
628-
read_wfc_lcao.o\
629599
write_wfc_nao.o\
630600
write_HS_sparse.o\
631601
single_R_io.o\
@@ -658,7 +628,6 @@ OBJS_LCAO=evolve_elec.o\
658628
stress_tools.o\
659629
edm.o\
660630
pulay_fs_center2.o\
661-
grid_init.o\
662631
spar_dh.o\
663632
spar_exx.o\
664633
spar_hsr.o\
@@ -673,6 +642,7 @@ OBJS_LCAO=evolve_elec.o\
673642
LCAO_init_basis.o\
674643
setup_exx.o\
675644
setup_deepks.o\
645+
rho_tau_lcao.o\
676646
center2_orb.o\
677647
center2_orb-orb11.o\
678648
center2_orb-orb21.o\
@@ -767,6 +737,7 @@ OBJS_SRCPW=H_Ewald_pw.o\
767737
of_stress_pw.o\
768738
symmetry_rho.o\
769739
symmetry_rhog.o\
740+
setup_psi_pw.o\
770741
setup_psi.o\
771742
psi_init.o\
772743
elecond.o\

source/source_base/element_basis_index.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,26 @@
44
//==========================================================
55

66
#include "element_basis_index.h"
7+
78
namespace ModuleBase
89
{
910

10-
Element_Basis_Index::IndexLNM Element_Basis_Index::construct_index( const Range &range )
11+
Element_Basis_Index::IndexLNM
12+
Element_Basis_Index::construct_index( const Range &range )
1113
{
1214
IndexLNM index;
1315
index.resize( range.size() );
14-
for( size_t T=0; T!=range.size(); ++T )
16+
for( std::size_t T=0; T!=range.size(); ++T )
1517
{
16-
size_t count=0;
18+
std::size_t count=0;
1719
index[T].resize( range[T].size() );
18-
for( size_t L=0; L!=range[T].size(); ++L )
20+
for( std::size_t L=0; L!=range[T].size(); ++L )
1921
{
2022
index[T][L].resize( range[T][L].N );
21-
for( size_t N=0; N!=range[T][L].N; ++N )
23+
for( std::size_t N=0; N!=range[T][L].N; ++N )
2224
{
2325
index[T][L][N].resize( range[T][L].M );
24-
for( size_t M=0; M!=range[T][L].M; ++M )
26+
for( std::size_t M=0; M!=range[T][L].M; ++M )
2527
{
2628
index[T][L][N][M] = count;
2729
++count;

source/source_base/element_basis_index.h

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,41 @@
88

99
#include <cstddef>
1010
#include <vector>
11+
1112
namespace ModuleBase
1213
{
1314

14-
class Element_Basis_Index
15+
namespace Element_Basis_Index
1516
{
16-
private:
17-
17+
//private:
18+
1819
struct NM
1920
{
2021
public:
21-
size_t N;
22-
size_t M;
22+
std::size_t N;
23+
std::size_t M;
2324
};
24-
25-
class Index_TL: public std::vector<std::vector<size_t>>
25+
26+
class Index_TL: public std::vector<std::vector<std::size_t>>
2627
{
2728
public:
28-
size_t N;
29-
size_t M;
29+
std::size_t N;
30+
std::size_t M;
3031
};
31-
32+
3233
class Index_T: public std::vector<Index_TL>
3334
{
3435
public:
35-
size_t count_size;
36-
};
37-
38-
public:
39-
40-
typedef std::vector<std::vector<NM>> Range; // range[T][L]
36+
std::size_t count_size;
37+
};
38+
39+
//public:
40+
41+
typedef std::vector<std::vector<NM>> Range; // range[T][L]
4142
typedef std::vector<Index_T> IndexLNM; // index[T][L][N][M]
42-
43-
static IndexLNM construct_index( const Range &range );
44-
};
43+
44+
extern IndexLNM construct_index( const Range &range );
45+
}
4546

4647
}
4748

source/source_base/gather_math_lib_info.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void zhegvx_i(const int *itype,
6060
const int *il,
6161
const int *iu,
6262
const double *abstol,
63-
const int *m,
63+
int *m,
6464
double *w,
6565
std::complex<double> *z,
6666
const int *ldz,

source/source_base/global_function.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,17 @@ inline void DCOPY(const T* a, T* b, const int& dim) {
182182
}
183183

184184
template <typename T>
185-
inline void COPYARRAY(const T* a, T* b, const long dim);
185+
inline void COPYARRAY(const T* a, T* b, const int dim);
186186

187187
template <>
188-
inline void COPYARRAY(const std::complex<double>* a, std::complex<double>* b, const long dim)
188+
inline void COPYARRAY(const std::complex<double>* a, std::complex<double>* b, const int dim)
189189
{
190190
const int one = 1;
191191
zcopy_(&dim, a, &one, b, &one);
192192
}
193193

194194
template <>
195-
inline void COPYARRAY(const double* a, double* b, const long dim)
195+
inline void COPYARRAY(const double* a, double* b, const int dim)
196196
{
197197
const int one = 1;
198198
dcopy_(&dim, a, &one, b, &one);

source/source_base/module_container/ATen/kernels/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ if(BUILD_TESTING)
1616
if(ENABLE_MPI)
1717
add_subdirectory(test)
1818
endif()
19-
endif()
19+
endif()

0 commit comments

Comments
 (0)