Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
25 changes: 23 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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|16_SDFT_GPU|MODULE_BASE|MODULE_IO|MODULE_HSOLVER|MODULE_CELL'"
26 changes: 13 additions & 13 deletions source/module_base/test_parallel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)
Expand All @@ -21,39 +21,39 @@ 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
)

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}
)
Expand All @@ -67,12 +67,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}
)
Expand Down
2 changes: 1 addition & 1 deletion source/module_base/test_parallel/blacs_connector_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_base/test_parallel/parallel_2d_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_base/test_parallel/parallel_common_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_base/test_parallel/parallel_global_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_base/test_parallel/parallel_reduce_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
34 changes: 17 additions & 17 deletions source/module_cell/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,106 +39,106 @@ 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
)

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
)
Expand Down
2 changes: 1 addition & 1 deletion source/module_cell/test/bcast_atom_pseudo_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_cell/test/bcast_atom_spec_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_cell/test/klist_test_para.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion source/module_cell/test/parallel_kpoints_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/module_cell/test/unitcell_test_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
4 changes: 2 additions & 2 deletions source/module_cell/test_pw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
)
2 changes: 1 addition & 1 deletion source/module_cell/test_pw/unitcell_test_pw_para.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
Loading
Loading