Error: stack too deep
Error: stack too deep
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
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
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Error: stack too deep
What OS are you using?
Error: stack too deep
right... I forgot to mention it.
The OS is Linux
The OS is Linux
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Error: stack too deep
Execute
nrngui -h
and discover how to adjust stack size.
nrngui -h
and discover how to adjust stack size.
Re: Error: stack too deep
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
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
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Error: stack too deep
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 ofGinetto wrote:Is it one of the interpreter options?
nrngui foo.hoc
type
nrngui -NSTACK 2000 foo.hoc
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 don't understand if my program is unefficient or it really needs more memory.
Linux reclaims memory when programs exit.I have to run many times the same simulation for statistical reasons, so I image/hope that at each run the memory is reset.
Re: Error: stack too deep
I meet some problems when I want to run my simulation using the command line.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 am using the model of Poirazi 2003. To run the sumulation I type in the terminal:
Code: Select all
./run_experiment
Code: Select all
../x86_64/experiment.hoc -
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!
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Error: stack too deep
So you know never to do anything like that yourself. There is such a thing as being too clever.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).
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?To run the sumulation I type in the terminal:where run_experiment is an executable file which contains the lines:Code: Select all
./run_experiment
where x86_64 is the folder created after compiling.Code: Select all
../x86_64/experiment.hoc -
Re: Error: stack too deep
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.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?
I created a new file called run_experiment with no extension, which contains a sigle line of code:
Code: Select all
../x86_64/experiment.hoc -
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.
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Error: stack too deep
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.
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
It works! Thanks!
Where can I find some info about the command line options of nrngui and their meanings?
Where can I find some info about the command line options of nrngui and their meanings?
-
- Site Admin
- Posts: 6384
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
Re: Error: stack too deep
nrngui --help