Skip to content

Commit 0d9b549

Browse files
authored
Merge branch 'develop' into refactor
2 parents 75e1952 + d749424 commit 0d9b549

File tree

86 files changed

+4941
-1613
lines changed

Some content is hidden

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

86 files changed

+4941
-1613
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ time.json
2121
*.pyc
2222
__pycache__
2323
abacus.json
24-
*.npy
24+
*.npy
25+
toolchain/install/
26+
toolchain/abacus_env.sh

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,9 +352,19 @@ if(USE_CUDA)
352352
endif()
353353
if (ENABLE_CUSOLVERMP)
354354
add_compile_definitions(__CUSOLVERMP)
355+
find_library(CAL_LIBRARY
356+
NAMES cal
357+
PATHS ${CAL_CUSOLVERMP_PATH}
358+
NO_DEFAULT_PATH
359+
)
360+
find_library(CUSOLVERMP_LIBRARY
361+
NAMES cusolverMp
362+
PATHS ${CAL_CUSOLVERMP_PATH}
363+
NO_DEFAULT_PATH
364+
)
355365
target_link_libraries(${ABACUS_BIN_NAME}
356-
cal
357-
cusolverMp
366+
${CAL_LIBRARY}
367+
${CUSOLVERMP_LIBRARY}
358368
)
359369
endif()
360370
endif()

docs/quick_start/easy_install.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Here, 'build' is the path for building ABACUS; and '-D' is used for setting up s
106106
- `CMAKE_INSTALL_PREFIX`: the path of ABACUS binary to install; `/usr/local/bin/abacus` by default
107107
- Compilers
108108
- `CMAKE_CXX_COMPILER`: C++ compiler; usually `g++`(GNU C++ compiler) or `icpx`(Intel C++ compiler). Can also set from environment variable `CXX`. It is OK to use MPI compiler here.
109-
- `MPI_CXX_COMPILER`: MPI wrapper for C++ compiler; usually `mpicxx` or `mpiicpc`(for Intel MPI).
109+
- `MPI_CXX_COMPILER`: MPI wrapper for C++ compiler; usually `mpicxx` or `mpiicpx`(for Intel toolkits) or `mpiicpc`(for classic Intel Compiler Classic MPI before 2024.0).
110110
- Requirements: Unless indicated, CMake will try to find under default paths.
111111
- `MKLROOT`: If environment variable `MKLROOT` exists, `cmake` will take MKL as a preference, i.e. not using `LAPACK`, `ScaLAPACK` and `FFTW`. To disable MKL, unset environment variable `MKLROOT`, or pass `-DMKLROOT=OFF` to `cmake`.
112112
- `LAPACK_DIR`: Path to OpenBLAS library `libopenblas.so`(including BLAS and LAPACK)
@@ -136,7 +136,7 @@ Here, 'build' is the path for building ABACUS; and '-D' is used for setting up s
136136
Here is an example:
137137

138138
```bash
139-
CXX=mpiicpc cmake -B build -DCMAKE_INSTALL_PREFIX=~/abacus -DELPA_DIR=~/elpa-2016.05.004/build -DCEREAL_INCLUDE_DIR=~/cereal/include
139+
CXX=mpiicpx cmake -B build -DCMAKE_INSTALL_PREFIX=~/abacus -DELPA_DIR=~/elpa-2025.01.001/build -DCEREAL_INCLUDE_DIR=~/cereal/include
140140
```
141141

142142
## Build and Install

source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ if(USE_ROCM)
104104
module_hamilt_pw/hamilt_pwdft/kernels/rocm/wf_op.hip.cu
105105
module_hamilt_pw/hamilt_pwdft/kernels/rocm/vnl_op.hip.cu
106106
module_base/kernels/rocm/math_kernel_op.hip.cu
107-
module_base/kernels/rocm/math_kernel_op.hip_vec.cu
107+
module_base/kernels/rocm/math_kernel_op_vec.hip.cu
108108
module_base/kernels/rocm/math_ylm_op.hip.cu
109109
module_hamilt_general/module_xc/kernels/rocm/xc_functional_op.hip.cu
110110
)

source/Makefile.Objects

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,10 @@ OBJS_RELAXATION=bfgs_basic.o\
443443
lattice_change_methods.o\
444444
relax_old.o\
445445
relax.o\
446-
line_search.o\
447446
bfgs.o\
447+
lbfgs.o\
448+
matrix_methods.o\
449+
line_search.o\
448450

