NEURON
nrncore_callbacks.h File Reference
#include <fstream>
#include <sstream>
#include <vector>
#include <set>
#include <cstdlib>
#include "partrans.h"

Go to the source code of this file.

Classes

struct  core2nrn_callback_t
 
struct  NrnCoreTransferEvents
 

Typedefs

typedef void *(* CNB) (...)
 
typedef struct core2nrn_callback_t core2nrn_callback_t
 
typedef std::vector< std::pair< int, bool > > Core2NrnWatchInfoItem
 
typedef std::vector< Core2NrnWatchInfoItemCore2NrnWatchInfo
 

Enumerations

enum  mech_type { voltage = -1 , i_membrane_ = -2 }
 

Functions

void write_memb_mech_types_direct (std::ostream &s)
 
void part2_clean ()
 
int get_global_int_item (const char *name)
 
voidget_global_dbl_item (void *p, const char *&name, int &size, double *&val)
 
void nrnthread_group_ids (int *groupids)
 
int nrnthread_dat1 (int tid, int &n_presyn, int &n_netcon, int *&output_gid, int *&netcon_srcgid, std::vector< int > &netcon_negsrcgid_tid)
 
int nrnthread_dat2_1 (int tid, int &ngid, int &n_real_gid, int &nnode, int &ndiam, int &nmech, int *&tml_index, int *&ml_nodecount, int &nidata, int &nvdata, int &nweight)
 
int nrnthread_dat2_2 (int tid, int *&v_parent_index, double *&a, double *&b, double *&area, double *&v, double *&diamvec)
 
int nrnthread_dat2_mech (int tid, size_t i, int dsz_inst, int *&nodeindices, double *&data, int *&pdata, std::vector< int > &pointer2type)
 
int nrnthread_dat2_3 (int tid, int nweight, int *&output_vindex, double *&output_threshold, int *&netcon_pnttype, int *&netcon_pntindex, double *&weights, double *&delays)
 
int nrnthread_dat2_corepointer (int tid, int &n)
 
int nrnthread_dat2_corepointer_mech (int tid, int type, int &icnt, int &dcnt, int *&iarray, double *&darray)
 
int nrnthread_dat2_vecplay (int tid, std::vector< int > &n)
 
int nrnthread_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)
 
int * datum2int (int type, Memb_list *ml, NrnThread &nt, CellGroup &cg, DatumIndices &di, int ml_vdata_offset, std::vector< int > &pointer2type)
 
void nrnthread_get_trajectory_requests (int tid, int &bsize, int &ntrajec, void **&vpr, int *&types, int *&indices, double **&pvars, double **&varrays)
 
void nrnthread_trajectory_values (int tid, int n_pr, void **vpr, double t)
 
void nrnthread_trajectory_return (int tid, int n_pr, int bsize, int vecsz, void **vpr, double t)
 
int nrnthread_all_spike_vectors_return (std::vector< double > &spiketvec, std::vector< int > &spikegidvec)
 NEURON callback used from CORENEURON to transfer all spike vectors after simulation. More...
 
void nrnthreads_all_weights_return (std::vector< double * > &weights)
 Copy weights from all coreneuron::NrnThread to NetCon instances. More...
 
size_t nrnthreads_type_return (int type, int tid, double *&data, double **&mdata)
 Return location for CoreNEURON to copy data into. More...
 
int core2nrn_corepointer_mech (int tid, int type, int icnt, int dcnt, int *iarray, double *darray)
 
void core2nrn_clear_queues (double t)
 Initialize queues before transfer Probably aleady clear, but if binq then must be initialized to time. More...
 
void core2nrn_NetCon_event (int tid, double td, size_t nc_index)
 Called from CoreNEURON core2nrn_tqueue_item. More...
 
void core2nrn_SelfEvent_event (int tid, double td, int tar_type, int tar_index, double flag, size_t nc_index, int is_movable)
 
void core2nrn_SelfEvent_event_noweight (int tid, double td, int tar_type, int tar_index, double flag, int is_movable)
 
void core2nrn_PreSyn_flag (int tid, std::set< int > presyns_flag_true)
 
NrnCoreTransferEventsnrn2core_transfer_tqueue (int tid)
 
void nrn2core_transfer_WATCH (void(*cb)(int, int, int, int, int))
 
void nrn_watch_clear ()
 Watch info corenrn->nrn transfer requires all activated WatchCondition be deactivated prior to mirroring the activation that exists on the corenrn side. More...
 
void core2nrn_watch_activate (int tid, int type, int wbegin, Core2NrnWatchInfo &)
 
void core2nrn_vecplay (int tid, int i_nrn, int last_index, int discon_index, int ubound_index)
 getting one item at a time from CoreNEURON More...
 
void core2nrn_vecplay_events ()
 start the vecplay events More...
 
