diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8225aba614..6fec0e7e2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -132,10 +132,31 @@ jobs: OMP_NUM_THREADS: '2' run: | cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_BASE" + + - name: Module IO Unit Test + env: + GTEST_COLOR: 'yes' + OMP_NUM_THREADS: '2' + run: | + cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_IO" + + - name: Module HSolver Unit Test + env: + GTEST_COLOR: 'yes' + OMP_NUM_THREADS: '2' + run: | + cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_HSOLVER" + + - name: Module Cell Unit Test + env: + GTEST_COLOR: 'yes' + OMP_NUM_THREADS: '2' + run: | + cmake --build build --target test ARGS="-V --timeout 1700 -R MODULE_CELL" - - name: Unit Test + - name: Other Unit Tests env: GTEST_COLOR: 'yes' OMP_NUM_THREADS: '2' run: | - 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|16_SDFT_GPU'" + 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'" diff --git a/source/module_base/test_parallel/CMakeLists.txt b/source/module_base/test_parallel/CMakeLists.txt index 52f467690a..bf4ed79bbc 100644 --- a/source/module_base/test_parallel/CMakeLists.txt +++ b/source/module_base/test_parallel/CMakeLists.txt @@ -1,17 +1,17 @@ AddTest( - TARGET base_ParaCommon + TARGET MODULE_BASE_ParaCommon LIBS parameter MPI::MPI_CXX SOURCES parallel_common_test.cpp ../global_variable.cpp ../parallel_common.cpp ) AddTest( - TARGET base_ParaGlobal + TARGET MODULE_BASE_ParaGlobal LIBS parameter MPI::MPI_CXX SOURCES parallel_global_test.cpp ../global_variable.cpp ../parallel_global.cpp ../parallel_comm.cpp ) AddTest( - TARGET base_ParaReduce + TARGET MODULE_BASE_ParaReduce LIBS parameter MPI::MPI_CXX SOURCES parallel_reduce_test.cpp ../global_variable.cpp ../parallel_global.cpp ../parallel_comm.cpp ../parallel_common.cpp ../parallel_reduce.cpp ) @@ -21,45 +21,45 @@ install(FILES parallel_global_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES parallel_reduce_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) find_program(BASH bash) -add_test(NAME base_parallel_common_test +add_test(NAME MODULE_BASE_parallel_common_test COMMAND ${BASH} parallel_common_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -add_test(NAME base_parallel_global_test +add_test(NAME MODULE_BASE_parallel_global_test COMMAND ${BASH} parallel_global_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -add_test(NAME base_parallel_reduce_test +add_test(NAME MODULE_BASE_parallel_reduce_test COMMAND ${BASH} parallel_reduce_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET base_para_gemm + TARGET MODULE_BASE_para_gemm LIBS MPI::MPI_CXX ${math_libs} base device parameter SOURCES test_para_gemm.cpp ) AddTest( - TARGET base_math_chebyshev_mpi + TARGET MODULE_BASE_math_chebyshev_mpi LIBS MPI::MPI_CXX parameter ${math_libs} base device container SOURCES math_chebyshev_mpi_test.cpp ) -add_test(NAME base_para_gemm_parallel - COMMAND mpirun -np 4 ./base_para_gemm +add_test(NAME MODULE_BASE_para_gemm_parallel + COMMAND mpirun -np 4 ./MODULE_BASE_para_gemm WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET parallel_2d_test + TARGET MODULE_BASE_parallel_2d_test SOURCES parallel_2d_test.cpp ../parallel_2d.cpp LIBS parameter ${math_libs} ) install(FILES parallel_2d_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) find_program(BASH bash) -add_test(NAME parallel_2d_test_para +add_test(NAME MODULE_BASE_parallel_2d_test_para COMMAND ${BASH} parallel_2d_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) @@ -73,12 +73,12 @@ add_test(NAME parallel_2d_test_para endif() AddTest( - TARGET blacs_connector + TARGET MODULE_BASE_blacs_connector LIBS parameter MPI::MPI_CXX ${BLACS_LIB} SOURCES blacs_connector_test.cpp ) install(FILES blacs_connector_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) - add_test(NAME blacs_connector_test + add_test(NAME MODULE_BASE_blacs_connector_test COMMAND ${BASH} blacs_connector_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/source/module_base/test_parallel/blacs_connector_test.sh b/source/module_base/test_parallel/blacs_connector_test.sh index 4824588fe2..cbf6e13ca0 100644 --- a/source/module_base/test_parallel/blacs_connector_test.sh +++ b/source/module_base/test_parallel/blacs_connector_test.sh @@ -9,7 +9,7 @@ do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./blacs_connector + mpirun -np $i ./MODULE_BASE_blacs_connector if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_base/test_parallel/parallel_2d_test.sh b/source/module_base/test_parallel/parallel_2d_test.sh index 79e6a3040c..47aadc867e 100755 --- a/source/module_base/test_parallel/parallel_2d_test.sh +++ b/source/module_base/test_parallel/parallel_2d_test.sh @@ -8,7 +8,7 @@ for i in 2 3 4; do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./parallel_2d_test + mpirun -np $i ./MODULE_BASE_parallel_2d_test if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_base/test_parallel/parallel_common_test.sh b/source/module_base/test_parallel/parallel_common_test.sh index 760849f0f5..9adbcb1f95 100755 --- a/source/module_base/test_parallel/parallel_common_test.sh +++ b/source/module_base/test_parallel/parallel_common_test.sh @@ -8,7 +8,7 @@ for i in 3;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./base_ParaCommon + mpirun -np $i ./MODULE_BASE_ParaCommon if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_base/test_parallel/parallel_global_test.sh b/source/module_base/test_parallel/parallel_global_test.sh index 7130c88395..37024e3cb8 100755 --- a/source/module_base/test_parallel/parallel_global_test.sh +++ b/source/module_base/test_parallel/parallel_global_test.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./base_ParaGlobal + mpirun -np $i ./MODULE_BASE_ParaGlobal if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_base/test_parallel/parallel_reduce_test.sh b/source/module_base/test_parallel/parallel_reduce_test.sh index 3dbfe543f7..ec2b46a583 100755 --- a/source/module_base/test_parallel/parallel_reduce_test.sh +++ b/source/module_base/test_parallel/parallel_reduce_test.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./base_ParaReduce + mpirun -np $i ./MODULE_BASE_ParaReduce if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_cell/test/CMakeLists.txt b/source/module_cell/test/CMakeLists.txt index 4762c8fb3d..870b71edf6 100644 --- a/source/module_cell/test/CMakeLists.txt +++ b/source/module_cell/test/CMakeLists.txt @@ -39,52 +39,52 @@ list(APPEND cell_simple_srcs add_library(cell_info OBJECT ${cell_simple_srcs}) AddTest( - TARGET cell_read_pp + TARGET MODULE_CELL_read_pp LIBS parameter ${math_libs} base device SOURCES read_pp_test.cpp ../atom_pseudo.cpp ../pseudo.cpp ../read_pp.cpp ../read_pp_complete.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp ../read_pp_vwr.cpp ../read_pp_blps.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_pseudo_nc + TARGET MODULE_CELL_pseudo_nc LIBS parameter ${math_libs} base device SOURCES pseudo_nc_test.cpp ../pseudo.cpp ../atom_pseudo.cpp ../read_pp.cpp ../read_pp_complete.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp ../read_pp_vwr.cpp ../read_pp_blps.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_atom_pseudo + TARGET MODULE_CELL_atom_pseudo LIBS parameter ${math_libs} base device SOURCES atom_pseudo_test.cpp ../atom_pseudo.cpp ../pseudo.cpp ../read_pp.cpp ../read_pp_complete.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp ../read_pp_vwr.cpp ../read_pp_blps.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_atom_spec + TARGET MODULE_CELL_atom_spec LIBS parameter ${math_libs} base device SOURCES atom_spec_test.cpp ../atom_spec.cpp ../atom_pseudo.cpp ../pseudo.cpp ../read_pp.cpp ../read_pp_complete.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp ../read_pp_vwr.cpp ../read_pp_blps.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_klist_test + TARGET MODULE_CELL_klist_test LIBS parameter ${math_libs} base device symmetry SOURCES klist_test.cpp ../klist.cpp ../parallel_kpoints.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_klist_test_para1 + TARGET MODULE_CELL_klist_test_para1 LIBS parameter ${math_libs} base device symmetry SOURCES klist_test_para.cpp ../klist.cpp ../parallel_kpoints.cpp ../../module_io/output.cpp ) -add_test(NAME cell_klist_test_para4 +add_test(NAME MODULE_CELL_klist_test_para4 COMMAND ${BASH} klist_test_para.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET cell_ParaKpoints + TARGET MODULE_CELL_ParaKpoints LIBS parameter MPI::MPI_CXX SOURCES parallel_kpoints_test.cpp ../../module_base/global_variable.cpp ../../module_base/parallel_global.cpp ../../module_base/parallel_common.cpp ../../module_base/parallel_comm.cpp ../parallel_kpoints.cpp @@ -92,53 +92,53 @@ AddTest( find_program(BASH bash) -add_test(NAME cell_bcast_atom_pseudo_test +add_test(NAME MODULE_CELL_bcast_atom_pseudo_test COMMAND ${BASH} bcast_atom_pseudo_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -add_test(NAME cell_bcast_atom_spec_test +add_test(NAME MODULE_CELL_bcast_atom_spec_test COMMAND ${BASH} bcast_atom_spec_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) -add_test(NAME cell_parallel_kpoints_test +add_test(NAME MODULE_CELL_parallel_kpoints_test COMMAND ${BASH} parallel_kpoints_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET cell_unitcell_test + TARGET MODULE_CELL_unitcell_test LIBS parameter ${math_libs} base device cell_info symmetry SOURCES unitcell_test.cpp ../../module_io/output.cpp ../../module_elecstate/cal_ux.cpp ) AddTest( - TARGET cell_unitcell_test_readpp + TARGET MODULE_CELL_unitcell_test_readpp LIBS parameter ${math_libs} base device cell_info SOURCES unitcell_test_readpp.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_unitcell_test_para + TARGET MODULE_CELL_unitcell_test_para LIBS parameter ${math_libs} base device cell_info SOURCES unitcell_test_para.cpp ../../module_io/output.cpp ) AddTest( - TARGET cell_unitcell_test_setupcell + TARGET MODULE_CELL_unitcell_test_setupcell LIBS parameter ${math_libs} base device cell_info SOURCES unitcell_test_setupcell.cpp ../../module_io/output.cpp ) -add_test(NAME cell_unitcell_test_parallel +add_test(NAME MODULE_CELL_unitcell_test_parallel COMMAND ${BASH} unitcell_test_parallel.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET cell_index_test + TARGET MODULE_CELL_index_test LIBS parameter ${math_libs} base device SOURCES cell_index_test.cpp ../cell_index.cpp ) diff --git a/source/module_cell/test/bcast_atom_pseudo_test.sh b/source/module_cell/test/bcast_atom_pseudo_test.sh index 1330838228..708e011e76 100755 --- a/source/module_cell/test/bcast_atom_pseudo_test.sh +++ b/source/module_cell/test/bcast_atom_pseudo_test.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./cell_atom_pseudo + mpirun -np $i ./MODULE_CELL_atom_pseudo if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_cell/test/bcast_atom_spec_test.sh b/source/module_cell/test/bcast_atom_spec_test.sh index 98a6f94a40..11bb8b5037 100755 --- a/source/module_cell/test/bcast_atom_spec_test.sh +++ b/source/module_cell/test/bcast_atom_spec_test.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./cell_atom_spec + mpirun -np $i ./MODULE_CELL_atom_spec if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_cell/test/klist_test_para.sh b/source/module_cell/test/klist_test_para.sh index 08a32c3da7..e14d46d5c2 100755 --- a/source/module_cell/test/klist_test_para.sh +++ b/source/module_cell/test/klist_test_para.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./cell_klist_test_para1 + mpirun -np $i ./MODULE_CELL_klist_test_para1 if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_cell/test/parallel_kpoints_test.sh b/source/module_cell/test/parallel_kpoints_test.sh index daa5ca3d56..d539990f12 100755 --- a/source/module_cell/test/parallel_kpoints_test.sh +++ b/source/module_cell/test/parallel_kpoints_test.sh @@ -9,7 +9,7 @@ do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./cell_ParaKpoints + mpirun -np $i ./MODULE_CELL_ParaKpoints if [ $? -ne 0 ]; then echo "TEST in parallel, nprocs=$i failed" exit 1 diff --git a/source/module_cell/test/unitcell_test_parallel.sh b/source/module_cell/test/unitcell_test_parallel.sh index dbdc453bdb..d10b2dc5d3 100755 --- a/source/module_cell/test/unitcell_test_parallel.sh +++ b/source/module_cell/test/unitcell_test_parallel.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./cell_unitcell_test_para + mpirun -np $i ./MODULE_CELL_unitcell_test_para if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_cell/test_pw/CMakeLists.txt b/source/module_cell/test_pw/CMakeLists.txt index 1fd37bb31d..7c135bb5c9 100644 --- a/source/module_cell/test_pw/CMakeLists.txt +++ b/source/module_cell/test_pw/CMakeLists.txt @@ -9,7 +9,7 @@ install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES unitcell_test_pw_para.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) AddTest( - TARGET cell_unitcell_test_pw + TARGET MODULE_CELL_unitcell_test_pw LIBS parameter ${math_libs} base device SOURCES unitcell_test_pw.cpp ../unitcell.cpp ../read_atoms.cpp ../atom_spec.cpp ../update_cell.cpp ../bcast_cell.cpp ../atom_pseudo.cpp ../pseudo.cpp ../read_pp.cpp ../read_pp_complete.cpp ../read_pp_upf201.cpp ../read_pp_upf100.cpp @@ -21,7 +21,7 @@ AddTest( ) find_program(BASH bash) -add_test(NAME cell_unitcell_test_pw_para +add_test(NAME MODULE_CELL_unitcell_test_pw_para COMMAND ${BASH} unitcell_test_pw_para.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/source/module_cell/test_pw/unitcell_test_pw_para.sh b/source/module_cell/test_pw/unitcell_test_pw_para.sh index 57d7647b66..df0ec614df 100755 --- a/source/module_cell/test_pw/unitcell_test_pw_para.sh +++ b/source/module_cell/test_pw/unitcell_test_pw_para.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./cell_unitcell_test_pw + mpirun -np $i ./MODULE_CELL_unitcell_test_pw if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_hsolver/test/CMakeLists.txt b/source/module_hsolver/test/CMakeLists.txt index 3150eab9b8..f77241bbb2 100644 --- a/source/module_hsolver/test/CMakeLists.txt +++ b/source/module_hsolver/test/CMakeLists.txt @@ -5,12 +5,12 @@ remove_definitions(-D__EXX) if (ENABLE_MPI) AddTest( - TARGET hsolver_parak2d_test + TARGET MODULE_HSOLVER_parak2d_test LIBS parameter ${math_libs} base device MPI::MPI_CXX SOURCES parallel_k2d_test.cpp ../parallel_k2d.cpp ../../module_cell/parallel_kpoints.cpp ) AddTest( - TARGET HSolver_bpcg + TARGET MODULE_HSOLVER_bpcg LIBS parameter ${math_libs} base psi device container SOURCES diago_bpcg_test.cpp ../diago_bpcg.cpp ../para_linear_transform.cpp ../diago_iter_assist.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -18,7 +18,7 @@ if (ENABLE_MPI) ../../module_hamilt_pw/hamilt_pwdft/operator_pw/operator_pw.cpp ) AddTest( - TARGET HSolver_cg + TARGET MODULE_HSOLVER_cg LIBS parameter ${math_libs} base psi device container SOURCES diago_cg_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -26,7 +26,7 @@ if (ENABLE_MPI) ../../module_hamilt_pw/hamilt_pwdft/operator_pw/operator_pw.cpp ) AddTest( - TARGET HSolver_cg_float + TARGET MODULE_HSOLVER_cg_float LIBS parameter ${math_libs} base psi device container SOURCES diago_cg_float_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -34,7 +34,7 @@ if (ENABLE_MPI) ../../module_hamilt_pw/hamilt_pwdft/operator_pw/operator_pw.cpp ) AddTest( - TARGET HSolver_dav + TARGET MODULE_HSOLVER_dav LIBS parameter ${math_libs} base psi device SOURCES diago_david_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -42,7 +42,7 @@ if (ENABLE_MPI) ../../module_hamilt_pw/hamilt_pwdft/operator_pw/operator_pw.cpp ) AddTest( - TARGET HSolver_dav_float + TARGET MODULE_HSOLVER_dav_float LIBS parameter ${math_libs} base psi device SOURCES diago_david_float_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -51,7 +51,7 @@ if (ENABLE_MPI) ) if(ENABLE_LCAO) AddTest( - TARGET HSolver_cg_real + TARGET MODULE_HSOLVER_cg_real LIBS parameter ${math_libs} base psi device container SOURCES diago_cg_float_test.cpp ../diago_cg.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -59,7 +59,7 @@ if (ENABLE_MPI) ../../module_hamilt_pw/hamilt_pwdft/operator_pw/operator_pw.cpp ) AddTest( - TARGET HSolver_dav_real + TARGET MODULE_HSOLVER_dav_real LIBS parameter ${math_libs} base psi device SOURCES diago_david_real_test.cpp ../diago_david.cpp ../diago_iter_assist.cpp ../diag_const_nums.cpp ../../module_basis/module_pw/test/test_tool.cpp @@ -69,20 +69,20 @@ if (ENABLE_MPI) endif() AddTest( - TARGET HSolver_base + TARGET MODULE_HSOLVER_base LIBS parameter ${math_libs} psi device base SOURCES test_hsolver.cpp ) AddTest( - TARGET HSolver_pw + TARGET MODULE_HSOLVER_pw LIBS parameter ${math_libs} psi device base container 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 ../../module_elecstate/elecstate_tools.cpp ../../module_elecstate/occupy.cpp ) AddTest( - TARGET HSolver_sdft + TARGET MODULE_HSOLVER_sdft LIBS parameter ${math_libs} psi device base container 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 ../../module_elecstate/elecstate_tools.cpp ../../module_elecstate/occupy.cpp @@ -91,13 +91,13 @@ if (ENABLE_MPI) if(ENABLE_LCAO) if(USE_ELPA) AddTest( - TARGET HSolver_LCAO + TARGET MODULE_HSOLVER_LCAO LIBS parameter ${math_libs} ELPA::ELPA base genelpa psi device SOURCES diago_lcao_test.cpp ../diago_elpa.cpp ../diago_scalapack.cpp ) else() AddTest( - TARGET HSolver_LCAO + TARGET MODULE_HSOLVER_LCAO LIBS parameter ${math_libs} base psi device SOURCES diago_lcao_test.cpp ../diago_scalapack.cpp ) @@ -105,7 +105,7 @@ if (ENABLE_MPI) if (ENABLE_PEXSI) AddTest( - TARGET HSolver_LCAO_PEXSI + 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 SOURCES diago_pexsi_test.cpp ../diago_pexsi.cpp ../../module_basis/module_ao/parallel_orbitals.cpp ) @@ -113,7 +113,7 @@ if (ENABLE_MPI) endif() if (USE_CUDA) AddTest( - TARGET HSolver_LCAO_cusolver + TARGET MODULE_HSOLVER_LCAO_cusolver LIBS parameter ${math_libs} base psi device SOURCES diago_lcao_cusolver_test.cpp ../diago_cusolver.cpp ../diago_scalapack.cpp ../kernels/dngvd_op.cpp @@ -123,7 +123,7 @@ if (ENABLE_MPI) else() if(ENABLE_LCAO) AddTest( - TARGET HSolver_Lapack + TARGET MODULE_HSOLVER_Lapack LIBS parameter ${math_libs} base psi device SOURCES diago_lapack_test.cpp ../diago_lapack.cpp ) @@ -156,43 +156,43 @@ install(FILES parallel_k2d_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) AddTest( - TARGET hsolver_diago_hs_parallel + TARGET MODULE_HSOLVER_diago_hs_parallel LIBS parameter ${math_libs} ELPA::ELPA base device MPI::MPI_CXX genelpa psi SOURCES test_diago_hs_para.cpp ../diag_hs_para.cpp ../diago_pxxxgvx.cpp ../diago_elpa.cpp ../diago_scalapack.cpp ) AddTest( - TARGET hsolver_linear_trans + TARGET MODULE_HSOLVER_linear_trans LIBS parameter ${math_libs} base device MPI::MPI_CXX SOURCES test_para_linear_trans.cpp ../para_linear_transform.cpp ) -add_test(NAME hsolver_para_linear_trans - COMMAND mpirun -np 4 ./hsolver_linear_trans +add_test(NAME MODULE_HSOLVER_para_linear_trans + COMMAND mpirun -np 4 ./MODULE_HSOLVER_linear_trans WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) find_program(BASH bash) if (ENABLE_MPI) - add_test(NAME HSolver_cg_parallel + add_test(NAME MODULE_HSOLVER_cg_parallel COMMAND ${BASH} diago_cg_parallel_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - add_test(NAME hsolver_parak2d_test_parallel + add_test(NAME MODULE_HSOLVER_parak2d_test_parallel COMMAND ${BASH} parallel_k2d_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - add_test(NAME HSolver_dav_parallel + add_test(NAME MODULE_HSOLVER_dav_parallel COMMAND ${BASH} diago_david_parallel_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) if(ENABLE_LCAO) - add_test(NAME HSolver_LCAO_parallel + add_test(NAME MODULE_HSOLVER_LCAO_parallel COMMAND ${BASH} diago_lcao_parallel_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) if(ENABLE_PEXSI) - add_test(NAME HSolver_LCAO_PEXSI_parallel + add_test(NAME MODULE_HSOLVER_LCAO_PEXSI_parallel COMMAND ${BASH} diago_pexsi_parallel_test.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/source/module_hsolver/test/diago_cg_parallel_test.sh b/source/module_hsolver/test/diago_cg_parallel_test.sh index 95345f1160..6a4831b4b3 100644 --- a/source/module_hsolver/test/diago_cg_parallel_test.sh +++ b/source/module_hsolver/test/diago_cg_parallel_test.sh @@ -8,9 +8,9 @@ for i in 6 3 2;do continue fi echo "TEST DIAGO CG in parallel, nprocs=$i" - OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_cg + OMP_NUM_THREADS=1 mpirun -np $i ./MODULE_HSOLVER_cg e1=$? - OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_cg_float + OMP_NUM_THREADS=1 mpirun -np $i ./MODULE_HSOLVER_cg_float e2=$? if [[ e1 -ne 0 || e2 -ne 0 ]];then echo -e "\e[1;33m [ FAILED ] \e[0m"\ diff --git a/source/module_hsolver/test/diago_david_parallel_test.sh b/source/module_hsolver/test/diago_david_parallel_test.sh index 5f3bf0b430..4c476369e5 100644 --- a/source/module_hsolver/test/diago_david_parallel_test.sh +++ b/source/module_hsolver/test/diago_david_parallel_test.sh @@ -8,9 +8,9 @@ for i in 6 3 2;do continue fi echo "TEST DIAGO davidson in parallel, nprocs=$i" - OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_dav + OMP_NUM_THREADS=1 mpirun -np $i ./MODULE_HSOLVER_dav e1=$? - OMP_NUM_THREADS=1 mpirun -np $i ./HSolver_dav_float + OMP_NUM_THREADS=1 mpirun -np $i ./MODULE_HSOLVER_dav_float e2=$? if [[ e1 -ne 0 || e2 -ne 0 ]];then echo -e "\e[1;33m [ FAILED ] \e[0m"\ diff --git a/source/module_hsolver/test/diago_lcao_parallel_test.sh b/source/module_hsolver/test/diago_lcao_parallel_test.sh index 30cd96f43a..7ec89c28a4 100644 --- a/source/module_hsolver/test/diago_lcao_parallel_test.sh +++ b/source/module_hsolver/test/diago_lcao_parallel_test.sh @@ -8,9 +8,9 @@ for i in 6 3 2;do continue fi echo "TEST DIAGO davidson in parallel, nprocs=$i" - mpirun -np $i ./HSolver_LCAO - mpirun -np $i ./HSolver_dav_real - mpirun -np $i ./HSolver_cg_real + mpirun -np $i ./MODULE_HSOLVER_LCAO + mpirun -np $i ./MODULE_HSOLVER_dav_real + mpirun -np $i ./MODULE_HSOLVER_cg_real if [[ $? != 0 ]];then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_hsolver/test/diago_pexsi_parallel_test.sh b/source/module_hsolver/test/diago_pexsi_parallel_test.sh index 4767d690a2..34bdfc48c3 100644 --- a/source/module_hsolver/test/diago_pexsi_parallel_test.sh +++ b/source/module_hsolver/test/diago_pexsi_parallel_test.sh @@ -8,7 +8,7 @@ for i in 6 3 2;do continue fi echo "TEST DIAGO PEXSI in parallel, nprocs=$i" - mpirun -np $i ./HSolver_LCAO_PEXSI + mpirun -np $i ./MODULE_HSOLVER_LCAO_PEXSI if [[ $? != 0 ]];then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_hsolver/test/parallel_k2d_test.sh b/source/module_hsolver/test/parallel_k2d_test.sh index 8e6effe472..50996ce8ee 100755 --- a/source/module_hsolver/test/parallel_k2d_test.sh +++ b/source/module_hsolver/test/parallel_k2d_test.sh @@ -8,7 +8,7 @@ for i in 8;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./hsolver_parak2d_test + mpirun -np $i ./MODULE_HSOLVER_parak2d_test if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error." diff --git a/source/module_io/test/CMakeLists.txt b/source/module_io/test/CMakeLists.txt index 7e04ee5c99..a6211f3093 100644 --- a/source/module_io/test/CMakeLists.txt +++ b/source/module_io/test/CMakeLists.txt @@ -8,71 +8,71 @@ install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) install(FILES INPUTs DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) AddTest( - TARGET io_input_test_para + TARGET MODULE_IO_input_test_para LIBS parameter ${math_libs} base device io_input SOURCES read_input_ptest.cpp ) -add_test(NAME io_input_test_para_4 - COMMAND mpirun -np 4 ./io_input_test_para +add_test(NAME MODULE_IO_input_test_para_4 + COMMAND mpirun -np 4 ./MODULE_IO_input_test_para WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET read_exit_file_test + TARGET MODULE_IO_read_exit_file_test LIBS parameter ${math_libs} base device SOURCES read_exit_file_test.cpp ../read_exit_file.cpp ) -add_test(NAME read_exit_file_test_para_4 - COMMAND mpirun -np 4 ./read_exit_file_test +add_test(NAME MODULE_IO_read_exit_file_test_para_4 + COMMAND mpirun -np 4 ./MODULE_IO_read_exit_file_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET io_winput_test + TARGET MODULE_IO_winput_test LIBS parameter ${math_libs} base device SOURCES winput_test.cpp ../winput.cpp ) AddTest( - TARGET io_output_test + TARGET MODULE_IO_output_test LIBS parameter ${math_libs} base device SOURCES output_test.cpp ../output.cpp ) AddTest( - TARGET binstream_test + TARGET MODULE_IO_binstream_test SOURCES binstream_test.cpp ../binstream.cpp ) AddTest( - TARGET io_write_istate_info_test + TARGET MODULE_IO_write_istate_info_test LIBS parameter ${math_libs} base device symmetry SOURCES write_istate_info_test.cpp ../write_istate_info.cpp ../output.cpp ../../module_cell/parallel_kpoints.cpp ../../module_cell/klist.cpp ../cif_io.cpp ) AddTest( - TARGET io_cal_dos + TARGET MODULE_IO_cal_dos LIBS parameter ${math_libs} base device SOURCES cal_dos_test.cpp ../cal_dos.cpp ) AddTest( - TARGET io_write_dos_pw + TARGET MODULE_IO_write_dos_pw LIBS parameter ${math_libs} base device symmetry SOURCES write_dos_pw_test.cpp ../cal_dos.cpp ../write_dos_pw.cpp ../output.cpp ../../module_cell/parallel_kpoints.cpp ../../module_cell/klist.cpp ../nscf_fermi_surf.cpp ) AddTest( - TARGET io_print_info + TARGET MODULE_IO_print_info LIBS parameter ${math_libs} base device symmetry cell_info SOURCES print_info_test.cpp ../print_info.cpp ../output.cpp ../../module_cell/klist.cpp ../../module_cell/parallel_kpoints.cpp ) AddTest( - TARGET io_single_R_test + TARGET MODULE_IO_single_R_test LIBS parameter ${math_libs} SOURCES single_R_io_test.cpp ../single_R_io.cpp ../../module_base/global_variable.cpp @@ -83,68 +83,68 @@ AddTest( ) AddTest( - TARGET io_write_wfc_nao + TARGET MODULE_IO_write_wfc_nao LIBS parameter ${math_libs} base psi device SOURCES write_wfc_nao_test.cpp ../write_wfc_nao.cpp ../../module_basis/module_ao/parallel_orbitals.cpp ../binstream.cpp ) install(FILES write_wfc_nao_para.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) find_program(BASH bash) -add_test(NAME io_write_wfc_nao_para +add_test(NAME MODULE_IO_write_wfc_nao_para COMMAND ${BASH} write_wfc_nao_para.sh WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET io_write_orb_info + TARGET MODULE_IO_write_orb_info LIBS parameter ${math_libs} base device cell_info SOURCES write_orb_info_test.cpp ../write_orb_info.cpp ../output.cpp ) AddTest( - TARGET io_parse_args + TARGET MODULE_IO_parse_args SOURCES parse_args_test.cpp ../parse_args.cpp ) AddTest( - TARGET io_bessel_basis_test + TARGET MODULE_IO_bessel_basis_test LIBS parameter ${math_libs} base device SOURCES bessel_basis_test.cpp ../bessel_basis.cpp ) AddTest( - TARGET io_output_log_test + TARGET MODULE_IO_output_log_test LIBS parameter base ${math_libs} device SOURCES ../output_log.cpp outputlog_test.cpp ../../module_basis/module_pw/test/test_tool.cpp ) AddTest( - TARGET io_sparse_matrix_test + TARGET MODULE_IO_sparse_matrix_test LIBS parameter base ${math_libs} device SOURCES sparse_matrix_test.cpp ../sparse_matrix.cpp ) AddTest( - TARGET io_file_reader_test + TARGET MODULE_IO_file_reader_test LIBS parameter base ${math_libs} device SOURCES file_reader_test.cpp ../file_reader.cpp ) AddTest( - TARGET io_csr_reader_test + TARGET MODULE_IO_csr_reader_test LIBS parameter base ${math_libs} device SOURCES csr_reader_test.cpp ../csr_reader.cpp ../file_reader.cpp ../sparse_matrix.cpp ) AddTest( - TARGET read_rhog_test + TARGET MODULE_IO_read_rhog_test LIBS parameter ${math_libs} base device planewave SOURCES read_rhog_test.cpp ../rhog_io.cpp ../binstream.cpp ../../module_basis/module_pw/test/test_tool.cpp ) if(ENABLE_LCAO) AddTest( - TARGET to_qo_test + TARGET MODULE_IO_to_qo_test LIBS parameter base ${math_libs} device numerical_atomic_orbitals container orb SOURCES to_qo_test.cpp @@ -160,31 +160,31 @@ AddTest( endif() AddTest( - TARGET read_wfc_pw_test + TARGET MODULE_IO_read_wfc_pw_test LIBS parameter base ${math_libs} device planewave SOURCES read_wfc_pw_test.cpp ../read_wfc_pw.cpp ../binstream.cpp ../../module_basis/module_pw/test/test_tool.cpp ) -add_test(NAME read_wfc_pw_test_parallel - COMMAND mpirun -np 4 ./read_wfc_pw_test +add_test(NAME MODULE_IO_read_wfc_pw_test_parallel + COMMAND mpirun -np 4 ./MODULE_IO_read_wfc_pw_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET read_wf2rho_pw_test + TARGET MODULE_IO_read_wf2rho_pw_test LIBS parameter base ${math_libs} device planewave psi SOURCES read_wf2rho_pw_test.cpp ../read_wfc_pw.cpp ../read_wf2rho_pw.cpp ../binstream.cpp ../../module_basis/module_pw/test/test_tool.cpp ../../module_elecstate/module_charge/charge_mpi.cpp ../write_wfc_pw.cpp ) -add_test(NAME read_wf2rho_pw_parallel - COMMAND mpirun -np 4 ./read_wf2rho_pw_test +add_test(NAME MODULE_IO_read_wf2rho_pw_parallel + COMMAND mpirun -np 4 ./MODULE_IO_read_wf2rho_pw_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET numerical_basis_test + TARGET MODULE_IO_numerical_basis_test LIBS parameter base ${math_libs} device numerical_atomic_orbitals container orb SOURCES numerical_basis_test.cpp ../numerical_basis_jyjy.cpp @@ -194,7 +194,7 @@ AddTest( AddTest( - TARGET io_mulliken_test + TARGET MODULE_IO_mulliken_test LIBS parameter base ${math_libs} device SOURCES output_mulliken_test.cpp output_mulliken_mock.cpp ../output_mulliken.cpp ../../module_cell/cell_index.cpp @@ -204,67 +204,67 @@ AddTest( if(ENABLE_LCAO) AddTest( - TARGET read_wfc_lcao_test + TARGET MODULE_IO_read_wfc_lcao_test LIBS parameter base ${math_libs} device SOURCES read_wfc_lcao_test.cpp ../read_wfc_lcao.cpp ) -add_test(NAME read_wfc_lcao_test_parallel - COMMAND mpirun -np 4 ./read_wfc_lcao_test +add_test(NAME MODULE_IO_read_wfc_lcao_test_parallel + COMMAND mpirun -np 4 ./MODULE_IO_read_wfc_lcao_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) endif() AddTest( - TARGET cif_io_test + TARGET MODULE_IO_cif_io_test LIBS parameter base ${math_libs} device SOURCES cif_io_test.cpp ../cif_io.cpp ) -add_test(NAME cif_io_test_parallel - COMMAND mpirun -np 4 ./cif_io_test +add_test(NAME MODULE_IO_cif_io_test_parallel + COMMAND mpirun -np 4 ./MODULE_IO_cif_io_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET orb_io_test + TARGET MODULE_IO_orb_io_test LIBS parameter base ${math_libs} device SOURCES orb_io_test.cpp ../orb_io.cpp ) -add_test(NAME orb_io_test_parallel - COMMAND mpirun -np 4 ./orb_io_test +add_test(NAME MODULE_IO_orb_io_test_parallel + COMMAND mpirun -np 4 ./MODULE_IO_orb_io_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET io_dmk_io + TARGET MODULE_IO_dmk_io LIBS parameter ${math_libs} base device cell_info SOURCES io_dmk_test.cpp ../io_dmk.cpp ../output.cpp ) add_test( - NAME io_dmk_io_parallel - COMMAND mpirun -np 2 ./io_dmk_io + NAME MODULE_IO_dmk_io_parallel + COMMAND mpirun -np 2 ./MODULE_IO_dmk_io WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) AddTest( - TARGET io_read_wfc_nao_test + TARGET MODULE_IO_read_wfc_nao_test LIBS parameter ${math_libs} base device SOURCES read_wfc_nao_test.cpp ../read_wfc_nao.cpp ../../module_psi/psi.cpp ../../module_basis/module_ao/parallel_orbitals.cpp ) add_test( - NAME io_read_wfc_nao_test_parallel - COMMAND mpirun -np 2 ./io_read_wfc_nao_test + NAME MODULE_IO_read_wfc_nao_test_parallel + COMMAND mpirun -np 2 ./MODULE_IO_read_wfc_nao_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) if(ENABLE_LCAO) AddTest( - TARGET cal_pLpR_test + TARGET MODULE_IO_cal_pLpR_test LIBS parameter base ${math_libs} device neighbor SOURCES cal_pLpR_test.cpp diff --git a/source/module_io/test/write_wfc_nao_para.sh b/source/module_io/test/write_wfc_nao_para.sh index ae3a175cc5..752fcd9b5e 100644 --- a/source/module_io/test/write_wfc_nao_para.sh +++ b/source/module_io/test/write_wfc_nao_para.sh @@ -8,7 +8,7 @@ for i in 4;do continue fi echo "TEST in parallel, nprocs=$i" - mpirun -np $i ./io_write_wfc_nao + mpirun -np $i ./MODULE_IO_write_wfc_nao if [[ $? -ne 0 ]]; then echo -e "\e[1;33m [ FAILED ] \e[0m"\ "execute UT with $i cores error."