449451

450452
OBJS_SURCHEM=surchem.o\

source/module_base/blas_connector.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ void vector_add_vector(const int& dim, float *result, const float *vector1, cons
820820
}
821821
else if (device_type == base_device::GpuDevice){
822822
#ifdef __CUDA
823-
ModuleBase::constantvector_addORsub_constantVector_op<float, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
823+
ModuleBase::vector_add_vector_op<float, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
824824
#endif
825825
}
826826
}
@@ -838,7 +838,7 @@ void vector_add_vector(const int& dim, double *result, const double *vector1, co
838838
}
839839
else if (device_type == base_device::GpuDevice){
840840
#ifdef __CUDA
841-
ModuleBase::constantvector_addORsub_constantVector_op<double, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
841+
ModuleBase::vector_add_vector_op<double, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
842842
#endif
843843
}
844844
}
@@ -856,7 +856,7 @@ void vector_add_vector(const int& dim, std::complex<float> *result, const std::c
856856
}
857857
else if (device_type == base_device::GpuDevice){
858858
#ifdef __CUDA
859-
ModuleBase::constantvector_addORsub_constantVector_op<std::complex<float>, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
859+
ModuleBase::vector_add_vector_op<std::complex<float>, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
860860
#endif
861861
}
862862
}
@@ -874,7 +874,7 @@ void vector_add_vector(const int& dim, std::complex<double> *result, const std::
874874
}
875875
else if (device_type == base_device::GpuDevice){
876876
#ifdef __CUDA
877-
ModuleBase::constantvector_addORsub_constantVector_op<std::complex<double>, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
877+
ModuleBase::vector_add_vector_op<std::complex<double>, base_device::DEVICE_GPU>()(dim, result, vector1, constant1, vector2, constant2);
878878
#endif
879879
}
880880
}

source/module_base/kernels/cuda/math_kernel_op_vec.cu

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void vector_div_vector_op<std::complex<double>, base_device::DEVICE_GPU>::operat
225225

