NEURON
nrn2core_direct.h
Go to the documentation of this file.
1 /*
2 # =============================================================================
3 # Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
4 #
5 # See top-level LICENSE file for details.
6 # =============================================================================
7 */
8 
9 #pragma once
10 
11 #include <iostream>
12 #include <vector>
13 #include <cstdint>
14 
15 extern "C" {
16 // The callbacks into nrn/src/nrniv/nrnbbcore_write.cpp to get
17 // data directly instead of via files.
18 
19 extern bool corenrn_embedded;
20 extern int corenrn_embedded_nthread;
21 
22 extern void (*nrn2core_group_ids_)(int*);
23 
24 extern void (*nrn2core_mkmech_info_)(std::ostream&);
25 
26 extern void* (*nrn2core_get_global_dbl_item_)(void*, const char*& name, int& size, double*& val);
27 extern int (*nrn2core_get_global_int_item_)(const char* name);
28 
29 extern int (*nrn2core_get_dat1_)(int tid,
30  int& n_presyn,
31  int& n_netcon,
32  std::vector<int>& output_gid,
33  int*& netcon_srcgid,
34  std::vector<int>& netcon_negsrcgid_tid);
35 
36 extern int (*nrn2core_get_dat2_1_)(int tid,
37  int& n_real_cell,
38  int& ngid,
39  int& n_real_gid,
40  int& nnode,
41  int& ndiam,
42  int& nmech,
43  int*& tml_index,
44  int*& ml_nodecount,
45  int& nidata,
46  int& nvdata,
47  int& nweight);
48 
49 extern int (*nrn2core_get_dat2_2_)(int tid,
50  int*& v_parent_index,
51  double*& a,
52  double*& b,
53  double*& area,
54  double*& v,
55  double*& diamvec);
56 
57 extern int (*nrn2core_get_dat2_mech_)(int tid,
58  size_t i,
59  int dsz_inst,
60  int*& nodeindices,
61  double*& data,
62  int*& pdata,
63  std::vector<uint32_t>& nmodlrandom,
64  std::vector<int>& pointer2type);
65 
66 extern int (*nrn2core_get_dat2_3_)(int tid,
67  int nweight,
68  int*& output_vindex,
69  double*& output_threshold,
70  int*& netcon_pnttype,
71  int*& netcon_pntindex,
72  double*& weights,
73  double*& delays);
74 
75 extern int (*nrn2core_get_dat2_corepointer_)(int tid, int& n);
76 
77 extern int (*nrn2core_get_dat2_corepointer_mech_)(int tid,
78  int type,
79  int& icnt,
80  int& dcnt,
81  int*& iarray,
82  double*& darray);
83 
84 extern int (*nrn2core_get_dat2_vecplay_)(int tid, std::vector<int>& indices);
85 
86 extern int (*nrn2core_get_dat2_vecplay_inst_)(int tid,
87  int i,
88  int& vptype,
89  int& mtype,
90  int& ix,
91  int& sz,
92  double*& yvec,
93  double*& tvec,
94  int& last_index,
95  int& discon_index,
96  int& ubound_index);
97 
98 extern void (*nrn2core_part2_clean_)();
99 
100 extern void (*nrn2core_get_dat3_cell_count_)(int& cell_count);
101 extern void (
102  *nrn2core_get_dat3_cellmapping_)(int i, int& gid, int& nsec, int& nseg, int& n_seclist);
103 extern void (*nrn2core_get_dat3_secmapping_)(int i_c,
104  int i_sec,
105  std::string& sclname,
106  int& nsec,
107  int& nseg,
108  size_t& total_lfp_factors,
109  int& n_electrodes,
110  std::vector<int>& data_sec,
111  std::vector<int>& data_seg,
112  std::vector<double>& data_lfp);
113 
114 /* what variables to send back to NEURON on each time step */
115 extern void (*nrn2core_get_trajectory_requests_)(int tid,
116  int& bsize,
117  int& n_pr,
118  void**& vpr,
119  int& n_trajec,
120  int*& types,
121  int*& indices,
122  double**& pvars,
123  double**& varrays);
124 
125 /* send values to NEURON on each time step */
126 extern void (*nrn2core_trajectory_values_)(int tid, int n_pr, void** vpr, double t);
127 
128 /* Filled the Vector data arrays and send back the sizes at end of run */
129 extern void (
130  *nrn2core_trajectory_return_)(int tid, int n_pr, int bsize, int vecsz, void** vpr, double t);
131 
132 /* send all spikes vectors to NEURON */
133 extern int (*nrn2core_all_spike_vectors_return_)(std::vector<double>& spikevec,
134  std::vector<int>& gidvec);
135 
136 /* send all weights to NEURON */
137 extern void (*nrn2core_all_weights_return_)(std::vector<double*>& weights);
138 
139 /* get data array pointer from NEURON to copy into. */
140 extern size_t (*nrn2core_type_return_)(int type,
141  int tid,
142  double*& data,
143  std::vector<double*>& mdata);
144 } // extern "C"
#define nodeindices
Definition: md1redef.h:35
#define area
Definition: md1redef.h:12
#define v
Definition: md1redef.h:11
#define data
Definition: md1redef.h:36
#define weights
Definition: md1redef.h:42
#define i
Definition: md1redef.h:19
#define pdata
Definition: md1redef.h:37
const char * name
Definition: init.cpp:16
int corenrn_embedded_nthread
Definition: nrn_setup.cpp:49
void(* nrn2core_all_weights_return_)(std::vector< double * > &weights)
Definition: nrn_setup.cpp:75
int(* nrn2core_get_dat2_mech_)(int tid, size_t i, int dsz_inst, int *&nodeindices, double *&data, int *&pdata, std::vector< uint32_t > &nmodlrandom, std::vector< int > &pointer2type)
Definition: phase2.cpp:48
int(* nrn2core_get_dat2_3_)(int tid, int nweight, int *&output_vindex, double *&output_threshold, int *&netcon_pnttype, int *&netcon_pntindex, double *&weights, double *&delays)
Definition: phase2.cpp:57
size_t(* nrn2core_type_return_)(int type, int tid, double *&data, std::vector< double * > &mdata)
, Information from NEURON to help with copying data to NEURON.
int(* nrn2core_get_dat2_corepointer_mech_)(int tid, int type, int &icnt, int &dcnt, int *&iarray, double *&darray)
Definition: phase2.cpp:68
void(* nrn2core_get_dat3_cell_count_)(int &cell_count)
Definition: phase3.cpp:15
void(* nrn2core_part2_clean_)()
Definition: main1.cpp:55
void(* nrn2core_get_dat3_cellmapping_)(int i, int &gid, int &nsec, int &nseg, int &n_seclist)
Definition: phase3.cpp:16
int(* nrn2core_get_dat2_vecplay_inst_)(int tid, int i, int &vptype, int &mtype, int &ix, int &sz, double *&yvec, double *&tvec, int &last_index, int &discon_index, int &ubound_index)
Definition: phase2.cpp:77
void(* nrn2core_trajectory_values_)(int tid, int n_pr, void **vpr, double t)
Definition: nrn_setup.cpp:69
int(* nrn2core_get_dat2_corepointer_)(int tid, int &n)
Definition: phase2.cpp:66
int(* nrn2core_get_dat2_2_)(int tid, int *&v_parent_index, double *&a, double *&b, double *&area, double *&v, double *&diamvec)
Definition: phase2.cpp:40
void(* nrn2core_get_trajectory_requests_)(int tid, int &bsize, int &n_pr, void **&vpr, int &n_trajec, int *&types, int *&indices, double **&pvars, double **&varrays)
Definition: nrn_setup.cpp:59
bool corenrn_embedded
--> Coreneuron
Definition: nrn_setup.cpp:47
int(* nrn2core_all_spike_vectors_return_)(std::vector< double > &spikevec, std::vector< int > &gidvec)
Definition: nrn_setup.cpp:73
int(* nrn2core_get_dat2_1_)(int tid, int &n_real_cell, int &ngid, int &n_real_gid, int &nnode, int &ndiam, int &nmech, int *&tml_index, int *&ml_nodecount, int &nidata, int &nvdata, int &nweight)
Definition: phase2.cpp:27
void(* nrn2core_mkmech_info_)(std::ostream &)
int(* nrn2core_get_global_int_item_)(const char *name)
Definition: global_vars.cpp:23
int(* nrn2core_get_dat1_)(int tid, int &n_presyn, int &n_netcon, std::vector< int > &output_gid, int *&netcon_srcgid, std::vector< int > &netcon_negsrcgid_tid)
Definition: phase1.cpp:17
void(* nrn2core_group_ids_)(int *)
Definition: nrn_setup.cpp:51
int(* nrn2core_get_dat2_vecplay_)(int tid, std::vector< int > &indices)
Definition: phase2.cpp:75
void(* nrn2core_get_dat3_secmapping_)(int i_c, int i_sec, std::string &sclname, int &nsec, int &nseg, size_t &total_lfp_factors, int &n_electrodes, std::vector< int > &data_sec, std::vector< int > &data_seg, std::vector< double > &data_lfp)
Definition: phase3.cpp:17
void(* nrn2core_trajectory_return_)(int tid, int n_pr, int bsize, int vecsz, void **vpr, double t)
Definition: nrn_setup.cpp:71
int const size_t const size_t n
Definition: nrngsl.h:10
short type
Definition: cabvars.h:10