Skip to content

Commit e4b8117

Browse files
authored
Merge branch 'develop' into homework-fix
2 parents 93d993f + 7d641c1 commit e4b8117

File tree

343 files changed

+12280
-3547
lines changed

Some content is hidden

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

343 files changed

+12280
-3547
lines changed

.github/workflows/ase_plugin_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v4
15+
uses: actions/checkout@v6
1616

1717
- name: Set up Miniconda
1818
uses: conda-incubator/setup-miniconda@v3

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777

7878
use_oidc: true
7979
- name: Upload Coverage Report Artifact
80-
uses: actions/upload-artifact@v6
80+
uses: actions/upload-artifact@v7
8181
if: always()
8282
with:
8383
name: coverage-report

.github/workflows/devcontainer.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
- name: Docker meta
3030
id: meta
31-
uses: docker/metadata-action@v5
31+
uses: docker/metadata-action@v6
3232
with:
3333
images: |
3434
ghcr.io/deepmodeling/abacus-${{ matrix.dockerfile }}
@@ -43,25 +43,25 @@ jobs:
4343
sudo chown -R $USER:$USER /home/runner/.docker
4444
4545
- name: Setup Docker Buildx
46-
uses: docker/setup-buildx-action@v3
46+
uses: docker/setup-buildx-action@v4
4747

4848
- name: Login to GitHub Container Registry
49-
uses: docker/login-action@v3
49+
uses: docker/login-action@v4
5050
with:
5151
registry: ghcr.io
5252
username: ${{ github.actor }}
5353
password: ${{ secrets.GITHUB_TOKEN }}
5454

5555
- name: Login to Aliyun Registry
56-
uses: docker/login-action@v3
56+
uses: docker/login-action@v4
5757
with:
5858
registry: dp-harbor-registry.us-east-1.cr.aliyuncs.com
5959
# AliCloud automatically mirrors to registry.dp.tech
6060
username: ${{ secrets.DP_HARBOR_USERNAME }}
6161
password: ${{ secrets.DP_HARBOR_PASSWORD }}
6262

6363
- name: Build and Push Container
64-
uses: docker/build-push-action@v6
64+
uses: docker/build-push-action@v7
6565
with:
6666
tags: ${{ steps.meta.outputs.tags }}
6767
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/dynamic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cd tests/integrate
2525
bash Autotest.sh -n 2 -s true
2626
- name: Publish Report to Dashboard
27-
uses: crazy-max/ghaction-github-pages@v4
27+
uses: crazy-max/ghaction-github-pages@v5
2828
if: ${{ ! cancelled() }}
2929
with:
3030
target_branch: dashboard

CMakeLists.txt

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ endif()
189189
# Use DSP hardware
190190
if (USE_DSP)
191191
set(USE_ELPA OFF)
192-
set(ENABLE_LCAO OFF)
193192
set(ABACUS_BIN_NAME abacus_dsp)
194193
endif()
195194

@@ -450,10 +449,28 @@ if(USE_CUDA)
450449
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xcompiler=${OpenMP_CXX_FLAGS}" CACHE STRING "CUDA flags" FORCE)
451450
endif()
452451
if (ENABLE_CUSOLVERMP)
453-
# Keep cuSolverMp discovery/linking logic in a dedicated module.
452+
# Keep cuSOLVERMp discovery/linking logic in a dedicated module.
454453
include(cmake/SetupCuSolverMp.cmake)
455454
abacus_setup_cusolvermp(${ABACUS_BIN_NAME})
456455
endif()
456+
if (ENABLE_CUBLASMP)
457+
# Enforcement 1: cuBLASMp requires cuSOLVERMp to be enabled
458+
if (NOT ENABLE_CUSOLVERMP)
459+
message(FATAL_ERROR
460+
"ENABLE_CUBLASMP is set to ON, but ENABLE_CUSOLVERMP is OFF."
461+
"In ABACUS, cuBLASMp support requires cuSOLVERMp to be enabled simultaneously."
462+
"Please set -DENABLE_CUSOLVERMP=ON.")
463+
endif()
464+
# Enforcement 2: cuBLASMp 0.8.0+ is incompatible with CAL backend
465+
# Note: _use_cal is defined inside abacus_setup_cusolvermp
466+
if (_use_cal)
467+
message(FATAL_ERROR
468+
"cuBLASMp 0.8.0+ requires NCCL Symmetric Memory, but cuSOLVERMp is using CAL backend."
469+
"Please upgrade cuSOLVERMp to >= 0.7.0 to use NCCL for both.")
470+
endif()
471+
include(cmake/SetupCuBlasMp.cmake)
472+
abacus_setup_cublasmp(${ABACUS_BIN_NAME})
473+
endif()
457474
endif()
458475
endif()
459476