226226
// vector operator: result[i] = vector1[i] * constant1 + vector2[i] * constant2
227227
template <typename T>
228-
void constantvector_addORsub_constantVector_op<T, base_device::DEVICE_GPU>::operator()(const int& dim,
228+
void vector_add_vector_op<T, base_device::DEVICE_GPU>::operator()(const int& dim,
229229
T* result,
230230
const T* vector1,
231231
const Real constant1,
@@ -314,10 +314,10 @@ template struct vector_div_vector_op<std::complex<float>, base_device::DEVICE_GP
314314
template struct vector_div_vector_op<double, base_device::DEVICE_GPU>;
315315
template struct vector_div_vector_op<std::complex<double>, base_device::DEVICE_GPU>;
316316

317-
template struct constantvector_addORsub_constantVector_op<float, base_device::DEVICE_GPU>;
318-
template struct constantvector_addORsub_constantVector_op<std::complex<float>, base_device::DEVICE_GPU>;
319-
template struct constantvector_addORsub_constantVector_op<double, base_device::DEVICE_GPU>;
320-
template struct constantvector_addORsub_constantVector_op<std::complex<double>, base_device::DEVICE_GPU>;
317+
template struct vector_add_vector_op<float, base_device::DEVICE_GPU>;
318+
template struct vector_add_vector_op<std::complex<float>, base_device::DEVICE_GPU>;
319+
template struct vector_add_vector_op<double, base_device::DEVICE_GPU>;
320+
template struct vector_add_vector_op<std::complex<double>, base_device::DEVICE_GPU>;
321321

322322
template struct dot_real_op<std::complex<float>, base_device::DEVICE_GPU>;
323323
template struct dot_real_op<double, base_device::DEVICE_GPU>;

source/module_base/kernels/math_kernel_op.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ template <typename T, typename Device> struct axpy_op {
134134

135135
// vector operator: result[i] = vector1[i] * constant1 + vector2[i] * constant2
136136
template <typename T, typename Device>
137-
struct constantvector_addORsub_constantVector_op {
137+
struct vector_add_vector_op {
138138
using Real = typename GetTypeReal<T>::type;
139139
/// @brief result[i] = vector1[i] * constant1 + vector2[i] * constant2
140140
///
@@ -315,7 +315,7 @@ template <typename T> struct vector_div_vector_op<T, base_device::DEVICE_GPU> {
315315

316316
// vector operator: result[i] = vector1[i] * constant1 + vector2[i] * constant2
317317
template <typename T>
318-
struct constantvector_addORsub_constantVector_op<T, base_device::DEVICE_GPU> {
318+
struct vector_add_vector_op<T, base_device::DEVICE_GPU> {
319319
using Real = typename GetTypeReal<T>::type;
320320
void operator()(const int &dim, T *result,
321321
const T *vector1, const Real constant1, const T *vector2,

source/module_base/kernels/math_kernel_op_vec.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct axpy_op<T, base_device::DEVICE_CPU>
9292

9393

9494
template <typename T>
95-
struct constantvector_addORsub_constantVector_op<T, base_device::DEVICE_CPU>
95+
struct vector_add_vector_op<T, base_device::DEVICE_CPU>
9696
{
9797
using Real = typename GetTypeReal<T>::type;
9898
void operator()(const int& dim,
@@ -167,9 +167,9 @@ template struct axpy_op<std::complex<float>, base_device::DEVICE_CPU>;
167167
template struct axpy_op<std::complex<double>, base_device::DEVICE_CPU>;
168168
template struct axpy_op<double, base_device::DEVICE_CPU>;
169169

170-
template struct constantvector_addORsub_constantVector_op<std::complex<float>, base_device::DEVICE_CPU>;
171-
template struct constantvector_addORsub_constantVector_op<double, base_device::DEVICE_CPU>;
172-
template struct constantvector_addORsub_constantVector_op<std::complex<double>, base_device::DEVICE_CPU>;
170+
template struct vector_add_vector_op<std::complex<float>, base_device::DEVICE_CPU>;
171+
template struct vector_add_vector_op<double, base_device::DEVICE_CPU>;
172+
template struct vector_add_vector_op<std::complex<double>, base_device::DEVICE_CPU>;
173173

174174
template struct dot_real_op<std::complex<float>, base_device::DEVICE_CPU>;
175175
template struct dot_real_op<std::complex<double>, base_device::DEVICE_CPU>;

source/module_base/kernels/rocm/math_kernel_op_vec.hip.cu

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void vector_mul_real_op<double, base_device::DEVICE_GPU>::operator()(const int d
8787
{
8888
int thread = 1024;
8989
int block = (dim + thread - 1) / thread;
90-
hipLaunchKernelGGL(HIP_KERNEL_NAME(vector_div_constant_kernel<double>),
90+
hipLaunchKernelGGL(HIP_KERNEL_NAME(vector_mul_real_kernel<double>),
9191
dim3(block),
9292
dim3(thread),
9393
0,
@@ -275,7 +275,7 @@ void vector_div_vector_op<std::complex<double>, base_device::DEVICE_GPU>::operat
275275

276276
// vector operator: result[i] = vector1[i] * constant1 + vector2[i] * constant2
277277
template <typename T>
278-
void constantvector_addORsub_constantVector_op<T, base_device::DEVICE_GPU>::operator()(const int& dim,
278+
void vector_add_vector_op<T, base_device::DEVICE_GPU>::operator()(const int& dim,
279279
T* result,
280280
const T* vector1,
281281
const Real constant1,
@@ -365,10 +365,10 @@ template struct vector_div_vector_op<std::complex<float>, base_device::DEVICE_GP
365365
template struct vector_div_vector_op<double, base_device::DEVICE_GPU>;
366366
template struct vector_div_vector_op<std::complex<double>, base_device::DEVICE_GPU>;
367367

368-
template struct constantvector_addORsub_constantVector_op<float, base_device::DEVICE_GPU>;
369-
template struct constantvector_addORsub_constantVector_op<std::complex<float>, base_device::DEVICE_GPU>;
370-
template struct constantvector_addORsub_constantVector_op<double, base_device::DEVICE_GPU>;
371-
template struct constantvector_addORsub_constantVector_op<std::complex<double>, base_device::DEVICE_GPU>;
368+
template struct vector_add_vector_op<float, base_device::DEVICE_GPU>;
369+
template struct vector_add_vector_op<std::complex<float>, base_device::DEVICE_GPU>;
370+
template struct vector_add_vector_op<double, base_device::DEVICE_GPU>;
371+
template struct vector_add_vector_op<std::complex<double>, base_device::DEVICE_GPU>;
372372

373373
template struct dot_real_op<std::complex<float>, base_device::DEVICE_GPU>;
374374
template struct dot_real_op<double, base_device::DEVICE_GPU>;

0 commit comments

Comments
 (0)