Hello,
I'm using cygwin, gfortran-4 compiler, in NetBeans IDE. My pc has WinXP SP3.
I'm trying to introduce parallel processing to my project, i've been
reading about OpenMP, so i make this litle code to test it:
//-------------------------------------------------------------------------------------------------
PROGRAM HELLO
!$ USE omp_lib
INTEGER n, i
PARAMETER (n=505150)
REAL X(n)
!$ call omp_set_num_threads(2)
write(6, "(a, i3)") " OpenMP max threads: ",
+ OMP_GET_MAX_THREADS()
!$OMP PARALLEL
write(6, "(2(a,i3))") " OpenMP: N_threads = ",
+ OMP_GET_NUM_THREADS(), " thread = ", OMP_GET_THREAD_NUM()
!$OMP END PARALLEL
!$OMP PARALLEL DO
!$OMP+ SHARED(X)
!$OMP+ PRIVATE(i)
DO i = 1, n
X(i) = i
!$ !write(*, *) " From Thread = ", OMP_GET_THREAD_NUM(), " i= ",i
END DO
!$OMP END PARALLEL DO
END PROGRAM
//-------------------------------------------------------------------------------------------------
The program runs ok with n<= 505150
with 505150 > n >= 505170 The output is from one thread only
with n > 505170 i get a runtime error, the cause is stack overflow.
i set windows environment variables
OMP_STACKSIZE=10000
GOMP_STACKSIZE=10000
but i get the same behaviour...
any ideas???