Code: Select all
2 nrniv: Segmentation violation
2 in RChiBuild3.hoc near line 224
2 pc.runworker()
^
2 fadvance()
2 advance()
2 step()
2 continuerun(4200)
and others
I've been able to isolate the issue to the use of 'MyVecStim.play(MyTimes)'. If I comment that statement out, the code works fine for as many jobs as I request, even if it exceeds the number of available processors. The code is as follows (relevant part is the func DoRun(). It omits further code for setting up the synapses randomly along given sections, and the ParallelContext setup):
Code: Select all
{load_file("nrngui.hoc")}
//Cell Type
{load_file("mvnB_TEMP.hoc")}
//Global Values. Still some used.
{load_file("globals.hoc")}
objref cell, stim
objref tms
cell = new mvnB()
access cell.somaB
objref rsVec, vek
objref pc
objref initial_Voltage_Stream
objref rate_Stream
objref inp_Stream
objref inp_trains
objref inps, tlist, vect
//Recording Vectors, for results/output.
objref recV, recI, recG
recV = new Vector()
recI = new Vector()
recG = new Vector()
sim_time = 4200
DT = 0.1
dt = DT
steps_per_ms = 1/DT
tstart = TSTART
tstop = sim_time
pop_size = 13
seed = 337
V_INIT = -65
syn_tau1 = 0.5 //Rise time
syn_tau2 = 3 //Fall time
nsyns = 20 //Number of Synapses
num_trains = 5000 // Total number of trains given in the .dat file. The total size of the input pool.
syn_Thresh = 10 //Exp2Syn Threshold
syn_Delay = 1 //Delay in ms
syn_Weight = 1.0 //Weight
objref vs[nsyns], nc[nsyns]
objref syn[nsyns], randomize_location
//Analysis start after X time.
analstart = 1200
{load_file("analysis.hoc")}
pc = new ParallelContext()
st1 = pc.time
//Read in .dat with input SpikeTimes, make vectors of them.
inps = new File()
inps.ropen("test_8Hz_A03.dat")
tlist = new List(num_trains)
for kk = 0, num_trains-1 {
vect = new Vector()
vect.scantil(inps, 9999)
tlist.append(vect)
}
func doRun() {
access cell.somaB
// recording vectors
recV = new Vector()
recV.record(&v(0.5), dt)
id = hoc_ac_
//Initial voltage, and rate for this particular simulation. And initialise Random Streams used WITHIN the DoRun block.
v_init = $2
F_rate = $3
syn_rand_seed = $4
train_seed = $5
inp_trains = new List(nsyns)
//Setup Random stream for choosing Input Trains
inp_Stream = new Random (train_seed)
inp_Stream.discunif(0, num_trains-1)
//Create the Synapses
creatensyn(cell, cell.alldendritesB, nsyns, syn_rand_seed)
//Set up Inputs
//Make the VecStims for driving the Synapses
for iv = 0, nsyns - 1{
vs[iv] = new VecStim()
}
//Attach VecStims to Synapses using NetCons
for in = 0, nsyns-1{
nc[in] = new NetCon(vs[in], syn[in], syn_Thresh, syn_Delay, syn_Weight)
}
//Choose input trains from pool
for k = 0, nsyns-1{
r_n = inp_Stream.repick()
inp_trains.append(tlist.o[k])
}
//Play these VecStims
for k = 0, nsyns-1{
tms = new Vector()
tms = inp_trains.o[k]
vs[k].play(tms)
}
finitialize(v_init)
run()
analspikes(analstart)
pc.post(id, spikes)
return 0
}
vecevent.c: In function 'play':
vecevent.c:238: error: invalid type of argument of 'unary *' (have 'int')
(and the same for the _destructor method)
make: *** [vecevent.lo] Error 1
Are there any alternatives to VecStim play method that I could/should be using here? Or is there an easy fix for the issue? I've come across Ted's suggestion for using FInitializeHandler, but each synapse has around 100-200 events during the simulation, and each cell can have up to 60 synapses attached, so I figure that wouldn't be the best way to go about it.
Currently using Neuron 7.2, with openmpi 1.6, using SGE (I think).