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

Stack size problem in DLL application.


Apparently  the DLL process fails at start of OMP loop where the master  process seems to fail when private arrays are defined, while other threads are started.

Apparently it has no effect to set the stack-size at linking of the DLL, and use of kmp_set_stacksize_s at runtime has apparently no effect for the master-thread,   and if processing in a new thread  (via CreateThread) is used in the DLL to allocate the necessary “main” stack, then the OpenMP system fails (e.g. OMP_GET_NUM_PROCS() creates program crash).

Are there any solution for the problem, when the exe-program is at third-party program which cannot be linked?

We need a  method to control main stack size at runtime using OMP.

Intel Fortran Version

Labels (1)
0 Kudos
2 Replies
Black Belt

This may be related to the main program .NOT. being (Intel) Fortran .OR. of being a much older version of Intel Fortran than the one used to build your DLL. At the load point of your DLL make a call to for_rtl_init_ and at the exit for_rtl_finish_

** Note, the init requirement may be once per first call per process making the call into the DLL.

Jim Dempsey



0 Kudos
Black Belt

On Windows, stack size is a property of the EXE. Any settings you put in the DLL are ignored.

0 Kudos