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

hi,

I've done some quick diff test with results of winGRASS7 32bit vs 64bit in
the NC sample dataset:

r.slope.aspect:

r.mapcalc aspect32bit - aspect64bit => 0
r.mapcalc slope32bit - slope64bit => 0

they seems to be identical.

r.watershed:

r.mapcalc accum32bit - accum64bit

r.info map=diffaccum@accumtest

+----------------------------------------------------------------------------+
| Map: diffaccum@accumtest Date: Wed Dec 30 11:50:35 2015
|
| Mapset: accumtest Login of Creator: myricaria
|
| Location: nc_spm_08_grass7
|
| DataBase: C:\grassdata
|
| Title: ( diffaccum )
|
| Timestamp: none
|

|----------------------------------------------------------------------------|
|
|
| Type of Map: raster Number of Categories: 0
|
| Data Type: DCELL
|
| Rows: 1350
|
| Columns: 1500
|
| Total Cells: 2025000
|
| Projection: Lambert Conformal Conic
|
| N: 228500 S: 215000 Res: 10
|
| E: 645000 W: 630000 Res: 10
|
| Range of data: min = -8.14907252788544e-010 max =
4.65661287307739e- |
|
|
| Data Description:
|
| generated by r.mapcalc
|
|
|
| Comments:
|
| accum32bit@accumtest - accum64bit@accumtest
|
|
|

+----------------------------------------------------------------------------+

the results between 32bit and 64bit winGRASS seems not to be identical.

any ideas if they should be identical?

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/results-in-winGRASS7-32bit-vs-64bit-should-they-be-identical-tp5243280.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Wed, Dec 30, 2015 at 11:48 AM, Helmut Kudrnovsky <hellik@web.de> wrote:

hi,

I've done some quick diff test with results of winGRASS7 32bit vs 64bit in
the NC sample dataset:

r.slope.aspect:

r.mapcalc aspect32bit - aspect64bit => 0
r.mapcalc slope32bit - slope64bit => 0

they seems to be identical.

r.watershed:

r.mapcalc accum32bit - accum64bit

...

the results between 32bit and 64bit winGRASS seems not to be identical.

any ideas if they should be identical?

Testing like this will likely show differences due to CPU precision etc.

The test needs to be implemented in a different way, using an epsilon.
Essentially, something like this:

if(abs(map_A - map_B) <= 1e-8,... )

Like this you check if the difference is very small and below the
acceptable threshold.
In C, we use GRASS_EPSILON for these comparisons.

best,
Markus

any ideas if they should be identical?

Testing like this will likely show differences due to CPU precision etc.

in this quick test it's the same machine, running 32bit and 64bit winGRASS
binaries ...

The test needs to be implemented in a different way, using an epsilon.
Essentially, something like this:

if(abs(map_A - map_B) <= 1e-8,... )

thanks for the hint.

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/results-in-winGRASS7-32bit-vs-64bit-should-they-be-identical-tp5243280p5243283.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

Like this you check if the difference is very small and below the
acceptable threshold.
In C, we use GRASS_EPSILON for these comparisons.

now done with GRASS_EPSILON 1.0e-15

r.mapcalc expression=difftestepsilon = if( abs( accum32bit@accumtest -
accum64bit@accumtest) <= 1.0e-15, 1 , 100 )

attached a screenshot of this map

accum_diff_wingrass32bitvs64bit.png
<http://osgeo-org.1560.x6.nabble.com/file/n5243286/accum_diff_wingrass32bitvs64bit.png&gt;

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/results-in-winGRASS7-32bit-vs-64bit-should-they-be-identical-tp5243280p5243286.html
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Wed, Dec 30, 2015 at 12:17 PM, Helmut Kudrnovsky <hellik@web.de> wrote:

Like this you check if the difference is very small and below the
acceptable threshold.
In C, we use GRASS_EPSILON for these comparisons.

now done with GRASS_EPSILON 1.0e-15

r.mapcalc expression=difftestepsilon = if( abs( accum32bit@accumtest -
accum64bit@accumtest) <= 1.0e-15, 1 , 100 )

attached a screenshot of this map

accum_diff_wingrass32bitvs64bit.png
<http://osgeo-org.1560.x6.nabble.com/file/n5243286/accum_diff_wingrass32bitvs64bit.png&gt;

Mhh..

Can you open a ticket with all relevant bits + the difference
screenshot along with a legend and "r.univar -e" output?

thanks
Makrus

Markus Neteler wrote

On Wed, Dec 30, 2015 at 12:17 PM, Helmut Kudrnovsky &lt;

hellik@

&gt; wrote:

Like this you check if the difference is very small and below the
acceptable threshold.
In C, we use GRASS_EPSILON for these comparisons.

now done with GRASS_EPSILON 1.0e-15

r.mapcalc expression=difftestepsilon = if( abs( accum32bit@accumtest -
accum64bit@accumtest) <= 1.0e-15, 1 , 100 )

attached a screenshot of this map

accum_diff_wingrass32bitvs64bit.png
&lt;http://osgeo-org.1560.x6.nabble.com/file/n5243286/accum_diff_wingrass32bitvs64bit.png&gt;

Mhh..

Can you open a ticket with all relevant bits + the difference
screenshot along with a legend and "r.univar -e" output?

done by https://trac.osgeo.org/grass/ticket/2854

-----
best regards
Helmut
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/results-in-winGRASS7-32bit-vs-64bit-should-they-be-identical-tp5243280p5244081.html
Sent from the Grass - Dev mailing list archive at Nabble.com.