From ff363c213f9698a45ce810e4ec31d5b9026ed7eb Mon Sep 17 00:00:00 2001 From: Hans Ekkehard Plesser Date: Mon, 10 Nov 2025 21:10:43 +0100 Subject: [PATCH 1/2] Port test_delay_exchange from SLI to Py --- testsuite/mpitests/test_delay_exchange.sli | 48 ------------------- .../pytests/mpi/4/test_delay_exchange.py | 43 +++++++++++++++++ 2 files changed, 43 insertions(+), 48 deletions(-) delete mode 100644 testsuite/mpitests/test_delay_exchange.sli create mode 100644 testsuite/pytests/mpi/4/test_delay_exchange.py diff --git a/testsuite/mpitests/test_delay_exchange.sli b/testsuite/mpitests/test_delay_exchange.sli deleted file mode 100644 index ce7a9ed081..0000000000 --- a/testsuite/mpitests/test_delay_exchange.sli +++ /dev/null @@ -1,48 +0,0 @@ -/* - * test_delay_exchange.sli - * - * This file is part of NEST. - * - * Copyright (C) 2004 The NEST Initiative - * - * NEST is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * NEST is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with NEST. If not, see . - * - */ - - -/** @BeginDocumentation -Name: testsuite::test_delay_exchange - check that delay extrema are exchanged correctly - -Synopsis: nest_indirect test_delay_exchange.sli -> compare results for different numbers of jobs - -Description: -This tests that creating a single connection (on a single process) will properly set the delay -extrema on all processes. - -Author: November 2014, Plesser -SeeAlso: unittest::distributed_collect_assert_or_die -*/ - -(unittest) run -/unittest using - -[4] -{ - ResetKernel - /n /iaf_psc_alpha Create def - n n /one_to_one << /synapse_model /static_synapse /delay 0.5 >> Connect - n n /one_to_one << /synapse_model /static_synapse /delay 2.5 >> Connect - GetKernelStatus [[/min_delay /max_delay]] get [0.5 2.5] pstack eq -} -distributed_collect_assert_or_die diff --git a/testsuite/pytests/mpi/4/test_delay_exchange.py b/testsuite/pytests/mpi/4/test_delay_exchange.py new file mode 100644 index 0000000000..1c00e5c84e --- /dev/null +++ b/testsuite/pytests/mpi/4/test_delay_exchange.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# +# test_delay_exchange.py +# +# This file is part of NEST. +# +# Copyright (C) 2004 The NEST Initiative +# +# NEST is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# NEST is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with NEST. If not, see . + +import nest + + +def test_delay_exchange(): + """ + Confirm that creating a single connection on a single rank will set delay extrema on all ranks. + + @note This test must be run on multiple MPI ranks to be meaningful. + """ + + assert nest.num_processes == 4 + + min_delay = 0.5 + max_delay = 2.5 + + n = nest.Create("parrot_neuron") + nest.Connect(n, n, "one_to_one", {"synapse_model": "static_synapse", "delay": min_delay}) + nest.Connect(n, n, "one_to_one", {"synapse_model": "static_synapse", "delay": max_delay}) + + # Accessing kernel attributes forces GetKernelStatus with exchange of delay info + assert nest.min_delay == min_delay + assert nest.max_delay == max_delay From d8a68f84b4186400aab36a5452e9032acd19ba35 Mon Sep 17 00:00:00 2001 From: Hans Ekkehard Plesser Date: Sun, 9 Nov 2025 18:04:57 +0100 Subject: [PATCH 2/2] Convert non-thread-skipping from unittest to pytest --- testsuite/pytests/mpi/4/test_consistent_local_vps.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/testsuite/pytests/mpi/4/test_consistent_local_vps.py b/testsuite/pytests/mpi/4/test_consistent_local_vps.py index c27ff277ad..18532b41af 100644 --- a/testsuite/pytests/mpi/4/test_consistent_local_vps.py +++ b/testsuite/pytests/mpi/4/test_consistent_local_vps.py @@ -19,14 +19,11 @@ # You should have received a copy of the GNU General Public License # along with NEST. If not, see . -import unittest - import nest - -HAVE_OPENMP = nest.ll_api.sli_func("is_threaded") +import pytest -@unittest.skipIf(not HAVE_OPENMP, "NEST was compiled without multi-threading") +@pytest.mark.skipif_missing_threads def test_consistent_local_vps(): """ Test local_vps field of kernel status.