I have the following problem:
I want to record and print the spike train of the single cell that I multisplitted.
Using the following code:
Code: Select all
objref tvec, idvec
proc spikerecord() {local i localobj nc, nil
tvec = new Vector()
if (section_exists("soma", 0)) {
soma nc=new NetCon(&v(1),nil,10,1,0.01)
nc.record(tvec)
}
}
proc spikeout() { local i
pc.barrier()
if (pc.id==0) printf("Spikes Time:\n")
for i=0, tvec.size-1 printf("Spike %d at %g\n", i+1, tvec.x[i])
pc.barrier()
}
I have seen that is possible to use:
Code: Select all
...
pnm.want_all_spikes()
...
for i=0, pnm.spikevec.size-1 {
print pnm.spikevec.x[i]
}
print pnm.spikevec.size
...
In addition I have an other problem with printing in a text file:
Code: Select all
start=200
for u=start,200{
...
if (u==start){
savdata3 = new File()
sprint(name3,"Simulation_%s.dat",str)
savdata3.wopen(name3)
pc.barrier()
if (section_exists("soma",0)){
savdata3.printf("gNa_axon=%f \t",gna_axon)
savdata3.printf("gK_axon=%f \t",gkdrbar_axon)
savdata3.printf("gK_soma=%f \t",gkdrbar_soma)
savdata3.printf("gNa_soma=%f \t",gna_soma)
savdata3.printf("gK_basal=%f \t",gkdrbar_basal)
savdata3.printf("g_Km=%f \t",gbar_km)
savdata3.printf("g_Ih=%f \t",soma_hbar)
savdata3.printf("g_CaT=%f \t",gcatbar_cat)
savdata3.printf("g_CaL=%f \t",gcalbar_cal)
savdata3.printf("g_CaR=%f \t",gcabar_somacar)
savdata3.printf("g_sAHP=%f \t",gbar_kca)
savdata3.printf("g_mAHP=%f \t\n",gkbar_mykca)
savdata3.printf("#nsynE \t #Spikes\n")
}
}
run_program()
}
But, for a single iteration (for example), the output is the following:
Code: Select all
200 0
0.300000 gK_axon=0.030000 gK_soma=0.007500 gNa_soma=0.030000 gK_basal=0.000100 g_Km=0.000400 g_Ih=0.000019 g_CaT=0.000050 g_CaL=0.007000 g_CaR=0.000600 g_sAHP=0.000500 g_mAHP=0.090750
200 2
PS: mpiexec -np 2 nrniv -mpi -NSTACK 2000 init.hoc
Thanks for your help.
Pasquale.