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
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
Is there any possible problem? Or if required, where and how can I share my modified codes?
Many thanks