This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
test/usecases/net_receive Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2161,6 +2161,10 @@ void CodegenNeuronCppVisitor::print_net_receive() {
21612161 printer->add_line (" auto * _ppvar = _nrn_mechanism_access_dparam(_pnt->prop);" );
21622162
21632163 printer->fmt_line (" auto inst = make_instance_{}(_lmc);" , info.mod_suffix );
2164+ printer->fmt_line (" // nocmodl has a nullptr dereference for thread variables." );
2165+ printer->fmt_line (" // NMODL will fail to compile at a later point, because of" );
2166+ printer->fmt_line (" // missing '_thread_vars'." );
2167+ printer->fmt_line (" Datum * _thread = nullptr;" );
21642168
21652169 printer->add_line (" size_t id = 0;" );
21662170 printer->add_line (" double t = _nt->_t;" );
Original file line number Diff line number Diff line change 1+ NEURON {
2+ POINT_PROCESS NetReceiveCalls
3+ RANGE c1, c2
4+ }
5+
6+ ASSIGNED {
7+ c1
8+ c2
9+ }
10+
11+ INITIAL {
12+ c1 = 0
13+ c2 = 0
14+ }
15+
16+ FUNCTION one() {
17+ one = 1
18+ }
19+
20+ PROCEDURE increment_c2() {
21+ c2 = c2 + 2
22+ }
23+
24+ NET_RECEIVE(w) {
25+ c1 = c1 + one()
26+ increment_c2()
27+ }
Original file line number Diff line number Diff line change 1+ import numpy as np
2+
3+ from neuron import h , gui
4+ from neuron .units import ms
5+
6+
7+ def test_calls ():
8+ nseg = 1
9+
10+ soma = h .Section ()
11+ soma .nseg = nseg
12+
13+ syn = h .NetReceiveCalls (soma (0.5 ))
14+
15+ stim = h .NetStim ()
16+ stim .interval = 0.2
17+ stim .number = 3
18+ stim .start = 0.1
19+
20+ netcon = h .NetCon (stim , syn )
21+
22+ h .stdinit ()
23+ h .run ()
24+
25+ assert syn .c1 == 3
26+ assert syn .c2 == 6
27+
28+
29+ if __name__ == "__main__" :
30+ test_calls ()
You can’t perform that action at this time.
0 commit comments