Commit Graph

110 Commits

Author SHA1 Message Date
Greg Sjaardema
cbcee382b0 Remove need for HDF5-1.6 API being defined 2021-04-28 13:59:24 -06:00
Dennis Heimbigner
aeb3ac2809 Mostly revert the filter code to reduce its complexity of use.
re: https://github.com/Unidata/netcdf-c/issues/1836

Revert the internal filter code to simplify it. From the user's
point of view, the only visible changes should be:

1. The functions that convert text to filter specs have had their signature reverted and have been moved to netcdf_aux.h
2. Some filter API functions now return NC_ENOFILTER when inquiry is made about some filter.

Internally,the dispatch table has been modified to get rid of the filter_actions
entry and associated complex structures. It has been replaced with
inq_var_filter_ids and inq_var_filter_info entries and the dispatch table
version has been bumped to 3. Corresponding NOOP and NOTNC4 functions
were added to libdispatch/dnotnc4.c. Also, the filter_action entries
in dispatch tables were replaced for all dispatch code bases (HDF5, DAP2,
etc). This should only impact UDF users.

In the process, it became clear that the form of the filters
field in NC_VAR_INFO_T was format dependent, so I converted it to
be of type void* and pushed its management into the various dispatch
code bases. Specifically libhdf5 and libnczarr now manage the filters
field in their own way.

The auxilliary functions for parsing textual filter specifications
were moved to netcdf_aux.h and were renamed to the following:
* ncaux_h5filterspec_parse
* ncaux_h5filterspec_parselist
* ncaux_h5filterspec_free
* ncaux_h5filter_fix8

Misc. Other Changes:

1. Document NUG/filters.md updated to reflect the changes above.
2. All the old data types (structs and enums)
   used by filter_actions actions were deleted.
   The exception is the NC_H5_Filterspec because it is needed
   by ncaux_h5filterspec_parselist.
3. Clientside filters were removed -- another enhancement
   for which no-one ever asked.
4. The ability to remove filters was itself removed.
5. Some functionality needed by nczarr was moved from libhdf5
   to libsrc4 e.g. nc4_find_default_chunksizes
6. All the filterx code was removed
7. ncfilter.h and nc4filter.c no longer used

Misc. Unrelated Changes:

1. The nczarr_test makefile clean was leaving some directories; so
   add clean-local to take care of them.
2020-09-27 12:43:46 -06:00
Dennis Heimbigner
59e04ae071 This PR adds EXPERIMENTAL support for accessing data in the
cloud using a variant of the Zarr protocol and storage
format. This enhancement is generically referred to as "NCZarr".

The data model supported by NCZarr is netcdf-4 minus the user-defined
types and the String type. In this sense it is similar to the CDF-5
data model.

