Problem in using SaveState class .save function

Anything that doesn't fit elsewhere.
Post Reply
Sherif
Posts: 27
Joined: Thu Oct 13, 2005 4:32 pm

Problem in using SaveState class .save function

Post by Sherif »

Hello,

I have a detailed model of a single neuron that takes long time to reach steady-state conditions in response to a given level of synaptic input. Given that most of my measurements are taken during steady-state conditions I use the SaveState class .save function to save the steady-state condition of my model. To save time I then load the saved state and use it as an initial condition of a new simulation. Surprisingly, I found that synapses in the model are not active when I upload the saved state even that I didn't change the synapses location, number, or any of their properties. Everything works fine except that the synapses are silent rather than being active as it should be. Does anyone have an explanation for this unexpected behavior?

Thanks
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

That sounds like a bug in the SaveState algorithms. The synapses are supposed to take up exactly where they left off on a SaveState.save(). However you must not change time back to 0. I just checked the
http://www.neuron.yale.edu/course/handson.html
example 14 and do not see a problem with inactive synapses. However there is a problem with the state of a NetStim in that when I initialize, SaveState.restore() a state that had been previously saved at 100 ms, do a cvode.re_init, and then a ContinueRun for 400 ms, that the NetStim generates its full stream as though it had been shifted by 100 ms. So some of its important computer state had not been saved. I will fix that problem and there is a chance it may also fix the problem you are experiencing. To save time, you may want to set up a test run yourself that exhibits your problem and send the hoc,ses,mod files in a zip file that would allow me to see the your specific problem and update the SaveState implementation. Send the zip file to me at michael.hines@yale.edu.
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

I was looking at the SaveState implementation and see the reason why NetStim was not being saved/restored properly. I believe it may also be the same reason that you are having trouble with your synapses. The clue comes from the comment:

Code: Select all

              // generally we only save STATE variables. However for
                // models containing a NET_RECEIVE block, we also need to
                // save everything except the parameters
                // because they often contain
                // logic and analytic state values. So change the type to
                // ASSIGNED if this is the case and use the end of the
                // param array to calculate the size.
What happened is that the NetStim does not declare any ASSIGNED variable to be a RANGE variable in the NEURON block. Thus the search for the first hoc registered ASSIGNED variable comes up empty and so none of them are saved. A work around for the NetStim.mod file would be to declare the
"on" variable as a range variable. Similarly, you might want to check your synaptic mod files and make sure the first ASSIGNED variable is explicitly put into a RANGE statement. I believe that will work around your problem. However, I will also fix the underlying problem in the savstate.cpp file so this issue does not recur.
Sherif
Posts: 27
Joined: Thu Oct 13, 2005 4:32 pm

Post by Sherif »

Hi Michael,

I defined the "on" variable in the NetStim.mod file as a range variable; however, the problem is still there. Interestingly, after I uploaded the saved state file and monitored the current delivered by one of the synapses in a current graph I found that the synapse completed its spike current then became zero after that. Any suggestions?
hines
Site Admin
Posts: 1691
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

My suggestion should have worked but there is too much ambiguity in your reply for me to be certain you carried it out. But no matter, I fixed the bug and we should take up from there. Please install the most recent version from
http://www.neuron.yale.edu/ftp/neuron/versions/alpha/
and if there is still a problem, zip up all your mod,ses,hoc files and email them to me at michael.hines@yale.edu. It would help if you set up an easy to use demo of the problem.
Post Reply