Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: add parallel scripts for parallel_orbitals unit tests #2778

Merged
merged 1 commit into from
Aug 2, 2023
Merged
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
9 changes: 8 additions & 1 deletion source/module_basis/module_ao/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ AddTest(

install(FILES parallel_2d_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
find_program(BASH bash)
add_test(NAME parallel_2d_test_para4
add_test(NAME parallel_2d_test_para
COMMAND ${BASH} parallel_2d_test.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
Expand All @@ -127,6 +127,13 @@ AddTest(
LIBS ${math_libs} device base
)

install(FILES parallel_orbitals_test.sh DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
find_program(BASH bash)
add_test(NAME parallel_orbitals_test_para
COMMAND ${BASH} parallel_orbitals_test.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)

install(DIRECTORY lcao_H2O DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
install(DIRECTORY lcao_H2O DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/../../../tests)

1 change: 0 additions & 1 deletion source/module_basis/module_ao/test/parallel_2d_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ for i in 2 3 4; do
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./parallel_2d_test
break
done
12 changes: 12 additions & 0 deletions source/module_basis/module_ao/test/parallel_orbitals_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -e

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

for i in 2 3 4; do
if [[ $i -gt $np ]];then
continue
fi
echo "TEST in parallel, nprocs=$i"
mpirun -np $i ./parallel_orbitals_test
done