PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Unexpectef Output

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



Joined: 09 Jul 2013
Posts: 13

PostPosted: Wed Jul 10, 2013 12:47 pm    Post subject: Unexpectef Output Reply with quote

I have the main program like this:
Quote:
call chemical_reaction<<<1,100>>>(y_d,temp_d,rho_d,z_d,method,dt
& , imech, isolver,GasCon,Press
& ,Coef_d)

! ***********************copy again to the host*********************
iastat=cudaDeviceSynchronize()
if (iastat /= cudaSuccess) write(*,*) cudaGetErrorString(iastat)
enth=enth_d
temp=temp_d
rho=rho_d
y=y_d
z=z_d
print*,enth,temp,rho
stop


where the function chemical_reaction is defined as follows

Quote:
attributes(global) subroutine chemical_reaction(yk,tempk,rhok,
& zk,methodk,dtk,imechk
& ,isolverk,gascon_d,press_d,coef_d)
use chem_mod_d
use rcce_mod_d
implicit none
! **********************arguments************************
double precision,device, dimension(100) :: enthk, tempk, rhok
double precision,device, dimension(53,100) :: yk
double precision,device, dimension(100) :: zk
integer, value :: methodk, imechk, isolverk
double precision, value :: dtk, falimk, ff_flam_mink,ff_flam_maxk
double precision,device, dimension(2,7,53) :: coef_d
double precision,value :: GasCon_d,press_d
! ******************local_variables**********************
double precision :: enth1, temp1, rho1
double precision, dimension(53) :: F_mol
integer i
! ******************control_parameters*******************
i=threadidx%x+(blockidx%x-1)*blockdim%x
! *********************execution*************************
F_mol=yk(:,i)
enth1=enthk(i)
temp1=tempk(i)
rho1=rhok(i)

rho1=enth1

yk(:,i)=F_mol
enthk(i)=enth1
tempk(i)=temp1
rhok(i)=rho1
end subroutine chemical_reaction

So, this function should copy the values of enth1 to rho1 for each thread and so the array
rhok should contain the enthk values. But instead of this I get an strange output like this.

Quote:
NaN -6.5354033241107468E+144 -4.8579438674133882E+149
1.9578881854846901E+269 ******************** 7.0641575457362301E-304
-6.5142805056262458E+303 6.1669851612137831E-304 -3.1045727094128839E+231
NaN -1.2961434396156444E+304 -3.3017189971762829E+268
1.1903952152261742E-287 ******************** -3.9869972208399978E+255


I don't know why that is happening. Thanks
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Jul 10, 2013 5:33 pm    Post subject: Reply with quote

Hi ElMaskina,

You declare "enthk" under "aguments" section but I don't see it in the argument list. Am I missing something or is it suppose to be passed in?

- Mat
Back to top
View user's profile
ElMaskina



Joined: 09 Jul 2013
Posts: 13

PostPosted: Fri Jul 12, 2013 7:46 am    Post subject: Reply with quote

Many thanks, stupid error.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Debugging and Profiling 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