Skip to content

Commit

Permalink
Merge pull request #948 from pxlxingliang/develop
Browse files Browse the repository at this point in the history
test(elecstate): add the unit test of psiToRho
  • Loading branch information
dyzheng authored May 27, 2022
2 parents bd6ccec + 43cabcc commit 6364f7a
Show file tree
Hide file tree
Showing 12 changed files with 3,106 additions and 0 deletions.
26 changes: 26 additions & 0 deletions source/module_elecstate/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ remove_definitions(-D__MPI)
remove_definitions(-D__EXX)
remove_definitions(-D__CUDA)
remove_definitions(-D__ROCM)
remove_definitions(-D__DEEPKS)

AddTest(
TARGET EState_updaterhok_pw
Expand All @@ -10,3 +11,28 @@ AddTest(
)

install(DIRECTORY support DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

AddTest(
TARGET EState_psiToRho_lcao
LIBS ${math_libs} ELPA::ELPA base orb cell neighbor
SOURCES elecstate_lcao_test.cpp ../elecstate_lcao.cpp ../dm2d_to_grid.cpp
../../src_parallel/parallel_global.cpp ../../src_parallel/parallel_common.cpp ../../src_parallel/parallel_reduce.cpp
../../src_lcao/local_orbital_charge.cpp ../../src_lcao/DM_gamma.cpp ../../src_lcao/DM_k.cpp
../../src_lcao/local_orbital_wfc.cpp
../../src_lcao/grid_technique.cpp ../../src_lcao/grid_meshball.cpp ../../src_lcao/grid_bigcell.cpp
../../src_lcao/grid_meshcell.cpp ../../src_lcao/grid_meshk.cpp
../../src_lcao/gint_tools.cpp
../../src_lcao/gint_k_rho.cpp ../../src_lcao/gint_gamma_rho.cpp ../../src_lcao/dm_2d.cpp
../../src_lcao/record_adj.cpp ../../src_lcao/LCAO_nnr.cpp ../../src_lcao/gint_gamma.cpp
../../src_pw/charge.cpp
../../src_pdiag/pdiag_common.cpp
../../src_io/output.cpp ../../src_pw/soc.cpp
)
target_compile_definitions(EState_psiToRho_lcao PRIVATE __MPI)
install(FILES elecstate_lcao_parallel_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

find_program(BASH bash)
add_test(NAME EState_psiToRho_lcao_parallel
COMMAND ${BASH} elecstate_lcao_parallel_test.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
13 changes: 13 additions & 0 deletions source/module_elecstate/test/elecstate_lcao_parallel_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

np=`cat /proc/cpuinfo | grep "cpu cores" | uniq| awk '{print $NF}'`
echo "nprocs in this machine is $np"

for i in 6 3 2;do
if [[ $i -gt $np ]];then
continue
fi
echo "TEST DIAGO davidson in parallel, nprocs=$i"
mpirun -np $i ./EState_psiToRho_lcao
break
done
Loading

0 comments on commit 6364f7a

Please sign in to comment.