1 #include "../../nrnconf.h"
20 int header_printed = 0;
25 if (cellnodes[inode] >= 0) {
26 if (!header_printed) {
30 if (receives_events) {
31 fprintf(f,
"%d nri %lu\n", cellnodes[inode],
pnt2index.size());
35 for (
int j = 0;
j < size; ++
j) {
50 std::vector<std::vector<NetCon*>> nclist(
pnt2index.size());
60 nclist[it->second].push_back(nc);
64 fprintf(f,
"netcons %d\n", nc_cnt);
65 fprintf(f,
" pntindex srcgid active delay weights\n");
66 for (
const auto&& [
i, ncl]:
enumerate(nclist)) {
67 for (
const auto& nc: ncl) {
68 int srcgid = (nc->src_) ? nc->src_->gid_ : -3;
69 if (srcgid < 0 && nc->src_ && nc->src_->osrc_) {
70 const char*
name = nc->src_->osrc_->ctemplate->sym->name;
71 fprintf(f,
"%zd %s %d %.*g",
i,
name, nc->active_ ? 1 : 0,
precision, nc->delay_);
72 }
else if (srcgid < 0 && nc->src_ && nc->src_->ssrc_) {
73 fprintf(f,
"%zd %s %d %.*g",
i,
"v", nc->active_ ? 1 : 0,
precision, nc->delay_);
75 fprintf(f,
"%zd %d %d %.*g",
i, srcgid, nc->active_ ? 1 : 0,
precision, nc->delay_);
78 for (
int k = 0;
k < wcnt; ++
k) {
79 fprintf(f,
" %.*g",
precision, nc->weight_[
k]);
95 int const inode = ps.
thvar_.
current_row() - cache_token.thread_cache(nt.
id).node_data_offset;
100 while (rnode >= nt.
ncell) {
106 int* cellnodes =
new int[nt.
end];
107 for (
int i = 0;
i < nt.
end; ++
i) {
111 cellnodes[rnode] =
cnt++;
114 cellnodes[
i] =
cnt++;
117 fprintf(f,
"%d nodes %d is the threshold node\n",
cnt, cellnodes[inode] - 1);
119 fprintf(f,
"inode parent area a b\n");
120 for (
int i = 0;
i < nt.
end; ++
i)
121 if (cellnodes[
i] >= 0) {
124 "%d %d %.*g %.*g %.*g\n",
134 fprintf(f,
"inode v\n");
135 for (
int i = 0;
i < nt.
end; ++
i)
136 if (cellnodes[
i] >= 0) {
162 FILE* f = fopen(
buf,
"w");
165 fprintf(f,
"gid = %d\n", gid);
ReceiveFunc * pnt_receive
neuron::container::data_handle< double > thvar_
constexpr auto enumerate(T &&iterable)
Symbol * hoc_lookup(const char *)
#define ITERATE(itm, lst)
static std::map< Point_process *, int > pnt2index
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.
PreSyn * nrn_gid2outputpresyn(int gid)
neuron::model_sorted_token nrn_ensure_model_data_are_sorted()
Ensure neuron::container::* data are sorted.
int * nrn_prop_param_size_
static void pr_netcon(NrnThread &nt, FILE *f, const std::map< void *, int > &pnt2index)
static void pr_realcell(PreSyn &ps, NrnThread &nt, FILE *f)
void nrn_prcellstate(int gid, const char *filesuffix)
static void pr_memb(int type, Memb_list *ml, int *cellnodes, NrnThread &nt, FILE *f, std::map< void *, int > &pnt2index)
std::vector< Memb_func > memb_func
A view into a set of mechanism instances.
std::vector< double * > data()
Get a vector of double* representing the model data.
Represent main neuron object computed by single thread.
struct NrnThreadMembList * next
A point process is computed just like regular mechanisms.
container::Node::storage & node_data()
Access the structure containing the data of all Nodes.
bool refers_to(Container const &container) const
Query whether this generic handle points to a value from the Tag field of the given container.
std::size_t current_row() const
Get the current logical row number.
T get() const
Explicit conversion to any T.