|
From: Tom H. <to...@co...> - 2006-01-01 17:01:24
|
In message <Pin...@he...>
Joost VandeVondele <jv...@he...> wrote:
> I'm running our CP2K program under valgrind (memcheck) and I'm finding
> that some of the numerical results are slightly different between a normal
> run and a run under valgrind. The difference is very minor (e.g.
> -0.94268415669060 vs. -0.94268415669059) and could be due to differences
> in rounding, but is reproducible (and no errors are generated by
> valgrind). I'm a bit surprised. Is this a known issue ? This is on opteron
> with valgrind-3.1.0.
My guess would be that you are seeing the difference between the 80 bit
internal precision of the x87 floating point unit and the 64 bit precision
of valgrind's emulation of it. See the documentation at:
http://www.valgrind.org/docs/manual/manual-core.html#manual-core.limits
Note that although that documentation implies that you have to be using
long doubles to observe the problem I believe that you can see it with
doubles as well if the code keeps values in registers between operations.
Try compiling your code with -mfpmath=sse (and -msse2 if this is a 32 bit
machine) and see if the two sets of results are then consistent.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|