Have been scratching head all day and not much further but think that array summations ie a()=a()+x are generally giving the “Complex loop carried dependence of” as a() would have a different value for every thread…Does this sound right? If so can I get round this? summation is very common in my program. Ive commented out these lines temp and the msg is no longer generated.
Attached is a (complete) representative acc region from one of the more computational routines. Same problems as last post stil apply.
Im new to this so ANY help much appreciated. If can crack this region then will be able to apply to other areas of my code. thanks.
Diagnostics are:
pcg2ap:
315, No parallel kernels found, accelerator region ignored
321, Complex loop carried dependence of ‘ibound’ prevents parallelization
Complex loop carried dependence of ‘cc’ prevents parallelization
Complex loop carried dependence of ‘cr’ prevents parallelization
Complex loop carried dependence of ‘cv’ prevents parallelization
Complex loop carried dependence of ‘hcof’ prevents parallelization
Complex loop carried dependence of ‘rhs’ prevents parallelization
Scalar last value needed after loop for ‘hhcof’ at line 642
Accelerator restriction: scalar variable live-out from loop: sr
Accelerator restriction: scalar variable live-out from loop: sp
Accelerator restriction: scalar variable live-out from loop: sn
Accelerator restriction: scalar variable live-out from loop: hhcof
322, Complex loop carried dependence of ‘ibound’ prevents parallelization
Loop carried dependence due to exposed use of ‘ibound(:)’ prevents parallelization
Complex loop carried dependence of ‘cc’ prevents parallelization
Loop carried dependence due to exposed use of ‘cc(nodes)’ prevents parallelization
Complex loop carried dependence of ‘cr’ prevents parallelization
Loop carried dependence due to exposed use of ‘cr(nodes)’ prevents parallelization
Complex loop carried dependence of ‘cv’ prevents parallelization
Loop carried dependence due to exposed use of ‘cv(nodes)’ prevents parallelization
Complex loop carried dependence of ‘hcof’ prevents parallelization
Loop carried dependence due to exposed use of ‘hcof(nodes)’ prevents parallelization
Complex loop carried dependence of ‘rhs’ prevents parallelization
Loop carried dependence due to exposed use of ‘rhs(nodes)’ prevents parallelization
Scalar last value needed after loop for ‘hhcof’ at line 642
Accelerator restriction: scalar variable live-out from loop: sr
Accelerator restriction: scalar variable live-out from loop: sp
Accelerator restriction: scalar variable live-out from loop: sn
Accelerator restriction: scalar variable live-out from loop: hhcof
323, Complex loop carried dependence of ‘ibound’ prevents parallelization
Complex loop carried dependence of ‘cc’ prevents parallelization
Loop carried dependence due to exposed use of ‘cc(nodes)’ prevents parallelization
Complex loop carried dependence of ‘cr’ prevents parallelization
Loop carried dependence due to exposed use of ‘cr(nodes)’ prevents parallelization
Complex loop carried dependence of ‘cv’ prevents parallelization
Loop carried dependence due to exposed use of ‘cv(nodes)’ prevents parallelization
Complex loop carried dependence of ‘hcof’ prevents parallelization
Loop carried dependence due to exposed use of ‘hcof(nodes)’ prevents parallelization
Complex loop carried dependence of ‘rhs’ prevents parallelization
Loop carried dependence due to exposed use of ‘rhs(nodes)’ prevents parallelization
Loop carried dependence due to exposed use of ‘ibound(:)’ prevents parallelization
Scalar last value needed after loop for ‘hhcof’ at line 642
Accelerator restriction: scalar variable live-out from loop: sr
Accelerator restriction: scalar variable live-out from loop: sp
Accelerator restriction: scalar variable live-out from loop: sn
Accelerator restriction: scalar variable live-out from loop: hhcof
C$OMP PARALLEL DO
C$OMP& SHARED(NLAY,NROW,NCOL,NRC,IBOUND,CC,CR,NODES,CV,HCOF,RHS,HNEW,
C$OMP& NORM)
C$OMP& PRIVATE(I,J,K,N,E,NRN,NRL,NCN,NCL,B,H,D,F,Z,S,RRHS,HHCOF,BHNEW,
C$OMP& HHNEW,DHNEW,FHNEW,ZHNEW,SHNEW,NCF,NCD,NRB,NRH,NLS,NLZ,NLN,NLL)
!$acc region copy(NLAY,NROW,NCOL,NRC,IBOUND(NODES),CC(NODES),
!$acc1 CR(NODES),NODES,CV(NODES),HCOF(NODES),RHS(NODES),
!$acc2 HNEW(NODES),NORM,I,J,K,N,E,NRN,NRL,NCN,NCL,B,H,D,F,Z,
!$acc3 S,RRHS,HHCOF,BHNEW,HHNEW,DHNEW,FHNEW,ZHNEW,SHNEW,NCF,
!$acc4 NCD,NRB,NRH,NLS,NLZ,NLN,NLL)
DO 115 K=1,NLAY
DO 115 I=1,NROW
DO 115 J=1,NCOL
C
C-------CALCULATE 1 DIMENSIONAL SUBSCRIPT OF CURRENT CELL AND
C-------SKIP CALCULATIONS IF CELL IS INACTIVE
N=J+(I-1)*NCOL+(K-1)*NRC
IF(IBOUND(N).EQ.0) THEN
CC(N)=0.
CR(N)=0.
IF(N.LE.(NODES-NRC)) CV(N)=0.
IF(N.GE.2) CR(N-1)=0.
IF(N.GE.NCOL+1) CC(N-NCOL)=0.
IF(N.LE.(NODES-NRC).AND.N.GE.NRC+1) CV(N-NRC)=0.
HCOF(N)=0.
RHS(N)=0.
GO TO 115
ENDIF
C
C-------CALCULATE 1 DIMENSIONAL SUBSCRIPTS FOR LOCATING THE 6
C-------SURROUNDING CELLS
NRN=N+NCOL
NRL=N-NCOL
NCN=N+1
NCL=N-1
NLN=N+NRC
NLL=N-NRC
C
C-------CALCULATE 1 DIMENSIONAL SUBSCRIPTS FOR CONDUCTANCE TO THE 6
C-------SURROUNDING CELLS.
NCF=N
NCD=N-1
NRB=N-NCOL
NRH=N
NLS=N
NLZ=N-NRC
C
C-----GET CONDUCTANCES TO NEIGHBORING CELLS
C-------NEIGHBOR IS 1 ROW BACK
B=DZERO
BHNEW=DZERO
IF(I.NE.1) THEN
B=CC(NRB)
BHNEW=B*(HNEW(NRL)-HNEW(N))
ENDIF
C
C-------NEIGHBOR IS 1 ROW AHEAD
H=DZERO
HHNEW=DZERO
IF(I.NE.NROW) THEN
H=CC(NRH)
HHNEW=H*(HNEW(NRN)-HNEW(N))
ENDIF
C
C-------NEIGHBOR IS 1 COLUMN BACK
D=DZERO
DHNEW=DZERO
IF(J.NE.1) THEN
D=CR(NCD)
DHNEW=D*(HNEW(NCL)-HNEW(N))
ENDIF
C
C-------NEIGHBOR IS 1 COLUMN AHEAD
F=DZERO
FHNEW=DZERO
IF(J.NE.NCOL) THEN
F=CR(NCF)
FHNEW=F*(HNEW(NCN)-HNEW(N))
ENDIF
C
C-------NEIGHBOR IS 1 LAYER BEHIND
Z=DZERO
ZHNEW=DZERO
IF(K.NE.1) THEN
Z=CV(NLZ)
ZHNEW=Z*(HNEW(NLL)-HNEW(N))
ENDIF
C
C-------NEIGHBOR IS 1 LAYER AHEAD
S=DZERO
SHNEW=DZERO
IF(K.NE.NLAY) THEN
S=CV(NLS)
SHNEW=S*(HNEW(NLN)-HNEW(N))
ENDIF
C
IF(I.EQ.NROW) CC(N)=0.
IF(J.EQ.NCOL) CR(N)=0.
C-------15JUN1993 SKIP CALCULATIONS AND MAKE CELL INACTIVE IF ALL
C SURROUNDING CELLS ARE INACTIVE
IF(B+H+D+F+Z+S.EQ.0.) THEN
IBOUND(N)=0
HCOF(N)=0.
RHS(N)=0.
GO TO 115
ENDIF
C
C-------CALCULATE THE RESIDUAL AND STORE IT IN RHS. TO SCALE A,
C-------CALCULATE THE DIAGONAL OF THE A MATRIX, AND STORE IT IN HCOF.
E=-Z-B-D-F-H-S
RRHS=RHS(N)
HHCOF=HNEW(N)*HCOF(N)
RHS(N)=RRHS-ZHNEW-BHNEW-DHNEW-HHCOF-FHNEW-HHNEW-SHNEW
IF(NORM.EQ.1) HCOF(N)=HCOF(N)+E
IF(IBOUND(N).LT.0) RHS(N)=0.
C-------ADDED FOR SENSITIVITY CALCULATIONS 9/1/91
IF(IU.NE.0.AND.IP.GT.0) THEN
IF(I.EQ.1.AND.J.EQ.1.AND.K.EQ.1) THEN
SN=0.
SP=0.
SR=0.
ENDIF
!SR=SR+RHS(N)
!IF(RRHS.LT.0.) SN=SN+RRHS
!IF(RRHS.GT.0.) SP=SP+RRHS
!IF(-ZHNEW.LT.0.) SN=SN-ZHNEW
!IF(-ZHNEW.GT.0.) SP=SP-ZHNEW
!IF(-BHNEW.LT.0.) SN=SN-BHNEW
!IF(-BHNEW.GT.0.) SP=SP-BHNEW
!IF(-DHNEW.LT.0.) SN=SN-DHNEW
!IF(-DHNEW.GT.0.) SP=SP-DHNEW
!IF(-HHCOF.LT.0.) SN=SN-HHCOF
!IF(-HHCOF.GT.0.) SP=SP-HHCOF
!IF(-FHNEW.LT.0.) SN=SN-FHNEW
!IF(-FHNEW.GT.0.) SP=SP-FHNEW
!IF(-HHNEW.LT.0.) SN=SN-HHNEW
!IF(-HHNEW.GT.0.) SP=SP-HHNEW
!IF(-SHNEW.LT.0.) SN=SN-SHNEW
!IF(-SHNEW.GT.0.) SP=SP-SHNEW
ENDIF
115 CONTINUE
!$acc end region