NEURON
bbsavestate.cpp File Reference
#include <../../nrnconf.h>
#include "bbsavestate.h"
#include "classreg.h"
#include "ndatclas.h"
#include "nrnoc2iv.h"
#include "ocfile.h"
#include <cmath>
#include <nrnmpiuse.h>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <sys/stat.h>
#include <unordered_map>
#include <unordered_set>
#include "netcon.h"
#include "nrniv_mf.h"
#include "tqueue.h"
#include "vrecitem.h"
#include "membfunc.h"
#include <ivocvect.h>

Go to the source code of this file.

Classes

class  BBSS_Cnt
 
class  BBSS_TxtFileOut
 
class  BBSS_TxtFileIn
 
class  BBSS_BufferOut
 
class  BBSS_BufferIn
 
struct  StateStructInfo
 
struct  DEList
 
class  SEWrap
 

Macros

#define QUEUECHECK   1
 
#define DEBUG   0
 
#define PDEBUG   f->s(dbuf, 1)
 

Typedefs

typedef void(* ReceiveFunc) (Point_process *, double *, double)
 
typedef void(* PFIO) (int, Object *)
 
typedef std::vector< TQItem * > TQItemList
 
typedef std::unordered_map< Point_process *, intPointProcessMap
 
typedef struct DEList DEList
 
typedef std::unordered_map< Point_process *, DEList * > PP2DE
 
typedef std::vector< double > DblList
 
typedef std::unordered_map< NetCon *, DblList * > NetCon2DblList
 
typedef std::vector< SEWrap * > SEWrapList
 
typedef std::unordered_map< int, intInt2Int
 
typedef std::unordered_map< int, DblList * > Int2DblList
 
typedef std::unordered_map< std::string, Section * > SecName2Sec
 

Functions

static void bbss_early (double td, TQItem *tq)
 
void nrn_shape_update ()
 
Sectionnrn_section_exists (char *name, int index, Object *cell)
 
TQueuenet_cvode_instance_event_queue (NrnThread *)
 
void clear_event_queue ()
 
hoc_Itemnet_cvode_instance_psl ()
 
PlayRecList * net_cvode_instance_prl ()
 
void nrn_netcon_event (NetCon *, double)
 
void nrn_gidout_iter (PFIO)
 
void net_send (void **, double *, Point_process *, double, double)
 
void nrn_fake_fire (int gid, double firetime, int fake_out)
 
Objectnrn_gid2obj (int gid)
 
PreSynnrn_gid2presyn (int gid)
 
int nrn_gid_exists (int gid)
 
static void nrn_spike_exchange (NrnThread *)
 
static void nrnmpi_barrier ()
 
static void nrnmpi_int_alltoallv (int *s, int *scnt, int *sdispl, int *r, int *rcnt, int *rdispl)
 
static void nrnmpi_dbl_alltoallv (double *s, int *scnt, int *sdispl, double *r, int *rcnt, int *rdispl)
 
static int nrnmpi_int_allmax (int x)
 
static void nrnmpi_int_allgather (int *s, int *r, int n)
 
static void nrnmpi_int_allgatherv (int *s, int *r, int *n, int *dspl)
 
static void nrnmpi_dbl_allgatherv (double *s, double *r, int *n, int *dspl)
 
Point_processob2pntproc (Object *)
 
void nrn_play_init ()
 
static void tqcallback (const TQItem *tq, int i)
 
static void bbss_queuecheck ()
 
voidbbss_buffer_counts (int *len, int **gids, int **sizes, int *global_size)
 
void bbss_save_global (void *bbss, char *buffer, int sz)
 
void bbss_restore_global (void *bbss, char *buffer, int sz)
 
void bbss_save (void *bbss, int gid, char *buffer, int sz)
 
void bbss_restore (void *bbss, int gid, int npiece, char *buffer, int sz)
 
void bbss_save_done (void *bbss)
 
void bbss_restore_done (void *bbss)
 
static voidcons (Object *)
 
static void destruct (void *v)
 
