Skip to content

Commit 4d5e538

Browse files
authored
Merge branch 'develop' into fix-nadj-calcpLp
2 parents 59ead16 + ecb36de commit 4d5e538

File tree

974 files changed

+40904
-76866
lines changed

Some content is hidden

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

974 files changed

+40904
-76866
lines changed

.github/workflows/pytest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Checkout
1414
uses: actions/checkout@v5
1515
- name: Set up Python
16-
uses: actions/setup-python@v5
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: 3.8
1919
- name: Build Pyabacus

.github/workflows/test.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,17 @@ jobs:
1717
volumes:
1818
- /tmp/ccache:/github/home/.ccache
1919
steps:
20-
- name: Checkout
20+
- name: Checkout repository
2121
uses: actions/checkout@v5
2222
with:
23-
submodules: recursive
2423
fetch-depth: 0
24+
# We will handle submodules manually after fixing ownership
25+
submodules: 'false'
26+
27+
- name: Take ownership of the workspace and update submodules
28+
run: |
29+
sudo chown -R $(whoami) .
30+
git submodule update --init --recursive
2531
2632
- name: Install CI tools
2733
run: |
@@ -126,12 +132,12 @@ jobs:
126132
run: |
127133
cmake --build build --target test ARGS="-V --timeout 1700 -R 03_NAO_multik"
128134
129-
- name: 04_LJ_DP Test
135+
- name: 04_FF Test
130136
env:
131137
GTEST_COLOR: 'yes'
132138
OMP_NUM_THREADS: '2'
133139
run: |
134-
cmake --build build --target test ARGS="-V --timeout 1700 -R 04_LJ_DP"
140+
cmake --build build --target test ARGS="-V --timeout 1700 -R 04_FF"
135141
136142
- name: 05_rtTDDFT Test
137143
env:
@@ -180,4 +186,4 @@ jobs:
180186
GTEST_COLOR: 'yes'
181187
OMP_NUM_THREADS: '2'
182188
run: |
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|source_psi|MODULE_RI'"
189+
cmake --build build --target test ARGS="-V --timeout 1700 -E 'integrate_test|01_PW|02_NAO_Gamma|03_NAO_multik|04_FF|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|source_psi|MODULE_RI'"

.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

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ __pycache__
2323
abacus.json
2424
*.npy
2525
toolchain/install/
26-
toolchain/abacus_env.sh
26+
toolchain/abacus_env.sh
27+
.trae

CMakeLists.txt

Lines changed: 18 additions & 7 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)
@@ -287,7 +284,7 @@ if (USE_SW)
287284
set(SW ON)
288285
include_directories(${SW_MATH}/include)
289286
include_directories(${SW_FFT}/include)
290-
287+
291288
target_link_libraries(${ABACUS_BIN_NAME} ${SW_FFT}/lib/libfftw3.a)
292289
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswfft.a)
293290
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswscalapack.a)
@@ -373,6 +370,7 @@ if(USE_CUDA)
373370
if(USE_CUDA)
374371
add_compile_definitions(__CUDA)
375372
add_compile_definitions(__UT_USE_CUDA)
373+
target_compile_definitions(${ABACUS_BIN_NAME} PRIVATE __USE_NVTX)
376374
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
377375
set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G" CACHE STRING "CUDA flags for debug build" FORCE)
378376
endif()
@@ -468,7 +466,7 @@ if(MKLROOT)
468466
find_package(MKL REQUIRED)
469467
add_definitions(-D__MKL)
470468
include_directories(${MKL_INCLUDE} ${MKL_INCLUDE}/fftw)
471-
list(APPEND math_libs MKL::MKL MKL::MKL_SCALAPACK)
469+
list(APPEND math_libs MKL::MKL)
472470
if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
473471
list(APPEND math_libs ifcore)
474472
endif()
@@ -480,8 +478,12 @@ else()
480478
find_package(Lapack REQUIRED)
481479
include_directories(${FFTW3_INCLUDE_DIRS})
482480
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
481+
if(USE_DSP)
482+
target_link_libraries(${ABACUS_BIN_NAME} ${SCALAPACK_LIBRARY_DIR})
483+
else()
483484
find_package(ScaLAPACK REQUIRED)
484485
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
486+
endif()
485487
if(USE_OPENMP)
486488
list(APPEND math_libs FFTW3::FFTW3_OMP)
487489
endif()
@@ -520,7 +522,7 @@ if(ENABLE_MLALGO)
520522
include_directories(${libnpy_INCLUDE_DIR})
521523
endif()
522524
include_directories(${libnpy_SOURCE_DIR}/include)
523-
525+
524526
add_compile_definitions(__MLALGO)
525527
endif()
526528

@@ -560,7 +562,7 @@ if (ENABLE_CNPY)
560562
include_directories(${cnpy_INCLUDE_DIR})
561563
endif()
562564
include_directories(${cnpy_SOURCE_DIR})
563-
565+
564566
# find ZLIB and link
565567
find_package(ZLIB REQUIRED)
566568
target_link_libraries(${ABACUS_BIN_NAME} cnpy ZLIB::ZLIB)
@@ -649,6 +651,15 @@ if(DEFINED DeePMD_DIR)
649651
endif()
650652
endif()
651653

654+
if(DEFINED NEP_DIR)
655+
find_package(NEP REQUIRED)
656+
657+
if(NEP_FOUND)
658+
add_compile_definitions(__NEP)
659+
target_link_libraries(${ABACUS_BIN_NAME} NEP::nep)
660+
endif()
661+
endif()
662+
652663
if(DEFINED TensorFlow_DIR)
653664
find_package(TensorFlow REQUIRED)
654665
include_directories(${TensorFlow_DIR}/include)

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()

