Commit Graph

648 Commits

Author SHA1 Message Date
Ward Fisher
8a45d26c78
Merge branch 'main' into plistfix.dmh 2023-07-25 15:22:38 -06:00
Dennis Heimbigner
65f866fff6 Fix memory leak
re: Issue https://github.com/Unidata/netcdf-c/issues/2723

H/T to Roland Ambs for finding a memory leak where an allocated
HDF5 plist is not being reclaimed.
2023-07-23 17:25:30 -06:00
Dennis Heimbigner
a446ebfc29 Update release notes 2023-07-23 12:44:00 -06:00
Dennis Heimbigner
a37ca49d25 Modify PR https://github.com/Unidata/netcdf-c/pull/2655 to ensure transient types have names.
re: PR https://github.com/Unidata/netcdf-c/pull/2655

This PR modifies the transient types PR so that all created
transient types are given a created unique name (within a
group). The form of the name is "_Anonymous<Class>NN". The class
is the user-defined type class: Enum, Compound, Opaque, or
Vlen. NN is an integer identifier to ensure uniqueness.
Additionally, this was applied to DAP/4 anonymous dimensions.
This also required some test baseline data changes.

The transient test case is modified to verify that the name exists.
2023-07-22 20:40:53 -06:00
Dennis Heimbigner
fb422e696b Update docs/filters.md and RELEASENOTES.md 2023-06-23 13:42:16 -06:00
Ward Fisher
2ac9239c00
Merge branch 'main' into netaccess.dmh 2023-06-12 15:08:45 -06:00
Dennis Heimbigner
f6ebbb04a0 Update release notes 2023-06-10 19:39:20 -06:00
Dennis Heimbigner
1f12c09b07 Update Release Notes 2023-06-10 19:28:43 -06:00
Ward Fisher
3695cc0668
Merge branch 'main' into ncdumptests.dmh 2023-06-07 14:55:11 -06:00
Ward Fisher
258ad3fabe
Merge branch 'main' into vlenperf.dmh 2023-06-06 15:59:04 -06:00
Ward Fisher
a14bfde418
Merge branch 'main' into verifyhost.dmh 2023-05-25 11:54:49 -06:00
Dennis Heimbigner
29740be9da update release notes 2023-05-20 17:36:47 -06:00
Dennis Heimbigner
fb40a72b45 Improve performance of the nc_reclaim_data and nc_copy_data functions.
re: Issue https://github.com/Unidata/netcdf-c/issues/2685
re: PR https://github.com/Unidata/netcdf-c/pull/2179

As noted in PR https://github.com/Unidata/netcdf-c/pull/2179,
the old code did not allow for reclaiming instances of types,
nor for properly copying them. That PR provided new functions
capable of reclaiming/copying instances of arbitrary types.

However, as noted by Issue https://github.com/Unidata/netcdf-c/issues/2685, using these
most general functions resulted in a significant performance
degradation, even for common cases.

This PR attempts to mitigate the cost of using the general
reclaim/copy functions in two ways.

First, the previous functions operating at the top level by
using ncid and typeid arguments. These functions were augmented
with equivalent versions that used the netcdf-c library internal
data structures to allow direct access to needed information.
These new functions are used internally to the library.

The second mitigation involves optimizing the internal functions
by providing early tests for common cases. This avoids
unnecessary recursive function calls.

The overall result is a significant improvement in speed by a
factor of roughly twenty -- your mileage may vary. These
optimized functions are still not as fast as the original (more
limited) functions, but they are getting close. Additional optimizations are
possible. But the cost is a significant "uglification" of the
code that I deemed a step too far, at least for now.

## Misc. Changes
1. Added a test case to check the proper reclamation/copy of complex types.
2. Found and fixed some places where nc_reclaim/copy should have been used.
3. Replaced, in the netcdf-c library, (almost all) occurrences of nc_reclaim_copy with calls to NC_reclaim/copy. This plus the optimizations is the primary speed-up mechanism.
4. In DAP4, the metadata is held in a substrate in-memory file; this required some changes so that the reclaim/copy code accessed that substrate dispatcher rather than the DAP4 dispatcher.
5. Re-factored and isolated the code that computes if a type is (transitively) variable-sized or not.
6. Clean up the reclamation code in ncgen; adding the use of nc_reclaim exposed some memory problems.
2023-05-20 17:11:25 -06:00
Ward Fisher
5dedd76de9
Merge branch 'main' into ncdumptests.dmh 2023-05-16 11:22:15 -06:00
Dennis Heimbigner
dc32f8133a Update release notes 2023-04-29 15:48:35 -06:00
Dennis Heimbigner
5058903053 debug2 2023-04-26 12:14:23 -06:00
Dennis Heimbigner
f6f4b89f39 cyg1 2023-04-25 20:27:59 -06:00
Dennis Heimbigner
49737888ca Improve S3 Documentation and Support
## Improvements to S3 Documentation
* Create a new document *quickstart_paths.md* that give a summary of the legal path formats used by netcdf-c. This includes both file paths and URL paths.
* Modify *nczarr.md* to remove most of the S3 related text.
* Move the S3 text from *nczarr.md* to a new document *cloud.md*.
* Add some S3-related text to the *byterange.md* document.