static double save (void *v)
 
static void bbss_restore_begin ()
 
static double restore (void *v)
 
static double save_request (void *v)
 
static double save_gid (void *v)
 
static double restore_gid (void *v)
 
static void pycell_name2sec_maps_clear ()
 
static double save_test (void *v)
 
static double save_test_bin (void *v)
 
static double ppignore (void *v)
 
static int ignored (Prop *p)
 
static void bbss_remove_delivered ()
 
static double restore_test (void *v)
 
static double restore_test_bin (void *v)
 
static double vector_play_init (void *v)
 
void BBSaveState_reg ()
 
static void ssi_def ()
 
static double binq_time (double tt)
 
static void del_presyn_info ()
 
static void base2spgid_item (int spgid, Object *obj)
 
static void cb_gidobj (int gid, Object *obj)
 
static void pycell_name2sec_maps_fill ()
 
static SecName2Secpycell_name2sec_map (Object *c)
 
static void all2allv_helper (int *scnt, int *sdispl, int *rcnt, int *rdispl)
 
static void all2allv_int2 (int *scnt, int *sdispl, int *gidsrc, int *ndsrc)
 
static void all2allv_dbl1 (int *scnt, int *sdispl, double *tssrc)
 
static void scatteritems ()
 
static void allgatherv_helper (int cnt, int *rcnt, int *rdspl)
 
static void spikes_on_correct_host (int cnt, int *g, int *dcnts, int tscnt, double *ts, Int2DblList *m)
 
static void construct_presyn_queue ()
 

Variables

bool nrn_use_bin_queue_
 
void(* nrn_binq_enqueue_error_handler )(double, TQItem *)
 
int section_count
 
Section ** secorder
 
ReceiveFuncpnt_receive
 
NetCvodenet_cvode_instance
 
cTemplate ** nrn_pnt_template_
 
double t
 
short * nrn_is_artificial_
 
Symlisthoc_built_in_symlist
 
static bool use_spikecompress_
 
static bool use_gidcompress_
 
static int callback_mode
 
static TQItemListtq_presyn_fanout
 
static TQItemListtq_removal_list
 
static int debug = DEBUG
 
static char dbuf [1024]
 
static BBSaveStatebbss
 
static int usebin_
 
static std::unique_ptr< PointProcessMappp_ignore_map
 
static Member_func members []
 
static StateStructInfossi
 
static cTemplatenct
 
static std::unique_ptr< PP2DEpp2de
 
static std::unique_ptr< NetCon2DblListnc2dblist
 
static SEWrapListsewrap_list
 
static std::unique_ptr< Int2Intbase2spgid {new Int2Int()}
 
static std::unique_ptr< Int2DblListsrc2send {new Int2DblList()}
 
static int src2send_cnt
 
static std::unique_ptr< Int2DblListqueuecheck_gid2unc
 
static std::unique_ptr< Int2DblListpresyn_queue
 
static std::unordered_map< void *, SecName2Secpycell_name2sec_maps
 
static int giddest_size
 
static intgiddest
 
static inttsdest_cnts
 
static double * tsdest
 

Macro Definition Documentation

◆ DEBUG

#define DEBUG   0

Definition at line 363 of file bbsavestate.cpp.

◆ PDEBUG

#define PDEBUG   f->s(dbuf, 1)

Definition at line 369 of file bbsavestate.cpp.

◆ QUEUECHECK

#define QUEUECHECK   1

Definition at line 295 of file bbsavestate.cpp.

Typedef Documentation

◆ DblList

typedef std::vector<double> DblList

Definition at line 1120 of file bbsavestate.cpp.

◆ DEList

typedef struct DEList DEList

◆ Int2DblList

typedef std::unordered_map<int, DblList*> Int2DblList

Definition at line 1166 of file bbsavestate.cpp.

◆ Int2Int

typedef std::unordered_map<int, int> Int2Int

Definition at line 1162 of file bbsavestate.cpp.

◆ NetCon2DblList

