Skip to content

Commit ce2108e

Browse files
author
Kai Luo
committed
Merge branch 'develop' into rdmft-egrad, still with conflicts in blas/lapack
2 parents e1f3d90 + 1a49431 commit ce2108e

File tree

502 files changed

+22277
-54281
lines changed

Some content is hidden

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

502 files changed

+22277
-54281
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'"

CMakeLists.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ if (USE_SW)
290290
set(SW ON)
291291
include_directories(${SW_MATH}/include)
292292
include_directories(${SW_FFT}/include)
293-
293+
294294
target_link_libraries(${ABACUS_BIN_NAME} ${SW_FFT}/lib/libfftw3.a)
295295
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswfft.a)
296296
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswscalapack.a)
@@ -376,6 +376,7 @@ if(USE_CUDA)
376376
if(USE_CUDA)
377377
add_compile_definitions(__CUDA)
378378
add_compile_definitions(__UT_USE_CUDA)
379+
target_compile_definitions(${ABACUS_BIN_NAME} PRIVATE __USE_NVTX)
379380
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
380381
set(CMAKE_CUDA_FLAGS_DEBUG "${CMAKE_CUDA_FLAGS_DEBUG} -g -G" CACHE STRING "CUDA flags for debug build" FORCE)
381382
endif()
@@ -482,9 +483,13 @@ else()
482483
find_package(FFTW3 REQUIRED)
483484
find_package(Lapack REQUIRED)
484485
include_directories(${FFTW3_INCLUDE_DIRS})
485-
list(APPEND math_libs FFTW3::FFTW3 LAPACKE::LAPACKE LAPACK::LAPACK BLAS::BLAS)
486+
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
487+
if(USE_DSP)
488+
target_link_libraries(${ABACUS_BIN_NAME} ${SCALAPACK_LIBRARY_DIR})
489+
else()
486490
find_package(ScaLAPACK REQUIRED)
487491
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
492+
endif()
488493
if(USE_OPENMP)
489494
list(APPEND math_libs FFTW3::FFTW3_OMP)
490495
endif()
@@ -523,7 +528,7 @@ if(ENABLE_MLALGO)
523528
include_directories(${libnpy_INCLUDE_DIR})
524529
endif()
525530
include_directories(${libnpy_SOURCE_DIR}/include)
526-
531+
527532
add_compile_definitions(__MLALGO)
528533
endif()
529534

@@ -563,7 +568,7 @@ if (ENABLE_CNPY)
563568
include_directories(${cnpy_INCLUDE_DIR})
564569
endif()
565570
include_directories(${cnpy_SOURCE_DIR})
566-
571+
567572
# find ZLIB and link
568573
find_package(ZLIB REQUIRED)
569574
target_link_libraries(${ABACUS_BIN_NAME} cnpy ZLIB::ZLIB)
@@ -652,6 +657,15 @@ if(DEFINED DeePMD_DIR)
652657
endif()
653658
endif()
654659

660+
if(DEFINED NEP_DIR)
661+
find_package(NEP REQUIRED)
662+
663+
if(NEP_FOUND)
664+
add_compile_definitions(__NEP)
665+
target_link_libraries(${ABACUS_BIN_NAME} NEP::nep)
666+
endif()
667+
endif()
668+
655669
if(DEFINED TensorFlow_DIR)
656670
find_package(TensorFlow REQUIRED)
657671
include_directories(${TensorFlow_DIR}/include)

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)