Sorry this response took such a long time.
I decided to start with a parallelized network model that is known to work--specifically, ringpar.hoc, which implements the parallelized model of the ring network in
Hines ML, Carnevale NT (2008) Translating network models to parallel hardware in NEURON J. Neurosci. Meth. 169:425-455
https://www.ncbi.nlm.nih.gov/pubmed/17997162
which is available from ModelDB
https://senselab.med.yale.edu/ModelDB/s ... odel=96444
Yes, it's in hoc, and the very short example in the Programmer's Reference documentation for BBSaveState is in Python, but the hoc implementation works.
Only minimal changes are needed to turn this into a program that would use BBSaveState. The changes I made are:
1. At the very start of the program insert
Code: Select all
// embed this assignment
// but consider moving it to the command line in the future
RESTORE = 0 // 0 to do a warmup run then save states
// 1 to use previously saved states
if (RESTORE == 0) {
TSTOP = 50 // do a 50 ms warmup simulation, then save states
} else {
TSTOP = 100 // for a run after saved states have been restored
}
2. Change the simulation flow code from
Code: Select all
tstop = 100
{pc.set_maxstep(10)}
stdinit()
{pc.psolve(tstop)}
to
Code: Select all
/*
tstop = 100
{pc.set_maxstep(10)}
stdinit()
{pc.psolve(tstop)}
*/
tstop = TSTOP
proc prun() { localobj bbss
pc.set_maxstep(10)
stdinit()
bbss = new BBSaveState()
if (RESTORE == 1) {
bbss.restore_test()
if (pc.id==0) printf("after restore t = %g\n", t)
pc.psolve(tstop)
} else {
pc.psolve(tstop)
bbss.save_test()
}
}
prun()
3. Comment out everything from the definition of proc spikeout() to the end of the file. Clearly a bit of additonal development is required to handle the "restore states and run a simulation from that point" case. For now, all I wanted was something that ran and saved states.
Program execution went well until the "save states" step, at which point the program exited with this message:
Code: Select all
nrniv: bbsavestate.cpp:410: BBSS_TxtFileOut::BBSS_TxtFileOut(const
char*): Assertion `f' failed.
It turns out that BBSaveState.save_test() expects the "out" subdirectory to already exist. If "out" does not exist, the program just quits. Of course, that's not explicitly stated in the documentation of save_test--but it should be.
Anyway, after I created an "out" subdirectory, the code ran without problems and wrote a bunch of files to that directory.