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

Intel Fortran compiler 9.1 stack overflow

huanghe
Beginner
3,599 Views

I have exactly the same code for three-dimensional CFD simulation (large memory required) and considered dynamic memory allocation for all larger arrays.If compiled by Intel Fortran compiler 7, it runs very well; however if compiled by Intel Fortran compiler 9.1 on the same computer, it gives me "stack overflow".

Is there any set-up I need to do for Intel Frotran compiler 9.1 to prevent the stack overflow.

thanks

0 Kudos
8 Replies
Steven_L_Intel1
Employee
3,599 Views
Try adding the /heap-arrays option to get the same behavior as IFC7.
0 Kudos
huanghe
Beginner
3,599 Views
Can you tell me how toadd the option in Microsoft Visual Studio 2005 environment? Thanks.
0 Kudos
Steven_L_Intel1
Employee
3,599 Views

Go to the property page Fortran > Command Line. In the Additional Options box, type in:

/heap_arrays

You will need a version of the compiler released in the last six months in order to use this.

0 Kudos
huanghe
Beginner
3,599 Views
Now I'm using Intel Fortran Compiler 10.0.025. I tried the /heap-arrays option as instructed. But it doesn't work.It I still have the stack overflow problem.
0 Kudos
ssragunath1
Beginner
3,599 Views
Did you try /heap_arrays or /heap-arrays ?
0 Kudos
Steven_L_Intel1
Employee
3,599 Views
Doesn't matter - they are equivalent.

Please send a test case to Intel Premier Support so that we can investigate.
0 Kudos
huanghe
Beginner
3,599 Views
After input /heap_arrays at command line, in the optimization set-up window, there is a new Heap Arrays item appears, I inputted 100 (kb) in the blank after it. It works now. The problem now is that it runs very slow. Any suggestions for running the program faster? Does it help if I set the Optimization/Parallization as Yes(/Qparallel)?

thanks a lot,

heqing
0 Kudos
Steven_L_Intel1
Employee
3,599 Views
Turn on /check:arg_temp_created (Fortran > Run-Time > Check for Actual Arguments using temporary Storage > Yes, rebuild and rerun your program. Look to see if you get messages about a temporary being created. At these locations, your program is doing something inefficient - passing a possibly non-contiguous array section to a routine expecting a contiguous array. If you see this, you can have the called routine accept the argument as assumed-shape (:) and provide an explicit interface to all callers, or do what is needed to pass the array as a contiguous section.

Your program is slow because it requires making large copies of one or more arrays - that you need to set /heap-arrays is an indication of this. If you can eliminate the copies, your program will get MUCH faster.
0 Kudos
Reply