73 hoc_execerr_ext(
"NetCon range variable reference source not a voltage");
76 bool b1 = !ps->dil_.empty();
77 bool b2 = b1 && bool(ps->dil_[0]->target_);
80 "%s with voltage source has no gid."
81 " (The source is %s(x)._ref_v"
82 " and is the source for %zd NetCons. %s%s)",
83 (b1 ? ncob.c_str() :
"NetCon"),
86 (b1 ? (ncob +
" has target ").c_str() :
""),
87 (b1 ? (b2 ? std::string(
hoc_object_name(ps->dil_[0]->target_->ob)).c_str()
98 for (
size_t j = 0;
j < mla.size(); ++
j) {
99 int type = mla[
j].first;
122 assert(ps->thvar_.refers_to_a_modern_data_structure());
139 for (
size_t j = 0;
j < mla.size(); ++
j) {
140 int type = mla[
j].first;
143 for (
int instance = 0; instance < ml->
nodecount; ++instance) {
145 auto*
const ps =
static_cast<PreSyn*
>(pnt->presyn_);
146 auto const other_thread =
static_cast<NrnThread*
>(pnt->_vnt)->
id;
150 auto const global_row = pnt->prop->id().current_row();
151 assert(global_row >= offset);
152 long const agid = -(
type + 1000 *
static_cast<long>(global_row - offset));
154 if (ps->output_index_ >= 0) {
168 if (agid < std::numeric_limits<int>::min() || agid >= -1) {
169 std::ostringstream oss;
170 oss <<
"maximum of ~" << std::numeric_limits<int>::max() / 1000
171 <<
" artificial cells of a given type can be created per NrnThread, "
174 <<
" (cannot store cgs[" <<
i <<
"].output_vindex[" << npre
175 <<
"]=" << agid <<
')';
212 for (
size_t j = 0;
j < mla.size(); ++
j) {
222 for (
size_t j = 0;
j < mla.size(); ++
j) {
223 int type = mla[
j].first;
241 hoc_execerror(
"A nonempty thread has no real cell or ARTIFICIAL_CELL with a gid",
NULL);
259 for (
int i = 0;
i < dsize; ++
i) {
260 if (dmap[
i] == -4 || dmap[
i] == -6 || dmap[
i] == -7 || dmap[
i] == -11 || dmap[
i] == 0) {
266 for (
int i = 0;
i < mcnt; ++
i) {
272 int offset =
i * dsize;
273 int vdata_offset =
i * vdata_size;
274 for (
int j = 0;
j < dsize; ++
j) {
283 assert(
area.refers_to_a_modern_data_structure());
288 eindex =
area.current_row() - cache_token.thread_cache(ith).node_data_offset;
290 }
else if (dmap[
j] == -2) {
292 eindex = dparam[
j].
get<
int>();
293 }
else if (dmap[
j] == -3) {
295 }
else if (dmap[
j] == -4) {
298 eindex = vdata_offset++;
299 }
else if (dmap[
j] == -6) {
302 eindex = vdata_offset++;
303 }
else if (dmap[
j] == -7) {
306 eindex = vdata_offset++;
307 }
else if (dmap[
j] == -8) {
310 }
else if (dmap[
j] == -10) {
313 }
else if (dmap[
j] == -11) {
315 eindex = vdata_offset++;
316 }
else if (dmap[
j] == -9) {
328 pdiam =
p->param_handle(0);
334 }
else if (dmap[
j] == -5) {
341 "POINTER is not pointing to voltage or mechanism data. Perhaps it "
342 "should be a BBCOREPOINTER\n");
350 auto*
const pval = dparam[
j].
get<
double*>();
352 assert(legacy_index >= 0);
353 eindex = legacy_index;
357 eindex = *dparam[
j].
get<
int*>();
360 Sprintf(errmes,
"Unknown semantics type %d for dparam item %d of", dmap[
j],
j);
418 assert(target_thread == ith);
441 "NetCon and NetCon source with no gid are not in the same thread",
446 int type = pnt->prop->_type;
447 auto const src_thread =
static_cast<NrnThread*
>(pnt->_vnt)->
id;
448 auto const current = pnt->prop->id().current_row();
456 1000 *
static_cast<long>(
current - offset));
506 if (strcmp(
memb_func[
i].sym->name,
"HDF5Reader") == 0) {
553 size_t mla_rankbytes = 0;
557 size_t threadbytes = 0;
561 nbytes = nt->end * (1 *
sizeof(int) + 3 *
sizeof(
double));
562 threadbytes += nbytes;
565 size_t mechcnt_instances = 0;
567 for (
size_t i = 0;
i < mla.size(); ++
i) {
568 int type = mla[
i].first;
583 (notart *
sizeof(int) + 1 *
sizeof(
double*) + 1 *
sizeof(
Datum*) +
584 psize *
sizeof(
double) + dpsize *
sizeof(
Datum));
585 threadbytes += nbytes;
591 mla_rankbytes += threadbytes;
593 return mla_rankbytes;
606 for (
size_t i = 0;
i < mla.size(); ++
i) {
607 int type = mla[
i].first;
const char * secname(Section *sec)
name of section (for use in error messages)
short * nrn_is_artificial_
int nrn_has_net_event_cnt_
NetCvode * net_cvode_instance
std::vector< std::map< int, Memb_list * > > Deferred_Type2ArtMl
std::vector< MlWithArtItem > MlWithArt
std::pair< int, Memb_list * > MlWithArtItem
static void mk_cgs_netcon_info(neuron::model_sorted_token const &cache_token, CellGroup *cgs)
std::vector< NetCon * > netcons
std::vector< int > output_vindex
static void mk_tml_with_art(neuron::model_sorted_token const &cache_token, CellGroup *)
std::vector< int > output_gid
static int * has_net_event_
static int nrn_has_net_event(int type)
static void clean_art(CellGroup *)
static void datumindex_fill(int, CellGroup &, DatumIndices &, Memb_list *)
std::vector< int > netcon_negsrcgid_tid
static void setup_nrn_has_net_event()
static size_t get_mla_rankbytes(CellGroup *)
static void datumtransform(CellGroup *)
static void mk_cellgroups(neuron::model_sorted_token const &cache_token, CellGroup *)
std::vector< PreSyn * > output_ps
static Deferred_Type2ArtMl deferred_type2artml_
DatumIndices * datumindices
neuron::container::data_handle< double > thvar_
void hoc_execerr_ext(const char *fmt,...)
printf style specification of hoc_execerror message.
char * hoc_object_name(Object *ob)
Symbol * hoc_lookup(const char *)
bool nrn_semantics_is_ion(int i)
bool nrn_semantics_is_ionstyle(int i)
int nrn_semantics_ion_type(int i)
#define ITERATE(itm, lst)
auto for_threads(NrnThread *threads, int num_threads)
void hoc_execerror(const char *s1, const char *s2)
Model & model()
Access the global Model instance.
int Sprintf(char(&buf)[N], const char *fmt, Args &&... args)
Redirect sprintf to snprintf if the buffer size can be deduced.
neuron::model_sorted_token nrn_ensure_model_data_are_sorted()
Ensure neuron::container::* data are sorted.
int nrn_dblpntr2nrncore(neuron::container::data_handle< double > dh, NrnThread &nt, int &type, int &index)
int * nrn_prop_dparam_size_
int const size_t const size_t n
int * nrn_prop_param_size_
std::vector< Memb_func > memb_func
std::vector< Memb_list > memb_list
A view into a set of mechanism instances.
void set_storage_offset(std::size_t offset)
Set the offset of this Memb_list into global storage for this type.
std::ptrdiff_t legacy_index(double const *ptr) const
Calculate a legacy index of the given pointer in this mechanism data.
Represent main neuron object computed by single thread.
A point process is computed just like regular mechanisms.
auto id() const
Get the identifier of this instance.
container::Node::storage & node_data()
Access the structure containing the data of all Nodes.
std::size_t node_data_offset
Offset into global Node storage for this thread.
std::vector< std::size_t > mechanism_offset
Offsets into global mechanism storage for this thread (one per mechanism)
Non-template stable handle to a generic value.
T get() const
Explicit conversion to any T.
cache::Thread & thread_cache(std::size_t i)