1 #include <../../nrnconf.h> 4 #define USE_MIN_DELAY 1 26 #include "shared/sundialsmath.h" 45 #include <unordered_map> 49 #define lvardtloop(i,j) for(i=0; i < nrn_nthread; ++i) for (j=0; j < p[i].nlcv_; ++j) 52 #define PP2NT(pp) ((NrnThread*)((pp)->_vnt)) 53 #define PP2t(pp) (PP2NT(pp)->_t) 58 #define POINT_RECEIVE(type, tar, w, f) (*pnt_receive[type])(tar, w, f) 76 extern void nrn_cvfun(
double t,
double* y,
double* ydot);
78 #define nt_dt nrn_threads->_dt 79 #define nt_t nrn_threads->_t 118 extern "C" void nrnthread_get_trajectory_requests(
int tid,
int& bsize,
int& n_pr,
void**& vpr,
int& n_trajec,
int*& types,
int*& indices,
double**& pvars,
double**& varrays);
142 #if COLLECT_TQueue_STATISTICS 144 return (stats[0]-stats[2]);
173 double **th,
double **
del) {
182 return ps->
dil_.size();
189 void neosim2nrn_advance(
void*,
void*,
double);
190 void neosim2nrn_deliver(
void*,
void*);
191 void (*p_nrn2neosim_send)(
void*, double);
192 static void* neosim_entity_;
223 void ncs2nrn_inputevent(
int netcon_input_index,
double tdeliver);
226 extern void nrn2ncs_outputevent(
int netcon_output_index,
double firetime);
236 void nrn2ncs_netcons();
239 extern void nrn2ncs_outputevent(
int netcon_output_index,
double firetime);
244 extern bool use_bgpdma_;
245 extern void nrnbgp_messager_advance();
256 extern bool nrn_use_localgid_;
257 extern void nrn_outputevent(
unsigned char,
double);
302 return net_cvode_instance->
psl_;
310 if (net_cvode_instance) {
343 sscanf(buf,
"%d %d\n", &type, &plr_index);
350 return new PlayRecordSave(
this);
354 PlayRecordSave*
prs =
nil;
358 nrn_assert(sscanf(buf,
"%d %d\n", &type, &index) == 2);
376 prs =
new PlayRecordSave(plr);
379 prs->savestate_read(f);
383 PlayRecordSave::PlayRecordSave(
PlayRecord* plr) {
388 PlayRecordSave::~PlayRecordSave() {
408 if (target_->ob == ob) {
415 #if 0 // way of printing dinfo 416 printf(
"NetCon from %s to ",
419 printf(
" weight index=%d\n", l);
474 for (
int i = 0;
i < s->
nnode; ++
i) {
502 for (
int i = 0;
i < s->
nnode; ++
i) {
510 obj = (*nrnpy_seg_from_sec_x)(
s, x);
532 obj = (*nrnpy_seg_from_sec_x)(d->
target_->
sec, x);
561 o = (
OcList*)((*po)->u.this_pointer);
577 for (
const auto& d : dil) {
594 for (
const auto& d1 : dil) {
595 if (d1->obj_ && d1->target_ == d->
target_) {
612 if (cell && net_cvode_instance->
psl_)
ITERATE(q, net_cvode_instance->
psl_) {
615 for (
const auto& d1 : dil) {
616 if (d1->obj_ && d1->target_
632 if (cell && net_cvode_instance->
psl_)
ITERATE(q, net_cvode_instance->
psl_) {
635 for (
const auto& d1 : dil) {
636 if (d1->obj_ && d1->src_ && ps->
ssrc_ 670 hoc_execerror(
"argument must be a point process or NULLobject",0);
677 #if DISCRETE_EVENT_OBSERVER 686 #if DISCRETE_EVENT_OBSERVER 692 if (d->
cnt_ != cnt) {
702 hoc_return_type_code = 2;
715 hoc_return_type_code = 2;
724 double td =
chkarg(1, -1e20,1e20);
725 if (d->
active_ == 0) {
return 0.0; }
737 hoc_execerror(
"Can only send fake self-events to ARTIFICIAL_CELLs",0);
771 hoc_return_type_code = 1;
827 if (strcmp(s->
name,
"delay") == 0) {
831 }
else if (strcmp(s->
name,
"weight") == 0) {
838 }
else if (strcmp(s->
name,
"x") == 0) {
839 static double dummy = 0.;
847 }
else if (strcmp(s->
name,
"threshold") == 0) {
855 if (!net_cvode_instance) {
860 Section* srcsec =
nil;
865 hoc_execerror(
"if arg 1 is an object it must be a point process or NULLObject", 0);
873 hoc_execerror(
"arg 2 must be a point process or NULLobject", 0);
875 double thresh = -1.e9;
881 delay =
chkarg(4, 0, 1e15);
885 thresh, delay, weight);
925 for (p1 = s, p2 = b; *p1; ++p1, ++p2) {
980 if(!spost->pattern()) {
993 if(!star->pattern()) {
1006 if (precell == opre) {
1014 if (spre->
Match(s, n, 0) > 0) {
1020 }
else if (ps->
osrc_) {
1023 if (presyn == opre) {
1031 if (spre->
Match(s, n, 0) > 0) {
1040 for (
const auto& d : dil) {
1051 if (postcell == opost) {
1059 if (spost->Match(s, n, 0) > 0) {
1067 if (target == otar) {
1075 if (star->Match(s, n, 0) > 0) {
1088 if (spre)
delete spre;
1089 if (spost)
delete spost;
1090 if (star)
delete star;
1096 tpool_ =
new TQItemPool(1000, 1);
1098 tqe_ =
new TQueue(tpool_, 0);
1099 sepool_ =
new SelfEventPool(1000,1);
1106 unreffed_event_cnt_ = 0;
1107 immediate_deliver_ = -1e100;
1114 delete [] inter_thread_events_;
1116 if (tq_) {
delete tq_; }
1120 selfqueue_->remove_all();
1125 for (
int i=0;
i < nlcv_; ++
i) {
1138 Printf(
"interthread send td=%.15g DE type=%d thread=%d target=%d %s\n",
1143 if(ite_cnt_ >= ite_size_) {
1146 for (
int i=0;
i < ite_cnt_; ++
i) {
1147 in[
i].
de_ = inter_thread_events_[
i].de_;
1148 in[
i].
t_ = inter_thread_events_[
i].t_;
1150 delete [] inter_thread_events_;
1151 inter_thread_events_ = in;
1170 for (i = 0; i < ite_cnt_; ++
i) {
1174 Printf(
"interthread enqueue td=%.15g DE type=%d thread=%d target=%d %s\n",
1186 use_long_double_ = 0;
1197 condition_order_ = 1;
1200 eps_ = 100.*UNIT_ROUNDOFF;
1203 nrn_use_fifo_queue_ =
false;
1205 nrn_use_daspk_ =
false;
1207 allthread_hocevents_ =
new HocEventList();
1220 structure_change_cnt_ = -1;
1221 fornetcon_change_cnt_ = -2;
1222 matrix_change_cnt_ = -1;
1223 playrec_change_cnt_ = 0;
1225 prl_ =
new PlayRecList(10);
1226 fixed_play_ =
new PlayRecList(10);
1227 fixed_record_ =
new PlayRecList(10);
1228 vec_event_store_ =
nil;
1237 if (net_cvode_instance == (
NetCvode*)
this) {
1238 net_cvode_instance =
nil;
1253 for (
auto it = ps->
dil_.rbegin(); it != ps->
dil_.rend(); ++it) {
1266 delete fixed_record_;
1267 while(prl_->count()) {
1268 delete prl_->item(prl_->count()-1);
1273 delete allthread_hocevents_;
1287 if (!b != single_) {
1290 structure_change_cnt_ = 0;
1292 nrn_use_daspk_ =
false;
1298 return (gcv_ != 0) ? gcv_->use_daspk_ :
false;
1303 if (gcv_ && b != gcv_->use_daspk_) {
1305 single_ = (b ?
true : single_);
1306 structure_change_cnt_ = 0;
1321 for (last = *first; last->
next; last = last->
next){}
1330 for (b = *first; b; b = bn) {
1339 no_cap_child_count_ = 0;
1341 no_cap_child_ =
nil;
1342 cv_memb_list_ =
nil;
1346 before_breakpoint_ =
nil;
1359 neq_v_ = nonvint_offset_ = 0;
1360 nonvint_extra_offset_ = 0;
1366 delete_memb_list(no_cap_memb_);
1373 delete [] no_cap_node_;
1374 delete [] no_cap_child_;
1377 watch_list_->RemoveAll();
1391 for (i = 0; i < pcnt_; ++
i) {
1394 for (j = 0; j < d.
nlcv_; ++
j) {
1395 delete_list(d.
lcv_ + j);
1410 del_cv_memb_list(cvode);
1418 if (gcv_) { del_cv_memb_list(gcv_); }
1419 for (
int i = 0;
i < pcnt_; ++
i) {
1421 for (
int j = 0;
j < d.
nlcv_; ++
j) {
1422 del_cv_memb_list(d.
lcv_ +
j);
1428 if (!cvode) {
return; }
1430 for (j=0; j < cv.
nctd_; ++
j) {
1437 if (cvode != gcv_) {
1448 cmlnext = cml->
next;
1469 for (cml = cmlist; cml; cml = cmlnext) {
1471 cmlnext = cml->
next;
1474 if (ml->nodeindices) {
1475 delete [] ml->nodeindices;
1482 delete [] ml->
pdata;
1504 }
else if (ps->
ssrc_) {
1510 z = cvsrc->
ctd_ + nt->
id;
1512 z->
psl_th_ =
new PreSynList(pst_cnt_);
1520 }
else if (ps->
ssrc_) {
1527 if (tid == nt->
id) {
1528 cvsrc =
p[tid].lcv_ + cellnum[
j];
1530 if (nt == cvsrc->
nth_) {
1532 z->
psl_th_ =
new PreSynList(1);
1561 for (i=0; i < d.
nlcv_; ++
i) {
1574 if (p_nrn2neosim_send)
for (i=0; i < nlist_; ++
i) {
1575 p.lcv_[
i].neosim_self_events_ =
new TQueue();
1592 matrix_change_cnt_ = -1;
1593 playrec_change_cnt_ = 0;
1606 distribute_dinfo(
nil, 0);
1621 || mf->
current || mf->ode_count || mf->ode_matsol
1622 || mf->ode_spec || mf->
state )
1639 cml->
ml->nodeindices = ml->nodeindices;
1676 if (gcv_) { b =
true; }
1677 if (!b)
for (i=0; i < pcnt_; ++
i) {
1691 if (_nt->
end == 0) {
continue; }
1692 int* cellnum =
new int[_nt->
end];
1693 for (i=0; i < _nt->
ncell; ++
i) {
1696 for (i=_nt->
ncell; i < _nt->
end; ++i) {
1700 for (i=0; i < _nt->
ncell; ++
i) {
1703 for (i=0; i < _nt->
end; ++
i) {
1706 for (i=0; i < _nt->
ncell; ++
i) {
1710 for (i=0; i < _nt->
ncell; ++
i) {
1714 for (i=0; i < _nt->
end; ++
i) {
1726 && (mf->
current || mf->ode_count || mf->ode_matsol
1727 || mf->ode_spec || mf->
state || i ==
CAP)
1742 last[cellnum[
inode]] = cml;
1744 if (last[cellnum[inode]]->
index == i) {
1750 last[cellnum[
inode]] = cml;
1760 for (i=0; i < d.
nlcv_; ++
i) {
1762 for (cml = cvml[i]; cml; cml = cml->
next) {
1766 ml->nodeindices =
new int[ml->
nodecount];
1784 && (mf->
current || mf->ode_count || mf->ode_matsol
1785 || mf->ode_spec || mf->
state || i ==
CAP)
1792 if (cvml[icell]->
index != i) {
1793 cvml[icell] = cvml[icell]->
next;
1813 fill_local_ba(cellnum, d);
1815 distribute_dinfo(cellnum,
id);
1849 for (tbl = nt->
tbl[bat]; tbl; tbl = tbl->
next) {
1865 for (
int icv = 0; icv < d.
nlcv_; ++icv) {
1869 if (cml->index == bam->
type) {
1893 for (ba = *pbml; ba; ba = ba->
next) {
2042 return solve_when_threads(tout);
2048 while (
p[0].tqe_->least_t() <= tout &&
stoprun==0) {
2049 deliver_least_event(nt);
2052 if (stoprun==0) {
nt_t = tout; }
2054 if (
p[0].tqe_->least()) {
2055 nt_t =
p[0].tqe_->least_t();
2056 deliver_events(
p[0].tqe_->least_t(), nt);
2062 }
else if (single_) {
2064 while (gcv_->t_ < tout ||
p[0].tqe_->least_t() < tout) {
2065 err = global_microstep();
2069 retreat(tout, gcv_);
2070 gcv_->record_continuous();
2073 double tc = gcv_->t_;
2074 initialized_ =
false;
2075 while (gcv_->t_ <= tc && !initialized_) {
2076 err = global_microstep();
2083 time_t rt = time(
nil);
2089 err = local_microstep(nt);
2094 if (rt < time(
nil)) {
2106 for (
int i=0;
i <
n; ++
i) {
2107 local_retreat(tout, lcv +
i);
2116 double te =
p[0].tqe_->least_t();
2117 while (tq->
least_t() <= tc &&
p[0].tqe_->least_t() <= te){
2136 #if 0 // now a HocEvent is used to do this 2141 gcv_->record_continuous();
2143 int i,
n =
p[nt->
id].nlcv_;
2145 for (i = 0; i <
n; ++
i) {
2146 local_retreat(tt, lcv + i);
2158 p[nt->
id].tqe_->remove(q);
2160 if (print_event_) { de->
pr(
"deliver", tt,
this); }
2168 if ((q =
p[nt->
id].tqe_->atomic_dq(til)) != 0) {
2171 p[nt->
id].tqe_->release(q);
2173 if (print_event_) { de->
pr(
"deliver", tt,
this); }
2186 if (
p[i].tqe_->least_t() <=
p[
i].tq_->least_t()) {
2187 deliver_least_event(nt);
2192 p[
i].tq_->move_least(cv->
t_);
2200 double tt =
p[0].tqe_->least_t();
2201 double tdiff = tt - gcv_->t_;
2206 assert(tdiff == 0.0 || ( gcv_->tstop_begin_ <= tt && tt <= gcv_->tstop_end_));
2207 deliver_events(tt, nt);
2209 err = gcv_->handle_step(
this, tt);
2211 if (
p[0].tqe_->least_t() < gcv_->t_) {
2212 gcv_->interpolate(
p[0].tqe_->least_t());
2222 for (
int i=0;
i < nctd_; ++
i) {
2240 check_deliver(nth_);
2251 evaluate_conditions(nth_);
2253 }
else if (te <= tn_) {
2255 }
else if (t_ < tn_) {
2258 record_continuous();
2262 evaluate_conditions(nth_);
2274 if (tt <
PP2t(pnt)) {
2278 se->
pr(
buf, tt, net_cvode_instance);
2297 sprintf(
buf,
"artcell_net_move tt-nt_t = %g", tt - nt->
_t);
2298 se->
pr(
buf, tt, net_cvode_instance);
2305 se->
deliver(tt, net_cvode_instance, nt);
2323 if (neosim_entity_){
2327 p[tid].tqe_->move(q, tnew);
2330 p[tid].tqe_->move(q, tnew);
2335 p[tid].tqe_->remove(q);
2349 assert(net_cvode_instance);
2353 sprintf(buf,
"net_send td-t = %g", td - nt->
_t);
2354 se->
pr(buf, td, net_cvode_instance);
2360 if (neosim_entity_) {
2364 q = net_cvode_instance->
event(td, se, nt);
2367 q = net_cvode_instance->
event(td, se, nt);
2385 assert(net_cvode_instance);
2389 sprintf(buf,
"net_send td-t = %g", td - nt->
_t);
2390 se->
pr(buf, td, net_cvode_instance);
2402 se->
deliver(td, net_cvode_instance, nt);
2405 net_send(v, weight, pnt, td, flag);
2413 if (time <
PP2t(pnt)) {
2415 sprintf(buf,
"net_event time-t = %g", time-
PP2t(pnt));
2416 ps->
pr(buf, time, net_cvode_instance);
2420 if (neosim_entity_) {
2421 (*p_nrn2neosim_send)(neosim_entity_,
nt_t);
2424 ps->
send(time, net_cvode_instance, ps->
nt_);
2432 if (!d[i]._pvoid || !d[0]._pvoid) {
2439 WatchList* wl = (WatchList*)d->
_pvoid;
2442 for (j=0; j < wl->count(); ++
j) {
2517 d->
_pvoid = (
void*)
new WatchList();
2539 for (
auto& htlists_of_thread: net_cvode_instance->
wl_list_) {
2540 for (
HTList* wl: htlists_of_thread) {
2552 int nn = offset +
n;
2553 if (d[offset]._pvoid) {
2554 WatchList* wl = (WatchList*)d[offset]._pvoid;
2557 for (i=offset+1; i < nn; ++
i) {
2569 if (vec_event_store_) {
2570 vec_event_store_ =
nil;
2577 #if BBTQ == 3 || BBTQ == 4 2579 if (nrn_use_fifo_queue_) {
2581 if (print_event_) { db->
pr(
"send", td,
this); }
2582 if (vec_event_store_) {
2583 Vect* x = vec_event_store_;
2585 x->resize_chunk(n+2);
2590 return p[0].tqe_->insert_fifo(td, db);
2592 return p[0].tqe_->insert(td, db);
2596 #define fifo_event event 2601 if (nrn_use_bin_queue_) {
2603 if (print_event_) {db->
pr(
"binq send", td,
this);}
2604 if (vec_event_store_) {
2606 Vect* x = vec_event_store_;
2611 return p[nt->
id].tqe_->enqueue_bin(td, db);
2614 if (print_event_) {db->
pr(
"send", td,
this);}
2616 return p[nt->
id].tqe_->insert(td, db);
2620 #define bin_event event 2625 if (print_event_) { db->
pr(
"send", td,
this); }
2626 if (vec_event_store_) {
2627 Vect* x = vec_event_store_;
2632 return p[nt->
id].tqe_->insert(td, db);
2638 if (tt - nt->
_t < 0) {
return; }
2640 if (neosim_entity_) {
2652 if (tt -
nt_t < 0) {
return; }
2654 if (neosim_entity_) {
2672 if (!ppobj && tt -
nt_t < 0) {
return; }
2674 if (neosim_entity_) {
2696 p[
i].interthread_send(tt, he, nt +
i);
2709 while (allthread_hocevents_->count()) {
2710 HocEvent* he = allthread_hocevents_->item(0);
2711 allthread_hocevents_->remove(0);
2720 int i,
n =
p[nt->
id].nlcv_;
2722 if (n)
for (i = 0; i <
n; ++
i) {
2723 local_retreat(tt, lcv + i);
2732 gcv_->record_continuous();
2736 allthread_hocevents_->append(he);
2748 deliver_events(tt, nt);
2759 static PPArgs* ppargs;
2761 static void point_receive_job(
NrnThread* nt) {
2762 PPArgs*
p = ppargs + nt->
id;
2769 int id =
PP2NT(pp)->id;
2774 PPArgs*
p = ppargs +
id;
2793 deliver_cnt_ = net_event_cnt_ = 0;
2794 NetCon::netcon_send_active_ = 0;
2795 NetCon::netcon_send_inactive_ = 0;
2796 NetCon::netcon_deliver_ = 0;
2797 ConditionEvent::init_above_ = 0;
2798 ConditionEvent::send_qthresh_ = 0;
2799 ConditionEvent::deliver_qthresh_ = 0;
2800 ConditionEvent::abandon_ = 0;
2801 ConditionEvent::eq_abandon_ = 0;
2802 ConditionEvent::abandon_init_above_ = 0;
2803 ConditionEvent::abandon_init_below_ = 0;
2804 ConditionEvent::abandon_above_ = 0;
2805 ConditionEvent::abandon_below_ = 0;
2806 PreSyn::presyn_send_mindelay_ = 0;
2807 PreSyn::presyn_send_direct_ = 0;
2808 PreSyn::presyn_deliver_netcon_ = 0;
2809 PreSyn::presyn_deliver_direct_ = 0;
2810 PreSyn::presyn_deliver_ncsend_ = 0;
2811 SelfEvent::selfevent_send_ = 0;
2812 SelfEvent::selfevent_move_ = 0;
2813 SelfEvent::selfevent_deliver_ = 0;
2814 WatchCondition::watch_send_ = 0;
2815 WatchCondition::watch_deliver_ = 0;
2816 PlayRecordEvent::playrecord_deliver_ = 0;
2817 PlayRecordEvent::playrecord_send_ = 0;
2818 HocEvent::hocevent_send_ = 0;
2819 HocEvent::hocevent_deliver_ = 0;
2820 DiscreteEvent::discretevent_send_ = 0;
2821 DiscreteEvent::discretevent_deliver_ = 0;
2822 KSSingle::singleevent_deliver_ = 0;
2823 KSSingle::singleevent_move_ = 0;
2829 allthread_hocevents_->remove_all();
2832 if (p_nrn2neosim_send)
for (i=0; i < nlist_; ++
i) {
2833 TQueue* tq =
p.lcv_[
i].neosim_self_events_;
2874 p[
i].tqe_->nshift_ = -1;
2893 #if BBTQ == 3 || BBTQ == 4 2897 if (nrn_use_fifo_queue_) {
2900 ps->
delay_ = dil[0]->delay_;
2906 if (dil.size() > 2) {
2908 ps->
delay_ = dil[0]->delay_;
2911 #endif // USE_MIN_DELAY 2913 for (
auto it = dil.rbegin(); it != dil.rend(); ++it) {
2918 #if BBTQ == 3 || BBTQ == 4 2919 if (nrn_use_fifo_queue_ && d->
delay_ != fifodelay) {
2920 hoc_warning(
"Use of the event fifo queue is turned off due to more than one value for NetCon.delay", 0);
2921 nrn_use_fifo_queue_ =
false;
2943 for (j = d->
cnt_-1; j > 0; --j) {
2951 if (gcv_->ctd_[j].watch_list_) {
2952 gcv_->ctd_[
j].watch_list_->RemoveAll();
2958 for (i = 0; i < d.
nlcv_; ++
i) {
2969 for (
auto it = dil_.rbegin(); it != dil_.rend(); ++it) {
2980 p[nt->
id].enqueue(
this, nt);
2981 while(deliver_event(til, nt)) {
2993 d->
pr(
"", q->
t_, net_cvode_instance);
3004 p[0].tqe_->forall_callback(
peq);
3019 int n = event_info_tvec_->
size();
3025 event_info_list_->
append(nc->obj_);
3032 event_info_flagvec_->
push_back(se->flag_);
3033 event_info_list_->
append(se->target_->ob);
3039 for (
auto it = ps->dil_.rbegin(); it != ps->dil_.rend(); ++it) {
3041 double td = nc->delay_ - ps->delay_;
3043 event_info_list_->
append(nc->obj_);
3055 event_info_type_ = (
int)
chkarg(i++, 2, 3);
3057 event_info_tvec_->
resize(0);
3060 event_info_flagvec_->
resize(0);
3071 ns->
event(tt,
this, nt);
3085 Printf(
"%s DiscreteEvent %.15g\n", s, tt);
3104 int type = target_->prop->type;
3105 std::string ss(
"net-receive-");
3108 if (
PP2NT(target_) != nt) {
3109 Printf(
"NetCon::deliver nt=%d target=%d\n", nt->
id,
PP2NT(target_)->
id);
3116 while ((q = *(pq)) !=
nil && q->
t_ < tt) {
3136 hoc_warning(
"errno set during NetCon deliver to NET_RECEIVE", (
char*)0);
3145 int type = target_->prop->type;
3150 hoc_warning(
"errno set during NetCon deliver to NET_RECEIVE", (
char*)0);
3169 if (use_min_delay_) {
3171 #if BBTQ == 3 || BBTQ == 4 3172 ns->fifo_event(tt+delay_,
this);
3183 ns->
event(tt+delay_,
this);
3188 for (
auto it = dil_.rbegin(); it != dil_.rend(); ++it) {
3204 #endif //ndef USENCS 3205 #if USENCS || NRNMPI 3206 if (output_index_ >= 0) {
3214 if (nrn_use_localgid_) {
3215 nrn_outputevent(localgid_, tt);
3218 nrn2ncs_outputevent(output_index_, tt);
3228 #endif //USENCS || NRNMPI 3243 for (
const auto& d : dil_) {
3244 if (d->active_ && d->target_ &&
PP2NT(d->target_) == nt) {
3245 double dtt = d->delay_ - delay_;
3249 d->deliver(tt, ns, nt);
3250 }
else if (dtt < 0.) {
3251 hoc_execerror(
"internal error: Source delay is > NetCon delay", 0);
3254 ns->
event(tt + dtt, d, nt);
3264 for (
const auto& d : dil_) {
3265 if (d->active_ && d->target_ &&
PP2NT(d->target_) == nt) {
3266 double dtt = d->delay_ - delay_;
3285 for (
const auto& d : dil_) {
3286 if (d->active_ && d->target_) {
3287 double dtt = d->delay_ - delay_;
3288 if (0 && dtt == 0.) {
3291 d->deliver(tt, ns, nt);
3292 }
else if (dtt < 0.) {
3293 hoc_execerror(
"internal error: Source delay is > NetCon delay", 0);
3296 ns->
event(tt + dtt, d, nt);
3323 net_send(movable_, weight_, target_, tt, flag_);
3330 int ppindex, ncindex, moff, pptype, iml;
3334 nrn_assert(sscanf(buf,
"%s %d %d %d %d %lf\n", ppname, &ppindex, &pptype, &ncindex, &moff, &flag) == 6);
3368 sepp_->reserve(211);
3379 const auto& iter = sepp_->find(type +
n_memb_func*oindex);
3381 return iter->second;
3392 moff = (
Datum*)(movable_) - target_->prop->dparam;
3393 assert(movable_ == &(target_->prop->dparam[moff]._pvoid));
3404 fprintf(f,
"%s %d %d %d %d %g\n",
3405 target_->ob->ctemplate->sym->name, target_->ob->index,
3406 target_->prop->type,
3414 int type = target_->prop->type;
3417 if (flag_ == 1.0) { *movable_ = 0; }
3419 while ((q = (
TQItem*)(*movable_)) != 0 && q->
t_ <= tt) {
3434 call_net_receive(ns);
3440 call_net_receive(ns);
3444 POINT_RECEIVE(target_->prop->type, target_, weight_, flag_);
3447 hoc_warning(
"errno set during SelfEvent deliver to NET_RECEIVE", (
char*)0);
3461 plr_->frecord_init(q);
3465 if (plr_->cvode_ && plr_->cvode_->nth_) {
3466 assert(nt == plr_->cvode_->nth_);
3470 plr_->deliver(tt, ns);
3476 Printf(
"%s PlayRecordEvent %.15g ", s, tt);
3495 Printf(
"%s TstopEvent %.15g\n", s, tt);
3501 hoc_execerror(
"TstopEvent::savestate_save:",
" is not the tstop_event_");
3508 Printf(
"tstop_event_ onto queue\n");
3528 Printf(
"microstep local retreat from %g (cvode_%p is at %g) for event onset=%g\n", cv->
tqitem_->
t_, cv, cv->
t_, t);
3534 if (print_event_ > 1) {
3535 Printf(
"after target solve time for %p is %g , dt=%g\n", cv, cv->
time(),
nt_dt);
3548 Printf(
"microstep retreat from %g (cvode_%p is at %g) for event onset=%g\n",
3557 if (print_event_ > 1) {
3558 Printf(
"after target solve time for %p is %g , dt=%g\n", cv, cv->
time(),
dt);
3565 bool neosim_deliver_self_events(
TQueue* tqe,
double til);
3566 bool neosim_deliver_self_events(
TQueue* tqe,
double til) {
3571 while (tqe->
least_t() <= til + .5e-8) {
3578 d->
deliver(t, net_cvode_instance);
3582 void neosim2nrn_advance(
void*
e,
void*
v,
double tout) {
3592 tqe = cv->neosim_self_events_;
3599 }
while (neosim_deliver_self_events(tqe, t));
3606 void neosim2nrn_deliver(
void* e,
void* v) {
3620 err = pgvts_event(tt);
3634 int rank, op, err,
init;
3637 de = pgvts_least(tt, op, init);
3638 err = pgvts_cvode(tt, op);
3639 if (init) { gcv_->set_init_flag(); }
3642 while (
p[0].tqe_->least_t() == tt) {
3647 p[0].tqe_->remove(q);
3662 if (gcv_->initialize_ &&
p[0].tqe_->least_t() > gcv_->t_) {
3666 }
else if (gcv_->tn_ <
p[0].tqe_->least_t()) {
3676 q =
p[0].tqe_->least();
3682 TQItem* q2 =
p[0].tqe_->second_least(tt);
3697 double ts = tt;
int ops = op;
3698 if (nrnmpi_pgvts_least(&tt, &op, &init)) {
3700 p[0].tqe_->remove(q);
3702 }
else if (op == 4) {
3703 p[0].tqe_->remove(q);
3704 }
else if (ts == tt && q && ops == op) {
3705 p[0].tqe_->remove(q);
3719 gcv_->check_deliver();
3721 gcv_->record_continuous();
3722 err = gcv_->advance_tn();
3724 gcv_->evaluate_conditions();
3728 err = gcv_->interpolate(tt);
3731 err = gcv_->init(tt);
3732 initialized_ =
true;
3734 gcv_->evaluate_conditions();
3743 if ( gcv_) {
return gcv_->use_partrans_; }
else {
return 0; }
3754 net_cvode_instance->
pgvts(tstop);
3760 net_cvode_instance->
solve(tstop);
3772 #if NRNMPI && !defined(USENCS) 3776 while (
nt_t <= ts) {
3793 return p[nt->
id].tqe_;
3809 for (q1 = sq->first(); q1; q1 = q2) {
3813 se->
deliver(q1->
t_, net_cvode_instance, nt);
3831 pending_selfqueue_deliver_ = tt;
3838 void ncs2nrn_inputevent(
int i,
double tdeliver) {
3840 net_cvode_instance->
event(tdeliver, ncs2nrn_input_->item(i), nt);
3846 void nrn2ncs_netcons() {
3853 if (ncs2nrn_input_) {
3854 for (i=0; i < ncs2nrn_input_->count(); ++
i) {
3857 ncs2nrn_input_->remove_all();
3862 for (i=0; i < list->
count(); ++
i) {
3865 ncs2nrn_input_->append(nc);
3871 for (i=0; i < list->
count(); ++
i) {
3886 if (i < 0 || ii++ == i) {
3887 p[
id].lcv_[
j].statistics();
3891 Printf(
"NetCon active=%lu (not sent)=%lu delivered=%lu\n", NetCon::netcon_send_active_, NetCon::netcon_send_inactive_, NetCon::netcon_deliver_);
3892 Printf(
"Condition O2 thresh detect=%lu via init=%lu effective=%lu abandoned=%lu (unnecesarily=%lu init+=%lu init-=%lu above=%lu below=%lu)\n",ConditionEvent::send_qthresh_, ConditionEvent::init_above_, ConditionEvent::deliver_qthresh_, ConditionEvent::abandon_, ConditionEvent::eq_abandon_, ConditionEvent::abandon_init_above_, ConditionEvent::abandon_init_below_, ConditionEvent::abandon_above_, ConditionEvent::abandon_below_);
3893 Printf(
"PreSyn send: mindelay=%lu direct=%lu\n", PreSyn::presyn_send_mindelay_, PreSyn::presyn_send_direct_);
3894 Printf(
"PreSyn deliver: O2 thresh=%lu NetCon=%lu (send=%lu deliver=%lu)\n", ConditionEvent::deliver_qthresh_, PreSyn::presyn_deliver_netcon_, PreSyn::presyn_deliver_ncsend_, PreSyn::presyn_deliver_direct_);
3895 Printf(
"SelfEvent send=%lu move=%lu deliver=%lu\n", SelfEvent::selfevent_send_, SelfEvent::selfevent_move_, SelfEvent::selfevent_deliver_);
3896 Printf(
"Watch send=%lu deliver=%lu\n", WatchCondition::watch_send_, WatchCondition::watch_deliver_);
3897 Printf(
"PlayRecord send=%lu deliver=%lu\n", PlayRecordEvent::playrecord_send_, PlayRecordEvent::playrecord_deliver_);
3898 Printf(
"HocEvent send=%lu deliver=%lu\n", HocEvent::hocevent_send_, HocEvent::hocevent_deliver_);
3899 Printf(
"SingleEvent deliver=%lu move=%lu\n", KSSingle::singleevent_deliver_, KSSingle::singleevent_move_);
3900 Printf(
"DiscreteEvent send=%lu deliver=%lu\n", DiscreteEvent::discretevent_send_, DiscreteEvent::discretevent_deliver_);
3901 Printf(
"%lu total events delivered net_event=%lu\n", deliver_cnt_, net_event_cnt_);
3902 Printf(
"Discrete event TQueue\n");
3903 p[0].tqe_->statistics();
3905 Printf(
"Variable step integrator TQueue\n");
3906 p[0].tq_->statistics();
3919 n +=
p[
i].lcv_[
j].neq_;
3932 p[0].tqe_->spike_stat(d+8);
3937 fornetcon_prepare();
3949 gcv_->init_prepare();
3952 gcv_->can_retreat_ =
false;
3963 if (playrec_change_cnt_ != structure_change_cnt_) {
3972 gcv_->t_ =
t; gcv_->tn_ =
t;
3981 double dtsav =
nt_dt;
3987 gcv_->evaluate_conditions();
4008 if (nrn_fornetcon_cnt_ == 0) {
return; }
4016 int index = nrn_fornetcon_index_[
i];
4017 int type = nrn_fornetcon_type_[
i];
4049 for (
const auto& d1 : dil) {
4051 if (pnt && t2i[pnt->
prop->
type] > -1) {
4061 int index = nrn_fornetcon_index_[
i];
4062 int type = nrn_fornetcon_type_[
i];
4089 for (
const auto& d1 : dil) {
4091 if (pnt && t2i[pnt->
prop->
type] > -1) {
4125 int i,
cnt = prl_->count();
4132 for (j=0; j < jcnt; ++
j) {
4137 for (i=0; i <
cnt; ++
i) {
4138 prl_->item(i)->record_init();
4143 int i,
cnt = prl_->count();
4144 for (i=0; i <
cnt; ++
i) {
4145 prl_->item(i)->play_init();
4157 if (sec ==
p[i].lcv_[j].ctd_[0].v_node_[
p[i].lcv_[j].ctd_[0].rootnodecount_]->sec) {
4180 n +=
p[
i].lcv_[
j].neq_;
4190 p[
i].lcv_[
j].states(vp+k);
4191 k +=
p[
i].lcv_[
j].neq_;
4209 n +=
p[
i].lcv_[
j].neq_;
4219 p[
i].lcv_[
j].dstates(vp+k);
4220 k +=
p[
i].lcv_[
j].neq_;
4241 if (s->size() != d->
gcv_->
neq_) {
hoc_execerror(
"size of state vector != number of state equations", 0); }
4243 ds->resize(s->size());
4252 if (s->size() != d->
gcv_->
neq_) {
hoc_execerror(
"size of state vector != number of state equations", 0); }
4281 n +=
p[
i].lcv_[
j].neq_;
4288 gcv_->states(vp + j);
4291 p[
i].lcv_[
j].error_weights(vp+k);
4292 k +=
p[
i].lcv_[
j].neq_;
4310 n +=
p[
i].lcv_[
j].neq_;
4317 gcv_->states(vp + j);
4320 p[
i].lcv_[
j].acor(vp+k);
4321 k +=
p[
i].lcv_[
j].neq_;
4327 int i, it,
j,
n, neq;
4337 n +=
p[
i].lcv_[
j].neq_;
4343 if (!hdp_ || hdp_->style() != style) {
4354 hdp_->append(pv[j]);
4359 neq =
p[it].lcv_[
i].ctd_[0].nvsize_;
4360 pv =
p[it].lcv_[
i].ctd_[0].pv_;
4361 for (j=0; j < neq; ++
j) {
4362 hdp_->append(pv[j]);
4374 Symbol* sym = hdp_->retrieve_sym(z.
pv_[is - j]);
4376 return sym2name(sym);
4390 if (j +
p[it].lcv_[i].neq_ > is) {
4393 Symbol* sym = hdp_->retrieve_sym(z.
pv_[is - j]);
4395 return sym2name(sym);
4405 j +=
p[it].lcv_[
i].neq_;
4412 if (sym->
type == RANGEVAR && sym->
u.
rng.type > 1
4414 static char buf[200];
4423 char*
buf =
new char[strlen(name)+1];
4426 for (cp = buf; *cp; ++cp) {
4437 if (sym && *cp ==
'\0' && (sym->
type == RANGEVAR || strcmp(sym->
name,
"Vector") == 0)) {
4440 }
else if (sym && sym->
type == TEMPLATE && *cp !=
'\0') {
4448 hoc_execerror(name,
"must be in form rangevar or Template.var");
4459 if ((stiff_ == 0) != (x == 0)) {
4461 gcv_->free_cvodemem();
4465 p[
i].lcv_[
j].free_cvodemem();
4474 gcv_->maxorder(maxorder_);
4478 p[
i].lcv_[
j].maxorder(maxorder_);
4490 o =
p[
i].lcv_[
j].order();
4499 gcv_->minstep(minstep_);
4503 p[
i].lcv_[
j].minstep(minstep_);
4510 gcv_->maxstep(maxstep_);
4514 p[
i].lcv_[
j].maxstep(maxstep_);
4523 gcv_->structure_change_ =
true;
4527 p[
i].lcv_[
j].structure_change_ =
true;
4538 if (ssrc) { consist_sec_pd(
"NetCon", ssrc, dsrc); }
4540 pst_ =
new PreSynTable(1000);
4560 if (!pst_->find(ps, psrc)) {
4561 ps =
new PreSyn(psrc, osrc, ssrc);
4563 pst_->insert(psrc, ps);
4572 ps =
new PreSyn(psrc, osrc, ssrc);
4588 structure_change_cnt_ = 0;
4613 pst_->remove(ps->
thvar_);
4617 for (
int it = 0; it < gcv_->nctd_; ++it) {
4618 PreSynList* psl = gcv_->ctd_[it].psl_th_;
4619 if (psl)
for (
int j = 0;
j < psl->count(); ++
j) {
4620 if (psl->item(
j) == ps) {
4629 PreSynList* psl =
p[
i].lcv_[
j].ctd_[0].psl_th_;
4630 if (psl)
for (
int j = 0; j < psl->count(); ++
j) {
4631 if (psl->item(j) == ps) {
4646 pr(
"savestate_save", 0, net_cvode_instance);
4647 hoc_execerror(
"DiscreteEvent::savestate_save:",
" is not the null_event_");
4654 Printf(
"null_event_ onto queue\n");
4677 src_->
dil_.push_back(
this);
4678 src_->use_min_delay_ = 0;
4680 if (target ==
nil) {
4684 weight_ =
new double[cnt_];
4690 #if DISCRETE_EVENT_OBSERVER 4699 weight_ =
new double[cnt_];
4700 for (
int i=0; i < cnt_; ++
i) {
4713 #if DISCRETE_EVENT_OBSERVER 4722 for (
int i=0; i < src_->dil_.size(); ++
i) {
4723 if (src_->dil_[i] ==
this) {
4724 src_->dil_.erase(src_->dil_.begin()+
i);
4725 if (src_->dil_.size() == 0 && src_->tvec_ ==
nil 4726 && src_->idvec_ ==
nil) {
4728 if (src_->output_index_ == -1)
4744 src_->dil_.push_back(
this);
4745 src_->use_min_delay_ = 0;
4762 if (netcon_ && netcon_->target_) {
4763 nt =
PP2NT(netcon_->target_);
4768 nc->
event(tt, netcon_, nt);
4776 sscanf(buf,
"%d\n", &index);
4784 fprintf(f,
"%d\n", netcon_->obj_->index);
4816 wtable_->insert(nc->
weight_, nc);
4820 if (wtable_->find(nc, pd)) {
4838 idxtable_->insert(obj->
index, nc);
4842 if (idxtable_->find(nc,
id)) {
4855 if (!ps) {
return; }
4860 }
else if (ps->
ssrc_) {
4869 if (!
p[i].psl_thr_) {
4883 if (
p[i].psl_thr_) {
4907 for (i=0; i <
n; ++
i) {
4908 p[
i].unreffed_event_cnt_ = 0;
4936 if (osrc_ && !src) {
4939 #if 1 || USENCS || NRNMPI 4948 #if DISCRETE_EVENT_OBSERVER 4964 #if DISCRETE_EVENT_OBSERVER 4974 if (thvar_ || osrc_) {
4975 #if DISCRETE_EVENT_OBSERVER 4986 for (
const auto& d : dil_) {
5004 nc->
event(tt, presyn_, presyn_->nt_);
5012 nrn_assert(sscanf(buf,
"%d %d\n", &index, &tid) == 2);
5021 fprintf(f,
"%ld %d\n", presyn_->hi_index_, presyn_->nt_?presyn_->nt_->id:0);
5044 idxtable_ =
new PreSynSaveIndexTable(2*cnt);
5053 if (idxtable_->find(ps,
id)) {
5076 if (strlen(stmt) > 0) {
5092 #if DISCRETE_EVENT_OBSERVER 5103 #if DISCRETE_EVENT_OBSERVER 5109 tvec_->mutconstruct(1);
5119 if (idvec_) {tvec_->lock();}
5120 tvec_->push_back(tt);
5122 idvec_->push_back(rec_id_);
5129 stmt_->execute(
false);
5136 if (tvec_ && tvec_->obj_ == ((
ObjObservable*)o)->object()) {
5139 if (idvec_ && idvec_->obj_ == ((
ObjObservable*)o)->object()) {
5142 if (dil_.size() == 0 && tvec_ ==
nil && idvec_ ==
nil && output_index_ == -1) {
5149 for (
const auto& d : dil_) {
5150 #if 0 // osrc_ below is invalid 5159 #if DISCRETE_EVENT_OBSERVER 5165 #if DISCRETE_EVENT_OBSERVER 5177 #if DISCRETE_EVENT_OBSERVER 5185 if (
value() > 0.0) {
5186 if (flag_ ==
false) {
5190 if (neosim_entity_) {
5191 (*p_nrn2neosim_send)(neosim_entity_, tt);
5194 send(tt + teps, net_cvode_instance, nt);
5214 abandon_statistics(cv);
5224 if (flag_ ==
false && val >= 0.0) {
5227 if (cv->
t0_ == cv->
tn_) {
5233 send(nt->
_t, net_cvode_instance, nt);
5239 valthresh_ = valold_;
5240 double th = -valold_/(val - valold_);
5241 th = th*nt->
_t + (1. - th)*told_;
5243 qthresh_ = net_cvode_instance->
event(th,
this, nt);
5245 }
else if (flag_ ==
true && valold_ < valthresh_ && val < valthresh_) {
5257 double val = stet_->value();
5264 if (
nt_t == qthresh_->t_) {
5269 Printf(
"abandon when t == qthresh_->t_ = %20.15g\n",
nt_t);
5271 if (cv->
t0_ == cv->
tn_) {
5272 if (
value() > 0.0) {
5278 if (
value() > 0.0) {
5322 cv = net_cvode_instance->
gcv_;
5331 net_cvode_instance->
wl_list_[
id].push_back(wl);
5338 fprintf(stderr,
"WATCH condition with flag=%g for %s\n",
5368 hoc_warning(
"errno set during WatchCondition deliver to NET_RECEIVE", (
char*)0);
5374 double* var1,
double* var2,
5385 if (st->
var1_ == &t) {
5391 if (var1_is_time_) {
5392 var1_ = &stec_->thread()->_t;
5394 if (stec_->qthresh_) {
5395 net_cvode_instance->
remove_event(stec_->qthresh_, stec_->thread()->id);
5396 stec_->qthresh_ =
NULL;
5402 if (stec_->qthresh_) {
5403 net_cvode_instance->
remove_event(stec_->qthresh_, stec_->thread()->id);
5404 stec_->qthresh_ =
NULL;
5460 hoc_warning(
"errno set during WatchCondition deliver to NET_RECEIVE", (
char*)0);
5477 hoc_warning(
"errno set during STECondition pgvts_deliver to NET_RECEIVE", (
char*)0);
5504 for (i = z.
psl_th_->count()-1; i >= 0; --
i) {
5505 z.
psl_th_->item(i)->condition(
this);
5531 for (i = z.
psl_th_->count()-1; i >= 0; --
i) {
5545 cnt = fixed_record_->count();
5546 for (i=0; i <
cnt; ++
i) {
5548 if (pr->
ith_ == nt->
id) {
5556 cnt = fixed_play_->count();
5557 for (i=0; i <
cnt; ++
i) {
5559 if (pr->
ith_ == nt->
id) {
5578 int i_trajec,
int* types,
int* indices,
double** pvars,
double** varrays)
5582 int cur_size = v->
size();
5587 v->
resize(bsize + cur_size);
5588 varrays[i_trajec] =
vector_vec(v) + cur_size;
5590 pvars[i_trajec] = pd;
5594 types[i_trajec] = 0;
5595 indices[i_trajec] = 0;
5599 Fprintf(stderr,
"Pointer %p of PlayRecord type %d ignored because not a Range Variable",
5622 int& n_pr,
void**& vpr,
5623 int& n_trajec,
int*& types,
int*& indices,
double**& pvars,
double**& varrays) {
5625 if (nrn_trajectory_request_per_time_step_) {
5642 for (
int i=0;
i < cntp; ++
i) {
5644 if (pr->
ith_ == tid) {
5668 for (
int j=0;
j < gvr->
count(); ++
j) {
5681 vpr =
new void*[n_pr];
5682 types =
new int[n_trajec];
5683 indices =
new int[n_trajec];
5685 varrays =
new double*[n_trajec];
5687 pvars =
new double*[n_trajec];
5692 for (
int i=0;
i < cntp; ++
i) {
5695 if (pr->
ith_ == tid) {
5700 err =
trajec_buffered(nt, bsize, v, &nt.
_t, n_pr++, pr, vpr, n_trajec++, types, indices, pvars, varrays);
5701 if (err) { n_pr--; n_trajec--; }
5704 err =
trajec_buffered(nt, bsize, v, pr->
pd_, n_pr++, pr, vpr, n_trajec++, types, indices, pvars, varrays);
5705 if (err) { n_pr--; n_trajec--; }
5710 if (bsize && !glr->
v_) {
5714 err =
trajec_buffered(nt, bsize, v, pr->
pd_, n_pr++, pr, vpr, n_trajec++, types, indices, pvars, varrays);
5715 if (err) { n_pr--; n_trajec--; }
5719 for (GLineRecordEData::iterator it = ed.begin(); it != ed.end(); ++it) {
5720 double* pd = (*it).first;
5723 if (bsize && v ==
NULL) {
5724 v = (*it).second =
new IvocVect(bsize);
5726 err =
trajec_buffered(nt, bsize, v, pd, n_pr, pr, vpr, n_trajec++, types, indices, pvars, varrays);
5739 for (
int j=0;
j < gvr->
count(); ++
j) {
5741 err =
trajec_buffered(nt, bsize,
NULL, gvr->
pdata(
j), n_pr,
pr, vpr, n_trajec++, types, indices, pvars, varrays);
5756 if (n_trajec == 0) {
5758 if (types) {
delete [] types; types =
NULL; }
5759 if (indices) {
delete [] indices; indices =
NULL; }
5760 if (vpr) {
delete [] vpr; vpr =
NULL; }
5761 if (varrays) {
delete [] varrays; varrays =
NULL; }
5762 if (pvars) {
delete [] pvars; pvars =
NULL; }
5765 printf(
"nrnthread_get_trajectory_requests tid=%d bsize=%d n_pr=%d n_trajec=%d\n", tid, bsize, n_pr, n_trajec);
5768 for (
int i=0;
i < n_pr; ++
i) {
5772 printf(
" %d %d prtype=%d %p type=%d index=%d\n",
i, i_trajec, pr->
type(), pd, types[i_trajec], indices[i_trajec]);
5778 i_trajec += ed.size();
5794 if (tid == 0) { t = tt; }
5797 for (
int i=0;
i < n_pr; ++
i) {
5807 oc.
run(
"screen_update()\n");
5832 if (tid == 0) { t = tt; }
5833 for (
int i=0;
i < n_pr; ++
i) {
5846 glr->
plot(vecsz, tt);
5867 if (ps->
nt_ == nt) {
5875 for (
HTList* wl: wl_list_[nt->
id]) {
5885 void(*
cb)(
int,
int,
int,
int,
int));
5892 for (
auto& htlists_of_thread : net_cvode_instance->
wl_list_) {
5893 for (
HTList* wl : htlists_of_thread) {
5904 double tm, tt, tsav;
5906 if (use_bgpdma_) { nrnbgp_messager_advance(); }
5910 tm = nt->
_t + 0.5*nt->
_dt;
5923 if (nrn_use_bin_queue_) {
5932 extern bool nrn_use_compress_;
5934 p[tid].enqueue(
this, nt);
5937 while ((q =
p[tid].tqe_->dequeue_bin()) != 0) {
5940 if (print_event_) {db->
pr(
"binq deliver",
nt_t,
this);}
5942 p[tid].tqe_->release(q);
5949 deliver_events(tm, nt);
5952 if (nrn_use_bin_queue_) {
5953 if (
p[tid].tqe_->top()) {
goto tryagain; }
5954 p[tid].tqe_->shift_bin(tm);
5964 playrec_change_cnt_ = 0;
5970 playrec_change_cnt_ = 0;
5971 int i,
cnt = prl_->count();
5972 for (i=0; i <
cnt; ++
i) {
5973 if (prl_->item(i) ==
pr) {
5978 cnt = fixed_play_->count();
5979 for (i=0; i <
cnt; ++
i) {
5980 if (fixed_play_->item(i) ==
pr) {
5981 fixed_play_->remove(i);
5985 cnt = fixed_record_->count();
5986 for (i=0; i <
cnt; ++
i) {
5987 if (fixed_record_->item(i) ==
pr) {
5988 fixed_record_->remove(i);
5995 int i,
cnt = prl_->count();
5996 for (i=0; i <
cnt; ++
i) {
5997 if (prl_->item(i) ==
pr) {
6005 assert(i < prl_->count());
6006 return prl_->item(i);
6010 int i,
cnt = prl_->count();
6011 for (i=0; i <
cnt; ++
i) {
6012 if (prl_->item(i)->uses(v)) {
6013 return prl_->item(i);
6160 assert(cursize_ <= vrd->t_->size());
6182 if (t_->size() > 0) {
6192 y_->push_back(*pd_);
6194 if (
y_->size() < t_->size()) {
6248 y_->push_back(*pd_);
6255 consist_sec_pd(
"Cvode.record",
chk_access(), pd);
6262 bool discrete = ( (
ifarg(4) && (
int)
chkarg(4,0,1) == 1) ?
true :
false);
6266 pr = playrec_uses(t);
6284 long i,
j, iprl, prlc;
6286 prlc = prl_->count();
6287 fixed_record_->remove_all();
6288 fixed_play_->remove_all();
6293 p[
i].lcv_[
j].delete_prl();
6296 for (iprl = 0; iprl < prlc; ++iprl) {
6318 hoc_execerror(
"We were unable to associate a PlayRecord item with a RANGE variable",
nil);
6324 i = owned_by_thread(pr->
pd_);
6327 hoc_execerror(
"We were unable to associate a PlayRecord item with a thread",
nil);
6331 playrec_change_cnt_ = structure_change_cnt_;
6340 if (&
NODEV(nd) == pd) {
6344 for (p = nd->
prop; p; p = p->
next) {
6369 for (in=i1; in < i3; ++in) {
6371 if (&
NODEV(nd) == pd) {
6375 for (p = nd->
prop; p; p = p->
next) {
6395 for (in=-1; in < sec->
nnode; ++in) {
6398 if (!nd) {
continue; }
6400 nd = sec->
pnode[in];
6402 if (&
NODEV(nd) == pd) {
6406 for (p = nd->
prop; p; p = p->
next) {
6419 hoc_execerror(msg,
" pointer not associated with currently accessed section\n\ 6420 Use section ... (&var(x)...) intead of ...(§ion.var(x)...)\n");
6432 gcv_->activate_maxstate(on?
true:
false);
6435 p[
i].lcv_[
j].activate_maxstate(on?
true:
false);
6443 double* pamax = &
dummy;
6447 return maxstate_analyse(sym, pamax);
6462 n +=
p[
i].lcv_[
j].neq_;
6473 if (gcv_->maxstate_) {
6504 for (j=0; j <
n; ++
j) {
6505 sym = hdp_->retrieve_sym(z.
pv_[j]);
6506 if (!mst_->find(msi, (
void*)sym)) {
6511 mst_->insert((
void*)sym, msi);
6513 if (msi->
max_ < ms[j]) { msi->
max_ = ms[
j];}
6524 for (sym = hoc_built_in_symlist->
first; sym; sym = sym->
next) {
6527 mst_ =
new MaxStateTable(3*n);
6529 {
for (
TableIterator(MaxStateTable) ti(*mst_); ti.more(); ti.next()) {
6530 msi = ti.cur_value();
6534 if (empty_) {
return; }
6538 maxstate_analyze_1(it, *gcv_, msi, gcv_->ctd_[it]);
6543 maxstate_analyze_1(i, cv, msi, cv.
ctd_[0]);
6550 if (mst_ && mst_->find(msi, (
void*)sym)) {
6551 *pamax = msi->
amax_;
6561 int i,
cnt = prl_->count();
6562 for (i=0; i <
cnt; ++
i) {
6575 pst_->remove(ps->
thvar_);
6576 pst_->insert(pd, ps);
6605 if (n)
for (
int i=0;
i <
n; ++
i) {
6622 deliver_events_when_threads(tout);
6630 if ((til = allthread_least_t(tid)) < 1e10) {
6631 deliver_events_when_threads(til);
6639 while (gcv_->t_ < tout || allthread_least_t(tid) < tout) {
6640 err = global_microstep_when_threads();
6644 retreat(tout, gcv_);
6645 gcv_->record_continuous();
6648 double tc = gcv_->t_;
6649 initialized_ =
false;
6650 while (gcv_->t_ <= tc && !initialized_) {
6651 err = global_microstep_when_threads();
6662 lvardt_tout_ = tout;
6663 while(
nt_t < tout) {
6668 allthread_least_t(tid);
6675 hoc_execerror(
"Lvardt method from fadvance()",
"presently limited to single thread.");
6702 while(allthread_least_t(tid) <= til) {
6712 double tt = allthread_least_t(tid);
6713 double tdiff = tt - gcv_->t_;
6719 assert(tdiff == 0.0 || ( gcv_->tstop_begin_ <= tt && tt <= gcv_->tstop_end_));
6720 deliver_events_when_threads(tt);
6722 err = gcv_->handle_step(
this, tt);
6724 if ((tt = allthread_least_t(tid)) < gcv_->t_) {
6725 gcv_->interpolate(tt);
6731 net_cvode_instance->
p[nt->
id].
enqueue(net_cvode_instance, nt);
6743 double tt,
min = 1e50;
6752 for (
int id = 0;
id < pcnt_; ++
id) {
6753 tt =
p[
id].tqe_->least_t();
6754 if (tt < min) { tid =
id; min = tt; }
static unsigned long abandon_init_below_
ReceiveFunc * pnt_receive
static unsigned long send_qthresh_
int owned_by_thread(double *)
int nonvint_extra_offset_
virtual void savestate_restore(double deliverytime, NetCvode *)
virtual void deliver(double t, NetCvode *)
static int trajec_buffered(NrnThread &nt, int bsize, IvocVect *v, double *pd, int i_pr, PlayRecord *pr, void **vpr, int i_trajec, int *types, int *indices, double **pvars, double **varrays)
void deliver_events(double til, NrnThread *)
hoc_List * hoc_l_newlist()
struct Memb_list Memb_list
void distribute_dinfo(int *, int)
virtual void update_ptr(double *)
static double nc_active(void *v)
struct Arrayinfo Arrayinfo
Object * nrn_sec2cell(Section *)
int hoc_is_str_arg(int narg)
static void * eval_cond(NrnThread *nt)
void update_ptr(double *)
void nrn_multithread_job(void *(*job)(NrnThread *))
static double nc_srcgid(void *v)
virtual void pgvts_deliver(double t, NetCvode *)
TQItem * event(double tdeliver, DiscreteEvent *, NrnThread *)
void re_init(double t0=0.)
virtual void disconnect(Observable *)
std::unordered_map< long, Point_process * > SelfEventPPTable
BAMechList * cvbml(int, BAMech *, Cvode *)
TQItem * bin_event(double tdeliver, DiscreteEvent *, NrnThread *)
implementPtrList(PlayRecList, PlayRecord) void NetCvode
static unsigned long presyn_send_direct_
virtual ~ConditionEvent()
virtual void disconnect(Observable *)
static unsigned long hocevent_deliver_
void nrn_ba(NrnThread *, int)
virtual void savestate_write(FILE *)
double(* c_)(Point_process *)
void(* ReceiveFunc)(Point_process *, double *, double)
void activate(double flag)
double nrn_hoc2gather_y(void *v)
struct NrnThreadMembList * next
Symlist * hoc_top_level_symlist
virtual ~VecRecordDiscreteSave()
static unsigned long abandon_below_
static double stats(void *v)
void deliver_events_when_threads(double)
int _nrn_netcon_args(void *v, double ***argslist)
virtual void pr(const char *, double t, NetCvode *)
static void pnode(Prop *)
int nrn_dblpntr2nrncore(double *pd, NrnThread &nt, int &type, int &index)
void hoc_l_delete(hoc_Item *)
double * n_vector_data(N_Vector, int)
int global_microstep_when_threads()
int playrec_item(PlayRecord *)
#define ITERATE(itm, lst)
int hoc_is_double_arg(int narg)
double nrn_arc_position(Section *sec, Node *node)
virtual void allthread_handle()
void disconnect(Observable *)
virtual void send(double, NetCvode *, NrnThread *)
virtual void savestate_restore(double deliverytime, NetCvode *)
static unsigned long abandon_init_above_
Symbol * hoc_lookup(const char *)
virtual void deliver(double, NetCvode *, NrnThread *)
void deliver_least_event(NrnThread *)
void nrn_netcon_event(NetCon *nc, double td)
void playrec_remove(PlayRecord *)
int local_microstep(NrnThread *)
void playrec_add(PlayRecord *)
DiscreteEvent * pgvts_least(double &tt, int &op, int &init)
virtual void send(double sendtime, NetCvode *, NrnThread *)
#define GVectorRecordType
static bool equal(float x, float y, float e)
char * hoc_object_name(Object *ob)
virtual NrnThread * thread()
Represent main neuron object computed by single thread.
Symlist * hoc_built_in_symlist
int hoc_araypt(Symbol *, int)
STECondition(Point_process *, double(*)(Point_process *)=NULL)
static Member_func members[]
void artcell_net_move(void **, Point_process *, double)
void retreat(double, Cvode *)
static DiscreteEvent * savestate_read(FILE *)
std::vector< std::pair< double *, IvocVect *> > GLineRecordEData
virtual void pr(const char *, double t, NetCvode *)
void record_init_clear(const TQItem *q, int)
NrnThreadBAList * tbl[BEFORE_AFTER_SIZE]
void nrn2core_transfer_WATCH(void(*cb)(int, int, int, int, int))
static DiscreteEvent * savestate_read(FILE *)
void nrn_notify_when_void_freed(void *p, Observer *ob)
void psl_append(PreSyn *)
StateTransitionEvent * ste_
virtual NrnThread * thread()
check_obj_type(o, "SectionList")
PlayRecList * fixed_play_
virtual void send(double sendtime, NetCvode *, NrnThread *)
void ps_thread_link(PreSyn *)
static DiscreteEvent * null_event_
static IvocVect * event_info_tvec_
virtual void disconnect(Observable *)
implementPool(TQItemPool, TQItem) SelfQueue
static unsigned long singleevent_move_
Point_process * nrn_netcon_target(NetCon *nc)
static unsigned long netcon_deliver_
static unsigned long net_event_cnt_
static IvocVect * event_info_flagvec_
static void * lvardt_integrate(NrnThread *nt)
void hoc_l_freelist(hoc_List **)
static DiscreteEvent * savestate_read(FILE *)
void presyn_disconnect(PreSyn *)
VecRecordDiscrete(double *, IvocVect *y, IvocVect *t, Object *ppobj=nil)
std::vector< NetCon * > NetConPList
static philox4x32_key_t k
NetCvode * net_cvode_instance
virtual DiscreteEvent * savestate_save()
void scatter_y(double *, int)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
BAMechList * after_solve_
#define PlayRecordEventType
virtual void savestate_restore(double deliverytime, NetCvode *)
static Object ** nc_preseg(void *v)
void fun_thread(double t, double *y, double *ydot, NrnThread *nt)
static void pr(N_Vector x)
short * nrn_artcell_qindex_
virtual NrnThread * thread()
static double condition_order(void *v)
static unsigned long selfevent_send_
static Object ** nc_prelist(void *v)
double nrn_event_queue_stats(double *stats)
static DiscreteEvent * savestate_read(FILE *)
static NetConSaveWeightTable * wtable_
static void Attach(Object *, Observer *)
#define implementTable(Table, Key, Value)
double * hoc_pgetarg(int narg)
static unsigned long selfevent_move_
void evaluate_conditions(NrnThread *nt=0)
void(* nrnthread_v_transfer_)(NrnThread *)
double nrn_hoc2fixed_step(void *)
Point_process * ob2pntproc(Object *)
void local_retreat(double, Cvode *)
static double re_init(void *v)
const char * string() const
void ncs2nrn_integrate(double tstop)
void(* nrn_allthread_handle)()
virtual void deliver(double, NetCvode *, NrnThread *)
bool deliver_event(double til, NrnThread *)
void bgp_dma_send(PreSyn *ps, double t)
virtual int init(double t)
static DiscreteEvent * savestate_read(FILE *)
static Object ** newoclist(int i, OcList *&o)
virtual PlayRecordSave * savestate_save()
static double nc_valid(void *v)
ReceiveFunc * pnt_receive_init
YvecRecord(double *, IvocVect *y, Object *ppobj=nil)
double nrn_netcon_get_delay(NetCon *nc)
double immediate_deliver_
virtual ~CvodeThreadData()
static unsigned long playrecord_send_
TQueue * event_queue(NrnThread *nt)
virtual DiscreteEvent * savestate_save()
virtual void savestate_restore(double deliverytime, NetCvode *)
NetCon * install_deliver(double *psrc, Section *ssrc, Object *osrc, Object *target, double threshold, double delay, double weight)
Object ** hoc_temp_objvar(Symbol *symtemp, void *v)
static double nc_wcnt(void *v)
void record(IvocVect *, IvocVect *idvec=nil, int rec_id=0)
virtual ~WatchCondition()
void remove_event(TQItem *, int threadid)
VecRecordDiscreteSave(PlayRecord *)
void record_add(PlayRecord *)
static double cell(void *v)
void _nrn_free_fornetcon(void **)
void nrnmusic_injectlist(void *vp, double tt)
void nrn_parent_info(Section *)
int const size_t const size_t n
virtual void frecord_init(TQItem *)
virtual NrnThread * thread()
virtual void frecord_init(TQItem *)
void record_stmt(const char *)
static double check(double t, Daspk *ida)
void _nrn_free_watch(Datum *, int, int)
Called by Point_process destructor in translated mod file.
virtual void install(Cvode *)
virtual NrnThread * thread()
virtual void record_init()
virtual void install(Cvode *cv)
double nrn_hoc2fun(void *v)
virtual NrnThread * thread()
static Point_process * index2pp(int type, int oindex)
#define VecRecordDiscreteType
virtual void savestate_write(FILE *)
virtual void savestate_restore()
virtual void disconnect(Observable *)
void class2oc(const char *, void *(*cons)(Object *), void(*destruct)(void *), Member_func *, int(*checkpoint)(void **), Member_ret_obj_func *, Member_ret_str_func *)
void hoc_obj_unref(Object *obj)
static unsigned long singleevent_deliver_
static unsigned long deliver_qthresh_
double allthread_least_t(int &tid)
static unsigned long deliver_cnt_
void hoc_event(double, const char *hoc_stmt, Object *ppobj=nil, int reinit=0, Object *pyact=nil)
void update(Observable *)
static Object ** nc_get_recordvec(void *v)
virtual void disconnect(Observable *)
virtual void deliver(double, NetCvode *, NrnThread *)
VecRecordDt(double *, IvocVect *y, double dt, Object *ppobj=nil)
static unsigned long discretevent_deliver_
virtual void frecord_init(TQItem *q)
void spike_stat(double *)
const char * secname(Section *sec)
void hoc_warning(const char *, const char *)
virtual void pgvts_deliver(double t, NetCvode *)
virtual void record_init()
static PreSyn * hindx2presyn(long)
static unsigned long presyn_deliver_direct_
static double interpolate(double x0, double x1, double y0, double y1, double xnew)
void nrn_pushsec(Section *sec)
void fill_local_ba(int *, NetCvodeThreadData &)
void allthread_handle(double, HocEvent *, NrnThread *)
void net_event(Point_process *, double)
static unsigned long presyn_send_mindelay_
void nrn_netcon_set_delay(NetCon *nc, double d)
virtual ~VecRecordDiscrete()
static unsigned long netcon_send_inactive_
void check_thresh(NrnThread *)
#define DiscreteEventType
static unsigned long watch_deliver_
virtual void savestate_restore()
static unsigned long presyn_deliver_ncsend_
static unsigned long eq_abandon_
static double nc_setpost(void *v)
void hoc_execerror(const char *, const char *)
TQueue * net_cvode_instance_event_queue(NrnThread *)
double nrn_netcon_get_thresh(NetCon *nc)
static bool eq2(double x, double y, double e)
VecRecordDtSave(PlayRecord *)
void nrn_netcon_set_thresh(NetCon *nc, double th)
TQItem * insert(double t, void *data_)
int is_point_process(Object *)
static void steer_val(void *v)
virtual int pgvts_op(int &i)
virtual void record_init()
MUTDEC void set_enqueueing()
int solve_when_threads(double)
virtual void savestate_restore(double deliverytime, NetCvode *)
#define POINT_RECEIVE(type, tar, w, f)
Object * hoc_name2obj(const char *name, int index)
void nrn_pending_selfqueue(double tt, NrnThread *)
void MaxStateItem PreSyn WatchCondition double PreSyn SelfEvent TQItem static HocEvent TQList * record_init_items_
fprintf(stderr, "Don't know the location of params at %p\, pp)
BAMechList(BAMechList **first)
virtual PlayRecordSave * savestate_save()
void MaxStateItem PreSyn WatchCondition double PreSyn * declarePool(SelfEventPool, SelfEvent) implementPool(SelfEventPool
virtual void deliver(double t, NetCvode *, NrnThread *)
virtual void record_init()
void transition(int src, int dest, double *var1, double *var2, HocCommand *)
void enqueue(NetCvode *, NrnThread *)
static unsigned long init_above_
virtual void send(double deliverytime, NetCvode *, NrnThread *)
static NetCon * weight2netcon(double *)
static void peq(const TQItem *, int)
int * nrn_fornetcon_type_
static double nc_postloc(void *v)
Point_process * ob2pntproc_0(Object *)
static Object ** nc_pre(void *v)
int nrn_netcon_weight(NetCon *nc, double **pw)
void nrn_cleanup_presyn(PreSyn *)
static void * chk_deliv(NrnThread *nt)
static Object ** nc_syn(void *v)
short * nrn_is_artificial_
virtual void pr(const char *, double t, NetCvode *)
virtual void savestate_write(FILE *)
void _nrn_watch_activate(Datum *, double(*)(Point_process *), int, Point_process *, int, double)
void nrnthread_trajectory_return(int tid, int n_pr, int bsize, int vecsz, void **vpr, double t)
BAMechList * before_breakpoint_
static Object ** nc_synlist(void *v)
void hoc_obj_ref(Object *obj)
static Object ** nc_postcell(void *v)
virtual void savestate_write(FILE *)
PlayRecList * net_cvode_instance_prl()
static DiscreteEvent * savestate_read(FILE *)
static DiscreteEvent * tstop_event_
virtual void deliver(double, NetCvode *, NrnThread *)
virtual ~NetCvodeThreadData()
static PlayRecordSave * savestate_read(FILE *)
static unsigned long discretevent_send_
static void destruct(void *v)
double state_magnitudes()
void handle_tstop_event(double, NrnThread *nt)
void MaxStateItem * declarePtrList(PreSynList, PreSyn) implementPtrList(PreSynList
static unsigned long playrecord_deliver_
GLineRecordEData pd_and_vec_
virtual void install(Cvode *)
#define TableIterator(Table)
declareTable(MaxStateTable, void *, MaxStateItem *) implementTable(MaxStateTable
static double pending_selfqueue_deliver_
void deliver_net_events(NrnThread *)
static unsigned long netcon_send_active_
virtual void continuous(double t)
void nrn_onethread_job(int i, void *(*job)(NrnThread *))
static NetCon * index2netcon(long)
static void destruct(BAMechList **first)
struct Symbol::@52::@53 rng
PreSyn(double *src, Object *osrc, Section *ssrc=nil)
static void savestate_free()
#define MUTCONSTRUCT(mkmut)
void * nrn_interthread_enqueue(NrnThread *)
virtual void pgvts_deliver(double t, NetCvode *)
void consist_sec_pd(const char *, Section *, double *)
void artcell_net_send(void **, double *, Point_process *, double, double)
bool nrn_trajectory_request_per_time_step_
virtual void continuous(double t)
static unsigned long selfevent_deliver_
PlayRecList * fixed_record_
void nrn_notify_when_double_freed(double *p, Observer *ob)
const char * statename(int, int style=1)
virtual void pr(const char *, double t, NetCvode *)
static void * pending_selfqueue(NrnThread *)
static double statename(void *v)
static double eps(double x)
int * nrn_fornetcon_index_
static OcList * event_info_list_
void fanout(double, NetCvode *, NrnThread *)
WatchCondition(Point_process *, double(*)(Point_process *))
static double lvardt_tout_
virtual void deliver(double, NetCvode *, NrnThread *)
static Member_ret_obj_func omembers[]
virtual void savestate_write(FILE *)
int pgvts_event(double &tt)
virtual void install(Cvode *)
virtual void pgvts_deliver(double t, NetCvode *)
HocStruct cTemplate * ctemplate
void replace_src(PreSyn *)
static unsigned long watch_send_
virtual NrnThread * thread()
static unsigned long hocevent_send_
virtual void savestate_restore(double deliverytime, NetCvode *)
Symbol * name2sym(const char *)
void fixed_play_continuous(NrnThread *)
const char * pattern() const
void abandon_statistics(Cvode *)
void nrnthread_trajectory_values(int tid, int n_pr, void **vpr, double t)
Symbol * hoc_table_lookup(const char *, Symlist *)
double * hoc_val_pointer(const char *s)
void * nrn_presyn_netcon(PreSyn *ps, int i)
virtual int interpolate(double t)
void interthread_send(double, DiscreteEvent *, NrnThread *)
static void event_info_callback(const TQItem *, int)
Object *(* nrnpy_seg_from_sec_x)(Section *, double)
static void allthread_handle_callback()
#define VecPlayContinuousType
PlayRecord(double *pd, Object *ppobj=nil)
virtual void check(NrnThread *, double sendtime, double teps=0.0)
virtual DiscreteEvent * savestate_save()
void move_event(TQItem *, double, NrnThread *)
hoc_Item * hoc_l_insertvoid(hoc_Item *, void *)
double * vector_vec(Vect *v)
static PreSyn * unused_presyn
virtual PlayRecordSave * savestate_save()
static Object ** nc_precelllist(void *v)
void point_receive(int, Point_process *, double *, double)
static void Detach(Object *, Observer *)
virtual int handle_step(NetCvode *, double)
void nrn_notify_pointer_disconnect(Observer *ob)
void fill_local_ba_cnt(int, int *, NetCvodeThreadData &)
static std::unique_ptr< SelfEventPPTable > sepp_
virtual void pr(const char *, double t, NetCvode *)
int nrn_netcon_info(NetCon *nc, double **pw, Point_process **target, double **th, double **del)
virtual void deliver(double, NetCvode *, NrnThread *)
PlayRecList * playrec_list()
virtual void pgvts_deliver(double t, NetCvode *)
void delete_memb_list(CvMembList *)
PlayRecord * playrec_uses(void *)
void hoc_pushpx(double *d)
void maxstate_analyze_1(int, Cvode &, MaxStateItem *, CvodeThreadData &)
void net_send(void **, double *, Point_process *, double, double)
virtual void continuous(double t)
int hoc_is_object_arg(int narg)
static unsigned long presyn_deliver_netcon_
void nrn_use_busywait(int)
static Object ** nc_precell(void *v)
double nrn_hoc2scatter_y(void *v)
static double nc_event(void *v)
virtual void install(Cvode *)
static unsigned long abandon_
static HocEvent * alloc(const char *stmt, Object *, int, Object *pyact=nil)
int Match(const char *text, int length, int index)
static PreSynSaveIndexTable * idxtable_
static Object ** nc_postcelllist(void *v)
virtual void pr(const char *, double t, NetCvode *)
virtual void savestate_write(FILE *)
Object ** hoc_temp_objptr(Object *)
static void all_pending_selfqueue(double tt)
NetCvode(bool single=true)
static Node * node(Object *)
int run(int argc, const char **argv)
void check_deliver(NrnThread *nt=0)
virtual ~VecRecordDtSave()
static double nc_record(void *v)
virtual void pgvts_deliver(double t, NetCvode *)
CvMembList * cv_memb_list_
void call_net_receive(NetCvode *)
virtual DiscreteEvent * savestate_save()
int nrn_sec2cell_equals(Section *, Object *)
Object ** hoc_objgetarg(int)
Section * chk_access(void)
static double nc_preloc(void *v)
void move(TQItem *, double tnew)
#define BEFORE_BREAKPOINT
hoc_Item * net_cvode_instance_psl()
void nrn2core_transfer_WatchCondition(WatchCondition *wc, void(*cb)(int, int, int, int, int))
In nrncore_callbacks.cpp.
virtual PlayRecordEvent * event()
void nrn_fixed_step_group(int)
const char * sym2name(Symbol *)
TvecRecord(Section *, IvocVect *tvec, Object *ppobj=nil)
static unsigned long abandon_above_
int nrn_presyn_count(PreSyn *ps)
virtual void pgvts_deliver(double t, NetCvode *)
double chkarg(int, double low, double high)
static Object ** nc_postseg(void *v)
void fixed_record_continuous(NrnThread *)
void nrn_wait_for_threads()
double * nrn_recalc_ptr(double *)
void nrn_watch_clear()
Watch info corenrn->nrn transfer requires all activated WatchCondition be deactivated prior to mirror...
void net_move(void **, Point_process *, double)
void nrnthread_get_trajectory_requests(int tid, int &bsize, int &n_pr, void **&vpr, int &n_trajec, int *&types, int *&indices, double **&pvars, double **&varrays)
virtual void disconnect(Observable *)
static void * deliver_for_thread(NrnThread *nt)
virtual DiscreteEvent * savestate_save()
virtual void frecord_init(TQItem *)
void nrn_cvfun(double t, double *y, double *ydot)
static int event_info_type_
int linmod_extra_eqn_count()
void play_add(PlayRecord *)
virtual void savestate_read(FILE *)
BAMechList * before_step_
virtual ~PlayRecordEvent()
virtual void deliver(double t, NetCvode *)
cTemplate ** nrn_pnt_template_
int pgvts_cvode(double tt, int op)
static void * cons(Object *o)
virtual void savestate_write(FILE *)
void _nrn_watch_allocate(Datum *d, double(*c)(Point_process *), int i, Point_process *pnt, double flag)
Introduced so corenrn->nrn can request the mod file to make sure all WatchCondition are allocated...
void fill_global_ba(NrnThread *, int, BAMechList **)
virtual void pr(const char *, double t, NetCvode *)
struct NrnThreadBAList * next
static char * escape_bracket(const char *s)
virtual void deliver(double t, NetCvode *, NrnThread *)
virtual DiscreteEvent * savestate_save()