PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

copyout Memcpy error

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



Joined: 09 Jul 2013
Posts: 13

PostPosted: Tue Jul 09, 2013 8:16 am    Post subject: copyout Memcpy error Reply with quote

Hello, I'm trying to port some combustion fluid dynamics code to the GPU. This functions which calculates the temperature of each specie gives me and error.
0: copyout Memcpy (host=0x1e1ced0, dev=0x2300200000, size=800) FAILED: 4(unspecified launch failure)


attributes(device) subroutine theta_d(F,enth_d,temp_d,rho_d)

! Calculates temperature and density
! given the species composition
! and enthalpy of the mixture

! *** Declarations ************************************************

use chem_mod_d
implicit none
! ******************argumensts************************************
double precision :: enth_d
double precision, dimension(53) :: F
double precision :: temp_d
double precision :: rho_d
! *****************local_variables*******************************

integer iter,k,j,NSP,NT,i
double precision FUN,FUNP,C1,DTEMP,SUMN,T_init,caca

! *****************************************************************
N_sp=53
N_r=325
NSP =53
SUMN = sum(F)

! CALCULATE TEMPERATURE
!
TEMP_d=300.0D0
ITER=0
30 ITER=ITER+1
IF(ITER.GT.500) THEN
!! WRITE(*,*) ' SUBROUTINE THETA : ITERATION COUNT EXCEEDED'
!! WRITE(*,*) (F(i),i=1,NSP)
!! WRITE(*,*)
!! iflag = 0
goto 100
!! STOP
END IF
IF(TEMP_d.GT.1000.0D0) THEN
NT=1
ELSE
NT=2
END IF
FUN=-ENTH_d/GASCON_d
FUNP=0.0D0
DO J=1,NSP
FUN=FUN+COEF(NT,6,J)*F(J)
END DO
DO K=1,5
C1=0.0D0
DO J=1,NSP
C1=C1+COEF(NT,K,J)*F(J)
END DO
FUN=FUN+C1/REAL(K)*TEMP_d**K
FUNP=FUNP+C1*TEMP_d**(K-1)
END DO
DTEMP=-FUN/FUNP
TEMP_d=TEMP_d+DTEMP
IF(ABS(DTEMP).GT.1.0D-03.OR.ITER.EQ.1) GO TO 30
!
!! CALCULATE DENSITY
RHO_d=PRESS_d/(GASCON_d*TEMP_d*SUMN)

100 continue
!
end subroutine theta_d
But if I comment the line
Quote:
IF(ABS(DTEMP).GT.1.0D-03.OR.ITER.EQ.1) GO TO 30
this error dissapears. I have no clue that what happens.

Thanks
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Jul 09, 2013 4:15 pm    Post subject: Reply with quote

ElMaskina,

The actual error just means that the kernel preceding the memcpy crashed for some reason. Not very helpful.

Given that it works when you remove the while loop conditional, this suggests that the kernel crashes either because of something in the loop after the first iteration or the value of TEMP_d is bad.

What I'd do is compile the code in emulation mode (-Mcuda=emu -g) and see if you can reproduce the error in the debugger.

If not, the next step is to put in "print *" statements to isolate exactly where it's crashing.

- Mat
Back to top
View user's profile
ElMaskina



Joined: 09 Jul 2013
Posts: 13

PostPosted: Wed Jul 10, 2013 12:14 pm    Post subject: copyout Memcpy error Reply with quote

Thanks, It is solved now. It was a problem with the coeff array which was no well defined
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