Project

General

Profile

Possible bug in development version

Added by Robert Wilson almost 4 years ago

I was testing my package, nctoolkit, which relies on CDO, using the development version of CDO and identified a potential bug in the development version.

This involves chaining inttime methods. The following gives a segementation fault:

cdo -seldate,1990-01-01,1993-01-01 -inttime,1990-01-01,12:00:00,1year sst.mon.mean.nc outfile.nc

Using data available here: https://github.com/r4ecology/nctoolkit/blob/master/data/sst.mon.mean.nc

Regards

Robert


Replies (9)

RE: Possible bug in development version - Added by Ralf Mueller almost 4 years ago

hi Robert!
I can confirm that this fails with the current CDO release. It does not fail, when chaining is avoided, but since it is a netcdf4 file, it can also be causes by a non-threadsafe hdf5 version used as a backend.

Therefor CDO has the '-L' option, which serializes the critical part of the IO in the chaining. Et Voila, your call just works with it. So please give it a try:

 cdo  -selyear,1990/1993 -inttime,1990-01-01,12:00:00,1year sst.mon.mean.nc t.nc
cdo(1) inttime: Process started
cdf_get_vara_float: ncid = 65536 varid = 3

Error (cdf_get_vara_float): NetCDF: HDF error
 cdo -L -selyear,1990/1993 -inttime,1990-01-01,12:00:00,1year sst.mon.mean.nc t.nc
cdo(1) inttime: Process started
cdo(1) inttime: Processed 1 variable over 360 timesteps.
cdo    selyear: Processed 259200 values from 1 variable over 10 timesteps [0.40s 69MB].

cheers
ralf

RE: Possible bug in development version - Added by Robert Wilson almost 4 years ago

Thanks Ralf

That works. Though the problem, at least in my installation seems to be with seldate, not threading.

The following gives me a segmentation fault with the development version, but not in 1.9.8.

cdo -L -seldate,1990-01-01 sst.mon.mean.nc t.nc

I am installing both versions of cdo essentially using the same script: https://github.com/r4ecology/nctoolkit/blob/master/cdo_installers/cdo198_install.sh. Though it's possible something is going wrong at my end.

Cheers,

Robert

RE: Possible bug in development version - Added by Ralf Mueller almost 4 years ago

the default build of hdf5 is not threadsafe. they switched this off years ago. now you have to give extra options to their configure call. I believe is '--enable-unsupported' and '--enable-threadsafe'. I will check the develop version of CDO with your data meanwhile

RE: Possible bug in development version - Added by Ralf Mueller almost 4 years ago

and you might you gdb to debug, where the error comes from

RE: Possible bug in development version - Added by Ralf Mueller almost 4 years ago

develop does not compile for different reason at the moment. but still the cdo-1.9.8 works fine for me. why do you compile cdo on your own? people could use conda instead. but maybe that's optional in nctoolkit ...

RE: Possible bug in development version - Added by Ralf Mueller almost 4 years ago

I had issues with gcc10, but now I could reproduce the seldate-error with the uploaded development tar ball. thx for the report

cheers
ralf

RE: Possible bug in development version - Added by Robert Wilson almost 4 years ago

Thanks Ralf

I personally use the conda version of cdo. The scripts on GitHub are just provided for people who don't use conda. There are still a lot of them. Right now nctoolkit just uses whatever version of cdo is available on the system, but the conda version will be a dependency once I release it to conda in the next couple of months.

Robert

RE: Possible bug in development version - Added by Uwe Schulzweida almost 4 years ago

Thanks for this report! The bug in seldate will be fixed in the next release.

Cheers,
Uwe

RE: Possible bug in development version - Added by Robert Wilson almost 4 years ago

Cool

I should add that all of my other tests pass with the dev version. Part of my test workflow is to make sure nctoolkit gives identical results regardless of cdo version for all of the cdo methods used by nctoolkit, so in effect it does regression testing of the most commonly used parts of cdo.

Cheers

Robert

    (1-9/9)