- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Embarassingly new at this, i.e. the combo I'm employing.
Have a fortran code that runs fine till I try to turn on OpenMP. Put a few OpenMP directives into the code, e.g. "!$omp parallel do private(i)", and then turned on OpenMP. I believe I'm turned it on correctly. Sequence is as follows:
Project > Project filename properties > Fortran > Language where I set "Process OpenMP Directives" to "General Parallel Code (/Qopenmp)"
It builds fine noting the loops with directives were parallelized.
But when I try to run I get a stack error "forrt1: severe (170): Program Exception - stack overflow"
Suggestions and help greatly appreciated!
Have a fortran code that runs fine till I try to turn on OpenMP. Put a few OpenMP directives into the code, e.g. "!$omp parallel do private(i)", and then turned on OpenMP. I believe I'm turned it on correctly. Sequence is as follows:
Project > Project filename properties > Fortran > Language where I set "Process OpenMP Directives" to "General Parallel Code (/Qopenmp)"
It builds fine noting the loops with directives were parallelized.
But when I try to run I get a stack error "forrt1: severe (170): Program Exception - stack overflow"
Suggestions and help greatly appreciated!
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At least in the absence of the /heap-arrays switch, switching on /Qopenmp is likely to consume more run-time stack. The run-time stack limit can be increased in the usual ways, by options such as /link /stack:9999999 or by using editbin to modify the .exe.
http://msdn2.microsoft.com/en-us/library/8cxs58a6(VS.80).aspx
http://msdn2.microsoft.com/en-us/library/8cxs58a6(VS.80).aspx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you're using Visual Studio, you can set the stack size in the property Linker..System..Stack Reserve.
When you enable OpenMP, that has the side-effect of defaulting local variables to "automatic" (stack) storage, so if you have large arrays, they will be stack-allocated. /heap-arrays is one option. Note also that when using OpenMP each thread has its own stack whose size can be set with an environment variable (KMP_STACKSIZE, I think.)
When you enable OpenMP, that has the side-effect of defaulting local variables to "automatic" (stack) storage, so if you have large arrays, they will be stack-allocated. /heap-arrays is one option. Note also that when using OpenMP each thread has its own stack whose size can be set with an environment variable (KMP_STACKSIZE, I think.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks folks. Just kept increasing the stack reserve size till it ran.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page