Skip to content

Commit 09b349c

Browse files
authored
Merge pull request #3438 from heplesser/sli2py_gaps
Port test_gap_junctions_mpi from SLI to Py
2 parents 6eb833d + 93e97e5 commit 09b349c

File tree

2 files changed

+75
-101
lines changed

2 files changed

+75
-101
lines changed

testsuite/mpitests/test_gap_junctions_mpi.sli

-101
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# test_gap_junctions_mpi.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 MPITestAssertEqual
24+
25+
26+
@MPITestAssertEqual([1, 2, 4], debug=False)
27+
def test_gap_junctions_mpi():
28+
"""
29+
Test gap junction functionality in parallel.
30+
31+
This is an overall test of the hh_psc_alpha_gap model connected by gap_junction.
32+
The test checks if the gap junction functionality works in parallel.
33+
"""
34+
35+
import nest
36+
import pandas as pd
37+
38+
# We can only test here if GSL is available
39+
if not nest.ll_api.sli_func("statusdict/have_gsl ::"):
40+
return
41+
42+
total_vps = 4
43+
h = 0.1
44+
45+
nest.SetKernelStatus(
46+
{
47+
"total_num_virtual_procs": total_vps,
48+
"resolution": h,
49+
"use_wfr": True,
50+
"wfr_tol": 0.0001,
51+
"wfr_interpolation_order": 3,
52+
"wfr_max_iterations": 10,
53+
"wfr_comm_interval": 1.0,
54+
}
55+
)
56+
n = nest.Create("hh_psc_alpha_gap", n=4)
57+
n[0].I_e = 400.0
58+
59+
sr = nest.Create(
60+
"spike_recorder",
61+
params={
62+
"record_to": "ascii",
63+
"time_in_steps": True,
64+
"label": SPIKE_LABEL.format(nest.num_processes), # noqa: F821
65+
},
66+
)
67+
68+
for nrn, w in zip(n[1:], [10, 8, 12]):
69+
nest.Connect(
70+
n[0], nrn, {"rule": "one_to_one", "make_symmetric": True}, {"synapse_model": "gap_junction", "weight": w}
71+
)
72+
73+
nest.Connect(n, sr)
74+
75+
nest.Simulate(50)

0 commit comments

Comments
 (0)