Commit Graph

32 Commits

Author SHA1 Message Date
Dennis Heimbigner
3ffe7be446 Enhance/Fix filter support
re: Discussion https://github.com/Unidata/netcdf-c/discussions/2214

The primary change is to support so-called "standard filters".
A standard filter is one that is defined by the following
netcdf-c API:
````
int nc_def_var_XXX(int ncid, int varid, size_t nparams, unsigned* params);
int nc_inq_var_XXXX(int ncid, int varid, int* usefilterp, unsigned* params);
````
So for example, zstandard would be a standard filter by defining
the functions *nc_def_var_zstandard* and *nc_inq_var_zstandard*.

In order to define these functions, we need a new dispatch function:
````
int nc_inq_filter_avail(int ncid, unsigned filterid);
````
This function, combined with the existing filter API can be used
to implement arbitrary standard filters using a simple code pattern.
Note that I would have preferred that this function return a list
of all available filters, but HDF5 does not support that functionality.

So this PR implements the dispatch function and implements
the following standard functions:
    + bzip2
    + zstandard
    + blosc
Specific test cases are also provided for HDF5 and NCZarr.
Over time, other specific standard filters will be defined.

## Primary Changes
* Add nc_inq_filter_avail() to netcdf-c API.
* Add standard filter implementations to test use of *nc_inq_filter_avail*.
* Bump the dispatch table version number and add to all the relevant
   dispatch tables (libsrc, libsrcp, etc).
* Create a program to invoke nc_inq_filter_avail so that it is accessible
  to shell scripts.
* Cleanup szip support to properly support szip
  when HDF5 is disabled. This involves detecting
  libsz separately from testing if HDF5 supports szip.
* Integrate shuffle and fletcher32 into the existing
  filter API. This means that, for example, nc_def_var_fletcher32
  is now a wrapper around nc_def_var_filter.
* Extend the Codec defaulting to allow multiple default shared libraries.

## Misc. Changes
* Modify configure.ac/CMakeLists.txt to look for the relevant
  libraries implementing standard filters.
* Modify libnetcdf.settings to list available standard filters
  (including deflate and szip).
* Add CMake test modules to locate libbz2 and libzstd.
* Cleanup the HDF5 memory manager function use in the plugins.
* remove unused file include//ncfilter.h
* remove tests for the HDF5 memory operations e.g. H5allocate_memory.
* Add flag to ncdump to force use of _Filter instead of _Deflate
  or _Shuffle or _Fletcher32. Used for testing.
2022-03-14 12:39:37 -06:00
Edward Hartnett
4e4e167817 turned logging back on in one test 2022-02-04 14:46:28 -07:00
Edward Hartnett
34cc3fe005 turned off logging in test 2022-02-04 14:45:31 -07:00
Edward Hartnett
526849612a better handling of logging for parallel I/O builds 2022-02-04 14:38:25 -07:00
Edward Hartnett
418e428a05 fixed problem with scalar compact 2020-02-26 09:13:12 -07:00
Edward Hartnett
b31aedcc8e all tests passing but compact storage for scalars not being properly written in file yet 2020-02-26 08:14:06 -07:00
Edward Hartnett
3241aca93a include storage in rec_print_metadata() output 2020-02-25 16:12:50 -07:00
Edward Hartnett
6241a6e7a0 more tests for storage, changed var names to reflect stortage 2020-02-25 15:55:34 -07:00
Edward Hartnett
2ff24bd6fe more tests for compact storage 2020-02-25 13:30:38 -07:00
Edward Hartnett
8952c9b9f1 whitespace cleanup of tst_h_vars2.c 2020-02-25 06:44:40 -07:00
Edward Hartnett
5b893d8e0a adding more test for compact var 2020-02-25 05:46:09 -07:00
Edward Hartnett
4b163b65e1 added some testing for compact vars 2020-02-24 14:34:27 -07:00
Edward Hartnett
fb4a209f2a more testing for compact vars 2019-12-16 09:44:31 -07:00
Edward Hartnett
e75c248478 more testing for compact vars 2019-12-16 09:42:54 -07:00
Edward Hartnett
66a2b4c05e more testing for compact vars 2019-12-16 09:37:54 -07:00
Edward Hartnett
90324dfd10 further test development for compact storage 2019-12-16 09:31:11 -07:00
Edward Hartnett
89b8981c86 got compact storage test working 2019-12-04 09:12:53 -07:00
Edward Hartnett
06896f432d got compact storage test working 2019-12-04 08:49:37 -07:00
Edward Hartnett
85994847b2 more test development 2019-12-04 08:06:55 -07:00
Edward Hartnett
1a1f537c26 more test development 2019-12-04 08:05:30 -07:00
Edward Hartnett
1a665b6d80 adding test for compact storage 2019-12-04 08:01:56 -07:00
Edward Hartnett
bb1f5e1637 whitespace cleanup of test 2019-12-04 07:55:54 -07:00
edwardhartnett
965da1de01 now testing that endianness can only be set on atomic ints and floats 2019-11-15 11:10:10 -07:00
Ed Hartnett
fd29e2e608 uncommented test 2019-05-12 08:51:02 -06:00
Ed Hartnett
1b38d9aef8 lazy read of some var metadata 2018-12-18 07:48:22 -07:00
Ed Hartnett
b2fbc71bd4 added test, uncommented some test code 2018-12-17 09:24:47 -07:00
Ward Fisher
462ec93913 Whew! Updated copyright stanza in nc_test4. 2018-12-06 15:27:32 -07:00
Ed Hartnett
262763c254 clean up 2018-11-16 10:01:31 -07:00
Ed Hartnett
12db5e22f3 added test of extending unlimited dim with no coord var 2018-06-11 06:17:52 -06:00
Ed Hartnett
bc759bba58 added tests to confirm correct default chunksizes when fletcher32/shuffle are turned on 2018-05-12 09:48:13 -06:00
Ward Fisher
1c11fc5d59 More refactoring, pushing to avoid accidental loss. 2016-10-21 19:24:40 +00:00
Ed Hartnett
965a3aac70 minor refactor of the build system to work better for cross-compiling 2011-03-15 10:19:08 +00:00