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

race condition.......

Intel_C_Intel
Employee
668 Views

I am not sure if its a right forum thread, if not let me

know I will move my question to appropriate one. I need some help to

detect race condition inside my code. Here is the part which is

parallelized.

!$omp parallel default(none)&

!$omp shared(GKL, IEL, NR, MAXBWL, NRS)

!$omp do lastprivate(L, CP, I, J, K, N, M, PIVOT, MR)

DO N=1,NRS

M = N - 1

MR =

MIN0(MAXBWL,NR-M)

PIVOT = GKL(IEL,N,1)

DO L=2,MR

CP = GKL(IEL,N,L)/PIVOT

I = M + L

J = 0

DO K=L,MR

J = J + 1

GKL(IEL,I,J) = GKL(IEL,I,J) - CP*GKL(IEL,N,K)

END DO

GKL(IEL,N,L) = CP

END DO

END DO

!$omp end do

!$omp end parallel

I am having problem with 2D matrix, and its really hard to detect

because when I am using small example something like 8x8 matrix everything 
works great, but when I am running bigger case at some point it start 
miscalculating decimal numbers, for example instead of 0.3122880E-04 it 
gives me 0.3125670E-04. 

If someone could help me figure this out I would be highly appreciated.

Thanks in advance.
0 Kudos
2 Replies
Intel_C_Intel
Employee
668 Views

Wow I cant believe that no one can help me here.

0 Kudos
TimP
Honored Contributor III
668 Views
You could help yourself by running Intel Thread Checker, if you don't care to clarify your example. If the question were more specifically about threading, you could try the threading forum. If you are using single precision, it may not be surprising that changes in threading produce numerical changes such as you mention.
0 Kudos
Reply