|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# test_ticket_798.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 | +import nest |
| 23 | +import pytest |
| 24 | + |
| 25 | + |
| 26 | +def test_quantal_stp_synapse_multithreaded(): |
| 27 | + """ |
| 28 | + Regression test for Ticket #798. |
| 29 | +
|
| 30 | + Ensure random number generation does not fail in multi-threaded simulation of quantal_stp_synapse. |
| 31 | + """ |
| 32 | + nest.ResetKernel() |
| 33 | + nest.SetDefaults( |
| 34 | + "quantal_stp_synapse", {"U": 0.2, "u": 0.2, "tau_fac": 500.0, "tau_rec": 200.0, "weight": 1.0, "n": 5} |
| 35 | + ) |
| 36 | + neurons = nest.Create("iaf_psc_exp", 10001) |
| 37 | + nest.SetStatus(neurons[0], {"I_e": 2000.0}) |
| 38 | + nest.Connect( |
| 39 | + neurons[0], neurons[1:], conn_spec={"rule": "all_to_all"}, syn_spec={"synapse_model": "quantal_stp_synapse"} |
| 40 | + ) |
| 41 | + nest.Simulate(100.0) |
| 42 | + # No assertion needed, test passes if no error is raised. |
0 commit comments