- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Everyone,
I got stack overflow error. It is on subroutine entry. How to expand the size of stack?
Thank
I got stack overflow error. It is on subroutine entry. How to expand the size of stack?
Thank
Lien copié
4 Réponses
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
This is not a reply to your question. Just some additional observations. I have encountered the error that you are talking about several times. It was always happening when I was passing faily big sized arrays as the arguments to a subroutine. The thing that puzzles me is that I was always under the impression that all the arguments are passed by reference in fortran (by default). So, when you are passing an array to a subroutine, only one address pointer must have been passed around which could not possibly overflow the stack. So, what is the reason for overflowing the stack.
Ali Asi
asi@enginia.com
Ali Asi
asi@enginia.com
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
You probably have an array temporary created on subroutine entry due to the way you're making the call. You can increase the size of the stack, but a larger array may one day exceed that too. Or you can change the way you make the call and avoid the creation of the array temporary. I'd choose the latter.
hth,
JT
Links:
In the online docs
Setting the stack size with the /stack linker switch
Changing the stack size with the editbin tool
Passing arrays:
Newsletter 1, Chris Bord's article 'PASSING ARRAYS IN FORTRAN 90'
In the online docs, under Programmer's Guide | Performance: Making Programs Run Faster | Use Arrays Efficiently | Passing Array Arguments Efficiently
hth,
JT
Links:
In the online docs
Setting the stack size with the /stack linker switch
Changing the stack size with the editbin tool
Passing arrays:
Newsletter 1, Chris Bord's article 'PASSING ARRAYS IN FORTRAN 90'
In the online docs, under Programmer's Guide | Performance: Making Programs Run Faster | Use Arrays Efficiently | Passing Array Arguments Efficiently
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thank a lot,
I almost use allocatable and pointer in my routine, and deallocate when it not used.
With same problem, stack overflow does not occur if I compiled with LF95. It means stack size of CVF too small?
I almost use allocatable and pointer in my routine, and deallocate when it not used.
With same problem, stack overflow does not occur if I compiled with LF95. It means stack size of CVF too small?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Toppo,
If you'd like a specific diagnosis of the problem, you should probably post the version of CVF you're using, and enough code to let someone point out anything that may help (this should include the subroutine declaration and the declaration of all dummy variables, local variables, and the actual args passed in.)
-JT
If you'd like a specific diagnosis of the problem, you should probably post the version of CVF you're using, and enough code to let someone point out anything that may help (this should include the subroutine declaration and the declaration of all dummy variables, local variables, and the actual args passed in.)
-JT
Répondre
Options du sujet
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable