Why does this variable temporarily disappear?

The basics of how to develop, test, and use models.
Post Reply
Posts: 18
Joined: Tue Apr 21, 2009 12:57 am

Why does this variable temporarily disappear?

Post by phendric »

Michael or Ted (or anyone else who would know the answer to this):

I have a case of a missing variable when running a NEURON script. It's the Poirazi model I talked a little bit with both of you about at this year's NEURON course - I'm in the process of re-working the code so that I can make the entire cell model into a template for use in a network - or at least to get the practice in doing so, since I'm probably going to have to do it with other models as well.

At this point, I've put all of the morphology/geometry for the cell into a single file, and I load another file which sets up all of the biophysical mechanisms. Here's the problem:

-In the geometry file, I create a vector named vRP, and fill it with 4 elements.
-At the time I load the biophysical properties file, vRP still exists and reports that it has a length of 4.
-In the biophysical properties file, two functions get called within each other - find_vector_distance_precise() gets called, and in turn, calls vector_distance(). However, once I enter the find_vector_distance() function, vRP no longer shows up for some reason, and NEURON returns an error when trying to call vector_distance(), which requires vRP to be passed to it. Here's the error message:

Code: Select all

/home/phendric/nrn70/nrn/i686/bin/nrniv: attempt to evaluate a non-variable vRP
 in CellSpec.hoc near line 6949
 access apical_dendrite[0]
        find_vector_distance_precise("apical_dendrite[0]", 0)
and others
After that error, I try to list the contents of vRP twice. The first time NEURON throws a seg fault, but the second time it displays the variable normally, and when I then try to call vector_distance() manually, it works:

Code: Select all

/home/phendric/nrn70/nrn/i686/bin/nrniv: Segmentation violation
 near line 1
func vector_distance() {
The error occurs in both NEURON 7.0 and 7.1. I'm running it under 32-bit Ubuntu 9.04.

I thought I could attach code files that you could then look at, but I guess I was wrong. I can, however, email them to you, if you'd like to take a closer look at the problem.

Any ideas about what's happening? Note that in Poirazi's original code, this problem does not occur, even though the same functions are getting called in, as far as I can tell, the same order.

Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: Why does this variable temporarily disappear?

Post by ted »

There's no substitute for seeing it with ones own eyes. Can you zip it up & send it?
Post Reply