59 for (
size_t j = 0;
j < mla.size(); ++
j) {
60 int type = mla[
j].first;
75 for (
int j = 0;
j < npre; ++
j) {
84 for (
size_t j = 0;
j < mla.size(); ++
j) {
85 int type = mla[
j].first;
101 double *d1 = ml->
data[0];
104 long ix{(d2 - d1) / sz};
105 agid = -(type + 1000 * ix);
108 if (ps->output_index_ >= 0) {
123 std::ostringstream oss;
125 <<
" artificial cells of a given type can be created per NrnThread, " 128 <<
" (cannot store cgs[" <<
i <<
"].output_vindex[" << npre
129 <<
"]=" << agid <<
')';
171 for (
size_t j = 0;
j < mla.size(); ++
j) {
181 for (
size_t j = 0;
j < mla.size(); ++
j) {
182 int type = mla[
j].first;
200 hoc_execerror(
"A nonempty thread has no real cell or ARTIFICIAL_CELL with a gid",
NULL);
213 if (dsize == 0) {
return; }
218 for (
int i=0;
i < dsize; ++
i) {
220 if (ds[
i] == -4 || ds[
i] == -6 || ds[
i] == -7 || ds[
i] == 0) {
226 for (
int i=0;
i < mcnt; ++
i) {
233 int offset =
i*dsize;
234 int vdata_offset =
i*vdata_size;
235 for (
int j=0;
j < dsize; ++
j) {
248 eindex = ml->nodeindices[
i];
251 if (dparam[
j].
pval < a || dparam[
j].
pval >= (a + nnode)){
252 printf(
"%s dparam=%p a=%p a+nnode=%p j=%d\n",
258 eindex = dparam[
j].
pval - a;
261 }
else if (dmap[
j] == -2) {
263 eindex = dparam[
j].
i;
264 }
else if (dmap[
j] == -3) {
266 }
else if (dmap[
j] == -4) {
269 eindex = vdata_offset++;
270 }
else if (dmap[
j] == -6) {
273 eindex = vdata_offset++;
274 }
else if (dmap[
j] == -7) {
277 eindex = vdata_offset++;
278 }
else if (dmap[
j] == -8) {
281 }
else if (dmap[
j] == -10) {
284 }
else if (dmap[
j] == -9) {
293 double* pdiam =
NULL;
301 eindex = ml->nodeindices[
i];
302 }
else if (dmap[
j] == -5) {
305 double* pd = dparam[
j].
pval;
308 fprintf(stderr,
"POINTER is not pointing to voltage or mechanism data. Perhaps it should be a BBCOREPOINTER\n");
312 }
else if (dmap[
j] > 0 && dmap[
j] < 1000) {
315 if(dparam[
j].pval < eml->
data[0]){
316 printf(
"%s dparam=%p data=%p j=%d etype=%d %s\n",
325 printf(
"%s dparam=%p data=%p j=%d psize=%d nodecount=%d etype=%d %s\n",
333 }
else if (dmap[
j] > 1000) {
336 eindex = *((
int*)dparam[
j]._pvoid);
339 sprintf(errmes,
"Unknown semantics type %d for dparam item %d of", dmap[
j], j);
404 double* d1 = ml->
data[0];
407 int ix = (d2 - d1)/sz;
422 if (nrn_nthread > 1) {
428 hoc_execerror(
"NetCon and NetCon source with no gid are not in the same thread",
NULL);
440 double* d1 = ml->
data[0];
443 int ix = (d2 - d1)/sz;
497 if (strcmp(
memb_func[i].sym->name,
"HDF5Reader") == 0) {
continue; }
515 ml->nodeindices =
NULL;
518 ml->
data =
new double*[acnt[
id]];
540 size_t mla_rankbytes=0;
546 size_t threadbytes = 0;
553 nbytes = nt->
end * (1 *
sizeof(
int) + 3 *
sizeof(
double));
554 threadbytes += nbytes;
557 size_t mechcnt_instances = 0;
559 for (
size_t i = 0;
i < mla.size(); ++
i) {
560 int type = mla[
i].first;
574 nbytes = ml->
nodecount * (notart *
sizeof(
int) + 1 *
sizeof(
double *) +
575 1 *
sizeof(
Datum * ) + psize *
sizeof(
double) + dpsize *
sizeof(
Datum));
576 threadbytes += nbytes;
582 mla_rankbytes += threadbytes;
584 return mla_rankbytes;
597 for (
size_t i = 0;
i < mla.size(); ++
i) {
598 int type = mla[
i].first;
static int nrn_has_net_event(int type)
static Deferred_Type2ArtMl deferred_type2artml_
struct Memb_list Memb_list
double max(double a, double b)
static void datumindex_fill(int, CellGroup &, DatumIndices &, Memb_list *)
static void datumtransform(CellGroup *)
static void clean_art(CellGroup *)
std::vector< MlWithArtItem > MlWithArt
struct Point_process Point_process
int nrn_dblpntr2nrncore(double *pd, NrnThread &nt, int &type, int &index)
#define ITERATE(itm, lst)
std::map< double *, int > PVoid2Int
Symbol * hoc_lookup(const char *)
Represent main neuron object computed by single thread.
DatumIndices * datumindices
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
std::pair< int, Memb_list *> MlWithArtItem
static void mk_tml_with_art(CellGroup *)
int const size_t const size_t n
static int nrncore_art2index(double *d)
void hoc_execerror(const char *, const char *)
fprintf(stderr, "Don't know the location of params at %p\, pp)
static void mk_cgs_netcon_info(CellGroup *cgs)
static CellGroup * mk_cellgroups(CellGroup *)
int * nrn_prop_param_size_
short * nrn_is_artificial_
static size_t get_mla_rankbytes(CellGroup *)
int * nrn_prop_dparam_size_
VEC * cgs(MTX_FN A, void *A_params, VEC *b, VEC *r0, double tol, VEC *x)
std::vector< int > netcon_negsrcgid_tid
HocStruct cTemplate * ctemplate
int nrn_has_net_event_cnt_
void nrncore_netpar_cellgroups_helper(CellGroup *)
static PVoid2Int artdata2index_
static void setup_nrn_has_net_event()
static int * has_net_event_
std::vector< std::map< int, Memb_list * > > Deferred_Type2ArtMl