PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Bug in pgf90 v. 14.3 + OpenMP

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Anton_70



Joined: 05 Jun 2014
Posts: 1

PostPosted: Thu Jun 05, 2014 5:12 am    Post subject: Bug in pgf90 v. 14.3 + OpenMP Reply with quote

Hi all. I'd like to inform about the bug in pgf90 + OpenMP. We spent about 8 hours trying to find an error, eliminating lines of the code, switching off modules etc. Finally only 13 lines were left:

program bug
!$OMP PARALLEL DEFAULT(PRIVATE)
!$OMP DO
DO KK=1,5
DO IO=1,3
IF(IO.EQ.3) write(*,*) ORTL/(ORTL-ORTR),ORTL/(ORTL-ORTR)
IF(IO.EQ.1) ORTL=1.0
IF(IO.EQ.2) ORTR=2.0
ENDDO
ENDDO
!$OMP END DO
!$OMP END PARALLEL
end program bug

If it is compiled by pgf90, everything goes fine. The output looks (as expected) like:

-1.000000 -1.000000
-1.000000 -1.000000
-1.000000 -1.000000
-1.000000 -1.000000
-1.000000 -1.000000

Now compile it with -mp option, to run it parallel. The output in this case looks quite strange:

-0.5000000 -1.000000
-0.5000000 -1.000000
-0.5000000 -1.000000
-0.5000000 -1.000000
-0.5000000 -1.000000

:-(

Changing the values of ORTL in ORTR variables, we conclude, that the compiler considers ORTL=0 during first evaluation of (ORTL-ORTR), but everywhere else uses the correct value (ORTL=1.0 in this example)

Intel compiler doesn't have this problem and generates correct output in both cases.
Back to top
View user's profile
cparrott



Joined: 02 May 2011
Posts: 146

PostPosted: Thu Jun 05, 2014 10:57 am    Post subject: Reply with quote

Hi Anton,

Thanks for the report. I am sorry to learn of this issue. I have filed a report on this with our developers as TPR #20543. We will keep you posted as to when this issue is fixed.

Best regards,

+chris
Back to top
View user's profile
cparrott



Joined: 02 May 2011
Posts: 146

PostPosted: Fri Jun 06, 2014 11:27 am    Post subject: Reply with quote

Anton,

Our developer has investigated the bug, and is working on a fix.

In the meantime, he suggested you could modify your code as follows to work around the issue:

after the !$OMP PARALLEL DEFAULT(PRIVATE), introduce an assignment to ORTL

Code:

!$OMP PARALLEL DEFAULT(PRIVATE)
ORTL = 0


Hope this helps.

Best regards,

+chris
Back to top
View user's profile
OSXcoder



Joined: 11 May 2014
Posts: 13

PostPosted: Thu Jun 12, 2014 8:27 pm    Post subject: Reply with quote

from f77 days, i always define and initialize a variable before using it.
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 440

PostPosted: Fri Jul 25, 2014 4:29 pm    Post subject: TPR 20543 has been fixed in 14.7 Reply with quote

TPR 20543 - UF: OpenMP code gets wrong answers

has been corrected in the PGI 14.7 release.

thanks,
dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group