cmake/SetupCuBlasMp.cmake

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# =============================================================================
2+
# Configure cuBLASMp dependencies and linking for ABACUS
3+
# =============================================================================
4+
5+
include_guard(GLOBAL)
6+
7+
function(abacus_setup_cublasmp target_name)
8+
add_compile_definitions(__CUBLASMP)
9+
10+
# 1. Search for cuBLASMp library and header files
11+
# libcublasmp.so
12+
find_library(CUBLASMP_LIBRARY NAMES cublasmp
13+
HINTS ${CUBLASMP_PATH} ${NVHPC_ROOT_DIR}
14+
PATH_SUFFIXES lib lib64 math_libs/lib math_libs/lib64)
15+
16+
# cublasmp.h
17+
find_path(CUBLASMP_INCLUDE_DIR NAMES cublasmp.h
18+
HINTS ${CUBLASMP_PATH} ${NVHPC_ROOT_DIR}
19+
PATH_SUFFIXES include math_libs/include)
20+
21+
if(NOT CUBLASMP_LIBRARY OR NOT CUBLASMP_INCLUDE_DIR)
22+
message(FATAL_ERROR
23+
"cuBLASMp not found. Please ensure CUBLASMP_PATH is set correctly."
24+
)
25+
endif()
26+
27+
message(STATUS "Found cuBLASMp: ${CUBLASMP_LIBRARY}")
28+
29+
# 2. Version validation by parsing header macros
30+
set(CUBLASMP_VERSION_STR "")
31+
set(CUBLASMP_VERSION_HEADER "${CUBLASMP_INCLUDE_DIR}/cublasmp.h")
32+
33+
if(EXISTS "${CUBLASMP_VERSION_HEADER}")
34+
# Extract version lines using regular expressions from cublasmp.h
35+
file(STRINGS "${CUBLASMP_VERSION_HEADER}" CUBLASMP_MAJOR_LINE
36+
REGEX "^#define[ \t]+CUBLASMP_VER_MAJOR[ \t]+[0-9]+")
37+
file(STRINGS "${CUBLASMP_VERSION_HEADER}" CUBLASMP_MINOR_LINE
38+
REGEX "^#define[ \t]+CUBLASMP_VER_MINOR[ \t]+[0-9]+")
39+
file(STRINGS "${CUBLASMP_VERSION_HEADER}" CUBLASMP_PATCH_LINE
40+
REGEX "^#define[ \t]+CUBLASMP_VER_PATCH[ \t]+[0-9]+")
41+
42+
# Extract numeric values from the matched strings
43+
string(REGEX MATCH "([0-9]+)" CUBLASMP_VER_MAJOR "${CUBLASMP_MAJOR_LINE}")
44+
string(REGEX MATCH "([0-9]+)" CUBLASMP_VER_MINOR "${CUBLASMP_MINOR_LINE}")
45+
string(REGEX MATCH "([0-9]+)" CUBLASMP_VER_PATCH "${CUBLASMP_PATCH_LINE}")
46+
47+
if(NOT CUBLASMP_VER_MAJOR STREQUAL ""
48+
AND NOT CUBLASMP_VER_MINOR STREQUAL ""
49+
AND NOT CUBLASMP_VER_PATCH STREQUAL "")
50+
set(CUBLASMP_VERSION_STR
51+
"${CUBLASMP_VER_MAJOR}.${CUBLASMP_VER_MINOR}.${CUBLASMP_VER_PATCH}")
52+
endif()
53+
endif()
54+
55+
message(STATUS "Detected cuBLASMp version: ${CUBLASMP_VERSION_STR}")
56+
57+
# 3. Version constraint: ABACUS requires cuBLASMp >= 0.8.0
58+
if(CUBLASMP_VERSION_STR AND CUBLASMP_VERSION_STR VERSION_LESS "0.8.0")
59+
message(FATAL_ERROR
60+
"cuBLASMp version ${CUBLASMP_VERSION_STR} is too old. "
61+
"ABACUS requires cuBLASMp >= 0.8.0 for NCCL Symmetric Memory support."
62+
)
63+
elseif(NOT CUBLASMP_VERSION_STR)
64+
message(WARNING "Could not detect cuBLASMp version. Proceeding cautiously.")
65+
endif()
66+
67+
# 4. Create cublasMp::cublasMp imported target
68+
if(NOT TARGET cublasMp::cublasMp)
69+
add_library(cublasMp::cublasMp IMPORTED INTERFACE)
70+
set_target_properties(cublasMp::cublasMp PROPERTIES
71+
INTERFACE_LINK_LIBRARIES "${CUBLASMP_LIBRARY};NCCL::NCCL"
72+
INTERFACE_INCLUDE_DIRECTORIES "${CUBLASMP_INCLUDE_DIR}")
73+
endif()
74+
75+
# 5. Link the library to the target
76+
target_link_libraries(${target_name} cublasMp::cublasMp)
77+
78+
endfunction()

