Skip to content

Commit 1a3282d

Browse files
committed
Merge branch 'develop' of https://github.com/deepmodeling/abacus-develop into ldos
2 parents 2e3baa1 + 940a664 commit 1a3282d

File tree

894 files changed

+7409
-3426
lines changed

Some content is hidden

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

894 files changed

+7409
-3426
lines changed

CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ option(USE_CUDA_MPI "Enable CUDA-aware MPI" OFF)
1717
option(USE_CUDA_ON_DCU "Enable CUDA on DCU" OFF)
1818
option(USE_ROCM "Enable ROCm" OFF)
1919
option(USE_DSP "Enable DSP" OFF)
20+
option(USE_SW "Enable SW Architecture" OFF)
2021

2122
option(USE_ABACUS_LIBM "Build libmath from source to speed up" OFF)
2223
option(ENABLE_LIBXC "Enable using the LibXC package" OFF)
@@ -281,6 +282,18 @@ if (USE_DSP)
281282
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_device.a)
282283
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_host.a)
283284
endif()
285+
if (USE_SW)
286+
add_compile_definitions(__SW)
287+
set(SW ON)
288+
include_directories(${SW_MATH}/include)
289+
include_directories(${SW_FFT}/include)
290+
291+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_FFT}/lib/libfftw3.a)
292+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswfft.a)
293+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswscalapack.a)
294+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswlapack.a)
295+
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswblas.a)
296+
endif()
284297

285298
find_package(Threads REQUIRED)
286299
target_link_libraries(${ABACUS_BIN_NAME} Threads::Threads)
@@ -459,6 +472,9 @@ if(MKLROOT)
459472
if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
460473
list(APPEND math_libs ifcore)
461474
endif()
475+
elseif(USE_SW)
476+
list(APPEND math_libs gfortran)
477+
# SW architecture can only use its own math library
462478
else()
463479
find_package(FFTW3 REQUIRED)
464480
find_package(Lapack REQUIRED)

cmake/FindCereal.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if(NOT CEREAL_INCLUDE_DIR)
1515
include(FetchContent)
1616
FetchContent_Declare(
1717
cereal
18-
URL https://github.com/USCiLab/cereal/archive/refs/tags/v1.3.2.tar.gz
18+
URL https://codeload.github.com/USCiLab/cereal/tar.gz/master
1919
)
2020
FetchContent_Populate(cereal)
2121
set(CEREAL_INCLUDE_DIR ${cereal_SOURCE_DIR}/include)

docs/advanced/input_files/input-main.md

Lines changed: 81 additions & 30 deletions
Large diffs are not rendered by default.

