Hi all. I have a provlem trying to use openmp to parallelize a code. The code is written in fortran77 (with a lot of commons, goto and old stuff) but I think it should work.
It seems that at a certain point at the label 230 the value of j = 0 and i obtain a runtime error. If I compile the code w/o the -openmp flag it work perfectly. If I compile the code with the openmp flag and I set only one thread it crashes.
Can any of you catch an error I don't see?
Any idea/workaround tip ?
Code:
[...]
DO 210 I=1,NK1
I1=I-1
IF(I.GE.NKM)MG=MG-1
ME=2
C$OMP PARALLEL DEFAULT(SHARED)
C write(*,*) "NUM THREADS USED: ", omp_get_num_threads() ! take the number of threads
C$OMP DO PRIVATE (K,AIK,ME,C,IK,J,L)
DO 220 K=2,MG
AIK=CDABS(APOM(I,K))
IF(AIK.EQ.0.)GOTO 220
C=APOM(I,K)/APOM(I,1)
IK=I1+K
J=0
DO 230 L=ME,MG
J=J+1
230 APOM(IK,J)=APOM(IK,J)-C*APOM(I,L)
BPOM(IK)=BPOM(IK)-C*BPOM(I)
220 ME=ME+1
C$OMP END PARALLEL
[...]
210 CONTINUE
Can any of you catch an error I don't see?
Any idea/workaround tip ?