Skip to content

Commit cc375d7

Browse files
authored
Merge branch 'develop' into addlbfgs
2 parents c6b8458 + f93b3a9 commit cc375d7

File tree

1,279 files changed

+52250
-31511
lines changed

Some content is hidden

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

1,279 files changed

+52250
-31511
lines changed

.github/workflows/build_test_cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
name: "Build with Intel toolchain"
1818

1919
- tag: gnu
20-
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
20+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
2121
name: "Build extra components with GNU toolchain"
2222
- tag: intel
23-
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_LIBRI=1"
23+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"
2424
name: "Build extra components with Intel toolchain"
2525

2626
- tag: cuda

.github/workflows/coverage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Install Requirements for Coverage Testing
1717
run: |
18-
apt update && apt install -y lcov gpg
18+
apt update && apt install -y lcov gpg curl jq ca-certificates
1919
- name: Building
2020
run: |
2121
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
@@ -27,8 +27,10 @@ jobs:
2727
run: |
2828
cmake --build build --target test ARGS="-V --timeout 21600" || exit 0
2929
- name: Upload Coverage to Codecov
30-
uses: codecov/codecov-action@v4
30+
uses: codecov/codecov-action@v5
3131
if: ${{ ! cancelled() }}
3232
with:
33-
gcov: true
33+
fail_ci_if_error: true
3434
token: ${{ secrets.CODECOV_TOKEN }}
35+
skip_validation: true
36+
verbose: true

.github/workflows/test.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ jobs:
3131
3232
- name: Configure
3333
run: |
34-
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1
34+
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_MLKEDF=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1
3535
36-
- uses: pre-commit/[email protected]
37-
with:
38-
extra_args:
39-
--from-ref ${{ github.event.pull_request.base.sha }}
40-
--to-ref ${{ github.event.pull_request.head.sha }}
41-
continue-on-error: true
42-
- uses: pre-commit-ci/[email protected]
36+
# Temporarily removed because no one maintains this now.
37+
# And it will break the CI test workflow.
38+
39+
# - uses: pre-commit/[email protected]
40+
# with:
41+
# extra_args:
42+
# --from-ref ${{ github.event.pull_request.base.sha }}
43+
# --to-ref ${{ github.event.pull_request.head.sha }}
44+
# continue-on-error: true
45+
# - uses: pre-commit-ci/[email protected]
4346

4447
- name: Build
4548
run: |

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ time.json
2222
*.pyc
2323
__pycache__
2424
abacus.json
25-
*.npy
25+
*.npy

CMakeLists.txt

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project(
1212

1313
option(ENABLE_LCAO "Enable LCAO calculation." ON)
1414
option(ENABLE_DEEPKS "Enable DeePKS functionality" OFF)
15+
option(ENABLE_MLKEDF "Enable Machine Learning based KEDF for OFDFT" OFF)
1516
option(ENABLE_LIBXC "Enable LibXC functionality" OFF)
1617
option(USE_CUDA "Enable support to CUDA for ABACUS." OFF)
1718
option(ENABLE_FLOAT_FFTW "Enable support to single precision FFTW library." OFF)
@@ -41,6 +42,7 @@ option(ENABLE_PEXSI "Enable support for PEXSI." OFF)
4142
option(ENABLE_CUSOLVERMP "Enable cusolvermp." OFF)
4243
option(USE_DSP "Enable DSP usage." OFF)
4344
option(USE_CUDA_ON_DCU "Enable CUDA on DCU" OFF)
45+
option(USE_CUDA_MPI "Enable CUDA-aware MPI" OFF)
4446

4547
# enable json support
4648
if(ENABLE_RAPIDJSON)
@@ -131,6 +133,10 @@ if (USE_CUDA_ON_DCU)
131133
add_compile_definitions(__CUDA_ON_DCU)
132134
endif()
133135

136+
if (USE_CUDA_MPI)
137+
add_compile_definitions(__CUDA_MPI)
138+
endif()
139+
134140
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
135141

136142
if(ENABLE_COVERAGE)
@@ -235,6 +241,9 @@ if(ENABLE_LCAO)
235241
add_compile_definitions(__PEXSI)
236242
set(CMAKE_CXX_STANDARD 14)
237243
endif()
244+
if(NEW_GINT)
245+
add_compile_definitions(__NEW_GINT)
246+
endif()
238247
else()
239248
set(ENABLE_DEEPKS OFF)
240249
set(ENABLE_LIBRI OFF)
@@ -253,8 +262,12 @@ if(ENABLE_MPI)
253262
endif()
254263

255264
if (USE_DSP)
256-
target_link_libraries(${ABACUS_BIN_NAME} ${DIR_MTBLAS_LIBRARY})
257265
add_compile_definitions(__DSP)
266+
target_link_libraries(${ABACUS_BIN_NAME} ${OMPI_LIBRARY1})
267+
include_directories(${MTBLAS_FFT_DIR}/libmtblas/include)
268+
include_directories(${MT_HOST_DIR}/include)
269+
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_device.a)
270+
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_host.a)
258271
endif()
259272