Hopefully, this will make it easier for users to find the information they want.

## Rebuild NCZarr Testing
In order to avoid problems with running make check in parallel, two changes were made:
1. The *nczarr_test* test system was rebuilt. Now, for each test.
any generated files are kept in a test-specific directory, isolated
from all other test executions.
2. Similarly, since the S3 test bucket is shared, any generated S3 objects
are isolated using a test-specific key path.

## Other S3 Related Changes
* Add code to ensure that files created on S3 are reclaimed at end of testing.
* Used the bash "trap" command to ensure S3 cleanup even if the test fails.
* Cleanup the S3 related configure.ac flag set since S3 is used in several places. So now one should use the option *--enable-s3* instead of *--enable-nczarr-s3*, although the latter is still kept as a deprecated alias for the former.
* Get some of the github actions yml to work with S3; required fixing various test scripts adding a secret to access the Unidata S3 bucket.
* Cleanup S3 portion of libnetcdf.settings.in and netcdf_meta.h.in and test_common.in.
* Merge partial S3 support into dhttp.c.
* Create an experimental s3 access library especially for use with Windows. It is enabled by using the options *--enable-s3-internal* (automake) or *-DENABLE_S3_INTERNAL=ON* (CMake). Also add a unit-test for it.
* Move some definitions from ncrc.h to ncs3sdk.h

## Other Changes
* Provide a default implementation of strlcpy and move this and similar defaults into *dmissing.c*.
2023-04-25 17:15:06 -06:00
Dennis Heimbigner
7df6118e02 Update WRT main 2023-04-25 15:00:17 -06:00
Dennis Heimbigner
2bed69ab25 Merge remote-tracking branch 'Unidata/main' 2023-04-13 12:30:06 -06:00
Dennis Heimbigner
e9ddb16474 Update release notes 2023-04-12 22:21:18 -06:00
Dennis Heimbigner
a6b0348e9d Fix some race conditions between some ncdump tests.
There are apparently some dependency conditions between ncdump/tst_nccopy4.sh and ncdump/tst_netcdf4.sh.
Fixed by creating a per-test directory into which all created intermediates are stored. Also created a test_ncdump.sh file to hold common code.

## Other Changes
* Remove some uses of strlcat from plugin-related code because strlcat is not always defined on some platforms and the plugin code generally should not rely on accessing libnetcdf.
* Cleanup the handling of test plugins.
2023-04-12 20:37:03 -06:00
Dennis Heimbigner
8fac3b479d Merge remote-tracking branch 'Unidata/main' 2023-04-12 19:43:46 -06:00
Ward Fisher
dc6e392c9d
Merge branch 'main' into znotnc.dmh 2023-04-12 16:02:34 -06:00
Dennis Heimbigner
33297862d4 update to current main 2023-04-12 12:14:01 -06:00
Ward Fisher
c8b3b37b1a Merge branch 'dap4tests2.dmh' of https://github.com/DennisHeimbigner/netcdf-c 2023-04-11 16:42:32 -06:00
Ward Fisher
9459f92f1f
Merge branch 'main' into dap4tests1.dmh 2023-04-11 16:23:48 -06:00
Ward Fisher
91591d37a0
Merge pull request #2660 from Unidata/v4.9.2-wellspring.wif
v4.9.2 Wellspring branch
2023-04-11 15:32:26 -06:00
Dennis Heimbigner
10828c5fda undo 2023-04-09 13:52:34 -06:00
Dennis Heimbigner
75bfaba966 Update release notes 2023-04-09 13:30:42 -06:00
Dennis Heimbigner
6c7a718e24 Update release notes 2023-04-09 13:21:57 -06:00
Dennis Heimbigner
d7d216a3f5 Merge branch 'master' into dap4tests2.dmh 2023-03-16 14:03:29 -06:00
Dennis Heimbigner
2971d9731d Merge branch 'master' into dap4tests1.dmh 2023-03-16 14:02:49 -06:00
Dennis Heimbigner
d738e03f5b Update 2023-03-14 14:14:44 -06:00
Ward Fisher
5f37f7639a Merge branch 'main' into v4.9.2-wellspring.wif 2023-03-14 13:58:59 -06:00
Ward Fisher
9c388dfd6a
Merge branch 'main' into vfd13.dmh 2023-03-14 11:36:09 -06:00
Ward Fisher
59971b5475 Update release notes. 2023-03-13 15:42:29 -06:00
Dennis Heimbigner
5c07ebfd11 Check at nc_open if file appears to be in NCZarr/Zarr format.
re: Issue https://github.com/Unidata/netcdf-c/issues/2656

Charlie Zender notes that *nc_open()* does not immediately detect that the given path refers to a file not in zarr format. Rather it fails later when trying to read the (meta-)data.

