|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# test_issue_281.py |
| 4 | +# |
| 5 | +# This file is part of NEST. |
| 6 | +# |
| 7 | +# Copyright (C) 2004 The NEST Initiative |
| 8 | +# |
| 9 | +# NEST is free software: you can redistribute it and/or modify |
| 10 | +# it under the terms of the GNU General Public License as published by |
| 11 | +# the Free Software Foundation, either version 2 of the License, or |
| 12 | +# (at your option) any later version. |
| 13 | +# |
| 14 | +# NEST is distributed in the hope that it will be useful, |
| 15 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | +# GNU General Public License for more details. |
| 18 | +# |
| 19 | +# You should have received a copy of the GNU General Public License |
| 20 | +# along with NEST. If not, see <http://www.gnu.org/licenses/>. |
| 21 | + |
| 22 | + |
| 23 | +from mpi_test_wrapper import MPITestAssertCompletes |
| 24 | + |
| 25 | + |
| 26 | +@MPITestAssertCompletes([1, 2, 4]) |
| 27 | +def test_issue_281(): |
| 28 | + """ |
| 29 | + Confirm that ConnectLayers works MPI-parallel for fixed fan-out. |
| 30 | + """ |
| 31 | + |
| 32 | + import nest |
| 33 | + import pandas as pd |
| 34 | + |
| 35 | + layer = nest.Create("parrot_neuron", positions=nest.spatial.grid(shape=[3, 3])) |
| 36 | + nest.Connect( |
| 37 | + layer, |
| 38 | + layer, |
| 39 | + {"rule": "fixed_indegree", "indegree": 8, "allow_multapses": False, "allow_autapses": False}, |
| 40 | + # weights are randomized to check that global RNGs stay in sync |
| 41 | + {"weight": nest.random.uniform(min=1, max=2)}, |
| 42 | + ) |
| 43 | + |
| 44 | + # Ensure by simulation that global RNGs are still in sync |
| 45 | + nest.Simulate(10) |
0 commit comments