Page 1 of 1
Error: stack too deep
Posted: Wed Mar 30, 2011 11:39 am
by Ginetto
Hello folks,
I am running my model several times (for statistical significance), but always after the 6th run I get the error:
Stack too deep. Increase with -NSTACK stacksize option
I don't understand which problem causes this error and how to solve it.
Could someone jelp me?
Thanks a lot!
Ginetto
Re: Error: stack too deep
Posted: Wed Mar 30, 2011 3:27 pm
by ted
What OS are you using?
Error: stack too deep
Posted: Fri Apr 01, 2011 5:29 am
by Ginetto
right... I forgot to mention it.
The OS is Linux
Re: Error: stack too deep
Posted: Fri Apr 01, 2011 9:55 am
by ted
Execute
nrngui -h
and discover how to adjust stack size.
Re: Error: stack too deep
Posted: Fri Apr 01, 2011 11:27 am
by Ginetto
Is it one of the interpreter options?
How can I check the current size of stack? The default value is 1000, but I want to check if I really change it.
Where I can find info about this argument? I had a look on "quick reference" and NEURON book, but nothing...
I don't understand if my program is unefficient or it really needs more memory.
I have to run many times the same simulation for statistical reasons, so I image/hope that at each run the memory is reset.
I am not an expert programmer, so I don't know how to check it.
Ginetto
Re: Error: stack too deep
Posted: Fri Apr 01, 2011 12:31 pm
by ted
Ginetto wrote:Is it one of the interpreter options?
It's a command line option, like command line options that other Linux programs have. If you want to specify a different value from NEURON's default, for example 2000, then instead of
nrngui foo.hoc
type
nrngui -NSTACK 2000 foo.hoc
I don't understand if my program is unefficient or it really needs more memory.
The error message told you the stack was too small for your code. If you want NEURON to run your code, increase the stack size until you find a value that works.
I have to run many times the same simulation for statistical reasons, so I image/hope that at each run the memory is reset.
Linux reclaims memory when programs exit.
Re: Error: stack too deep
Posted: Mon Apr 04, 2011 9:53 am
by Ginetto
ted wrote:It's a command line option, like command line options that other Linux programs have. If you want to specify a different value from NEURON's default, for example 2000, then instead of
nrngui foo.hoc
type
nrngui -NSTACK 2000 foo.hoc
I meet some problems when I want to run my simulation using the command line.
I am using the model of Poirazi 2003. To run the sumulation I type in the terminal:
where run_experiment is an executable file which contains the lines:
where x86_64 is the folder created after compiling.
If I run the NEURON's GUI through the command
nrngui and then I load my hoc file
experiment.hoc, I have an error. I think the problem is that NEURON cannot find the mechanisms of the model (note that
experiment.hoc is in a different directory respect to the mechanisms).
Even if I load a session I meet similar error.
In conclusion, if I type
nrngui -NSTACK 2000 experiment.hoc my model cannot run, but if I run my simulation with
./run_experiment I don't know how to change the stack size!
Re: Error: stack too deep
Posted: Mon Apr 04, 2011 10:09 am
by ted
I think the problem is that NEURON cannot find the mechanisms of the model (note that experiment.hoc is in a different directory respect to the mechanisms).
So you know never to do anything like that yourself. There is such a thing as being too clever.
To run the sumulation I type in the terminal:
where run_experiment is an executable file which contains the lines:
where x86_64 is the folder created after compiling.
I don't understand. experiment.hoc is a text file that contains hoc statements? How can typing the name of a hoc file at the command line do anything useful?
Re: Error: stack too deep
Posted: Mon Apr 04, 2011 10:48 am
by Ginetto
ted wrote:I don't understand. experiment.hoc is a text file that contains hoc statements? How can typing the name of a hoc file at the command line do anything useful?
experiment.hoc is a text file which contains hoc statements, as you said. Once exectuted, It loads the model and runs the simulations. In other words it is the main hoc file of the model.
I created a new file called
run_experiment with no extension, which contains a sigle line of code:
On the linux shell I type
chmod +x run_experiment to make it executable.
In order to execute experiment.hoc and so my model, I type in the Linux shell the command
./run_experiment.
Maybe it is more laborious, but for me it is the only way to run the model correctly.
I think this procedure should be equivalent to type in the shell
nrngui and then load the hoc file
experiment.hoc using the GUI... But for some reasons, I cannot run my model with this second procedure.
Re: Error: stack too deep
Posted: Mon Apr 04, 2011 9:27 pm
by ted
In the directory that contains your hoc files, execute
nrnivmodl pathtoyourmodfiles
where
pathtoyourmodfiles
is the path to the location of your mod files. Then x86_64 will be created and the compiled mechanisms will be placed in that directory, and you will be able to execute
nrngui -NSTACK 2000 foo.hoc
or whatever you like.
Re: Error: stack too deep
Posted: Tue Apr 05, 2011 11:04 am
by Ginetto
It works! Thanks!
Where can I find some info about the command line options of nrngui and their meanings?
Re: Error: stack too deep
Posted: Tue Apr 05, 2011 4:15 pm
by ted
nrngui --help