serial construct in openacc, Fortran

OpenACC and CUDA Fortran
afiguer
Posts: 10
Joined: Mar 23 2020

Re: serial construct in openacc, Fortran

Post by afiguer » Tue Mar 24, 2020 10:48 am

This occurs in the first loop iteration. In the subroutine I use the following:

Code: Select all

implicit real*8 (a-h,o-z)
Based on that ippne is an integer. Any suggestion on how to declare the variable
in the device?

afiguer
Posts: 10
Joined: Mar 23 2020

Re: serial construct in openacc, Fortran

Post by afiguer » Tue Mar 24, 2020 8:35 pm

I tried to create a reproducing example but I had not success.
However I tried something different:

Code: Select all

       subroutine fd_bcunkperibc_gpu(nppni ,nppnr ,nunkp ,npoin ,mppne ,
     &                               bppni ,bppnr ,lppas ,unkno )
c
       implicit real*8 (a-h,o-z)
c
       integer bppni(nppni,mppne),lppas(50)
       integer ippne,nppn0,nppn1
       real*8  bppnr(nppnr,mppne),unkno(nunkp,npoin)
c
c
c     -----loop over the passes
c
       nppn1=0
c
       do 1200 ippas=1,50
c
       nppn0=nppn1+1
       nppn1=lppas(ippas)
c
c     -----did we complete the passes ?
c
       if(nppn1.eq.0)                                          goto 1201
c
c     -----do we have any ?
c
       if(nppn0.gt.nppn1)                                     goto 1199
c
c     -----loop over the receiving points
c
c$acc  enter data copyin(nppn0,nppn1,ippas)
c$acc  kernels  present(bppni,bppnr,unkno)
c$acc  loop seq 
       do 1400 ippne=nppn0,nppn1
c
c     -----points
c
       ipoin=bppni(1,ippne)
       jpoin=bppni(2,ippne)
c
c     -----variables 1-nunkp
c
c$acc  loop seq
       do 1410 iva=1,nunkp
       unkno(iva,ipoin)=unkno(iva,jpoin)+bppnr(iva,ippne)
 1410 continue
c
c     ----end of loop over the receiving points
c     
 1400 continue
c$acc  end kernels
c
c
c     ----end of loop over the passes
c     
 1199 continue
 1200 continue
 1201 continue
c
      return
      end
This code does not work either. But, when I add a print statement as the following

Code: Select all

 
       do 1200 ippas=1,50
       print *,'IPPAS=',ippas
       ....
       
Everything works as expected... I am not really interested on the performance of this subroutine, but I am trying to avoid to copy between dev. and host. Is there any way to write this part of the code in an explicit way in order to generate a 'more clear code' for the device?

mkcolg
Posts: 8382
Joined: Jun 30 2004

Re: serial construct in openacc, Fortran

Post by mkcolg » Wed Mar 25, 2020 7:26 am

This seems more likely to be a compiler code generation issue. Best guess is that loop index variables are being optimize somehow to cause the error and by adding the print, this optimization is being inhibited.

If I asked our customer support team to contact you directly, can you send us the full source? If it is a compiler issue, I'd like to get it reported and fixed.

Thanks,
Mat

afiguer
Posts: 10
Joined: Mar 23 2020

Re: serial construct in openacc, Fortran

Post by afiguer » Wed Mar 25, 2020 8:47 am

Hi Matt,

Thank you for your answer. I will ask for permission for sending the code, but I think
this will not be a problem. Please, ask the support team to contact me.

Best,
Alejandro

Post Reply