openMP on FORTRAN:goes into infinite loop

General OpenMP discussion

openMP on FORTRAN:goes into infinite loop

Postby hrushi.397 » Sun May 25, 2008 2:24 am

Hi all,

I have written a program & threaded it with openMP. Now program runs absolutely well when it is run on single thread. However it doesnot run on mutithread, actually goes into infinite loop. I have Intel fortran compiler attached to Visual Studio 2005. Now when I debugged the program, it gives that some of the array pointers as 'UNDEFINED ADDRESS'.

My code goes something like this:

INTEGER I,J,L

INTEGER,DIMENSION(1000)::GRID

DO I=1, COUNTER

>L=SOME EXPRESSION

!$OMP PARALLEL DO NUM_THREADS(1) PRIVATE(VARIABLE_LIST) COPYIN(L,GRID)

DO J=1, GRID(L)

>CALL mySUBROUTINE(VARIABLE_LIST)

END DO

Here statements starting with > mark are the breakpoints.

Now problem is that at first break point, the value of L is as expected. However, when control reaches the second breakpoint,there value of L changes and it becomes so large that it completely goes outofBound.

Can somebody tell me why is it so?
hrushi.397
 
Posts: 1
Joined: Sun May 25, 2008 2:09 am

Re: openMP on FORTRAN:goes into infinite loop

Postby ejd » Sun May 25, 2008 7:18 am

I have no idea what the Microsoft compiler is doing. However, it should be giving you an error because as the program is in your post, the variables "L" and "GRID" are incorrecty defined. The copyin clause is only used for threadprivate variables and neither "L" or "GRID" are declared threadprivate. You need to either declare them as threadprivate or remove the copyin clause. Since I have no idea how they are used or if they are used in mySUBROUTINE you will have to decide. See if once you get that strightened out what happens.
ejd
 
Posts: 1025
Joined: Wed Jan 16, 2008 7:21 am


Return to Using OpenMP

Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests