mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
3ffe7be446
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. |
||
---|---|---|
.. | ||
bm_chunking.c | ||
bm_radar.c | ||
bzip2.cdl | ||
cdm_sea_soundings.c | ||
clear_cache.sh | ||
CMakeLists.txt | ||
findplugin.in | ||
h5testszip.c | ||
Makefile.am | ||
noop.cdl | ||
ref_any.cdl | ||
ref_bzip2.c | ||
ref_fillonly.cdl | ||
ref_filter_order_create.txt | ||
ref_filter_order_read.txt | ||
ref_filter_repeat.txt | ||
ref_filtered.cdl | ||
ref_filteredvv.cdl | ||
ref_filterx_hdf5.txt | ||
ref_hdf5_compat1.nc | ||
ref_hdf5_compat2.nc | ||
ref_hdf5_compat3.nc | ||
ref_multi.cdl | ||
ref_nccopyF.cdl | ||
ref_ncgenF.cdl | ||
ref_szip.cdl | ||
ref_szip.h5 | ||
ref_tst_compounds.nc | ||
ref_tst_dims.nc | ||
ref_tst_interops4.nc | ||
ref_tst_xplatform2_1.nc | ||
ref_tst_xplatform2_2.nc | ||
ref_unfiltered.cdl | ||
ref_unfilteredvv.cdl | ||
renamegroup.c | ||
run_empty_vlen_test.sh | ||
run_grp_rename.sh | ||
run_par_test.sh.in | ||
t_type.c | ||
tdset.h5 | ||
test_fillonly.sh | ||
test_filter_misc.c | ||
test_filter_order.c | ||
test_filter_reg.c | ||
test_filter_repeat.c | ||
test_filter_vlen.c | ||
test_filter.c | ||
test_filterx_hdf5.c | ||
test_szip.c | ||
test_wrapper.in | ||
tst_alignment.c | ||
tst_atts1.c | ||
tst_atts2.c | ||
tst_atts3.c | ||
tst_atts_string_rewrite.c | ||
tst_atts.c | ||
tst_bug324.c | ||
tst_bug1442.c | ||
tst_camrun.c | ||
tst_charvlenbug.c | ||
tst_chunks2.c | ||
tst_chunks.c | ||
tst_compounds2.c | ||
tst_compounds3.c | ||
tst_compounds.c | ||
tst_converts2.c | ||
tst_converts.c | ||
tst_coords2.c | ||
tst_coords3.c | ||
tst_coords.c | ||
tst_dims2.c | ||
tst_dims3.c | ||
tst_dims.c | ||
tst_elatefill.c | ||
tst_empty_vlen_unlim.c | ||
tst_endian_fill.c | ||
tst_enums.c | ||
tst_files4.c | ||
tst_files5.c | ||
tst_files6.c | ||
tst_files.c | ||
tst_fill_attr_vanish.c | ||
tst_fillbug.c | ||
tst_fillonly.c | ||
tst_fills2.c | ||
tst_fills.c | ||
tst_filter_avail.c | ||
tst_filter.sh | ||
tst_filterparser.c | ||
tst_grps2.c | ||
tst_grps.c | ||
tst_h5_endians.c | ||
tst_h_converts.c | ||
tst_h_refs.c | ||
tst_h_scalar.c | ||
tst_h_strbug.c | ||
tst_h_strings3.c | ||
tst_h_vl2.c | ||
tst_hdf5_file_compat.c | ||
tst_interops4.c | ||
tst_interops5.c | ||
tst_interops6.c | ||
tst_interops_dims.c | ||
tst_interops.c | ||
tst_large2.c | ||
tst_large3.c | ||
tst_large5.c | ||
tst_large.c | ||
tst_misc.sh | ||
tst_mode.c | ||
tst_mpi_parallel.c | ||
tst_multifilter.c | ||
tst_nc4perf.c | ||
tst_nc_converts.c | ||
tst_opaques.c | ||
tst_parallel3.c | ||
tst_parallel4.c | ||
tst_parallel5.c | ||
tst_parallel_compress.c | ||
tst_parallel_zlib.c | ||
tst_parallel.c | ||
tst_put_vars_two_unlim_dim.c | ||
tst_put_vars.c | ||
tst_quantize_par.c | ||
tst_quantize.c | ||
tst_rehash.c | ||
tst_rename2.c | ||
tst_rename3.c | ||
tst_rename.c | ||
tst_simplerw_coll_r.c | ||
tst_specific_filters.sh | ||
tst_strings2.c | ||
tst_strings.c | ||
tst_sync.c | ||
tst_szip.sh | ||
tst_types.c | ||
tst_udf.c | ||
tst_unlim_vars.c | ||
tst_utf8.c | ||
tst_v2.c | ||
tst_varms.c | ||
tst_vars2.c | ||
tst_vars3.c | ||
tst_vars4.c | ||
tst_vars.c | ||
tst_varsperf.c | ||
tst_virtual_datasets.c | ||
tst_vl.c | ||
tst_vlenstr.c | ||
tst_xplatform2.c | ||
tst_xplatform.c |