cmake/SetupCuSolverMp.cmake

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# =============================================================================
2-
# Configure cuSolverMp dependencies and linking for ABACUS
2+
# Configure cuSOLVERMp dependencies and linking for ABACUS
33
# =============================================================================
44

55
include_guard(GLOBAL)
66

77
function(abacus_setup_cusolvermp target_name)
88
add_compile_definitions(__CUSOLVERMP)
99

10-
# Find cuSolverMp first, then decide communicator backend.
10+
# Find cuSOLVERMp first, then decide communicator backend.
1111
find_library(CUSOLVERMP_LIBRARY NAMES cusolverMp
1212
HINTS ${CAL_CUSOLVERMP_PATH} ${NVHPC_ROOT_DIR}
1313
PATH_SUFFIXES lib lib64 math_libs/lib math_libs/lib64)
@@ -18,11 +18,11 @@ function(abacus_setup_cusolvermp target_name)
1818

1919
if(NOT CUSOLVERMP_LIBRARY OR NOT CUSOLVERMP_INCLUDE_DIR)
2020
message(FATAL_ERROR
21-
"cusolverMp not found. Set CUSOLVERMP_PATH or NVHPC_ROOT_DIR."
21+
"cuSOLVERMp not found. Set CUSOLVERMP_PATH or NVHPC_ROOT_DIR."
2222
)
2323
endif()
2424

25-
message(STATUS "Found cusolverMp: ${CUSOLVERMP_LIBRARY}")
25+
message(STATUS "Found cuSOLVERMp: ${CUSOLVERMP_LIBRARY}")
2626

2727
set(CUSOLVERMP_VERSION_STR "")
2828
set(CUSOLVERMP_VERSION_HEADER "${CUSOLVERMP_INCLUDE_DIR}/cusolverMp.h")
@@ -47,27 +47,30 @@ function(abacus_setup_cusolvermp target_name)
4747
# Check minimum version requirement (>= 0.4.0)
4848
if(CUSOLVERMP_VERSION_STR AND CUSOLVERMP_VERSION_STR VERSION_LESS "0.4.0")
4949
message(FATAL_ERROR
50-
"cuSolverMp version ${CUSOLVERMP_VERSION_STR} is too old. "
51-
"ABACUS requires cuSolverMp >= 0.4.0 (NVIDIA HPC SDK >= 23.5). "
50+
"cuSOLVERMp version ${CUSOLVERMP_VERSION_STR} is too old. "
51+
"ABACUS requires cuSOLVERMp >= 0.4.0 (NVIDIA HPC SDK >= 23.5). "
5252
"Please upgrade your NVIDIA HPC SDK installation."
5353
)
5454
endif()
5555

56-
# Auto-select communicator backend by cuSolverMp version.
57-
# cuSolverMp < 0.7.0 -> CAL, otherwise -> NCCL.
56+
# Auto-select communicator backend by cuSOLVERMp version.
57+
# cuSOLVERMp < 0.7.0 -> CAL, otherwise -> NCCL.
5858
set(_use_cal OFF)
5959
if(CUSOLVERMP_VERSION_STR AND CUSOLVERMP_VERSION_STR VERSION_LESS "0.7.0")
6060
set(_use_cal ON)
6161
message(STATUS
62-
"Detected cuSolverMp ${CUSOLVERMP_VERSION_STR} (< 0.7.0). Using CAL backend.")
62+
"Detected cuSOLVERMp ${CUSOLVERMP_VERSION_STR} (< 0.7.0). Using CAL backend.")
6363
elseif(CUSOLVERMP_VERSION_STR)
6464
message(STATUS
65-
"Detected cuSolverMp ${CUSOLVERMP_VERSION_STR} (>= 0.7.0). Using NCCL backend.")
65+
"Detected cuSOLVERMp ${CUSOLVERMP_VERSION_STR} (>= 0.7.0). Using NCCL backend.")
6666
elseif(NOT CUSOLVERMP_VERSION_STR)
6767
message(WARNING
68-
"Unable to detect cuSolverMp version from header. Using NCCL backend by default.")
68+
"Unable to detect cuSOLVERMp version from header. Using NCCL backend by default.")
6969
endif()
7070