cmake/FindNEP.cmake

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
###############################################################################
2+
# - Find NEP
3+
# Finds the NEP header and library.
4+
#
5+
# This module will search for the NEP library, looking for a hint
6+
# from the NEP_DIR environment variable or CMake variable.
7+
#
8+
# This module defines the following variables:
9+
#
10+
# NEP_FOUND - True if the NEP library and headers were found.
11+
# NEP_INCLUDE_DIR - The directory where nep.h is located.
12+
# NEP_LIBRARY - The full path to the NEP library.
13+
#
14+
# It also defines the following imported target:
15+
#
16+
# NEP::nep - The NEP library target.
17+
#
18+
###############################################################################
19+
# Note: Currently only CPU version is supported, Since the NEP interface with GPU support is not available yet.
20+
# In feature, if available, we can use USE_CUDA to switch between CPU and GPU version.
21+
22+
find_path(NEP_INCLUDE_DIR nep.h
23+
HINTS ${NEP_DIR}
24+
PATH_SUFFIXES "include"
25+
)
26+
27+
find_library(NEP_LIBRARY
28+
NAMES nep
29+
HINTS ${NEP_DIR}
30+
PATH_SUFFIXES "lib"
31+
)
32+
33+
include(FindPackageHandleStandardArgs)
34+
find_package_handle_standard_args(NEP
35+
DEFAULT_MSG
36+
NEP_LIBRARY NEP_INCLUDE_DIR)
37+
38+
if(NEP_FOUND)
39+
if(NOT TARGET NEP::nep)
40+
add_library(NEP::nep UNKNOWN IMPORTED)
41+
set_target_properties(NEP::nep PROPERTIES
42+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
43+
IMPORTED_LOCATION "${NEP_LIBRARY}"
44+
INTERFACE_INCLUDE_DIRECTORIES "${NEP_INCLUDE_DIR}"
45+
)
46+
endif()
47+
endif()
48+
49+
mark_as_advanced(NEP_INCLUDE_DIR NEP_LIBRARY)

docs/advanced/elec_properties/Mulliken.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Mulliken Charge Analysis
22

33
From version 2.1.0, ABACUS has the function of Mulliken population analysis. The example can be found in [examples/mulliken](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/mulliken). \
4-
To use this function, set [out_mul](./input-main.md#out_mul) to `1` in the INPUT file. After calculation, there will be an output file named `mulliken.txt` in the output directory. In MD calculations, the output interval is controlled by the keyword [out_interval](./input-main.md#out_interval). In the file, there are contents like (`nspin 1`):
4+
To use this function, set [out_mul](./input-main.md#out_mul) to `1` in the INPUT file. After calculation, there will be an output file named `mulliken.txt` in the output directory. In MD calculations, the output interval is controlled by the keyword [out_freq_ion](./input-main.md#out_freq_ion). In the file, there are contents like (`nspin 1`):
55

66
```
77
STEP: 0

docs/advanced/elec_properties/hs_matrix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ The CSR format stores a sparse m × n matrix M in row form using three (one-dime
4545
- The arrays V and COL_INDEX are of length NNZ, and contain the non-zero values and the column indices of those values respectively.
4646
- The array ROW_INDEX is of length m + 1 and encodes the index in V and COL_INDEX where the given row starts. This is equivalent to ROW_INDEX[j] encoding the total number of nonzeros above row j. The last element is NNZ , i.e., the fictitious index in V immediately after the last valid index NNZ - 1.
4747

48-
For calculations involving ionic movements, the output frequency of the matrix is controlled by [out_interval](../input_files/input-main.md#out_interval) and [out_app_flag](../input_files/input-main.md#out_app_flag).
48+
For calculations involving ionic movements, the output frequency of the matrix is controlled by [out_freq_ion](../input_files/input-main.md#out_freq_ion) and [out_app_flag](../input_files/input-main.md#out_app_flag).
4949

5050
## get_s
5151
We also offer the option of only calculating the overlap matrix without running SCF. For that purpose, in `INPUT` file we need to set the value keyword [calculation](../input_files/input-main.md#calculation) to be `get_s`.

docs/advanced/elec_properties/position_matrix.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Each file or each section of the appended file starts with "STEP: " followed by
1818

1919
Each block here contains the matrix for the corresponding cell. There are three columns in each block, giving the matrix elements in x, y, z directions, respectively. There are altogether nbasis * nbasis lines in each block, which emulates the matrix elements.
2020

21-
In molecular dynamics (MD) calculations, if [out_app_flag](../input_files/input-main.md#out_app_flag) is set to true, then `data-rR-tr` is written in an append manner. Otherwise, output files will be put in a separate directory, `matrix`, and named as `$x`_data-rR-tr, where `$x` is the number of MD step. In addition, the output frequency is controlled by [out_interval](../input_files/input-main.md#out_interval). For example, if we are running a 10-step MD with out_interval = 3, then `$x` will be 0, 3, 6, and 9.
21+
In molecular dynamics (MD) calculations, if [out_app_flag](../input_files/input-main.md#out_app_flag) is set to true, then `data-rR-tr` is written in an append manner. Otherwise, output files will be put in a separate directory, `matrix`, and named as `$x`_data-rR-tr, where `$x` is the number of MD step. In addition, the output frequency is controlled by [out_freq_ion](../input_files/input-main.md#out_freq_ion). For example, if we are running a 10-step MD with out_freq_ion = 3, then `$x` will be 0, 3, 6, and 9.
2222

2323
## get_s
2424
We also offer the option of only calculating the position matrix without running SCF. For that purpose, in `INPUT` file we need to set the keyword [calculation](../input_files/input-main.md#calculation) to `get_s`, and [out_mat_r](../input_files/input-main.md#out_mat_r) to `true`.

0 commit comments

Comments
 (0)