typedef std::unordered_map<NetCon*, DblList*> NetCon2DblList

Definition at line 1121 of file bbsavestate.cpp.

◆ PFIO

typedef void(* PFIO) (int, Object *)

Definition at line 214 of file bbsavestate.cpp.

◆ PointProcessMap

typedef std::unordered_map<Point_process*, int> PointProcessMap

Definition at line 763 of file bbsavestate.cpp.

◆ PP2DE

typedef std::unordered_map<Point_process*, DEList*> PP2DE

Definition at line 1117 of file bbsavestate.cpp.

◆ ReceiveFunc

typedef void(* ReceiveFunc) (Point_process *, double *, double)

Definition at line 198 of file bbsavestate.cpp.

◆ SecName2Sec

typedef std::unordered_map<std::string, Section*> SecName2Sec

Definition at line 1742 of file bbsavestate.cpp.

◆ SEWrapList

typedef std::vector<SEWrap*> SEWrapList

Definition at line 1159 of file bbsavestate.cpp.

◆ TQItemList

typedef std::vector<TQItem*> TQItemList

Definition at line 291 of file bbsavestate.cpp.

Function Documentation

◆ all2allv_dbl1()

static void all2allv_dbl1 ( int scnt,
int sdispl,
double *  tssrc 
)
static

Definition at line 2330 of file bbsavestate.cpp.

◆ all2allv_helper()

static void all2allv_helper ( int scnt,
int sdispl,
int rcnt,
int rdispl 
)
static

Definition at line 2289 of file bbsavestate.cpp.

◆ all2allv_int2()

static void all2allv_int2 ( int scnt,
int sdispl,
int gidsrc,
int ndsrc 
)
static

Definition at line 2306 of file bbsavestate.cpp.

◆ allgatherv_helper()

static void allgatherv_helper ( int  cnt,
int rcnt,
int rdspl 
)
static

Definition at line 2445 of file bbsavestate.cpp.

◆ base2spgid_item()

static void base2spgid_item ( int  spgid,
Object obj 
)
static

Definition at line 1542 of file bbsavestate.cpp.

◆ BBSaveState_reg()

void BBSaveState_reg ( )

Definition at line 1034 of file bbsavestate.cpp.

◆ bbss_buffer_counts()

void * bbss_buffer_counts ( int len,
int **  gids,
int **  sizes,
int global_size 
)

Definition at line 790 of file bbsavestate.cpp.

◆ bbss_early()

static void bbss_early ( double  td,
TQItem tq 
)
static

Definition at line 1213 of file bbsavestate.cpp.

◆ bbss_queuecheck()

static void bbss_queuecheck ( )
static

Definition at line 2776 of file bbsavestate.cpp.

◆ bbss_remove_delivered()

static void bbss_remove_delivered ( )
static

Definition at line 843 of file bbsavestate.cpp.

◆ bbss_restore()

void bbss_restore ( void bbss,
int  gid,
int  npiece,
char *  buffer,
int  sz 
)

Definition at line 827 of file bbsavestate.cpp.

◆ bbss_restore_begin()

static void bbss_restore_begin ( )
static

Definition at line 623 of file bbsavestate.cpp.

◆ bbss_restore_done()

void bbss_restore_done ( void bbss)

Definition at line 876 of file bbsavestate.cpp.

◆ bbss_restore_global()

void bbss_restore_global ( void bbss,
char *  buffer,
int  sz 
)

Definition at line 810 of file bbsavestate.cpp.

◆ bbss_save()

void bbss_save ( void bbss,
int  gid,
char *  buffer,
int  sz 
)

Definition at line 819 of file bbsavestate.cpp.

◆ bbss_save_done()

void bbss_save_done ( void bbss)

Definition at line 838 of file bbsavestate.cpp.

◆ bbss_save_global()

void bbss_save_global ( void bbss,
char *  buffer,
int  sz 
)

Definition at line 803 of file bbsavestate.cpp.

◆ binq_time()

static double binq_time ( double  tt)
static

