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

Moving large variables from stack to heap

jeremy_h
New Contributor I
383 Views
Hi friends,

With CVF, we had a routine that declared a large array (say 50mb). Since we did not adjust the CVF program stack size, I think I can assume that the CVF compiler chose to put this on the heap instead of the stack.

With our current project settings, IVF tries to put this on the stack, and we need 64mb of stack for the routine to not crash on entry. Is there a way to trick or force IVF to put large variables on the heap, perhaps with some AUTOMATIC setting, or reentrency or SAVE or something.

Regards,

- Jeremy
0 Kudos
3 Replies
mecej4
Honored Contributor III
383 Views
Read about the

/heap-arrays[:n]

compiler option.
0 Kudos
Steven_L_Intel1
Employee
383 Views
CVF made the array static, not on the heap.
0 Kudos
jeremy_h
New Contributor I
383 Views
Both excellent answers and very helpful.

Thanks - Jeremy
0 Kudos
Reply