Commit Graph

659 Commits

Author SHA1 Message Date
Dennis Heimbigner
9df7f8d14b Update release notes 2023-10-25 15:26:46 -06:00
Dennis Heimbigner
bef8cf0460 Reduce warning by changing type of NC_OBJ.id.
re: https://github.com/Unidata/netcdf-c/issues/2780

As noted in the above issue, changing the NC_OBJ.id field
type from size_t to int reduces irrelevant warning.
There is no semantic effect since the number of distinct ids
will never approach the max positive integer value.
Note that this could change in the future if the id becomes
more than a simple counter.
2023-10-25 15:14:29 -06:00
Ward Fisher
375e5105ff Update Release Notes 2023-10-02 10:14:18 -06:00
Dennis Heimbigner
8feafaac63 Fix test file 2023-09-26 17:27:17 -06:00
Dennis Heimbigner
df3636b959 Mitigate S3 test interference + Unlimited Dimensions in NCZarr
This PR started as an attempt to add unlimited dimensions to NCZarr.
It did that, but this exposed significant problems with test interference.
So this PR is mostly about fixing -- well mitigating anyway -- test
interference.

The problem of test interference is now documented in the document docs/internal.md.
The solutions implemented here are also describe in that document.
The solution is somewhat fragile but multiple cleanup mechanisms
are provided. Note that this feature requires that the
AWS command line utility must be installed.

## Unlimited Dimensions.
The existing NCZarr extensions to Zarr are modified to support unlimited dimensions.
NCzarr extends the Zarr meta-data for the ".zgroup" object to include netcdf-4 model extensions. This information is stored in ".zgroup" as dictionary named "_nczarr_group".
Inside "_nczarr_group", there is a key named "dims" that stores information about netcdf-4 named dimensions. The value of "dims" is a dictionary whose keys are the named dimensions. The value associated with each dimension name has one of two forms
Form 1 is a special case of form 2, and is kept for backward compatibility. Whenever a new file is written, it uses format 1 if possible, otherwise format 2.
* Form 1: An integer representing the size of the dimension, which is used for simple named dimensions.
* Form 2: A dictionary with the following keys and values"
   - "size" with an integer value representing the (current) size of the dimension.
   - "unlimited" with a value of either "1" or "0" to indicate if this dimension is an unlimited dimension.

For Unlimited dimensions, the size is initially zero, and as variables extend the length of that dimension, the size value for the dimension increases.
That dimension size is shared by all arrays referencing that dimension, so if one array extends an unlimited dimension, it is implicitly extended for all other arrays that reference that dimension.
This is the standard semantics for unlimited dimensions.

Adding unlimited dimensions required a number of other changes to the NCZarr code-base. These included the following.
* Did a partial refactor of the slice handling code in zwalk.c to clean it up.
* Added a number of tests for unlimited dimensions derived from the same test in nc_test4.
* Added several NCZarr specific unlimited tests; more are needed.
* Add test of endianness.

## Misc. Other Changes
* Modify libdispatch/ncs3sdk_aws.cpp to optionally support use of the
   AWS Transfer Utility mechanism. This is controlled by the
   ```#define TRANSFER```` command in that file. It defaults to being disabled.
* Parameterize both the standard Unidata S3 bucket (S3TESTBUCKET) and the netcdf-c test data prefix (S3TESTSUBTREE).
* Fixed an obscure memory leak in ncdump.
* Removed some obsolete unit testing code and test cases.
* Uncovered a bug in the netcdf-c handling of big-endian floats and doubles. Have not fixed yet. See tst_h5_endians.c.
* Renamed some nczarr_tests testcases to avoid name conflicts with nc_test4.
* Modify the semantics of zmap\#ncsmap_write to only allow total rewrite of objects.
* Modify the semantics of zodom to properly handle stride > 1.
* Add a truncate operation to the libnczarr zmap code.
2023-09-26 16:56:48 -06:00
Dennis Heimbigner
c5b5a8a17e Update release notes 2023-08-16 23:09:26 -06:00
Dennis Heimbigner
ad1e16a7ae Update release notes 2023-08-10 17:00:22 -06:00
Dennis Heimbigner
f1a3a64b65 Cleanup the handling of cache parameters.
re: https://github.com/Unidata/netcdf-c/issues/2733

When addressing the above issue, I noticed that there was a disconnect
in NCZarr between nc_set_chunk_cache and nc_set_var_chunk cache.
Specifically, setting nc_set_chunk_cache had no impact on the per-variable cache parameters when nc_set_var_chunk_cache was not used.

So, modified the NCZarr code so that the per-variable cache parameters are set in this order (#1 is first choice):
1. The values set by nc_set_var_chunk_cache
2. The values set by nc_set_chunk_cache
3. The defaults set by configure.ac
2023-08-10 16:57:57 -06:00
Ward Fisher
aee19e263f
Merge pull request #2684 from Dave-Allured/release-notes.minor-fixes
Release notes:  Minor.  Add historical tag, and spell fix.
2023-07-31 17:26:23 -06:00
Ward Fisher
4c71b59b52 Update Release Notes 2023-07-26 14:33:48 -06:00
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
Dave Allured
d50d440fc5
Release notes: Add historical tag, and spell fix
1.  Add missing [File Change] tag to old 4.4.1-RC1 release note which modified hdf5 file format control.
2.  Minor spelling fix, coincidental.
2023-04-18 16:05:43 -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