Page 1 of 1

SaveState.restore() causes various error

Posted: Mon Jul 22, 2019 1:48 pm
by neuronalpail
I follows a cerebellar granular layer model published by Sudhakar et al. (2017) which available on ModelDB https://senselab.med.yale.edu/ModelDB/s ... del=232023.

I tried to save and restore the state variables with SaveState class, but once insert scripts for it, the model returns errors during psolve(tstop) (segmentation fault (signal 11) on my local laptop with NEURON v. 7.6.2; assertion (signal 6) on the cluster machine with NEURON v. 7.4, assert message is following).

Code: Select all

net_send td-t = -20.125 SelfEvent target=VecStim[38] 0 flag=1
I inserted save/restore scripts between stdinit() and pc1.psolve(tstop) functions in run.hoc as follows.

Code: Select all

pc1.set_maxstep(10)
stdinit()
if(statesCond==0){ // newly defined
    pc1.psolve(t_state) // t_state = 20, newly defined

    print "saving state with SaveState class."
    sprint(stateName,"states%02d.dat",pc1.id)
    svstate = new SaveState()
    svstate.save()
    fstate = new File(stateName)
    svstate.fwrite(fstate)
    fstate.close()
}else{
    print "loading state with SaveState class."
    sprint(stateName,"states%02d.dat",pc1.id)
    svstate = new SaveState()
    fstate = new File(stateName)
    svstate.fread(fstate)
    svstate.restore()
    fstate.close()
    pc1.barrier()
}
pc1.psolve(tstop) // tstop = 30, modified
The model uses VecStim for input mossy fibre layer, so already modified to generate spikes only after t_state (=20 ms) for restoring simulation.

Is there any possible problem? Or if required, where and how can I share my modified codes?

Many thanks

Re: SaveState.restore() causes various error

Posted: Tue Jul 23, 2019 11:34 am
by ted
Did you ever use SaveState before, to do anything? Build a toy model and try it out with that toy model. When you get that right, try something more complicated.