I have a mixed C/F95 console application that runs fine without OpenMP on Windows, and also runs fine on Linux with OpenMP (using icc/ifort). Using OpenMP, even with one thread, I'm getting a stack overflow (exception in chkstk) upon entry into a particular subroutine (the first that uses OMP threads). I've tried setting KMP_STACKSIZE to 16m, 64m, 256m, as well as setting STACK:reserve to various values (for the stack of the initial thread). Nothing seems to help. The particular subroutine does have a fairly large fixed array (1 million doubles), but using /heap-array does not help.
The application uses two libraries:
- a F95 static library, compiled with ifort, that contains all of the OpenMP directives
- a C DLL that calls fortran, compiled with Studio 2005 C without OpenMP
Another OpenMP console application using the same static library runs fine (but does not call the offending subroutine).
Is there some issue with mixing ifort and VS2005 C with OpenMP, or something that I've missed related to the stack?