void nrn2core_PreSyn_flag (int tid, std::set< int > &presyns_flag_true)
 
void nrn2core_patternstim (void **info)
 
void map_coreneuron_callbacks (void *handle)
 Populate function pointers by mapping function pointers for callback. More...
 

Variables

static core2nrn_callback_t cnbs []
 

Typedef Documentation

◆ CNB

typedef void*(* CNB) (...)

Definition at line 12 of file nrncore_callbacks.h.

◆ core2nrn_callback_t

◆ Core2NrnWatchInfo

Definition at line 163 of file nrncore_callbacks.h.

◆ Core2NrnWatchInfoItem

typedef std::vector<std::pair<int, bool> > Core2NrnWatchInfoItem

Definition at line 162 of file nrncore_callbacks.h.

Enumeration Type Documentation

◆ mech_type

enum mech_type
Enumerator
voltage 
i_membrane_ 

Definition at line 21 of file nrncore_callbacks.h.

Function Documentation

◆ core2nrn_clear_queues()

void core2nrn_clear_queues ( double  t)

Initialize queues before transfer Probably aleady clear, but if binq then must be initialized to time.

Definition at line 1023 of file nrncore_callbacks.cpp.

◆ core2nrn_corepointer_mech()

int core2nrn_corepointer_mech ( int  tid,
int  type,
int  icnt,
int  dcnt,
int *  iarray,
double *  darray 
)

Definition at line 503 of file nrncore_callbacks.cpp.

◆ core2nrn_NetCon_event()

void core2nrn_NetCon_event ( int  tid,
double  td,
size_t  nc_index 
)

Called from CoreNEURON core2nrn_tqueue_item.

Definition at line 1030 of file nrncore_callbacks.cpp.

◆ core2nrn_PreSyn_flag()

void core2nrn_PreSyn_flag ( int  tid,
std::set< int >  presyns_flag_true 
)

Definition at line 1112 of file nrncore_callbacks.cpp.

◆ core2nrn_SelfEvent_event()

void core2nrn_SelfEvent_event ( int  tid,
double  td,
int  tar_type,
int  tar_index,
double  flag,
size_t  nc_index,
int  is_movable 
)

Definition at line 1079 of file nrncore_callbacks.cpp.

◆ core2nrn_SelfEvent_event_noweight()

void core2nrn_SelfEvent_event_noweight ( int  tid,
double  td,
int  tar_type,
int  tar_index,
double  flag,
int  is_movable 
)

Definition at line 1100 of file nrncore_callbacks.cpp.

◆ core2nrn_vecplay()

void core2nrn_vecplay ( int  tid,
int  i_nrn,
int  last_index,
int  discon_index,
int  ubound_index 
)

getting one item at a time from CoreNEURON

Definition at line 715 of file nrncore_callbacks.cpp.

◆ core2nrn_vecplay_events()

void core2nrn_vecplay_events ( )

start the vecplay events

Definition at line 728 of file nrncore_callbacks.cpp.

◆ core2nrn_watch_activate()

void core2nrn_watch_activate ( int  tid,
int  type,
int  wbegin,
Core2NrnWatchInfo wi 
)

Definition at line 1172 of file nrncore_callbacks.cpp.

◆ datum2int()

int* datum2int ( int  type,
Memb_list ml,
NrnThread nt,
CellGroup cg,
DatumIndices di,
int  ml_vdata_offset,
std::vector< int > &  pointer2type 
)

Definition at line 527 of file nrncore_callbacks.cpp.

◆ get_global_dbl_item()

void* get_global_dbl_item ( void p,
const char *&  name,
int &  size,
double *&  val 
)

Definition at line 85 of file nrncore_callbacks.cpp.

◆ get_global_int_item()

int get_global_int_item ( const char *  name)

Definition at line 72 of file nrncore_callbacks.cpp.

◆ map_coreneuron_callbacks()

void map_coreneuron_callbacks ( void handle)

Populate function pointers by mapping function pointers for callback.

Definition at line 34 of file nrncore_callbacks.cpp.

◆ nrn2core_patternstim()

void nrn2core_patternstim ( void **  info)

Definition at line 1209 of file nrncore_callbacks.cpp.

◆ nrn2core_PreSyn_flag()

void nrn2core_PreSyn_flag ( int  tid,
std::set< int > &  presyns_flag_true 
)

Definition at line 1149 of file nrncore_callbacks.cpp.

◆ nrn2core_transfer_tqueue()

NrnCoreTransferEvents* nrn2core_transfer_tqueue ( int  tid)

Definition at line 933 of file nrncore_callbacks.cpp.

◆ nrn2core_transfer_WATCH()

void nrn2core_transfer_WATCH ( void(*)(int, int, int, int, int)  cb)

Definition at line 6161 of file netcvode.cpp.

◆ nrn_watch_clear()

