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

how to use KMP_SET_STACKSIZE_S ?

dsmanoli
Beginner
888 Views
Hi,

I am working with Intel Visual Fortran Compiler 10.0 on Microsoft Visual Studio 2005.

Could someone tell me how to use the subroutine KMP_SET_STACKSIZE_S() ?

I would like to set the stacksize for each thread that will be used in a parallelized program, and I am having trouble. I have included

INCLUDE 'omp_lib.h'

at the top of my program, and then I am typing

!$omp parallel

callKMP_SET_STACKSIZE_S(10000000)

!$omp end parallel


I thencheck the stacksize for each thread using

!$omp parallel

check_stack=KMP_GET_STACKSIZE_S()

!$omp end parallel

and I find check_stack = 4194304.

Please let me know what I am doing wrong or if there is some other way I should set the stacksize for each thread. Thanks!

0 Kudos
1 Reply
TimP
Honored Contributor III
888 Views
You're not specifying stack size separately for each thread, it's one value for all threads, to be set prior to the first parallel region, I believe.
0 Kudos
Reply