python/pyabacus/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ set(BASE_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/base")
7979
add_subdirectory(${ABACUS_SOURCE_DIR}/source_base ${BASE_BINARY_DIR})
8080
# add parameter
8181
set(PARAMETER_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/parameter")
82-
add_subdirectory(${ABACUS_SOURCE_DIR}/module_parameter ${PARAMETER_BINARY_DIR})
82+
add_subdirectory(${ABACUS_SOURCE_DIR}/source_io/module_parameter ${PARAMETER_BINARY_DIR})
8383
# add orb
8484
set(ORB_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/orb")
8585
add_subdirectory(${ABACUS_SOURCE_DIR}/source_basis/module_ao ${ORB_BINARY_DIR})

python/pyabacus/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ set(BASE_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/base")
144144
add_subdirectory(${ABACUS_SOURCE_DIR}/source_base ${BASE_BINARY_DIR})
145145
# Add parameter
146146
set(PARAMETER_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/parameter")
147-
add_subdirectory(${ABACUS_SOURCE_DIR}/module_parameter ${PARAMETER_BINARY_DIR})
147+
add_subdirectory(${ABACUS_SOURCE_DIR}/source_io/module_parameter ${PARAMETER_BINARY_DIR})
148148
# Add orb
149149
set(ORB_BINARY_DIR "${PROJECT_SOURCE_DIR}/build/orb")
150150
add_subdirectory(${ABACUS_SOURCE_DIR}/source_basis/module_ao ${ORB_BINARY_DIR})

python/pyabacus/src/ModuleNAO/py_m_nao.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,9 @@ void bind_m_nao(py::module& m)
152152
double* cvR = static_cast<double*>(pvR_info.ptr);
153153
ModuleBase::Vector3<double> vR(cvR[0], cvR[1], cvR[2]);
154154
double out[1] = {0.0};
155-
double* grad_out = nullptr;
156-
if (cal_grad)
157-
{
158-
grad_out = new double[3];
159-
}
160-
self.calculate(itype1, l1, izeta1, m1, itype2, l2, izeta2, m2, vR, out, grad_out);
155+
double grad_out[3] = {0.0, 0.0, 0.0};
156+
double* grad_ptr = cal_grad ? grad_out : nullptr;
157+
self.calculate(itype1, l1, izeta1, m1, itype2, l2, izeta2, m2, vR, out, grad_ptr);
161158
py::array_t<double> out_array(1, out);
162159
if (cal_grad)
163160
{

python/pyabacus/tests/test_m_nao.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,36 @@ def test_rc():
7373
assert orb(0,1,1).l == 1
7474
assert orb(0,2,0).l == 2
7575

76+
def test_twocenterintegrator():
77+
orb_dir = '../../../tests/PP_ORB/'
78+
file_list = ["C_gga_8au_100Ry_2s2p1d.orb", "O_gga_10au_100Ry_2s2p1d.orb"]
79+
file_list = [orb_dir + orbfile for orbfile in file_list]
80+
81+
orb = nao.RadialCollection()
82+
orb.build(2, file_list, 'o')
83+
84+
alpha = nao.RadialCollection()
85+
alpha.build(1, [file_list[0]])
86+
87+
dr = 0.01 # R spacing
88+
rmax = max(orb.rcut_max, alpha.rcut_max)
89+
cutoff = 2.0 * rmax
90+
nr = int(rmax / dr) + 1
91+
92+
orb.set_uniform_grid(True, nr, cutoff, 'i', True)
93+
alpha.set_uniform_grid(True, nr, cutoff, 'i', True)
94+
95+
sbt = base.SphericalBesselTransformer()
96+
orb.set_transformer(sbt)
97+
alpha.set_transformer(sbt)
98+
99+
integrator = nao.TwoCenterIntegrator()
100+
integrator.tabulate(orb, alpha, 'S', nr, cutoff)
76101

102+
overlap = integrator.snap(0, 0, 0, 0, 0, np.array([0.0, 0.0, 0.0]), False)
103+
assert 1 - overlap[0][0] < 1e-10
104+
overlap = integrator.snap(1, 0, 0, 0, 0, np.array([3.0, 3.0, 3.0]), False)
105+
assert abs(overlap[0][0] - 0.031136758774787342) < 1e-10
77106

78107

79108

source/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ add_subdirectory(source_lcao/module_gint)
1515
add_subdirectory(source_io)
1616
add_subdirectory(source_relax)
1717
add_subdirectory(source_lcao/module_ri)
18-
add_subdirectory(module_parameter)
19-
add_subdirectory(module_lr)
18+
add_subdirectory(source_io/module_parameter)
19+
add_subdirectory(source_lcao/module_lr)
2020

2121
# add by jghan
2222
add_subdirectory(source_lcao/module_rdmft)
@@ -54,6 +54,10 @@ list(APPEND device_srcs
5454
source_pw/module_pwdft/kernels/vnl_op.cpp
5555
source_base/kernels/math_ylm_op.cpp
5656
source_hamilt/module_xc/kernels/xc_functional_op.cpp
57+
source_pw/module_pwdft/kernels/cal_density_real_op.cpp
58+
source_pw/module_pwdft/kernels/mul_potential_op.cpp
59+
source_pw/module_pwdft/kernels/vec_mul_vec_complex_op.cpp
60+
source_pw/module_pwdft/kernels/exx_cal_energy_op.cpp
5761
)
5862

5963
if(USE_CUDA)
@@ -80,6 +84,10 @@ if(USE_CUDA)
8084
source_base/kernels/cuda/math_kernel_op.cu
8185
source_base/kernels/cuda/math_kernel_op_vec.cu
8286
source_hamilt/module_xc/kernels/cuda/xc_functional_op.cu
87+
source_pw/module_pwdft/kernels/cuda/cal_density_real_op.cu
88+
source_pw/module_pwdft/kernels/cuda/mul_potential_op.cu
89+
source_pw/module_pwdft/kernels/cuda/vec_mul_vec_complex.cu
90+
source_pw/module_pwdft/kernels/cuda/exx_cal_energy_op.cu
8391
)
8492
endif()
8593

source/Makefile.Objects

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ VPATH=./src_global:\
2020
./source_cell:\
2121
./source_base:\
2222
./source_base/kernels:\
23+
./source_base/module_external:\
2324
./source_base/module_container/base/core:\
2425
./source_base/module_container/ATen/core:\
2526
./source_base/module_container/ATen/kernels:\
@@ -32,7 +33,7 @@ VPATH=./src_global:\
3233
./source_esolver:\
3334
./source_hsolver:\
3435
./source_hsolver/kernels:\
35-
./source_hsolver/genelpa:\
36+
./source_hsolver/module_genelpa:\
3637
./source_hsolver/module_pexsi:\
3738
./source_estate:\
3839
./source_estate/kernels:\
@@ -54,12 +55,12 @@ VPATH=./src_global:\
5455
./source_pw/module_pwdft/module_exx_helper:\
5556
./source_pw/module_stodft/kernels:\
5657
./source_lcao/module_hcontainer:\
57-
./source_lcao/hamilt_lcaodft:\
58+
./source_lcao:\
5859
./source_lcao/module_rt:\
5960
./source_lcao/module_deepks:\
6061
./source_lcao/module_dftu:\
6162
./source_lcao/module_deltaspin:\
62-
./source_lcao/hamilt_lcaodft/operator_lcao:\
63+
./source_lcao/module_operator_lcao:\
6364
./source_lcao/module_gint:\
6465
./source_lcao/module_gint/temp_gint:\
6566
./source_relax:\
@@ -68,13 +69,13 @@ VPATH=./src_global:\
6869
./source_io/json_output:\
6970
./src_ri:\
7071
./source_lcao/module_ri:\
71-
./module_parameter:\
72-
./module_lr:\
73-
./module_lr/ao_to_mo_transformer:\
74-
./module_lr/dm_trans:\
75-
./module_lr/operator_casida:\
76-
./module_lr/potentials:\
77-
./module_lr/utils:\
72+
./source_io/module_parameter:\
73+
./source_lcao/module_lr:\
74+
./source_lcao/module_lr/ao_to_mo_transformer:\
75+
./source_lcao/module_lr/dm_trans:\
76+
./source_lcao/module_lr/operator_casida:\
77+
./source_lcao/module_lr/potentials:\
78+
./source_lcao/module_lr/utils:\
7879
./source_lcao/module_rdmft:\
7980
./\
8081

@@ -341,10 +342,15 @@ OBJS_HAMILT=hamilt_pw.o\
341342
velocity_pw.o\
342343
radial_proj.o\
343344
exx_helper.o\
345+
vec_mul_vec_complex_op.o\
346+
exx_cal_energy_op.o\
347+
cal_density_real_op.o\
348+
mul_potential_op.o\
344349

345350
OBJS_HAMILT_OF=kedf_tf.o\
346351
kedf_vw.o\
347352
kedf_wt.o\
353+
kedf_xwm.o\
348354
kedf_lkt.o\
349355
kedf_manager.o\
350356

@@ -355,6 +361,7 @@ OBJS_HAMILT_LCAO=hamilt_lcao.o\
355361
overlap_new.o\
356362
td_ekinetic_lcao.o\
357363
td_nonlocal_lcao.o\
364+
td_pot_hybrid.o\
358365
veff_lcao.o\
359366
meta_lcao.o\
360367
op_dftu_lcao.o\
@@ -623,8 +630,9 @@ OBJS_LCAO=evolve_elec.o\
623630
propagator_cn2.o\
624631
propagator_taylor.o\
625632
propagator_etrs.o\
626-
td_velocity.o\
627-
td_current.o\
633+
td_folding.o\
634+
td_info.o\
635+
velocity_op.o\
628636
snap_psibeta_half_tddft.o\
629637
solve_propagation.o\
630638
upsi.o\

source/source_base/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ add_library(
1010
base
1111
OBJECT
1212
assoc_laguerre.cpp
13-
blas_connector_base.cpp
14-
blas_connector_vector.cpp
15-
blas_connector_matrix.cpp
13+
module_external/blas_connector_base.cpp
14+
module_external/blas_connector_vector.cpp
15+
module_external/blas_connector_matrix.cpp
1616
clebsch_gordan_coeff.cpp
1717
complexarray.cpp
1818
complexmatrix.cpp
@@ -85,7 +85,7 @@ if(BUILD_TESTING)
8585
add_subdirectory(kernels/test)
8686
add_subdirectory(module_mixing/test)
8787
add_subdirectory(module_device/test)
88-
add_subdirectory(grid/test)
88+
add_subdirectory(module_grid/test)
8989
if (USE_ABACUS_LIBM)
9090
add_subdirectory(libm/test)
9191
endif()

0 commit comments

Comments
 (0)