Hi, Hines,
Thanks for the help. Yes, I've been trying to debug this issue step-by-step.
I created a small network with only 100 cells. I printed out the sequences saved and restored.
But I'm not sure whether I did it correctly. Below is what I did.
For the first part of the simulation, I saved the sequences to a file:
Code: Select all
objref randomfile
randomfile = new File("randomfile")
if(pc.id==0){
randomfile.wopen()
randomfile.close()
}
proc randomsave() { local i, rank
pc.barrier() // wait for all hosts to get to this point
for rank=0, pc.nhost-1 { // host 0 first, then 1, 2, etc.
if (rank==pc.id) {
for i=0, randomlist.count-1 {
randomfile.aopen()
randomfile.printf("%g\n", randomlist.o(i).seq())
randomfile.close()
}
}
pc.barrier() // wait for all hosts to get to this point
}
}
randomsave()
I got a file with one column with 100 values, with 2 or 3. As I'm not familiar with what's been saved, I not sure whether I did it correctly.
Then I moved on to the restore part, i.e. the second part of the simulation.
This is the restore part that I used in the second part:
Code: Select all
proc init() {
finitialize()
s = new String()
sprint(s.s, "svst.%04d", pc.id)
f = new File(s.s)
ss = new SaveState()
ss.fread(f, 0)
randomlist = new List()
for i=0,randomlist.count-1 {
randomlist.o(i).seq(f.scanvar())
}
f.close
ss.restore()
t=50
if (cvode.active()) {
cvode.re_init()
} else {
fcurrent()
}
frecord_init()
}
As I couldn't do printf in the init(), I saved the second part's random seq in the same way as I did in the first part.
Code: Select all
objref randomfile_restore
randomfile_restore = new File("randomfile_restore")
if(pc.id==0){ //"wopen" once by node 0 to clear the contents of the file
randomfile_restore.wopen()
randomfile_restore.close()
}
proc randomrestore() { local i, rank
pc.barrier() // wait for all hosts to get to this point
for rank=0, pc.nhost-1 { // host 0 first, then 1, 2, etc.
if (rank==pc.id) {
for i=0, randomlistII.count-1 {
randomfile_restore.aopen()
randomfile_restore.printf("%g\n", randomlistII.o(i).seq())
randomfile_restore.close()
}
}
pc.barrier() // wait for all hosts to get to this point
}
}
randomrestore()
randomlistII is the list that I created in the second simulation.
Then I got randomfile_restore file from the second simulation. From my understanding, randomfile and randomfile_restore are supposed to be the same. But when I checked those two files, the values are different. However, it's been strange that, for this small network simulation, I could match the spikes data to non-segmentation. But once the network size goes to 1000-cell, I got mismatch. And also, as long as I got mismatch, the mismatched spiking data always happened after more than 20ms from the beginning of the second simulation. For example, for 100ms-simulation, 0-50ms was for the first part, and 50-100ms was for the second part, then the mismatch part always happens after 70ms or even more. If the noise generator seq was not restored properly, the mismatch could happen right from the start of the second simulation, my thought.
It seems there are several issues, maybe they are from the same reason?
Please let me know your thought. Thank you so much.