PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

weird (incorrect) compiler output - very minor issue

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



Joined: 02 Feb 2012
Posts: 51

PostPosted: Sun Apr 14, 2013 11:07 am    Post subject: weird (incorrect) compiler output - very minor issue Reply with quote

I have a subroutine with the following code in it. The DO WHILE is at line 134.

DO WHILE ( loop_on )
!
! BEGIN LOOP
! SOLVE THE EQUATIONS
!
DO j = 1, nelem
w(j) = ZERO
wtemp(j) = ZERO
sig_j(j) = ZERO
DO i = 1, nfmaxp2
IF ( CN(i,j)>0 ) wtemp(j) = wtemp(j) + A(i,j)*p(CN(i,j))
ENDDO
w(j) = (wtemp(j)+B(j)*p(j))/B(j)
sig_j(j) = q(j)*w(j)
ENDDO
!
sig = ZERO
! OVERRELAXED JACOBI CGS
DO j = 1, nelem
sig = sig + sig_j(j)
ENDDO
!
IF ( sig==ZERO ) sig = tol
alpha = rho/sig
DO j = 1, nelem
h(j) = u(j) - alpha*w(j)
u(j) = (u(j)+h(j))*alpha
Tn(j) = Tn(j) + u(j)
ENDDO
!
DO j = 1, nelem
w(j) = ZERO
rho_j(j) = ZERO
DO i = 1, nfmaxp2
IF ( CN(i,j)>0 ) w(j) = w(j) + A(i,j)*u(CN(i,j))
ENDDO
w(j) = (w(j)+B(j)*u(j))/B(j)
r(j) = r(j) - w(j)
rho_j(j) = q(j)*r(j)
ENDDO
!
rsum = ZERO
nindex = 0
rho1 = rho
IF ( rho1==ZERO ) rho1 = tol
rho = ZERO
DO j = 1, nelem
sumold = rsum
rsum = MAX(rsum,ABS(u(j)/Tn(j)))
IF ( rsum/=sumold ) nindex = j
rho = rho + rho_j(j)
ENDDO
!
beta = rho/rho1
DO j = 1, nelem
u(j) = r(j) + beta*h(j)
p(j) = u(j) + beta*(beta*p(j)+h(j))
ENDDO
!
IF ( rsum<tol ) loop_on = .FALSE.
!
iter = iter + 1
IF ( iter>1000 ) THEN
WRITE (6,*) ' Too Many Iterations in CGS'
WRITE (6,*) ' ABORTING...'
STOP
ENDIF
!
IF ( itero==1 ) first_cycle2 = .FALSE.
ENDDO


Output from 13.3 compiler for this outer loop is
" 134, Loop not vectorized/parallelized: contains call".

Now I actually didn't expect the compiler to vectorized or parallelize this loop but the reason given ("contains call") is wrong .


-ralph
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5952
Location: The Portland Group Inc.

PostPosted: Mon Apr 15, 2013 8:26 am    Post subject: Reply with quote

Hi Ralph,

It's probably the WRITE and/or STOP statement, which are calls. MAX and ABS are calls as well, but usually get inlined at higher optimization levels so shouldn't cause this message.

What happens if you comment out:

Code:
IF ( iter>1000 ) THEN
WRITE (6,*) ' Too Many Iterations in CGS'
WRITE (6,*) ' ABORTING...'
STOP
ENDIF


- Mat
Back to top
View user's profile
deeppow



Joined: 02 Feb 2012
Posts: 51

PostPosted: Mon Apr 15, 2013 8:49 am    Post subject: Reply with quote

A little clarification in the compiler output could help, e.g.
" 134, Loop not vectorized/parallelized: contains call, e.gl write, stop, subrountine, etc."

Plus I'm using the highest level of optimization you have. I'll test commenting out the write statement.
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