void nrn_watch_clear ( )

Watch info corenrn->nrn transfer requires all activated WatchCondition be deactivated prior to mirroring the activation that exists on the corenrn side.

Definition at line 2620 of file netcvode.cpp.

◆ nrnthread_all_spike_vectors_return()

int nrnthread_all_spike_vectors_return ( std::vector< double > &  spiketvec,
std::vector< int > &  spikegidvec 
)

NEURON callback used from CORENEURON to transfer all spike vectors after simulation.

Parameters
spiketvec- vector of spikes
spikegidvec- vector of gids
Returns
1 if CORENEURON shall drop writing out.dat; 0 otherwise

Definition at line 1329 of file netpar.cpp.

◆ nrnthread_dat1()

int nrnthread_dat1 ( int  tid,
int &  n_presyn,
int &  n_netcon,
int *&  output_gid,
int *&  netcon_srcgid,
std::vector< int > &  netcon_negsrcgid_tid 
)

Definition at line 203 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_1()

int nrnthread_dat2_1 ( int  tid,
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 at line 224 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_2()

int nrnthread_dat2_2 ( int  tid,
int *&  v_parent_index,
double *&  a,
double *&  b,
double *&  area,
double *&  v,
double *&  diamvec 
)

Definition at line 278 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_3()

int nrnthread_dat2_3 ( int  tid,
int  nweight,
int *&  output_vindex,
double *&  output_threshold,
int *&  netcon_pnttype,
int *&  netcon_pntindex,
double *&  weights,
double *&  delays 
)

Definition at line 397 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_corepointer()

int nrnthread_dat2_corepointer ( int  tid,
int &  n 
)

Definition at line 445 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_corepointer_mech()

int nrnthread_dat2_corepointer_mech ( int  tid,
int  type,
int &  icnt,
int &  dcnt,
int *&  iarray,
double *&  darray 
)

Definition at line 461 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_mech()

int nrnthread_dat2_mech ( int  tid,
size_t  i,
int  dsz_inst,
int *&  nodeindices,
double *&  data,
int *&  pdata,
std::vector< int > &  pointer2type 
)

Definition at line 329 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_vecplay()

int nrnthread_dat2_vecplay ( int  tid,
std::vector< int > &  n 
)

Definition at line 633 of file nrncore_callbacks.cpp.

◆ nrnthread_dat2_vecplay_inst()

int nrnthread_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 at line 661 of file nrncore_callbacks.cpp.

◆ nrnthread_get_trajectory_requests()

void nrnthread_get_trajectory_requests ( int  tid,
int &  bsize,
int &  ntrajec,
void **&  vpr,
int *&  types,
int *&  indices,
double **&  pvars,
double **&  varrays 
)

◆ nrnthread_group_ids()

void nrnthread_group_ids ( int *  groupids)

Definition at line 196 of file nrncore_callbacks.cpp.

◆ nrnthread_trajectory_return()

void nrnthread_trajectory_return ( int  tid,
int  n_pr,
int  bsize,
int  vecsz,
void **  vpr,
double  t 
)

Definition at line 6097 of file netcvode.cpp.

◆ nrnthread_trajectory_values()

void nrnthread_trajectory_values ( int  tid,
int  n_pr,
void **  vpr,
double  t 
)

Definition at line 6054 of file netcvode.cpp.

◆ nrnthreads_all_weights_return()

void nrnthreads_all_weights_return ( std::vector< double * > &  weights)

Copy weights from all coreneuron::NrnThread to NetCon instances.

This depends on the CoreNEURON weight order for each thread to be the same as was originally sent from NEURON. See how that order was constructed in CellGroup::mk_cgs_netcon_info.

Definition at line 123 of file nrncore_callbacks.cpp.

◆ nrnthreads_type_return()

size_t nrnthreads_type_return ( int  type,
int  tid,
double *&  data,
double **&  mdata 
)

Return location for CoreNEURON to copy data into.

The type is mechanism type or special negative type for voltage, i_membrane_, or time. See coreneuron/io/nrn_setup.cpp:stdindex2ptr. We allow coreneuron to copy to NEURON's AoS data as CoreNEURON knows how its data is arranged (SoA and possibly permuted). This function figures out the size (just for sanity check) and data pointer to be returned based on type and thread id. The ARTIFICIAL_CELL type case is special as there is no thread specific Memb_list for those.

Definition at line 151 of file nrncore_callbacks.cpp.

◆ part2_clean()

void part2_clean ( )

Definition at line 590 of file nrncore_callbacks.cpp.

◆ write_memb_mech_types_direct()

void write_memb_mech_types_direct ( std::ostream &  s)

Definition at line 49 of file nrncore_callbacks.cpp.

Variable Documentation

◆ cnbs

core2nrn_callback_t cnbs[]
static

Definition at line 186 of file nrncore_callbacks.h.