Definition at line 1199 of file bbsavestate.cpp.

◆ cb_gidobj()

static void cb_gidobj ( int  gid,
Object obj 
)
static

Definition at line 1658 of file bbsavestate.cpp.

◆ clear_event_queue()

void clear_event_queue ( )

Definition at line 57 of file cvodestb.cpp.

◆ cons()

static void* cons ( Object )
static

Definition at line 603 of file bbsavestate.cpp.

◆ construct_presyn_queue()

static void construct_presyn_queue ( )
static

Definition at line 2510 of file bbsavestate.cpp.

◆ del_presyn_info()

static void del_presyn_info ( )
static

Definition at line 1450 of file bbsavestate.cpp.

◆ destruct()

static void destruct ( void v)
static

Definition at line 608 of file bbsavestate.cpp.

◆ ignored()

static int ignored ( Prop p)
static

Definition at line 780 of file bbsavestate.cpp.

◆ net_cvode_instance_event_queue()

TQueue* net_cvode_instance_event_queue ( NrnThread )

Definition at line 297 of file netcvode.cpp.

◆ net_cvode_instance_prl()

PlayRecList* net_cvode_instance_prl ( )

Definition at line 305 of file netcvode.cpp.

◆ net_cvode_instance_psl()

hoc_Item* net_cvode_instance_psl ( )

Definition at line 301 of file netcvode.cpp.

◆ net_send()

void net_send ( void **  ,
double *  ,
Point_process ,
double  ,
double   
)

Definition at line 2340 of file netcvode.cpp.

◆ nrn_fake_fire()

void nrn_fake_fire ( int  gid,
double  firetime,
int  fake_out 
)

Definition at line 867 of file netpar.cpp.

◆ nrn_gid2obj()

Object * nrn_gid2obj ( int  gid)

Definition at line 1495 of file netpar.cpp.

◆ nrn_gid2presyn()

PreSyn * nrn_gid2presyn ( int  gid)

Definition at line 1499 of file netpar.cpp.

◆ nrn_gid_exists()

int nrn_gid_exists ( int  gid)

Definition at line 997 of file netpar.cpp.

◆ nrn_gidout_iter()

void nrn_gidout_iter ( PFIO  callback)

Definition at line 1505 of file netpar.cpp.

◆ nrn_netcon_event()

void nrn_netcon_event ( NetCon ,
double   
)

Definition at line 162 of file netcvode.cpp.

◆ nrn_play_init()

void nrn_play_init ( )

Definition at line 75 of file cvodestb.cpp.

◆ nrn_section_exists()

Section* nrn_section_exists ( char *  name,
int  index,
Object cell 
)

Definition at line 2409 of file cabcode.cpp.

◆ nrn_shape_update()

void nrn_shape_update ( )

Definition at line 932 of file treeset.cpp.

◆ nrn_spike_exchange()

static void nrn_spike_exchange ( NrnThread )
static

Definition at line 235 of file bbsavestate.cpp.

◆ nrnmpi_barrier()

static void nrnmpi_barrier ( )
static

Definition at line 236 of file bbsavestate.cpp.

◆ nrnmpi_dbl_allgatherv()

static void nrnmpi_dbl_allgatherv ( double *  s,
double *  r,
int n,
int dspl 
)
static

Definition at line 265 of file bbsavestate.cpp.

◆ nrnmpi_dbl_alltoallv()

static void nrnmpi_dbl_alltoallv ( double *  s,
int scnt,
int sdispl,
double *  r,
int rcnt,
int rdispl 
)
static

Definition at line 242 of file bbsavestate.cpp.

◆ nrnmpi_int_allgather()

static void nrnmpi_int_allgather ( int s,
int r,
int  n 
)
static

Definition at line 255 of file bbsavestate.cpp.

◆ nrnmpi_int_allgatherv()

static void nrnmpi_int_allgatherv ( int s,
int r,
int n,
int dspl 
)
static

Definition at line 260 of file bbsavestate.cpp.

◆ nrnmpi_int_allmax()

