68 for (
size_t j = 0;
j < mla.size(); ++
j) {
69 int type = mla[
j].first;
76 cgs[
i].n_presyn = npre;
77 cgs[
i].n_real_output = ncell;
79 cgs[
i].output_gid =
new int[npre];
80 cgs[
i].output_vindex =
new int[npre];
84 for (
int j = 0;
j < npre; ++
j) {
86 cgs[
i].output_gid[
j] = -1;
87 cgs[
i].output_vindex[
j] = -1;
92 cgs[
i].n_output = ncell;
93 for (
size_t j = 0;
j < mla.size(); ++
j) {
94 int type = mla[
j].first;
100 cgs[
i].output_ps[npre] = ps;
110 double* d1 = ml->
data[0];
113 long ix{(d2 - d1) / sz};
114 agid = -(
type + 1000 * ix);
117 if (ps->output_index_ >= 0) {
118 cgs[
i].output_gid[npre] = ps->output_index_;
120 cgs[
i].group_id = ps->output_index_;
124 cgs[
i].output_gid[npre] = agid;
127 cgs[
i].output_gid[npre] = -1;
132 std::ostringstream oss;
134 <<
" artificial cells of a given type can be created per NrnThread, "
137 <<
" (cannot store cgs[" <<
i <<
"].output_vindex[" << npre
138 <<
"]=" << agid <<
')';
141 cgs[
i].output_vindex[npre] = agid;
155 cgs[
i].group_id =
cgs[
i].output_gid[0];
180 for (
size_t j = 0;
j < mla.size(); ++
j) {
190 for (
size_t j = 0;
j < mla.size(); ++
j) {
191 int type = mla[
j].first;
209 hoc_execerror(
"A nonempty thread has no real cell or ARTIFICIAL_CELL with a gid",
NULL);
228 for (
int i = 0;
i < dsize; ++
i) {
230 if (ds[
i] == -4 || ds[
i] == -6 || ds[
i] == -7 || ds[
i] == 0) {
236 for (
int i = 0;
i < mcnt; ++
i) {
243 int offset =
i * dsize;
244 int vdata_offset =
i * vdata_size;
245 for (
int j = 0;
j < dsize; ++
j) {
258 eindex = ml->nodeindices[
i];
261 if (dparam[
j].
pval < a || dparam[
j].
pval >= (a + nnode)) {
262 printf(
"%s dparam=%p a=%p a+nnode=%p j=%d\n",
272 eindex = dparam[
j].
pval - a;
275 }
else if (dmap[
j] == -2) {
277 eindex = dparam[
j].
i;
278 }
else if (dmap[
j] == -3) {
280 }
else if (dmap[
j] == -4) {
283 eindex = vdata_offset++;
284 }
else if (dmap[
j] == -6) {
287 eindex = vdata_offset++;
288 }
else if (dmap[
j] == -7) {
291 eindex = vdata_offset++;
292 }
else if (dmap[
j] == -8) {
295 }
else if (dmap[
j] == -10) {
298 }
else if (dmap[
j] == -9) {
307 double* pdiam =
NULL;
315 eindex = ml->nodeindices[
i];
316 }
else if (dmap[
j] == -5) {
319 double* pd = dparam[
j].
pval;
323 "POINTER is not pointing to voltage or mechanism data. Perhaps it "
324 "should be a BBCOREPOINTER\n");
328 }
else if (dmap[
j] > 0 && dmap[
j] < 1000) {
331 if (dparam[
j].pval < eml->
data[0]) {
332 printf(
"%s dparam=%p data=%p j=%d etype=%d %s\n",
343 if (dparam[
j].
pval >=
345 printf(
"%s dparam=%p data=%p j=%d psize=%d nodecount=%d etype=%d %s\n",
358 }
else if (dmap[
j] > 1000) {
361 eindex = *((
int*) dparam[
j]._pvoid);
364 sprintf(errmes,
"Unknown semantics type %d for dparam item %d of", dmap[
j],
j);
398 cgs[
i].n_netcon = nccnt[
i];
400 cgs[
i].netcon_srcgid =
new int[nccnt[
i] + 1];
401 cgs[
i].netcon_pnttype =
new int[nccnt[
i] + 1];
402 cgs[
i].netcon_pntindex =
new int[nccnt[
i] + 1];
417 cgs[ith].netcons[
i] = nc;
428 double* d1 = ml->
data[0];
431 int ix = (d2 - d1) / sz;
432 cgs[ith].netcon_pntindex[
i] = ix;
435 cgs[ith].netcon_pnttype[
i] = 0;
436 cgs[ith].netcon_pntindex[
i] = -1;
442 cgs[ith].netcon_srcgid[
i] = ps->
gid_;
447 cgs[ith].netcon_negsrcgid_tid.push_back(ps->
nt_->
id);
453 "NetCon and NetCon source with no gid are not in the same thread",
461 cgs[ith].netcon_srcgid[
i] = -(
type + 1000 * ix);
466 double* d1 = ml->
data[0];
469 int ix = (d2 - d1) / sz;
470 cgs[ith].netcon_srcgid[
i] = -(
type + 1000 * ix);
473 cgs[ith].netcon_srcgid[
i] = -1;
477 cgs[ith].netcon_srcgid[
i] = -1;
523 if (strcmp(
memb_func[
i].sym->name,
"HDF5Reader") == 0) {
545 ml->nodeindices =
NULL;
548 ml->
data =
new double*[acnt[
id]];
572 size_t mla_rankbytes = 0;
577 size_t threadbytes = 0;
584 nbytes = nt->
end * (1 *
sizeof(int) + 3 *
sizeof(
double));
585 threadbytes += nbytes;
588 size_t mechcnt_instances = 0;
590 for (
size_t i = 0;
i < mla.size(); ++
i) {
591 int type = mla[
i].first;
606 (notart *
sizeof(int) + 1 *
sizeof(
double*) + 1 *
sizeof(
Datum*) +
607 psize *
sizeof(
double) + dpsize *
sizeof(
Datum));
608 threadbytes += nbytes;
614 mla_rankbytes += threadbytes;
616 return mla_rankbytes;
629 for (
size_t i = 0;
i < mla.size(); ++
i) {
630 int type = mla[
i].first;
short * nrn_is_artificial_
int nrn_has_net_event_cnt_
void nrncore_netpar_cellgroups_helper(CellGroup *)
std::vector< std::map< int, Memb_list * > > Deferred_Type2ArtMl
std::vector< MlWithArtItem > MlWithArt
std::pair< int, Memb_list * > MlWithArtItem
std::map< double *, int > PVoid2Int
static void mk_cgs_netcon_info(CellGroup *cgs)
static PVoid2Int artdata2index_
static int * has_net_event_
static CellGroup * mk_cellgroups(CellGroup *)
static int nrn_has_net_event(int type)
static void clean_art(CellGroup *)
static void datumindex_fill(int, CellGroup &, DatumIndices &, Memb_list *)
static void mk_tml_with_art(CellGroup *)
static void setup_nrn_has_net_event()
static size_t get_mla_rankbytes(CellGroup *)
static void datumtransform(CellGroup *)
static Deferred_Type2ArtMl deferred_type2artml_
static int nrncore_art2index(double *d)
DatumIndices * datumindices
VEC * cgs(MTX_FN A, void *A_params, VEC *b, VEC *r0, double tol, VEC *x)
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
void hoc_execerror(const char *, const char *)
Symbol * hoc_lookup(const char *)
#define ITERATE(itm, lst)
int * nrn_prop_param_size_
int nrn_dblpntr2nrncore(double *pd, NrnThread &nt, int &type, int &index)
int * nrn_prop_dparam_size_
int const size_t const size_t n
struct Memb_list Memb_list
struct Point_process Point_process
Represent main neuron object computed by single thread.
HocStruct cTemplate * ctemplate