Skip to content

Commit

Permalink
Merge pull request #3102 from heplesser/nic_mtest
Browse files Browse the repository at this point in the history
Port MPI tests from SLI to Python, Part I
  • Loading branch information
terhorstd authored Feb 28, 2024
2 parents 6ba8cd4 + b451861 commit 355e52d
Show file tree
Hide file tree
Showing 9 changed files with 484 additions and 299 deletions.
18 changes: 15 additions & 3 deletions testsuite/do_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ ls -la "${TEST_BASEDIR}"

NEST="nest_serial"
HAVE_MPI="$(sli -c 'statusdict/have_mpi :: =only')"
HAVE_OPENMP="$(sli -c 'is_threaded =only')"

if test "${HAVE_MPI}" = "true"; then
MPI_LAUNCHER="$(sli -c 'statusdict/mpiexec :: =only')"
Expand Down Expand Up @@ -503,17 +504,28 @@ if test "${PYTHON}"; then
PYNEST_TEST_DIR="${TEST_BASEDIR}/pytests"
XUNIT_NAME="07_pynesttests"

# Run all tests except those in the mpi* subdirectories because they cannot be run concurrently
# Run all tests except those in the mpi* and sli2py_mpi subdirectories because they cannot be run concurrently
XUNIT_FILE="${REPORTDIR}/${XUNIT_NAME}.xml"
env
set +e
"${PYTHON}" -m pytest --verbose --timeout $TIME_LIMIT --junit-xml="${XUNIT_FILE}" --numprocesses=1 \
--ignore="${PYNEST_TEST_DIR}/mpi" "${PYNEST_TEST_DIR}" 2>&1 | tee -a "${TEST_LOGFILE}"
--ignore="${PYNEST_TEST_DIR}/mpi" --ignore="${PYNEST_TEST_DIR}/sli2py_mpi" "${PYNEST_TEST_DIR}" 2>&1 | tee -a "${TEST_LOGFILE}"
set -e

# Run tests in the mpi* subdirectories, grouped by number of processes
# Run tests in the sli2py_mpi subdirectory. The must be run without loading conftest.py.
if test "${HAVE_MPI}" = "true" && test "${HAVE_OPENMP}" = "true" ; then
XUNIT_FILE="${REPORTDIR}/${XUNIT_NAME}_sli2py_mpi.xml"
env
set +e
"${PYTHON}" -m pytest --noconftest --verbose --timeout $TIME_LIMIT --junit-xml="${XUNIT_FILE}" --numprocesses=1 \
"${PYNEST_TEST_DIR}/sli2py_mpi" 2>&1 | tee -a "${TEST_LOGFILE}"
set -e
fi

# Run tests in the mpi/* subdirectories, with one subdirectory per number of processes to use
if test "${HAVE_MPI}" = "true"; then
if test "${MPI_LAUNCHER}"; then
# Loop over subdirectories whose names are the number of mpi procs to use
for numproc in $(cd ${PYNEST_TEST_DIR}/mpi/; ls -d */ | tr -d '/'); do
XUNIT_FILE="${REPORTDIR}/${XUNIT_NAME}_mpi_${numproc}.xml"
PYTEST_ARGS="--verbose --timeout $TIME_LIMIT --junit-xml=${XUNIT_FILE} ${PYNEST_TEST_DIR}/mpi/${numproc}"
Expand Down
51 changes: 0 additions & 51 deletions testsuite/mpitests/issue-1957.sli

This file was deleted.

50 changes: 0 additions & 50 deletions testsuite/mpitests/test_all_to_all.sli

This file was deleted.

195 changes: 0 additions & 195 deletions testsuite/mpitests/test_mini_brunel_ps.sli

This file was deleted.

5 changes: 5 additions & 0 deletions testsuite/pytests/sli2py_mpi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# MPI tests

Test in this directory run NEST with different numbers of MPI ranks and compare results.

See documentation in mpi_test_wrappe.py for details.
Loading

0 comments on commit 355e52d

Please sign in to comment.