static int nrnmpi_int_allmax ( int  x)
static

Definition at line 252 of file bbsavestate.cpp.

◆ nrnmpi_int_alltoallv()

static void nrnmpi_int_alltoallv ( int s,
int scnt,
int sdispl,
int r,
int rcnt,
int rdispl 
)
static

Definition at line 237 of file bbsavestate.cpp.

◆ ob2pntproc()

Point_process* ob2pntproc ( Object )

Definition at line 88 of file hocmech.cpp.

◆ ppignore()

static double ppignore ( void v)
static

Definition at line 766 of file bbsavestate.cpp.

◆ pycell_name2sec_map()

static SecName2Sec& pycell_name2sec_map ( Object c)
static

Definition at line 1783 of file bbsavestate.cpp.

◆ pycell_name2sec_maps_clear()

static void pycell_name2sec_maps_clear ( )
static

Definition at line 1746 of file bbsavestate.cpp.

◆ pycell_name2sec_maps_fill()

static void pycell_name2sec_maps_fill ( )
static

Definition at line 1750 of file bbsavestate.cpp.

◆ restore()

static double restore ( void v)
static

Definition at line 642 of file bbsavestate.cpp.

◆ restore_gid()

static double restore_gid ( void v)
static

Definition at line 681 of file bbsavestate.cpp.

◆ restore_test()

static double restore_test ( void v)
static

Definition at line 918 of file bbsavestate.cpp.

◆ restore_test_bin()

static double restore_test_bin ( void v)
static

Definition at line 950 of file bbsavestate.cpp.

◆ save()

static double save ( void v)
static

Definition at line 613 of file bbsavestate.cpp.

◆ save_gid()

static double save_gid ( void v)
static

Definition at line 676 of file bbsavestate.cpp.

◆ save_request()

static double save_request ( void v)
static

Definition at line 657 of file bbsavestate.cpp.

◆ save_test()

static double save_test ( void v)
static

Definition at line 688 of file bbsavestate.cpp.

◆ save_test_bin()

static double save_test_bin ( void v)
static

Definition at line 720 of file bbsavestate.cpp.

◆ scatteritems()

static void scatteritems ( )
static

Definition at line 2352 of file bbsavestate.cpp.

◆ spikes_on_correct_host()

static void spikes_on_correct_host ( int  cnt,
int g,
int dcnts,
int  tscnt,
double *  ts,
Int2DblList m 
)
static

Definition at line 2453 of file bbsavestate.cpp.

◆ ssi_def()

static void ssi_def ( )
static

Definition at line 1046 of file bbsavestate.cpp.

◆ tqcallback()

static void tqcallback ( const TQItem tq,
int  i 
)
static

Definition at line 1226 of file bbsavestate.cpp.

◆ vector_play_init()

static double vector_play_init ( void v)
static

Definition at line 1010 of file bbsavestate.cpp.

Variable Documentation

◆ base2spgid

std::unique_ptr<Int2Int> base2spgid {new Int2Int()}
static

Definition at line 1163 of file bbsavestate.cpp.

◆ bbss

BBSaveState* bbss
static

Definition at line 372 of file bbsavestate.cpp.

◆ callback_mode

int callback_mode
static

Definition at line 289 of file bbsavestate.cpp.

◆ dbuf

char dbuf[1024]
static

Definition at line 365 of file bbsavestate.cpp.

◆ debug

int debug = DEBUG
static

Definition at line 364 of file bbsavestate.cpp.

◆ giddest

int* giddest
static

Definition at line 2284 of file bbsavestate.cpp.

◆ giddest_size

int giddest_size
static

Definition at line 2283 of file bbsavestate.cpp.

◆ hoc_built_in_symlist

Symlist* hoc_built_in_symlist

Definition at line 39 of file symbol.cpp.

◆ members

