Skip to content

Commit

Permalink
Parametrize test over number of nodes to demonstrate that it is possi…
Browse files Browse the repository at this point in the history
…ble.
  • Loading branch information
heplesser committed Feb 28, 2024
1 parent 3d67a2b commit b451861
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions testsuite/pytests/sli2py_mpi/test_all_to_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
# You should have received a copy of the GNU General Public License
# along with NEST. If not, see <http://www.gnu.org/licenses/>.


import numpy as np
import pandas
import pytest
from mpi_test_wrapper import MPITestAssertEqual


# Parametrization over the number of nodes here only so show hat it works
@pytest.mark.parametrize("N", [4, 7])
@MPITestAssertEqual([1, 4], debug=False)
def test_all_to_all():
def test_all_to_all(N):
"""
Confirm that all-to-all connections created correctly for more targets than local nodes.
"""
Expand All @@ -34,7 +38,7 @@ def test_all_to_all():

nest.ResetKernel()

nrns = nest.Create("parrot_neuron", n=4)
nrns = nest.Create("parrot_neuron", n=N)
nest.Connect(nrns, nrns, "all_to_all")

conns = nest.GetConnections().get(output="pandas").drop(labels=["target_thread", "port"], axis=1)
Expand Down

0 comments on commit b451861

Please sign in to comment.