PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Precision Error setting array to zero
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming
View previous topic :: View next topic  
Author Message
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Thu Mar 01, 2012 1:36 pm    Post subject: Precision Error setting array to zero Reply with quote

Something strange is happening, in my code, I have

Code:

DOUBLE PRECISION, DIMENSION(ilev, isize) :: aerop1_d
double precision, parameter :: zerod=0.0d0
...
    aerop1_d = zerodp


So after that line, if I print the values in the debugger (wait until that above line is executed), I get stuff like:

Code:

pgdbg> print aerop1_d
(21:22,11):  0                         0                       
(23:24,11):  0                         2.8275281606231457e-315
(25:26,11):  0                         0                       
(27:28,11):  0                         0 


Why aren't they all zero? And if that number is simply the machine representation of zero (closest approximation), why aren't they all like that, rather than most being zero?

The code is built with pgfortran 12.1 on CentOS 5.7:
Code:

pgfortran -tp=istanbul  -mp -g -O0 -gopt -traceback -Mpreprocess -Minform=inform


I just noticed that I was using the 11.10 debugger, but that shouldn't make a difference.
Back to top
View user's profile
mkcolg



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

PostPosted: Thu Mar 01, 2012 5:22 pm    Post subject: Reply with quote

Hi khea_actua1,

You are correct in that the value should be zero. The questions is it just how the debugger is presenting the data (something in the print) or is the memory really off just a bit.

As an experiment, can you run the debugger with the same program, but before using the "print" command, use the "hex" command to get the hex values of elements of the array? Is element (24,11) the same as the rest of the array?

After the "hex" command use the "print" command again to double check that it is the same element with the bogus value

- Mat
Back to top
View user's profile
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Fri Mar 02, 2012 10:11 am    Post subject: Reply with quote

Hi,

This time it was element (25,11).

The list shows that I'm doing the prints right after the assignment to zero. aerop1 is a real, aerop1_d is a double.

Code:

pgdbg> list
 #381:         aerop1 = 0.0
 #382:         aerop1_d = zerodp
 #383:==>>     DO k=1,icob
...
pgdbg> print zerodp
0
pgdbg> hex aerop1_d(24:25,11)

aerop1_d(24:25,11):  0                         1.5481471191334162e-103 

pgdbg> hex aerop1_d(25,11)
0x2A963113C6025A0D

pgdbg> print aerop1_d(24:25,11)

aerop1_d(24:25,11):  0                         1.5481471191334162e-103


So even with hex, it's not actually zero.

Oh, and this time, I was using the same version of the debugger as the code was compiled with (12.2) Though I get the same when I use the 11.10 and 12.1 compilers and debuggers.

One other thing, I notice that when I look at the stack, the values make no sense. I have the code outputting values, and those values (say, the input integer variable intent(IN) icob=12) is right, but in the debugger when I look at it with the debugger, it's a huge random number.

Code:

=> #0  coagd_d line: "coagd_d.f90"@171 address: 0x6019A0
     ilg = 150, il1 = 1, il2 = 150, ilev = 28, throw = 0x10C836D0, isize = 12, roarow = 0x7FFF5E464FA0, rtcoa = 0x7FFF5E464FA0, .... ntp = 1581668736 ...  jlat = 1581668736, icob = 1581668736, ....


Meanwhile the print statement (in the code it self, printing to STDOUT) at the top of this file outputs:
Code:

 Just to double check against the compiler..
 icob=           12
 jlat=           19
 ntp=            8


Last edited by khea_actua1 on Tue Mar 06, 2012 2:08 pm; edited 1 time in total
Back to top
View user's profile
mkcolg



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

PostPosted: Mon Mar 05, 2012 11:50 am    Post subject: Reply with quote

Hi khea_actua1,

Unfortunately, we don't know what's wrong. It could be the compiler, debugger, a system issue, or a problem with your program. Can you send us a reproducible example (trs@pgroup.com)? If we can recreate it here, then we should be able determine the problem.

Thanks,
Mat
Back to top
View user's profile
khea_actua1



Joined: 06 Nov 2008
Posts: 42
Location: Carleton University

PostPosted: Mon Mar 05, 2012 4:03 pm    Post subject: Reply with quote

Hi,

I could send an executable, but it won't run without ~10 gigs of associated data that I'm not allowed to share (it's a meteorological model written by the government.)

Would it be possible to try to work this out over the phone? Or maybe even with a multi-user screen session via ssh?
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Accelerator Programming All times are GMT - 7 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
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