Patch to allow restore after recreating the geometry
Posted: Wed Sep 23, 2015 4:10 pm
When running multiple simulations on the same geometry (with different extracellular fields and/or synapse weights, etc) it's useful to be able to run the simulation to steady state, save the state of the sections, and then use this saved state to start new simulations after recreating the exact same geometry (in python). In order to do that I made the following small change to savstate.cpp. I thought that this might also be useful to other users. I can also create a simple python program demonstrating it's use if there is interest.
Code: Select all
*** nrn-7.4-orig/src/nrniv/savstate.cpp 2015-04-23 14:06:34.000000000 -0700
--- nrn-7.4/src/nrniv/savstate.cpp 2015-07-18 11:24:21.848503407 -0700
***************
*** 275,281 ****
}
return false;
}
! if (nsec_ && ss_[0].sec == NULL) { // got the data from a read
isec = 0; ForAllSections(sec)
ss_[isec].sec = sec;
section_ref(ss_[isec].sec);
--- 275,282 ----
}
return false;
}
! if (nsec_ && ((ss_[0].sec == NULL)||(!ss_[0].sec->prop))) { // got the data from a read (or recreated the geometry)
! fprintf(stderr, "SaveState: Setting sections.\n");
isec = 0; ForAllSections(sec)
ss_[isec].sec = sec;
section_ref(ss_[isec].sec);