260273
find_package(Threads REQUIRED)
@@ -425,10 +438,8 @@ else()
425438
find_package(Lapack REQUIRED)
426439
include_directories(${FFTW3_INCLUDE_DIRS})
427440
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
428-
429441
find_package(ScaLAPACK REQUIRED)
430442
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
431-
432443
if(USE_OPENMP)
433444
list(APPEND math_libs FFTW3::FFTW3_OMP)
434445
endif()
@@ -469,10 +480,29 @@ if(ENABLE_DEEPKS)
469480
add_compile_definitions(__DEEPKS)
470481
endif()
471482

483+
if(ENABLE_MLKEDF)
484+
target_link_libraries(${ABACUS_BIN_NAME} hamilt_mlkedf)
485+
486+
find_path(libnpy_SOURCE_DIR npy.hpp HINTS ${libnpy_INCLUDE_DIR})
487+
if(NOT libnpy_SOURCE_DIR)
488+
include(FetchContent)
489+
FetchContent_Declare(
490+
libnpy
491+
GIT_REPOSITORY https://github.com/llohse/libnpy.git
492+
GIT_SHALLOW TRUE
493+
GIT_PROGRESS TRUE)
494+
FetchContent_MakeAvailable(libnpy)
495+
else()
496+
include_directories(${libnpy_INCLUDE_DIR})
497+
endif()
498+
include_directories(${libnpy_SOURCE_DIR}/include)
499+
add_compile_definitions(__MLKEDF)
500+
endif()
501+
472502
# Torch uses outdated components to detect CUDA arch, causing failure on
473503
# latest CUDA kits. Set CMake variable TORCH_CUDA_ARCH_LIST in the form of
474504
# "major.minor" if required.
475-
if(ENABLE_DEEPKS OR DEFINED Torch_DIR)
505+
if(ENABLE_DEEPKS OR ENABLE_MLKEDF OR DEFINED Torch_DIR)
476506
find_package(Torch REQUIRED)
477507
if(NOT Torch_VERSION VERSION_LESS "2.1.0")
478508
set_if_higher(CMAKE_CXX_STANDARD 17)

cmake/FindMKL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ endif()
8383
endif() # MKL::MKL
8484

8585
# For compatibility with legacy libpaw_interface CMakeLists.txt
86-
if(TARGET MKL::MKL)
86+
if(TARGET MKL::MKL AND NOT TARGET IntelMKL::MKL)
8787
add_library(IntelMKL::MKL ALIAS MKL::MKL)
8888
endif()
8989

docs/CITATIONS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,9 @@ The following references are required to be cited when using ABACUS. Specificall
3333
Peize Lin, Xinguo Ren, and Lixin He. "Efficient Hybrid Density Functional Calculations for Large Periodic Systems Using Numerical Atomic Orbitals." Journal of Chemical Theory and Computation 2021, 17(1), 222–239.
3434

3535
Peize Lin, Xinguo Ren, and Lixin He. "Accuracy of Localized Resolution of the Identity in Periodic Hybrid Functional Calculations with Numerical Atomic Orbitals." Journal of Physical Chemistry Letters 2020, 11, 3082-3088.
36+
37+
- **If ML-KEDF is used:**
38+
39+
Sun, Liang, and Mohan Chen. "Machine learning based nonlocal kinetic energy density functional for simple metals and alloys." Physical Review B 109.11 (2024): 115135.
40+
41+
Sun, Liang, and Mohan Chen. "Multi-channel machine learning based nonlocal kinetic energy density functional for semiconductors." Electronic Structure 6.4 (2024): 045006.

0 commit comments

Comments
 (0)