CoreNEURON
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 
14 extern "C" {
15 // The callbacks into nrn/src/nrniv/nrnbbcore_write.cpp to get
16 // data directly instead of via files.
17 
18 extern bool corenrn_embedded;
19 extern int corenrn_embedded_nthread;
20 
21 extern void (*nrn2core_group_ids_)(int*);
22 
23 extern void (*nrn2core_mkmech_info_)(std::ostream&);
24 
25 extern void* (*nrn2core_get_global_dbl_item_)(void*, const char*& name, int& size, double*& val);
26 extern int (*nrn2core_get_global_int_item_)(const char* name);
27 
28 extern int (*nrn2core_get_dat1_)(int tid,
29  int& n_presyn,
30  int& n_netcon,
31  int*& output_gid,
32  int*& netcon_srcgid,
33  std::vector<int>& netcon_negsrcgid_tid);
34 
35 extern int (*nrn2core_get_dat2_1_)(int tid,
36  int& n_real_cell,
37  int& ngid,
38  int& n_real_gid,
39  int& nnode,
40  int& ndiam,
41  int& nmech,
42  int*& tml_index,
43  int*& ml_nodecount,
44  int& nidata,
45  int& nvdata,
46  int& nweight);
47 
48 extern int (*nrn2core_get_dat2_2_)(int tid,
49  int*& v_parent_index,
50  double*& a,
51  double*& b,
52  double*& area,
53  double*& v,
54  double*& diamvec);
55 
56 extern int (*nrn2core_get_dat2_mech_)(int tid,
57  size_t i,
58  int dsz_inst,
59  int*& nodeindices,
60  double*& data,
61  int*& pdata,
62  std::vector<int>& pointer2type);
63 
64 extern int (*nrn2core_get_dat2_3_)(int tid,
65  int nweight,
66  int*& output_vindex,
67  double*& output_threshold,
68  int*& netcon_pnttype,
69  int*& netcon_pntindex,
70  double*& weights,
71  double*& delays);
72 
73 extern int (*nrn2core_get_dat2_corepointer_)(int tid, int& n);
74 
75 extern int (*nrn2core_get_dat2_corepointer_mech_)(int tid,
76  int type,
77  int& icnt,
78  int& dcnt,
79  int*& iarray,
80  double*& darray);
81 
82 extern int (*nrn2core_get_dat2_vecplay_)(int tid, std::vector<int>& indices);
83 
84 extern int (*nrn2core_get_dat2_vecplay_inst_)(int tid,
85  int i,
86  int& vptype,
87  int& mtype,
88  int& ix,
89  int& sz,
90  double*& yvec,
91  double*& tvec,
92  int& last_index,
93  int& discon_index,
94  int& ubound_index);
95 
96 extern void (*nrn2core_part2_clean_)();
97 
98 /* what variables to send back to NEURON on each time step */
99 extern void (*nrn2core_get_trajectory_requests_)(int tid,
100  int& bsize,
101  int& n_pr,
102  void**& vpr,
103  int& n_trajec,
104  int*& types,
105  int*& indices,
106  double**& pvars,
107  double**& varrays);
108 
109 /* send values to NEURON on each time step */
110 extern void (*nrn2core_trajectory_values_)(int tid, int n_pr, void** vpr, double t);
111 
112 /* Filled the Vector data arrays and send back the sizes at end of run */
113 extern void (
114  *nrn2core_trajectory_return_)(int tid, int n_pr, int bsize, int vecsz, void** vpr, double t);
115 
116 /* send all spikes vectors to NEURON */
117 extern int (*nrn2core_all_spike_vectors_return_)(std::vector<double>& spikevec,
118  std::vector<int>& gidvec);
119 
120 /* send all weights to NEURON */
121 extern void (*nrn2core_all_weights_return_)(std::vector<double*>& weights);
122 
123 /* get data array pointer from NEURON to copy into. */
124 extern size_t (*nrn2core_type_return_)(int type, int tid, double*& data, double**& mdata);
125 } // extern "C"
corenrn_embedded_nthread
int corenrn_embedded_nthread
Definition: nrn_setup.cpp:47
nrn2core_get_dat2_corepointer_mech_
int(* nrn2core_get_dat2_corepointer_mech_)(int tid, int type, int &icnt, int &dcnt, int *&iarray, double *&darray)
Definition: phase2.cpp:66
nrn2core_all_spike_vectors_return_
int(* nrn2core_all_spike_vectors_return_)(std::vector< double > &spikevec, std::vector< int > &gidvec)
Definition: nrn_setup.cpp:71
pdata
#define pdata
Definition: md1redef.h:37
nrn2core_get_dat2_mech_
int(* nrn2core_get_dat2_mech_)(int tid, size_t i, int dsz_inst, int *&nodeindices, double *&data, int *&pdata, std::vector< int > &pointer2type)
Definition: phase2.cpp:47
coreneuron::t
double t
Definition: register_mech.cpp:22
i
#define i
Definition: md1redef.h:19
nrn2core_get_dat2_3_
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:55
nrn2core_trajectory_values_
void(* nrn2core_trajectory_values_)(int tid, int n_pr, void **vpr, double t)
Definition: nrn_setup.cpp:67
nrn2core_group_ids_
void(* nrn2core_group_ids_)(int *)
Definition: nrn_setup.cpp:49
nrn2core_get_global_int_item_
int(* nrn2core_get_global_int_item_)(const char *name)
Definition: global_vars.cpp:23
nrn2core_trajectory_return_
void(* nrn2core_trajectory_return_)(int tid, int n_pr, int bsize, int vecsz, void **vpr, double t)
Definition: nrn_setup.cpp:69
weights
#define weights
Definition: md1redef.h:42
nrn2core_part2_clean_
void(* nrn2core_part2_clean_)()
Definition: main1.cpp:59
nrn2core_get_dat2_1_
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:26
area
#define area
Definition: md1redef.h:12
nrn2core_get_dat1_
int(* nrn2core_get_dat1_)(int tid, int &n_presyn, int &n_netcon, int *&output_gid, int *&netcon_srcgid, std::vector< int > &netcon_negsrcgid_tid)
Definition: phase1.cpp:17
nrn2core_mkmech_info_
void(* nrn2core_mkmech_info_)(std::ostream &)
Definition: mk_mech.cpp:36
data
#define data
Definition: md1redef.h:36
nrn2core_type_return_
size_t(* nrn2core_type_return_)(int type, int tid, double *&data, double **&mdata)
, Information from NEURON to help with copying data to NEURON.
Definition: core2nrn_data_return.cpp:29
nrn2core_get_dat2_corepointer_
int(* nrn2core_get_dat2_corepointer_)(int tid, int &n)
Definition: phase2.cpp:64
corenrn_embedded
bool corenrn_embedded
--> Coreneuron
Definition: nrn_setup.cpp:46
nrn2core_get_dat2_vecplay_
int(* nrn2core_get_dat2_vecplay_)(int tid, std::vector< int > &indices)
Definition: phase2.cpp:73
v
#define v
Definition: md1redef.h:11
nodeindices
#define nodeindices
Definition: md1redef.h:35
nrn2core_get_dat2_vecplay_inst_
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:75
nrn2core_all_weights_return_
void(* nrn2core_all_weights_return_)(std::vector< double * > &weights)
Definition: nrn_setup.cpp:73
nrn2core_get_trajectory_requests_
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:57
nrn2core_get_dat2_2_
int(* nrn2core_get_dat2_2_)(int tid, int *&v_parent_index, double *&a, double *&b, double *&area, double *&v, double *&diamvec)
Definition: phase2.cpp:39