Member_func members[]
static
Initial value:
= {
{"save", save},
{"restore", restore},
{"save_test", save_test},
{"restore_test", restore_test},
{"save_test_bin", save_test_bin},
{"restore_test_bin", restore_test_bin},
{"save_request", save_request},
{"save_gid", save_gid},
{"restore_gid", restore_gid},
{"ignore", ppignore},
{"vector_play_init", vector_play_init},
{0, 0}}
static double save_test_bin(void *v)
static double restore_test(void *v)
static double restore_gid(void *v)
static double save_request(void *v)
static double ppignore(void *v)
static double restore(void *v)
static double save_gid(void *v)
static double save_test(void *v)
static double vector_play_init(void *v)
static double save(void *v)
static double restore_test_bin(void *v)

Definition at line 1015 of file bbsavestate.cpp.

◆ nc2dblist

std::unique_ptr<NetCon2DblList> nc2dblist
static

Definition at line 1122 of file bbsavestate.cpp.

◆ nct

cTemplate* nct
static

Definition at line 1045 of file bbsavestate.cpp.

◆ net_cvode_instance

NetCvode* net_cvode_instance

Definition at line 27 of file cvodestb.cpp.

◆ nrn_binq_enqueue_error_handler

void(* nrn_binq_enqueue_error_handler) (double, TQItem *)

Definition at line 28 of file sptbinq.cpp.

◆ nrn_is_artificial_

short* nrn_is_artificial_

Definition at line 231 of file init.cpp.

◆ nrn_pnt_template_

cTemplate** nrn_pnt_template_

Definition at line 169 of file init.cpp.

◆ nrn_use_bin_queue_

bool nrn_use_bin_queue_

Definition at line 251 of file netcvode.cpp.

◆ pnt_receive

ReceiveFunc* pnt_receive

Definition at line 171 of file init.cpp.

◆ pp2de

std::unique_ptr<PP2DE> pp2de
static

Definition at line 1118 of file bbsavestate.cpp.

◆ pp_ignore_map

std::unique_ptr<PointProcessMap> pp_ignore_map
static

Definition at line 764 of file bbsavestate.cpp.

◆ presyn_queue

std::unique_ptr<Int2DblList> presyn_queue
static

Definition at line 1448 of file bbsavestate.cpp.

◆ pycell_name2sec_maps

std::unordered_map<void*, SecName2Sec> pycell_name2sec_maps
static

Definition at line 1743 of file bbsavestate.cpp.

◆ queuecheck_gid2unc

std::unique_ptr<Int2DblList> queuecheck_gid2unc
static

Definition at line 1196 of file bbsavestate.cpp.

◆ secorder

Section** secorder

Definition at line 77 of file solve.cpp.

◆ section_count

int section_count

Definition at line 76 of file solve.cpp.

◆ sewrap_list

SEWrapList* sewrap_list
static

Definition at line 1160 of file bbsavestate.cpp.

◆ src2send

std::unique_ptr<Int2DblList> src2send {new Int2DblList()}
static

Definition at line 1167 of file bbsavestate.cpp.

◆ src2send_cnt

int src2send_cnt
static

Definition at line 1167 of file bbsavestate.cpp.

◆ ssi

StateStructInfo* ssi
static

Definition at line 1044 of file bbsavestate.cpp.

◆ t

double t

Definition at line 123 of file init.cpp.

◆ tq_presyn_fanout

TQItemList* tq_presyn_fanout
static

Definition at line 292 of file bbsavestate.cpp.

◆ tq_removal_list

TQItemList* tq_removal_list
static

Definition at line 293 of file bbsavestate.cpp.

◆ tsdest

double* tsdest
static

Definition at line 2286 of file bbsavestate.cpp.

◆ tsdest_cnts

int* tsdest_cnts
static

Definition at line 2285 of file bbsavestate.cpp.

◆ use_gidcompress_

bool use_gidcompress_
static

Definition at line 287 of file bbsavestate.cpp.

◆ use_spikecompress_

bool use_spikecompress_
static

Definition at line 286 of file bbsavestate.cpp.

◆ usebin_

int usebin_
static

Definition at line 376 of file bbsavestate.cpp.