precision woes

William Gropp gropp at mcs.anl.gov
Fri Jan 30 09:06:09 CST 2004


At 04:15 AM 1/30/2004, Joachim Worringen wrote:

>Some more SX test results: running the tests 'nf_test' and 'nc_test' on SX-6
>systems reported a lot of errors.
>
>After being quite sure that our MPI-IO is alright and testing on Linux IA-32,
>I assumed that there may be some 32/64 bit issues, probably in the test
>programs themselves. Here we go - the proposed fixes worked for me, but maybe
>won't work for others (?), although I do not see why this could be the case.
>
>- test/nc_test/test_get.c and test_put.c: ptrdiff_t is used to pass arrays of
>size_t values to pnetcdf -> on SX, ptrdiff_t is 64bit, while size_t is 32 bit
>Fix: replace all ptrdiff_t by size_t

Thanks for the fixes.  This is certainly the correct fix for the way that 
the ncmpi_xxx routines are defined (they take size_t and never 
ptrdiff_t).  What we need to look at is whether the ncmpi_xxx routines 
should use ptrdiff_t in the way that the test programs used the value.  In 
other words, is the ncmpi binding wrong or is the test program wrong?  We 
should strive to minimize the differences with regular netCDF.


>- pnetcdf.h: defines NC_UNLIMITED to '0L' - this is 64bit on SX, but is 
>passed
>as 32-bit size_t value
>Fix: define to 0, not 0L

It might be best instead for use to cast it to the right type ((size_t)0), 
since we might need the long on some platforms (though a good compiler 
should handle the cast for us because of the prototype).


>- test/nf_test/test_put.F: in the functions hash_real(), check_vars_real() 
>and
>check_atts_real(), I had to replace the 'doubleprecision' declarations by
>'real' to avoid (bogus!?) error messages. I am not Fortran-expert, though,
>and am still wondering why these 'doubleprecision' declarations do not cause
>such problems in functions like check_vars_int().

What messages did you get?

Bill 




More information about the parallel-netcdf mailing list