Showing results for 
Search instead for 
Did you mean: 

OpenMP code with 5 or more threads gives stack overflow


I recently parallelized a program of mine using OpenMP directives using Intel's fortran compiler.  The program appears to run fine if I use 1-4 threads, but with 5 or more threads it crashes at runtime, with a message such as the following:

The thread 0x1d94 has exited with code 0 (0x0). Unhandled exception at 0x00007FF79B3D8507 in Tvar19.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x0000008161A93000).

I am currently using the following compiler options:   /Od /Qopenmp /F:10000000 /Zi /traceback /check:noarg_temp_created .  Changing the number associated with the /F: option doesn't help.

When the program crashes, nothing is written to the command window from which I have run the program.  A window simply pops up and tells me the program has quit.  Then it asks if I want to debug using visual studio, in which case Visual Studio gives me the aforementioned error and a bunch of assembly code which is all Greek to me.

If anyone can help me get this program running with more than 4 threads, I would be most appreciative.


0 Kudos
3 Replies
Valued Contributor II

There have been several forum

There have been several forum discussions I have read on similar topics.

Read this link that my help you:


0 Kudos



That is a good article and has most of the issues covered. Is there something newer than 2006 to be found? I do not think the sections on the heap_arrays is current.

And page 11 is wrong (from my understanding).

Jim Dempsey

0 Kudos
Black Belt

That description of heap

That description of heap-arrays :size option implies a gfortran like functionality which was never implemented in a useful manner, nor did the docs ever admit it.

0 Kudos