71+
# Raise the variable to the caller's scope
72+
set(_use_cal ${_use_cal} PARENT_SCOPE)
73+
7174
# Backend selection:
7275
# - _use_cal=ON -> cal communicator backend
7376
# - _use_cal=OFF -> NCCL communicator backend

docs/advanced/input_files/input-main.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,8 @@
301301
- [exx\_pca\_threshold](#exx_pca_threshold)
302302
- [exx\_c\_threshold](#exx_c_threshold)
303303
- [exx\_cs\_inv\_thr](#exx_cs_inv_thr)
304+
- [shrink\_abfs\_pca\_thr](#shrink_abfs_pca_thr)
305+
- [shrink\_lu\_inv\_thr](#shrink_lu_inv_thr)
304306
- [exx\_v\_threshold](#exx_v_threshold)
305307
- [exx\_dm\_threshold](#exx_dm_threshold)
306308
- [exx\_c\_grad\_threshold](#exx_c_grad_threshold)
@@ -316,6 +318,10 @@
316318
- [rpa\_ccp\_rmesh\_times](#rpa_ccp_rmesh_times)
317319
- [exx\_symmetry\_realspace](#exx_symmetry_realspace)
318320
- [out\_ri\_cv](#out_ri_cv)
321+
- [out\_unshrinked\_v](#out_unshrinked_v)
322+
- [exx\_coul\_moment](#exx_coul_moment)
323+
- [exx\_rotate\_abfs](#exx_rotate_abfs)
324+
- [exx\_multip\_moments\_threshold](#exx_multip_moments_threshold)
319325
- [Exact Exchange (PW)](#exact-exchange-pw)
320326
- [exxace](#exxace)
321327
- [exx\_gamma\_extrapolation](#exx_gamma_extrapolation)
@@ -2945,6 +2951,18 @@
29452951
- **Description**: By default, the Coulomb matrix inversion required for obtaining LRI coefficients is performed using LU decomposition. However, this approach may suffer from numerical instabilities when a large set of auxiliary basis functions (ABFs) is employed. When exx_cs_inv_thr &gt; 0, the inversion is instead carried out via matrix diagonalization. Eigenvalues smaller than exx_cs_inv_thr are discarded to improve numerical stability. A relatively safe and commonly recommended value is 1e-5.
29462952
- **Default**: -1
29472953

2954+
### shrink_abfs_pca_thr
2955+
2956+
- **Type**: Real
2957+
- **Description**: Threshold to shrink the auxiliary basis for GW/RPA calculations.
2958+
- **Default**: -1
2959+
2960+
### shrink_lu_inv_thr
2961+
2962+
- **Type**: Real
2963+
- **Description**: Threshold for obtaining the inverse of the overlap matrix by LU decomposition in the auxiliary-basis representation.
2964+
- **Default**: 1e-6
2965+
29482966
### exx_v_threshold
29492967

29502968
- **Type**: Real
@@ -3042,6 +3060,30 @@
30423060
- **Description**: Whether to output the coefficient tensor C(R) and ABFs-representation Coulomb matrix V(R) for each atom pair and cell in real space.
30433061
- **Default**: false
30443062

3063+
### out_unshrinked_v
3064+
3065+
- **Type**: Boolean
3066+
- **Description**: Whether to output the large Vq matrix in the unshrinked auxiliary basis.
3067+
- **Default**: false
3068+
3069+
### exx_coul_moment
3070+
3071+
- **Type**: Boolean
3072+
- **Description**: Whether to use the moment method for Coulomb calculation.
3073+
- **Default**: false
3074+
3075+
### exx_rotate_abfs
3076+
3077+
- **Type**: Boolean
3078+
- **Description**: Whether to rotate the auxiliary basis for Coulomb calculation.
3079+
- **Default**: false
3080+
3081+
### exx_multip_moments_threshold
3082+
3083+
- **Type**: Real
3084+
- **Description**: Threshold to screen multipole moments in Coulomb calculation.
3085+
- **Default**: 1e-10
3086+
30453087
[back to top](#full-list-of-input-keywords)
30463088

30473089
## Exact Exchange (PW)

docs/advanced/output_files/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Detailed Introduction of the Output Files
55
.. toctree::
66
:maxdepth: 1
77

8+
output-specification
89
running_scf.log
910

0 commit comments

Comments
 (0)