Skip to content

Commit

Permalink
Add vpicio and bdcats to MPI test
Browse files Browse the repository at this point in the history
  • Loading branch information
houjun committed Apr 26, 2024
1 parent 145c787 commit 4bf8395
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ set(SCRIPTS
run_test.sh
mpi_test.sh
run_multiple_test.sh
run_multiple_mpi_test.sh
run_checkpoint_restart_test.sh
)

Expand Down Expand Up @@ -487,6 +488,7 @@ if(BUILD_MPI_TESTING)
add_test(NAME obj_info_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND mpi_test.sh ./obj_info ${MPI_RUN_CMD} 4 6 )
add_test(NAME obj_put_data_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND mpi_test.sh ./obj_put_data ${MPI_RUN_CMD} 4 6 )
add_test(NAME obj_get_data_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND mpi_test.sh ./obj_get_data ${MPI_RUN_CMD} 4 6 )
add_test(NAME vpicio_bdcats_mpi WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND run_multiple_mpi_test.sh ${MPI_RUN_CMD} 4 6 ./vpicio ./bdcats)

set_tests_properties(read_obj_shared_int PROPERTIES LABELS "parallel;parallel_obj" )
set_tests_properties(read_obj_shared_float PROPERTIES LABELS "parallel;parallel_obj" )
Expand Down Expand Up @@ -514,6 +516,7 @@ if(BUILD_MPI_TESTING)
# set_tests_properties(region_transfer_2D_skewed_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" )
# set_tests_properties(region_transfer_3D_skewed_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" )
set_tests_properties(region_transfer_write_read_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" )
set_tests_properties(vpicio_bdcats_mpi PROPERTIES LABELS "parallel;parallel_region_transfer" )
set_tests_properties(region_transfer_all_mpi PROPERTIES LABELS "parallel;parallel_region_transfer_all" )
set_tests_properties(region_transfer_all_2D_mpi PROPERTIES LABELS "parallel;parallel_region_transfer_all" )
set_tests_properties(region_transfer_all_3D_mpi PROPERTIES LABELS "parallel;parallel_region_transfer_all" )
Expand Down
52 changes: 52 additions & 0 deletions src/tests/run_multiple_mpi_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/bash
# This version of the test runner doesn't attempt to run any parallel tests.
# We assume too, that if the library build has enabled MPI, that LD_LIBRARY_PATH is
# defined and points to the MPI libraries used by the linker (e.g. -L<path -lmpi)

extra_cmd=""

if [[ "$SUPERCOMPUTER" == "perlmutter" ]]; then
extra_cmd="--mem=25600 --cpu_bind=cores --overlap"
fi

if [ $# -lt 1 ]; then echo "missing test argument" && exit -1 ; fi
# check the test to be run:
mpi_cmd="$1"
n_servers="$2"
n_client="$3"
# copy the remaining test input arguments (if any)
all_test="${@:4}"
test_args=""
echo $all_test

rm -rf pdc_tmp pdc_data

# START the server (in the background)
echo "$mpi_cmd -n $n_servers $extra_cmd ./pdc_server.exe &"
$mpi_cmd -n $n_servers $extra_cmd ./pdc_server.exe &

# WAIT a bit, for 1 second
sleep 1

# RUN the actual test(s)
for test_exe in $all_test
do
if [ -x $test_exe ]; then echo "testing: $test_exe"; else echo "test: $test_exe not found or not and executable" && exit -2; fi
if [[ "$test_exe" = *vpicio ]]; then
test_args="1024"
fi
if [[ "$test_exe" = *bdcats ]]; then
test_args="1024"
fi
echo "$mpi_cmd -n $n_client $extra_cmd $test_exe $test_args"
$mpi_cmd -n $n_client $extra_cmd $test_exe $test_args
ret="$?"
done

# Need to test the return value
ret="$?"
# and shutdown the SERVER before exiting
echo "Close server"
echo "$mpi_cmd -n 1 $extra_cmd ./close_server"
$mpi_cmd -n 1 $extra_cmd ./close_server
exit $ret

0 comments on commit 4bf8395

Please sign in to comment.