|
| View previous topic :: View next topic |
| Author |
Message |
deeppow
Joined: 02 Feb 2012 Posts: 51
|
Posted: Sun Apr 14, 2013 11:07 am Post subject: weird (incorrect) compiler output - very minor issue |
|
|
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 |
|
 |
mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Mon Apr 15, 2013 8:26 am Post subject: |
|
|
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 |
|
 |
deeppow
Joined: 02 Feb 2012 Posts: 51
|
Posted: Mon Apr 15, 2013 8:49 am Post subject: |
|
|
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 |
|
 |
|
|
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 © 2001, 2002 phpBB Group
|