Skip to content

Commit

Permalink
Skip test_issue_3108.py tests if run with more than one MPI rank on G…
Browse files Browse the repository at this point in the history
…ithub Linux runners due to performance issues; the tests are run under macOS
  • Loading branch information
heplesser committed Apr 23, 2024
1 parent 13742f2 commit abeb018
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/nestbuildmatrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,8 @@ jobs:
echo "backend : svg" > $HOME/.matplotlib/matplotlibrc
- name: "Run NEST testsuite"
env:
DO_TESTS_SKIP_TEST_REQUIRING_MANY_CORES: foo
run: |
pwd
cd "$NEST_VPATH"
Expand Down
10 changes: 9 additions & 1 deletion testsuite/do_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -520,8 +520,16 @@ if test "${PYTHON}"; then
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}"

if "${DO_TESTS_SKIP_TEST_REQUIRING_MANY_CORES:-false}"; then
PYTEST_ARGS="${PYTEST_ARGS} -m 'not requires_many_cores'"
fi

set +e
$(sli -c "${numproc} (${PYTHON} -m pytest) (${PYTEST_ARGS}) mpirun =only") 2>&1 | tee -a "${TEST_LOGFILE}"

# We need to use eval here because $() splits run_command in weird ways
run_command="$(sli -c "${numproc} (${PYTHON} -m pytest) (${PYTEST_ARGS}) mpirun =only")"
eval "${run_command}" 2>&1 | tee -a "${TEST_LOGFILE}"
set -e
done
fi
Expand Down
12 changes: 12 additions & 0 deletions testsuite/pytests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ def test_gsl():
import testutil # noqa


def pytest_configure(config):
"""
Add NEST-specific markers.
See https://docs.pytest.org/en/8.0.x/how-to/mark.html.
"""
config.addinivalue_line(
"markers",
"requires_many_cores: mark tests as needing many cores (deselect with '-m \"not requires_many_cores\"')",
)


@pytest.fixture(scope="module", autouse=True)
def safety_reset():
"""
Expand Down
4 changes: 4 additions & 0 deletions testsuite/pytests/test_issue_3108.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
The connect tests test that NodeCollection::thread_local_begin() works.
"""

# Needs up to 16 cores when run on 4 MPI ranks.
# Experiences severe slowdown on Github runners under Linux with MPI and OpenMP
pytestmark = pytest.mark.requires_many_cores

if nest.ll_api.sli_func("is_threaded"):
num_threads = [1, 2, 3, 4]
else:
Expand Down

0 comments on commit abeb018

Please sign in to comment.