Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,12 +337,23 @@ if (USE_DSP)
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_host.a)
endif()
if (USE_SW)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-mieee" ABACUS_CXX_SUPPORTS_MIEEE)
add_compile_definitions(__SW)
if(ABACUS_CXX_SUPPORTS_MIEEE)
add_compile_options(-mieee)
endif()
set(SW ON)
Comment thread
A-006 marked this conversation as resolved.
include_directories(${SW_MATH}/include)
include_directories(${SW_FFT}/include)

target_link_libraries(${ABACUS_BIN_NAME} ${SW_FFT}/lib/libfftw3.a)
list(APPEND math_libs
${SW_FFT}/lib/libfftw3.a
${SW_MATH}/libswfft.a
${SW_MATH}/libswscalapack.a
${SW_MATH}/libswlapack.a
${SW_MATH}/libswblas.a
gfortran)
endif()

find_package(Threads REQUIRED)
Expand Down Expand Up @@ -805,14 +816,6 @@ if(ENABLE_RAPIDJSON)
target_link_libraries(${ABACUS_BIN_NAME} json_output)
endif()

if (USE_SW)
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswfft.a)
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswscalapack.a)
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswlapack.a)
target_link_libraries(${ABACUS_BIN_NAME} ${SW_MATH}/libswblas.a)
list(APPEND math_libs gfortran)
endif()

list(APPEND math_libs m)
target_link_libraries(${ABACUS_BIN_NAME} ${math_libs})

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
AddTest(
TARGET MODULE_BASE_container_kernels_uts
LIBS parameter ${math_libs}
LIBS parameter container base device ${math_libs}
SOURCES blas_test.cpp lapack_test.cpp
memory_test.cpp linalg_test.cpp
)

target_link_libraries(MODULE_BASE_container_kernels_uts container base device)
6 changes: 6 additions & 0 deletions source/source_base/truncated_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ inline void truncated_underflow(FPTYPE& x)
}
}

template <typename FPTYPE>
inline void truncated_underflow(const FPTYPE& x)
{
truncated_underflow(const_cast<FPTYPE&>(x));
Comment thread
A-006 marked this conversation as resolved.
}

