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