More detailed information about enabling and using NCZarr is
described in the document NUG/nczarr.md and in a
[Unidata Developer's blog entry](https://www.unidata.ucar.edu/blogs/developer/en/entry/overview-of-zarr-support-in).

WARNING: this code has had limited testing, so do use this version
for production work. Also, performance improvements are ongoing.
Note especially the following platform matrix of successful tests:

Platform | Build System | S3 support
------------------------------------
Linux+gcc      | Automake     | yes
Linux+gcc      | CMake        | yes
Visual Studio  | CMake        | no

Additionally, and as a consequence of the addition of NCZarr,
major changes have been made to the Filter API. NOTE: NCZarr
does not yet support filters, but these changes are enablers for
that support in the future.  Note that it is possible
(probable?) that there will be some accidental reversions if the
changes here did not correctly mimic the existing filter testing.

In any case, previously filter ids and parameters were of type
unsigned int. In order to support the more general zarr filter
model, this was all converted to char*.  The old HDF5-specific,
unsigned int operations are still supported but they are
wrappers around the new, char* based nc_filterx_XXX functions.
This entailed at least the following changes:
1. Added the files libdispatch/dfilterx.c and include/ncfilter.h
2. Some filterx utilities have been moved to libdispatch/daux.c
3. A new entry, "filter_actions" was added to the NCDispatch table
   and the version bumped.
4. An overly complex set of structs was created to support funnelling
   all of the filterx operations thru a single dispatch
   "filter_actions" entry.
5. Move common code to from libhdf5 to libsrc4 so that it is accessible
   to nczarr.

Changes directly related to Zarr:
1. Modified CMakeList.txt and configure.ac to support both C and C++
   -- this is in support of S3 support via the awd-sdk libraries.
2. Define a size64_t type to support nczarr.
3. More reworking of libdispatch/dinfermodel.c to
   support zarr and to regularize the structure of the fragments
   section of a URL.

Changes not directly related to Zarr:
1. Make client-side filter registration be conditional, with default off.
2. Hack include/nc4internal.h to make some flags added by Ed be unique:
   e.g. NC_CREAT, NC_INDEF, etc.
3. cleanup include/nchttp.h and libdispatch/dhttp.c.
4. Misc. changes to support compiling under Visual Studio including:
   * Better testing under windows for dirent.h and opendir and closedir.
5. Misc. changes to the oc2 code to support various libcurl CURLOPT flags
   and to centralize error reporting.
6. By default, suppress the vlen tests that have unfixed memory leaks; add option to enable them.
7. Make part of the nc_test/test_byterange.sh test be contingent on remotetest.unidata.ucar.edu being accessible.

Changes Left TO-DO:
1. fix provenance code, it is too HDF5 specific.
2020-06-28 18:02:47 -06:00
Dennis Heimbigner
44d0dcaad2 Add support for multiple filters per variable.
re: https://github.com/Unidata/netcdf-c/issues/1584

Support has been added for multiple filters per variable.  This
affects a number of components in netcdf. The new APIs are
documented in NUG/filters.md.

The primary changes are:
* A set of new functions are provided (see __include/netcdf_filter.h__).
    - Obtain a list of the filters associated with a variable
    - Obtain the parameters for a specific filter.
* The existing __nc_inq_var_filter__ function now returns info
  about the first defined filter.
* The utilities (ncgen, ncdump, and nccopy) now support
  an extended format for specifying a sequence of filters.
  The general form is __<filter>|<filter>..._.
* The ncdump **_Filter** attribute now dumps a list of all the
  filters associated with a variable using the above new format.
* Filter specifications can now use a filter name instead of number
  for filters known to the netcdf library, which in turn is taken
  from the HDF5 filter registration page.
* New errors are defined: NC_EFILTER and NC_ENOFILTER. The latter
  is returned if an attempt is made to access an unknown filter.
* Internally, the dispatch table has been extended to add a function
  to handle all of the filter functions.
* New, filter-related, tests were added to nc_test4.
* A new plugin was added to the plugins directory to help with testing.

Notes:
1. The shuffle and fletcher32 filters are not part of the multifilter system.

Misc. changes:
1. A debug module was added to libhdf5 to help catch error locations.
2020-02-16 12:59:33 -07:00
Greg Sjaardema
56c0d5cf8a Spelling fixes 2019-09-18 08:03:01 -06:00
Ed Hartnett
085b59e0d2 comment 2019-07-04 13:47:14 -06:00
Ed Hartnett
0c069e8e4c fixed memory error in sfc_pres_temp_more.c 2019-07-04 13:46:33 -06:00
Ed Hartnett
082ec55f43 made examples quick_large_files and quick_small_files only run for large file builds 2019-07-02 09:14:50 -06:00
Ed Hartnett
137e507574 clean up 2019-07-02 09:04:30 -06:00
Ed Hartnett
4ba1caaa9d clean up 2019-07-02 09:02:57 -06:00
Ed Hartnett
3526d643de adding simple to the programs that are run 2019-07-02 09:00:36 -06:00
Ed Hartnett
5fe7afea42 adding simple.c to the programs that are built 2019-07-02 09:00:06 -06:00
Ed Hartnett
472fd0b348 cleanup of simple.c 2019-07-02 08:59:27 -06:00
Ed Hartnett
c8a2ad233f adding sfc_pres_temp_more to examples that are run 2019-07-02 08:58:28 -06:00
Ed Hartnett
732d461530 fixed sfc_pres_temp_more.c 2019-07-02 08:57:57 -06:00
Ed Hartnett
a4a8bdf7a1 fixed quick_small_files.c 2019-07-02 08:53:26 -06:00
Ed Hartnett
e3f6a705b4 cleanup of sfc_pres_temp_more.c 2019-07-02 08:34:25 -06:00
Ed Hartnett
99258bf156 fixed warnings in quick_small_files.c 2019-07-02 08:28:30 -06:00
Ed Hartnett
ca274823c6 now running quick_small_files.c 2019-07-02 08:27:02 -06:00
Ed Hartnett
1c1d40dfec fixed warning in quick_large_files.c 2019-07-02 08:25:44 -06:00
Ed Hartnett
26f97cff85 turing on programs in examples/C 2019-05-12 09:12:42 -06:00
Ward Fisher
85b94a4244
Merge pull request #1364 from NetCDF-World-Domination-Council/ejh_non_contoversial
non controversial parts of last PR
2019-03-26 11:14:33 -06:00
Ed Hartnett
42bcf4594b example documentation cleanup 2019-03-12 10:28:10 -06:00
Ed Hartnett
1ad17d71e0 example documentation cleanup 2019-03-12 10:26:38 -06:00
Ed Hartnett
6c89b7a4b9 example documentation cleanup 2019-03-12 10:22:44 -06:00
Ed Hartnett
cab5458c2e example documentation cleanup 2019-03-12 10:21:36 -06:00
Ed Hartnett
59ca5b8cec example documentation cleanup 2019-03-12 10:20:30 -06:00
Ed Hartnett
afff56a83b example documentation cleanup 2019-03-12 10:12:44 -06:00
Ed Hartnett
12635339c5 example documentation cleanup 2019-03-12 10:11:07 -06:00
Ed Hartnett
930f6e3e87 example documentation cleanup 2019-03-12 10:06:31 -06:00
Ed Hartnett
6efc184fb3 example documentation cleanup 2019-03-12 10:02:25 -06:00
Ed Hartnett
1c9a9e117b Makefile.am cleanup 2019-03-12 09:18:31 -06:00
Ed Hartnett
5214b51622 fixed examples/C/Makefile.am for parallel builds without parallel testing 2019-03-12 09:17:00 -06:00
Ed Hartnett
39c258449c now properly running pnetcdf example program in parallel 2019-03-12 09:00:31 -06:00
Dennis Heimbigner
15e4fdcbb4 Support installation of the bzip2 plugin under name libh5bzip2.so
re: https://github.com/Unidata/netcdf-c/issues/1347

It turns out that the plugin libraries (bzip2 and misc) were
being installed as part of 'make installed'. This was not intended
behavior. But after some discussion in the above issue, it was decided
to install the bzip2 plugin. However, in order to avoid naming conflicts,
the plugin is installed under the name 'libh5bzip2.so'.
Note that this is automake behavior only; the install does not
(yet) occur using cmake.

Misc. unrelated changes
-----------------------
1. turn off some debug output in ncdump/Makefile.am
2019-02-27 15:22:46 -07:00
Ed Hartnett
151f0226f9 change to trigger CI 2019-01-14 13:26:52 -07:00
Ed Hartnett
c03432ac4c warnings fixes 2019-01-03 07:07:13 -07:00
Ward Fisher
30ea33435c Merge remote-tracking branch 'origin/license_update.wif' into pr-aggregation.wif 2018-12-11 17:08:21 -05:00
Ward Fisher
a3eb21c068 Continuing to replace references. 2018-12-04 16:51:40 -07:00
Ward Fisher
3c59fb860d Updating files to refer to the top-level COPYRIGHT file. 2018-12-04 15:52:43 -07:00
Ed Hartnett
db83d0b4bf got disable-hdf5 builds working without utils 2018-12-01 07:29:58 -07:00
Dennis Heimbigner
a5a34f6aba
Merge branch 'master' into nc_mpiio_nc_mpiposix 2018-10-06 13:33:55 -06:00
Dennis Heimbigner
d07c05b58f Fix memory problems when using HDF5 version 1.10.x and later.
re: issue https://github.com/Unidata/netcdf-c/issues/1156

Starting with HDF5 version 1.10.x, the plugin code MUST be
careful when using the standard *malloc()*, *realloc()*, and
*free()* function.

In the event that the code is allocating, reallocating, or
free'ing memory that either came from -- or will be exported to --
the calling HDF5 library, then one MUST use the corresponding
HDF5 functions *H5allocate_memory()*, *H5resize_memory()*,
*H5free_memory()* [5] to avoid memory failures.

Additionally, if your filter code leaks memory, then the HDF5 library
generates a failure something like this.
````
H5MM.c:232: H5MM_final_sanity_check: Assertion `0 == H5MM_curr_alloc_bytes_s' failed.
````

This PR modifies the code in the plugins directory to
conform to these new requirements.

This raises a question about the libhdf5 code where this
same problem may occur. We need to scan especially nc4hdf.c
to look for this problem.
2018-10-04 11:37:21 -06:00
Wei-keng Liao
0ed70756cc Ignore flags NC_MPIIO and NC_MPIPOSIX. 2018-09-22 20:22:34 -05:00
Wei-keng Liao
48da78e133 Use PnetCDF instead of parallel-netcdf to avoid confusion with
parallel netcdf4. Also, update PnetCDF web page.
2018-09-17 17:18:48 -05:00
Wei-keng Liao
739dfa2aa2 PnetCDF does not support per-variable collective/independent data mode change; modify nc_var_par_access to ignore varid 2018-07-15 16:19:21 -05:00
luz.paz
74fbacdb82 Misc. source comment typos
Some are user-facing. Found via `codespell` and through the downstream FreeCAD.
2018-04-26 23:04:01 -04:00
Thomas Braun
3af477a926 netcdf-c: Make cmake pass a windows cmd prompt
add_sh_test only creates the test if HAVE_BASH is TRUE.
Therefore we can only call SET_TESTS_PROPERTIES on the created test if
HAVE_BASH is equally true.
2018-04-26 14:43:27 +02:00
Dennis Heimbigner
d3b309722e re: gh issue https://github.com/Unidata/netcdf-c/issues/911
I took Ed's advice and moved the plugin stuff to its own
top-level directory. This is an attempt to solve the problem of
copying files that we have experienced. In any case, it will
serve as a place to stick additional plugins.
2018-04-21 20:10:47 -06:00
Ward Fisher
dad2101a04
Merge branch 'master' into index.dmh 2018-04-02 13:56:00 -06:00