template <>
inline void truncated_underflow(double& x)
{
Expand Down
38 changes: 19 additions & 19 deletions source/source_hsolver/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,44 +5,44 @@ remove_definitions(-D__EXX)
if (ENABLE_MPI)
AddTest(
TARGET MODULE_HSOLVER_parak2d_test
LIBS parameter ${math_libs} base device MPI::MPI_CXX
LIBS parameter base device MPI::MPI_CXX ${math_libs}
SOURCES parallel_k2d_test.cpp ../parallel_k2d.cpp ../../source_cell/parallel_kpoints.cpp
)
AddTest(
TARGET MODULE_HSOLVER_bpcg
LIBS parameter ${math_libs} base psi device container
LIBS parameter base psi device container ${math_libs}
SOURCES diago_bpcg_test.cpp ../diago_bpcg.cpp ../para_linear_transform.cpp ../diago_iter_assist.cpp
Comment thread
A-006 marked this conversation as resolved.
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
../../source_pw/module_pwdft/op_pw.cpp
)
AddTest(
TARGET MODULE_HSOLVER_cg
LIBS parameter ${math_libs} base psi device container
LIBS parameter base psi device container ${math_libs}
SOURCES diago_cg_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
../../source_pw/module_pwdft/op_pw.cpp
)
AddTest(
TARGET MODULE_HSOLVER_cg_float
LIBS parameter ${math_libs} base psi device container
LIBS parameter base psi device container ${math_libs}
SOURCES diago_cg_float_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
../../source_pw/module_pwdft/op_pw.cpp
)
AddTest(
TARGET MODULE_HSOLVER_dav
LIBS parameter ${math_libs} base psi device
LIBS parameter base psi device ${math_libs}
SOURCES diago_david_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
../../source_pw/module_pwdft/op_pw.cpp
)
AddTest(
TARGET MODULE_HSOLVER_dav_float
LIBS parameter ${math_libs} base psi device
LIBS parameter base psi device ${math_libs}
SOURCES diago_david_float_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
Expand All @@ -51,15 +51,15 @@ if (ENABLE_MPI)
if(ENABLE_LCAO)
AddTest(
TARGET MODULE_HSOLVER_cg_real
LIBS parameter ${math_libs} base psi device container
LIBS parameter base psi device container ${math_libs}
SOURCES diago_cg_float_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
../../source_pw/module_pwdft/op_pw.cpp
)
AddTest(
TARGET MODULE_HSOLVER_dav_real
LIBS parameter ${math_libs} base psi device
LIBS parameter base psi device ${math_libs}
SOURCES diago_david_real_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp
../../source_basis/module_pw/test/test_tool.cpp
../../source_hamilt/operator.cpp
Expand All @@ -69,20 +69,20 @@ if (ENABLE_MPI)

AddTest(
TARGET MODULE_HSOLVER_base
LIBS parameter ${math_libs} psi device base
LIBS parameter psi device base ${math_libs}
SOURCES test_hsolver.cpp
)

AddTest(
TARGET MODULE_HSOLVER_pw
LIBS parameter ${math_libs} psi device base container
LIBS parameter psi device base container ${math_libs}
SOURCES test_hsolver_pw.cpp ../hsolver_pw.cpp ../hsolver_lcaopw.cpp ../diago_bpcg.cpp ../diago_dav_subspace.cpp ../diag_const_nums.cpp ../diago_iter_assist.cpp ../para_linear_transform.cpp
../../source_estate/elecstate_tools.cpp ../../source_estate/occupy.cpp ../../source_base/module_fft/fft_bundle.cpp ../../source_base/module_fft/fft_cpu.cpp
)

AddTest(
TARGET MODULE_HSOLVER_sdft
LIBS parameter ${math_libs} psi device base container
LIBS parameter psi device base container ${math_libs}
SOURCES test_hsolver_sdft.cpp ../hsolver_pw_sdft.cpp ../hsolver_pw.cpp ../diago_bpcg.cpp ../diago_dav_subspace.cpp ../diag_const_nums.cpp ../diago_iter_assist.cpp ../para_linear_transform.cpp
../../source_estate/elecstate_tools.cpp ../../source_estate/occupy.cpp ../../source_base/module_fft/fft_bundle.cpp ../../source_base/module_fft/fft_cpu.cpp
)
Expand All @@ -91,29 +91,29 @@ if (ENABLE_MPI)
if(USE_ELPA)
AddTest(
TARGET MODULE_HSOLVER_LCAO
LIBS parameter ${math_libs} ELPA::ELPA base genelpa psi device
LIBS parameter base genelpa psi device ELPA::ELPA ${math_libs}
SOURCES diago_lcao_test.cpp ../diago_elpa.cpp ../diago_scalapack.cpp ../diago_lapack.cpp
)
else()
AddTest(
TARGET MODULE_HSOLVER_LCAO
LIBS parameter ${math_libs} base psi device
LIBS parameter base psi device ${math_libs}
SOURCES diago_lcao_test.cpp ../diago_scalapack.cpp ../diago_lapack.cpp
)
endif()

if (ENABLE_PEXSI)
AddTest(
TARGET MODULE_HSOLVER_LCAO_PEXSI
LIBS parameter ${math_libs} ${PEXSI_LIBRARY} ${SuperLU_DIST_LIBRARY} ${ParMETIS_LIBRARY} ${METIS_LIBRARY} MPI::MPI_CXX base psi device pexsi
LIBS parameter base psi device pexsi MPI::MPI_CXX ${PEXSI_LIBRARY} ${SuperLU_DIST_LIBRARY} ${ParMETIS_LIBRARY} ${METIS_LIBRARY} ${math_libs}
SOURCES diago_pexsi_test.cpp ../diago_pexsi.cpp ../../source_basis/module_ao/parallel_orbitals.cpp
)
endif()
endif()
if (USE_CUDA)
AddTest(
TARGET MODULE_HSOLVER_LCAO_cusolver
LIBS parameter ${math_libs} base psi device
LIBS parameter base psi device ${math_libs}
SOURCES diago_lcao_cusolver_test.cpp ../diago_cusolver.cpp ../diago_scalapack.cpp
../kernels/hegvd_op.cpp
../kernels/cuda/diag_cusolver.cu
Expand Down Expand Up @@ -149,20 +149,20 @@ install(FILES parallel_k2d_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
if (USE_ELPA)
AddTest(
TARGET MODULE_HSOLVER_diago_hs_parallel
LIBS parameter ${math_libs} ELPA::ELPA base device MPI::MPI_CXX genelpa psi
LIBS parameter base device MPI::MPI_CXX genelpa psi ELPA::ELPA ${math_libs}
SOURCES test_diago_hs_para.cpp ../diag_hs_para.cpp ../diago_pxxxgvx.cpp ../diago_elpa.cpp ../diago_scalapack.cpp
)
else()
AddTest(
TARGET MODULE_HSOLVER_diago_hs_parallel
LIBS parameter ${math_libs} base device MPI::MPI_CXX psi
LIBS parameter base device MPI::MPI_CXX psi ${math_libs}
SOURCES test_diago_hs_para.cpp ../diag_hs_para.cpp ../diago_pxxxgvx.cpp ../diago_scalapack.cpp
)
endif()

AddTest(
TARGET MODULE_HSOLVER_linear_trans
LIBS parameter ${math_libs} base device MPI::MPI_CXX
LIBS parameter base device MPI::MPI_CXX ${math_libs}
SOURCES test_para_linear_trans.cpp ../para_linear_transform.cpp
)

Expand Down Expand Up @@ -197,4 +197,4 @@ if (ENABLE_MPI)
)
endif()
endif()
endif()
endif()
11 changes: 5 additions & 6 deletions source/source_lcao/module_rt/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,30 @@ target_link_libraries(tddft_test_lib Threads::Threads GTest::gtest_main GTest::g

AddTest(
TARGET MODULE_LCAO_tddft_middle_hamilt_test
LIBS parameter ${math_libs} base device tddft_test_lib
LIBS parameter base device tddft_test_lib ${math_libs}
SOURCES middle_hamilt_test.cpp ../middle_hamilt.cpp
)

AddTest(
TARGET MODULE_LCAO_tddft_band_energy_test
LIBS parameter ${math_libs} base device tddft_test_lib
LIBS parameter base device tddft_test_lib ${math_libs}
SOURCES band_energy_test.cpp ../band_energy.cpp ../../../source_basis/module_ao/parallel_orbitals.cpp
)

AddTest(
TARGET MODULE_LCAO_tddft_norm_psi_test
LIBS parameter ${math_libs} base device tddft_test_lib
LIBS parameter base device tddft_test_lib ${math_libs}
SOURCES norm_psi_test.cpp ../norm_psi.cpp
)

AddTest(
TARGET MODULE_LCAO_tddft_upsi_test
LIBS parameter ${math_libs} base device tddft_test_lib
LIBS parameter base device tddft_test_lib ${math_libs}
SOURCES upsi_test1.cpp upsi_test2.cpp upsi_test3.cpp ../upsi.cpp
)

AddTest(
TARGET MODULE_LCAO_tddft_propagator_test
LIBS parameter ${math_libs} base device tddft_test_lib
LIBS parameter base device tddft_test_lib ${math_libs}
SOURCES propagator_test1.cpp propagator_test2.cpp propagator_test3.cpp ../propagator.cpp ../propagator_cn2.cpp ../propagator_taylor.cpp ../propagator_etrs.cpp
)

Loading