The reason is that the Zarr format is highly decentralized. There is no easily testable magic number or superblock to look for. In effect the only way to see if a directory is Zarr is to successfully read it.

It is possible to heuristically detect that a path refers to an NCZarr/Zarr file by doing a breadth-first search of the file tree starting at the given path. If the search encounters a file whose name starts with ".z", then assume it is a legitimate NCZarr/Zarr file. Of course, this test could be costly. One hopes that in practice that it is not.

In addition to this fix, a corresponding test case was added.

## Other Changes

re: PR https://github.com/Unidata/netcdf-c/pull/2529

There was an error under Cygwin for this PR that is fixed in this PR. The fix was to convert all *noinst_* references to *check_*.
2023-03-13 13:24:14 -06:00
Ward Fisher
8d51666d04
Merge branch 'main' into encode.dmh 2023-03-07 14:18:38 -07:00
Dennis Heimbigner
cf6fcb3b9c Merge branch 'master' into dap4tests2.dmh 2023-03-02 20:00:05 -07:00
Dennis Heimbigner
bec55cb95e Merge branch 'master' into dap4tests1.dmh 2023-03-02 19:59:32 -07:00
Dennis Heimbigner
69e84fe9f1 Fix byterange handling of some URLS
re: Issue

The byterange handling of the following URLS fails.

### Problem 1: "https://crudata.uea.ac.uk/cru/data/temperature/HadCRUT.4.6.0.0.median.nc#mode=bytes"
It turns out that byterange in hdf5 has two possible targets: S3 and not-S3 (e.g. a thredds server or the crudata URL above). Each uses a different HDF5 Virtual File Driver (VFD).
I incorrectly set up the byterange code in libhdf5 so that it would choose one or the other of the two VFD's for any netcdf-c library build. The fix is to allow it to choose either one at run-time.

### Problem 2: "https://noaa-goes16.s3.amazonaws.com/ABI-L1b-RadF/2022/001/18/OR_ABI-L1b-RadF-M6C01_G16_s20220011800205_e20220011809513_c20220011809562.nc#mode=bytes,s3"
When given what appears to be an S3-related URL, the netcdf-c library code converts it into a canonical, so-called "path" format. In casing out the possible input URL formats, I missed the case where the host contains the bucket ("noaa-goes16"), but not the region. So the fix was to check for this case.

## Misc. Related Changes
1. Since S3 is used in more than just NCZarr, I changed the automake/cmake options to replace "--enable-nczarr-s3" with "--enable-s3", but keeping the former option as a synonym for the latter. This also entailed cleaning up libnetcdf.settings WRT S3 support
2. Added the above URLS as additional test cases

## Misc. Un-Related Changes
1. CURLOPT_PUT is deprecated in favor to CURLOPT_UPLOAD
2. Fix some minor warnings

## Open Problems
* Under Ubuntu, either libcrypto or aws-sdk-cpp has a memory leak.
2023-03-02 19:51:02 -07:00
Dennis Heimbigner
21b920cbab update RELEASENOTES 2023-02-22 12:30:15 -07:00
Dennis Heimbigner
8556a9d634 Extend the dispatch table for H5FD back to version 1.13.2
re: Issue https://github.com/Unidata/netcdf-c/issues/2634
re: PR https://github.com/Unidata/netcdf-c/pull/2615
re: Issue https://github.com/Unidata/netcdf-c/issues/2614

It turns out that the H5FD table change identified in
issue https://github.com/Unidata/netcdf-c/issues/2614
actually occurred in HDF5 version 1.13.2.
Since we do not test with 1.13.x, we did not catch this.
2023-02-22 11:15:43 -07:00
Ward Fisher
6a8d5b9314 Remove a stray character at the head file. 2023-02-17 15:58:44 -07:00
Dennis Heimbigner
295c132789 Fix a distcheck failure with nczarr_test/run_interop.sh
The problem was that files were being copied
into the ${srcdir} rather than ${builddir} directory.
2023-02-17 13:01:11 -07:00
Dennis Heimbigner
e9bf385d3f Update Release notes 2023-02-16 20:24:13 -07:00
Dennis Heimbigner
e31ce10842 Enable ACCEPT_ENCODING on DAP requests
re: PR https://github.com/Unidata/netcdf-c/issues/2622

H/T Nathan Potter for finding this.

Apparently the existing library DAP code for supporting
compressed http responses was disabled.

So:
1. enable CURLOPT_ACCEPT_ENCODING by default
2. Add a new HTTP.ENCODE for .dodsrc to allow it to be disabled.
2023-02-16 20:21:22 -07:00
Ward Fisher
23ba09e5a5
Merge branch 'main' into gh2274.wif 2023-02-16 10:27:50 -07:00
Ward Fisher
6f55c85260 Update nc-config in support of https://github.com/Unidata/netcdf-c/issues/2274 2023-02-13 10:52:41 -07:00