Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all articles
Browse latest Browse all 5691

!$OMP and stack overflow problem--cannot solve

$
0
0

 

Hi, 

I have a very basic code using openmp on intel fortran (Intel(R) Visual Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.1.3471.2008, Copyright (C) 2002-2010 Intel Corporation Microsoft Visual Studio 2008 Version 9.0.21022.8.RTM On the help page it said "Intel® Visual Fortran Compiler Professional Edition 11.1")  I have the stack overflow problem when the array k is increased to 5,000,000, which should not be that high number for the compiler.  The code works fine with something like 200,000, but for 500,000 it just breaks down with stack overflow problem.

I tried all solutions I could search, but i am not sure whether I did them correctly,

- Apparently "Call KMP_SET_STACKSIZE(2000000000)" does not work.
-OMP_get_thread_num()+1 cannot even be compiled.
- Setting Heap arrays to 0 does not work as well.

Could someone please help me out?
Thanks very much.

==========================================================

PROGRAM TestOPENMP

USE omp_lib

IMPLICIT NONE
INTEGER :: i,j,l
INTEGER, DIMENSION (500000) :: k

Call KMP_SET_STACKSIZE(2000000000)
CALL OMP_set_num_threads(OMP_get_max_threads()-1)


!$OMP PARALLEL DO PRIVATE(i,j)

!  a=OMP_get_thread_num()+1

DO i=1,500000
    j=i*i
    k(i)=i*i
    !PRINT*, 'i=',i,'  j=',j,'  k=',k(i)
END DO

!$OMP END PARALLEL DO

END PROGRAM

 


Viewing all articles
Browse latest Browse all 5691

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>