Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

stack overflow

jfdoyle
Beginner
467 Views
i am compiling an app using IVF 10.1 but not the IDE. During run time i get
forrtl severe(170) stack overflow
at a call to one of my subroutines.
this apps compiles and runs fine with FPS 4.0

How do i fix the problem? i tried /Qsave and /F1000
What is good programming practice to minimize the likelihood of stack overflow occuring?
--- james
0 Kudos
3 Replies
bmuirpurdue_edu
467 Views
I had exactly this same problem when converting from MS Powerstation. The solution is to allocate memory in subroutines usingALLOCATE to dinension variables. I think this takes memory from the Heap rather than the Stack. Powerstation did not care, it just kept increasing memory as needed. At the end of the subroutine be careful to DEALLOCATE those variable or you will get another error.


0 Kudos
Steven_L_Intel1
Employee
467 Views
Add /heap-arrays - this will match the FPS behavior.
0 Kudos
jfdoyle
Beginner
467 Views
Quoting - jfdoyle
i am compiling an app using IVF 10.1 but not the IDE. During run time i get
forrtl severe(170) stack overflow
at a call to one of my subroutines.
this apps compiles and runs fine with FPS 4.0

How do i fix the problem? i tried /Qsave and /F1000
What is good programming practice to minimize the likelihood of stack overflow occuring?
--- james

steve:

i used /heap-arrays:2 and everything seems to work just dine.

thanks, james

0 Kudos
Reply