[GRASS-dev] [GRASS GIS] #2854: results in winGRASS7 32bit vs 64bit: should they be identical?

GRASS GIS trac at osgeo.org
Sat Feb 27 13:50:18 PST 2016


#2854: results in winGRASS7 32bit vs 64bit: should they be identical?
---------------------+---------------------------------
  Reporter:  hellik  |      Owner:  grass-dev@…
      Type:  defect  |     Status:  new
  Priority:  normal  |  Milestone:  7.0.4
 Component:  Raster  |    Version:  svn-releasebranch70
Resolution:          |   Keywords:
       CPU:  x86-64  |   Platform:  MSWindows 7
---------------------+---------------------------------

Comment (by mmetz):

 Replying to [comment:9 glynn]:
 > Replying to [comment:7 neteler]:
 >
 > > Doesn't this qualify for "basically identical results as much as
 different architectures can achieve"?
 >
 > In theory, it should be possible to obtain identical results on any
 architecture using IEEE-754 floating-point for calculations using only +,
 -, *, / and sqrt() (no transcendental functions such as sin, cos, log,
 exp, etc). But that may have a noticeable performance cost (e.g. using
 -ffloat-store to discard excess precision, forgoing certain optimisations,
 etc).

 According to the GCC compiler options used for WinGRASS, WinGRASS does not
 necessarily adhere to IEEE-754 standards, see
 [https://gcc.gnu.org/wiki/FAQ#PR323]

 The results are thus as precise as requested per GCC compiler options for
 the given architecture. The same GCC compiler options can lead to
 different results under different architectures.

 Generally, with limited fp precision,

 (a * b) / c != a * (b / c)

 I tested this with r.watershed and got differences in the range also
 observed between 32bit and 64bit architectures. The differences between
 architectures are thus within the expected range of floating-point
 results. Identical results for different architectures could maybe
 obtained with gcc -fexcess-precision=standard -std=c99.

 In other words, the results obtained with WinGRASS 32bit and WinGRASS
 64bit are both correct, even if they differ from each other. The results
 are as precise as possible / as requested.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2854#comment:12>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list