Skip to content

Commit 355e52d

Browse files
authored
Merge pull request #3102 from heplesser/nic_mtest
Port MPI tests from SLI to Python, Part I
2 parents 6ba8cd4 + b451861 commit 355e52d

File tree

9 files changed

+484
-299
lines changed

9 files changed

+484
-299
lines changed

testsuite/do_tests.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ ls -la "${TEST_BASEDIR}"
145145

146146
NEST="nest_serial"
147147
HAVE_MPI="$(sli -c 'statusdict/have_mpi :: =only')"
148+
HAVE_OPENMP="$(sli -c 'is_threaded =only')"
148149

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

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

514-
# Run tests in the mpi* subdirectories, grouped by number of processes
515+
# Run tests in the sli2py_mpi subdirectory. The must be run without loading conftest.py.
516+
if test "${HAVE_MPI}" = "true" && test "${HAVE_OPENMP}" = "true" ; then
517+
XUNIT_FILE="${REPORTDIR}/${XUNIT_NAME}_sli2py_mpi.xml"
518+
env
519+
set +e
520+
"${PYTHON}" -m pytest --noconftest --verbose --timeout $TIME_LIMIT --junit-xml="${XUNIT_FILE}" --numprocesses=1 \
521+
"${PYNEST_TEST_DIR}/sli2py_mpi" 2>&1 | tee -a "${TEST_LOGFILE}"
522+
set -e
523+
fi
524+
525+
# Run tests in the mpi/* subdirectories, with one subdirectory per number of processes to use
515526
if test "${HAVE_MPI}" = "true"; then
516527
if test "${MPI_LAUNCHER}"; then
528+
# Loop over subdirectories whose names are the number of mpi procs to use
517529
for numproc in $(cd ${PYNEST_TEST_DIR}/mpi/; ls -d */ | tr -d '/'); do
518530
XUNIT_FILE="${REPORTDIR}/${XUNIT_NAME}_mpi_${numproc}.xml"
519531
PYTEST_ARGS="--verbose --timeout $TIME_LIMIT --junit-xml=${XUNIT_FILE} ${PYNEST_TEST_DIR}/mpi/${numproc}"

testsuite/mpitests/issue-1957.sli

Lines changed: 0 additions & 51 deletions
This file was deleted.

testsuite/mpitests/test_all_to_all.sli

Lines changed: 0 additions & 50 deletions
This file was deleted.

testsuite/mpitests/test_mini_brunel_ps.sli

Lines changed: 0 additions & 195 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# MPI tests
2+
3+
Test in this directory run NEST with different numbers of MPI ranks and compare results.
4+
5+
See documentation in mpi_test_wrappe.py for details.

0 commit comments

Comments
 (0)