Skip to content
This repository was archived by the owner on Mar 20, 2023. It is now read-only.

Commit 4b95cca

Browse files
authored
Improvement for Presyn and queue event transfer (#673)
* The issue was encountered while testing model of 250k cells from Ivan, see: neuronsimulator/nrn#1472 * Neuron queue transfer of PreSyn may be CoreNEURON InputPreSyn. * Needed explicit transfer indication of PreSyn or InputPreSyn * After direct mode initialize, clear the spike vectors. Those spikes have already been recorded in NEURON.
1 parent ec0a4d4 commit 4b95cca

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

coreneuron/apps/main1.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ void nrn_init_and_load_data(int argc,
342342
// to NEURON. Here there is some first time only
343343
// initialization and queue transfer.
344344
direct_mode_initialize();
345+
clear_spike_vectors(); // PreSyn send already recorded by NEURON
345346
(*nrn2core_part2_clean_)();
346347
}
347348

coreneuron/io/nrn2core_data_init.cpp

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -245,21 +245,28 @@ static void nrn2core_tqueue() {
245245
} break;
246246

247247
case 4: { // PreSyn
248-
int ps_index = ncte->intdata[idat++];
248+
int type = ncte->intdata[idat++];
249+
if (type == 0) { // CoreNEURON PreSyn
250+
int ps_index = ncte->intdata[idat++];
249251
#if CORENRN_DEBUG_QUEUE
250-
printf("nrn2core_tqueue tid=%d i=%zd type=%d tdeliver=%g PreSyn %d\n",
251-
tid,
252-
i,
253-
ncte->type[i],
254-
ncte->td[i],
255-
ps_index);
252+
printf("nrn2core_tqueue tid=%d i=%zd type=%d tdeliver=%g PreSyn %d\n",
253+
tid,
254+
i,
255+
ncte->type[i],
256+
ncte->td[i],
257+
ps_index);
256258
#endif
257-
PreSyn* ps = nt.presyns + ps_index;
258-
int gid = ps->output_index_;
259-
// Following assumes already sent to other machines.
260-
ps->output_index_ = -1;
261-
ps->send(ncte->td[i], net_cvode_instance, &nt);
262-
ps->output_index_ = gid;
259+
PreSyn* ps = nt.presyns + ps_index;
260+
int gid = ps->output_index_;
261+
// Following assumes already sent to other machines.
262+
ps->output_index_ = -1;
263+
ps->send(ncte->td[i], net_cvode_instance, &nt);
264+
ps->output_index_ = gid;
265+
} else { // CoreNEURON InputPreSyn
266+
int gid = ncte->intdata[idat++];
267+
InputPreSyn* ps = gid2in[gid];
268+
ps->send(ncte->td[i], net_cvode_instance, &nt);
269+
}
263270
} break;
264271

265272
case 6: { // PlayRecordEvent

0 commit comments

Comments
 (0)