Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with stack overflow

Status
Not open for further replies.

armeros

Programmer
Aug 26, 2014
23
AU
Hi everyone,

I have an error message forrtl: severe(170): Program exception - stack overflow

My program is doing some grid search. It ran fine with a small number of grids, but then I got this message when I increase the number of grids to the realistic level. I read the topic but I still don't understand. ( I use Intel Visual Fortran Compiler with IMSL libraries (use include 'link_fnl_static_hpc.h') and I ran the program by clicking Start without debugging so I don't know what "ifort" is.

Anyone could suggest me the way out of this ?

Thank you very much.

PS. I use Windows 7 with Intel(R) Xeon(R) CPU W350 @2.80GHZ
RAM 6.00 GB
64 bit operating system (but the compiler was installed as 32 bit due to some installation problem)
 
ifort is the fortran compiler.

From visual studio, under debug/exceptions, check win32 exceptions.
Press F5 to run your program.
 
So, how would I solve this overflow problem ? Thanks.
 
When the program stops in the debugger, it tells you where the problem lies. If you're saying that it works with small amounts of data but not with large ones, then it is a matter of increasing your array sizes.

If it is badly written, say something like
Code:
real res(5), oneway(5,2), otherway(2,5), ranks(2), flat(10)
do ii = 1, 5
   ...
   do jj = 1, 2
      ...
   end do
end do
Then you may have problems. If it is written properly
Code:
integer, parameter:: XMAX=5, YMAX=2
real res(XMAX), oneway(XMAX,YMAX), otherway(YMAX,XMAX), ranks(YMAX), flat(XMAX*YMAX)
do ii = 1, XMAX
   do jj = 1, YMAX
Then it will be really easy to modify
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top