Stack overflow and /Qopenmp: is the stack size smaller when /Qopenmp used?

Stack overflow and /Qopenmp: is the stack size smaller when /Qopenmp used?

Portrait de Tony Garratt

I have a Fortran program that has some hardwired arrays via PARAMETER statements. Hence the memory goes on the stack. There is not THAT much memory going on the stack. If I compile without /Qopenmp I have no problems. If I compile with /Qopenmp I get a stack overflow. Why would /Qopenmp make such a difference?

3 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.
Portrait de Tony Garratt

I should add that I am linking with MKL and this is windows 64bit with version 11.1 of the compiler.

Portrait de Tony Garratt

I think I have answered my own question by readingthe following... using openmp is pushing hardwired arrays on to the stack...

http://docs.sun.com/source/819-0501/5_compiling.html

5.5 Stacks and Stack Sizes

The executing program maintains a main memory stack for the initial thread executing the program, as well as distinct stacks for each slave thread. Stacks are temporary memory address spaces used to hold arguments and automatic variables during invocation of a subprogram or function reference.

In general, the default main stack size is 8 megabytes. Compiling Fortran programs with the f95 -stackvar option forces the allocation of local variables and arrays on the stack as if they were automatic variables. Use of -stackvar with OpenMP programs is implied with explicitly parallelized programs because it improves the optimizer's ability to parallelize calls in loops. (See the Fortran User's Guide for a discussion of the -stackvar flag.) However, this may lead to stack overflow if not enough memory is allocated for the stack.

Connectez-vous pour laisser un commentaire.