netcdf-c icon indicating copy to clipboard operation
netcdf-c copied to clipboard

ncdump failure on intel oneapi compiler

Open edwardhartnett opened this issue 1 year ago • 8 comments

This is with the latest code from main (updated today).

The intel oneapi compiler seems to have broken some infinities(?):

cd ncdump
bash-4.4$ bash -x ./run_back_comp_tests.sh 
...
+ echo '*** Testing that this version can read data produced by old versions of netCDF.'
*** Testing that this version can read data produced by old versions of netCDF.
+ echo '*** checking ref_nc_test_netcdf4_4_0.nc...'
*** checking ref_nc_test_netcdf4_4_0.nc...
+ /scratch1/BMC/gsd-hpcs/ed/netcdf-c-4.9.3-rc1/ncdump/ncdump -n ref_nc_test_netcdf4_4_0 /scratch1/BMC/gsd-hpcs/ed/netcdf-c-4.9.3-rc1/ncdump/ref_nc_test_netcdf4_4_0.nc
+ diff -b -w /scratch1/BMC/gsd-hpcs/ed/netcdf-c-4.9.3-rc1/ncdump/ref_nc_test_netcdf4.cdl tst_nc_test_netcdf4_4_0.cdl
19c19
<               i:f = -3.402823e+38f, 3.402823e+38f, -Infinityf, Infinityf ;
---
>               i:f = -3.402823e+38f, 3.402823e+38f, -inff, inff ;
163c163
<               :Gf = -3.402823e+38f, 3.402823e+38f, -Infinityf, Infinityf, 531.f ;
---
>               :Gf = -3.402823e+38f, 3.402823e+38f, -inff, inff, 531.f ;
233c233
<  f3 = -3.402823e+38, 3.402823e+38, -Infinityf ;
---
>  f3 = -3.402823e+38, 3.402823e+38, -inf ;
245c245
<  f4 = -3.402823e+38, 3.402823e+38, -Infinityf, Infinityf ;
---
>  f4 = -3.402823e+38, 3.402823e+38, -inf, _ ;

edwardhartnett avatar Aug 05 '24 20:08 edwardhartnett

Presumably this is the same issue as this: https://github.com/Unidata/netcdf-c/issues/2700

DennisHeimbigner avatar Aug 05 '24 21:08 DennisHeimbigner

So I suppose the stanza introduced in https://github.com/Unidata/netcdf-c/pull/2935/files is either not being entered, or the -fhonor-infinities flag is not doing what is expected. @edwardhartnett can you pass -fhonor-inifinities to the compiler and see if that addresses the issue on your end? If so, I'll check the conditional, if not, I'll look more into compiler flags.

WardF avatar Aug 05 '24 21:08 WardF

I will try when I can log in again - some problem with the system this morning.

The Intel oneapi is freely available and can be tested in the CI. We do that with the NCEPLIBS libraries here at NOAA. My colleague @AlexanderRichert-NOAA has made a GitHub action which installs the Intel compilers on a test instance. Take a look here, I think you could just use it directly, or take your own copy: https://github.com/NOAA-EMC/ci-install-intel-toolkit

edwardhartnett avatar Aug 06 '24 13:08 edwardhartnett

I will take a look at integrating that, thanks!

WardF avatar Aug 06 '24 15:08 WardF

I'm working on the next Fortran release, so that might be a good time to integrate modern alternatives to gfortran.

WardF avatar Aug 06 '24 15:08 WardF

But it should be noted that the problem described in this issue was in the C library...

edwardhartnett avatar Aug 06 '24 16:08 edwardhartnett

It should be noted indeed, and should have been obvious; as you can tell, I've been focused on the Fortran release XD. Yes, I will take a look at this in the C library.

WardF avatar Aug 06 '24 23:08 WardF

I'm also going to do some netcdf-fortran tests after the netcdf-c testing I'm doing.

I was just reflecting on the value of unit tests to the netCDF project. Here we have code written in some cases 15 or 20 years ago, still working very well on new compilers, new systems, all with a small staff - and netCDF continues to add new features at an impressive rate. After all this time, the original v2 test code still runs perfectly. It's a record any software project would envy...

edwardhartnett avatar Aug 07 '24 13:08 edwardhartnett