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

Runtime error 170: "Stack overflow" - What's the cause and what should I do?

Nan_Deng
Beginner
1,102 Views
In running one large Fortran application program I encountered the runtime error "Stack overflow". What could be the cause and what should I do to fix it? I'd appreciate all helpful comments/tips.
0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,102 Views
Read this, then let us know if you have more questions.
0 Kudos
Nan_Deng
Beginner
1,102 Views
Thanks Steve. I am using Visual Fortran 11.1 with VS2008. The linker options related to stack is on the "system" sub menu, and then two choices: "Stack Reserve Size","Stack Commit Size", all default at 0. How big should I change to? (I an running pretty big problems - factorize a non-sparse matrix roughly 1 million by 1 million in double precision complex).
0 Kudos
Steven_L_Intel1
Employee
1,102 Views
Stack Reserve Size is the value to look at. But let me suggest instead changing Fortran > Optimization > Heap Arrays to 0. This will enable the Heap Arrays feature.

But if you need a million by a million by double-precision-complex in a temporary, you're not going to get it, at least not on 32-bit Windows. Are you using 64-bit Windows? I hope the compiler isn't trying to create a 16TB temporary!
0 Kudos
Nan_Deng
Beginner
1,102 Views
Thanks Steve. Let me try your suggestions. I'll report back.

I am using xp64 with 12 core and 32 GB memory, 5x2 TB HD. The matrix is symmetric. I am using PARDISO's out-of-core option. I just hope the compiler and OS wouldn't have internal limits!
0 Kudos
Steven_L_Intel1
Employee
1,102 Views
Ok -let us know how it works. With a problem size like that, use Heap Arrays and not the Stack Reserve, which is limited to 1GB no matter what,

The compiler does not have its own limits here.
0 Kudos
Reply