adding new template slows down
Posted: Tue Mar 10, 2009 10:30 pm
I generated the following template (it works well):
and then I created many instances of this cell template using the following loop:
I didn't put the entire code of the program. The point is that the above loop for creation of instances of the cell starts executing rapidly (about 100 print statement lines per second) but then quickly slows down (1 print statement line per 20 seconds). The above 30x30x2 loop takes hours to complete.
Is this normal?
Is there a way to speed this up?
Code: Select all
begintemplate tpTCN
external newseed, grDur, stimulatortime
public soma,vcell,gnoise,electrode,stimulator
create soma
objref vcell,gnoise,electrode,stimulator
proc init() {
access soma
soma {
nseg = 1
diam = 76.58
L = 100
cm = 1
insert hh2
ena = 50
ek = -100
vtraub_hh2 = -52
gnabar_hh2 = 0.01
gkbar_hh2 = 0.01
insert itGHK
cai = 2.4e-4
cao = 2
eca = 120
shift_itGHK = -1
gcabar_itGHK = 0.0002
qm_itGHK = 2.5
qh_itGHK = 2.5
pcabar_itGHK = 8e-5
insert cad
depth_cad = 0.1
kt_cad = 0
kd_cad = 1e-4
taur_cad = 5
cainf_cad = 2.4e-4
insert pas
g_pas = 3.79e-5
e_pas = -76.5
cm = 0.88
Ra = 173
gnoise = new Gfluct(0.5)
gnoise.g_e0 = 0.0711
gnoise.std_e = 0.005
gnoise.g_i0 = 0.1
gnoise.std_i = 0.02
gnoise.tau_e = 3
gnoise.tau_i = 10
gnoise.E_e = 0
gnoise.E_i = -75
gnoise.new_seed(newseed())
electrode = new PointProcessManager(0)
electrode.pp=new IClamp(0)
electrode.pp.del=0
electrode.pp.dur=grDur
electrode.pp.amp=0
}
vcell = new Vector()
vcell.record(&soma.v(0.5))
stimulator=new VectorPlay(1)
stimulator.vy = new Vector(grDur+1)
stimulator.vx = stimulatortime
stimulator.vy.play(&electrode.pp.amp, stimulator.vx)
}
endtemplate tpTCN
Code: Select all
rowsTCN=30
colsTCN=rowsTCN
slabsTCN=2
objref TCN[colsTCN][rowsTCN][slabsTCN]
for col=0, colsTCN-1 for row=0, rowsTCN-1 for slab=0, slabsTCN-1 {
TCN[col][row][slab] = new tpTCN()
TCN[col][row][slab].gnoise.g_e0 = .05
print "created TCN[",col,"][",row,"][",slab,"]"
}
Is this normal?
Is there a way to speed this up?