Commit Graph

102 Commits

Author SHA1 Message Date
Ed Hartnett
76d6b55eff moved call to nc4_rec_grp_del() to inside nc4_nc4f_list_del() 2019-07-16 16:29:06 -06:00
Ed Hartnett
4398cad8f5 whitespace cleanup 2019-07-16 16:17:07 -06:00
Ed Hartnett
b8e50c9254 moved freeing of allvars, alldims, alltypes lists to nc4_nc4f_list_del 2019-07-16 16:16:11 -06:00
Ed Hartnett
e9666f7333 moved free(h5) intonc4_nc4f_list_del 2019-07-16 16:07:21 -06:00
Ed Hartnett
d840c1864c removed unused prototype 2019-07-16 16:02:08 -06:00
Dennis Heimbigner
2eb1a8d8cf For some reason, the code for this was incorrect.
Anyway, I repaired it as follows:
1. Created NC4_write_provenance as parallel to NC4_read_provenance
2. Modified hdf5file.c to use NC4_write_provenance
3. Modified hdf5open.c to use NC4_read_provenance (was NC4_read_ncproperties).
4. The creation of the _NCProperties string was seriously hosed:
   was using all the wrong fields.
2019-04-18 14:23:20 -06:00
Dennis Heimbigner
88a7a1753c Simplify libhdf5/nc5info.c to move to lazy parsing
re: https://github.com/Unidata/netcdf-c/issues/1352

When nc4info.c encounters an _NCProperties attribute
with a version number it does not recognize, it does not
show it correctly.

Solution chosen is to arrange so that accessing the attribute
returns the raw value of the Attribute from the file. This way,
even if the version is unrecognized, it will return something
usable.

The changes were primarily to never attempt to parse the value
of _NCProperties until actually required. Which since they
are currently not used means that parsing never occurs.

Also modified ncdump/tst_fileinfo.sh to include some extra testing

I tested the original failure by changing the value of NCPROPS to 3.
However, there is no way to test this at build time.

Misc. Changes
* Inlined the provenance info in the NC_FILE_INFO_T structure
* Centralized stuff from elsewhere into include/nc_provenance.h

Misc. Unrelated Changes
* Removed/turned off some misc debug output left on by accident
* Fix CPPFLAGS name error in libhdf5/Makefile.am
2019-03-09 20:35:57 -07:00
Ed Hartnett
8b1f5a8fad cleanup of whitespace in HDF5 directory 2019-02-19 05:18:02 -07:00
Ed Hartnett
840d51d035 changed NC_GRP_INFO_T to use atts_read instead of atts_not_read 2019-01-22 08:11:52 -07:00
Ed Hartnett
c6a9948a8e removed unneeded var, fixed broken log statements that cause segfaults 2019-01-20 09:37:13 -07:00
Ed Hartnett
3c9a141ee3 moved function detect_preserve_dimids and made it static 2018-12-11 06:15:47 -07:00
Ed Hartnett
8d31f5b806 clean up 2018-11-07 14:23:55 -07:00
Ed Hartnett
6f4b4ac80d moving attribute HDF5 stuff to libhdf5 2018-11-07 14:21:57 -07:00
Ed Hartnett
5f36a3b425 merged master 2018-11-02 10:00:53 -06:00
Dennis Heimbigner
245961de00 re: github issues
https://github.com/Unidata/netcdf-c/issues/1168
    https://github.com/Unidata/netcdf-c/issues/1163
    https://github.com/Unidata/netcdf-c/issues/1162

This PR partially fixes memory leaks in the netcdf-c library,
in the ncdump utility, and in some test cases.

The netcdf-c library now runs memory clean with the assumption
that the --disable-utilities option is used. The primary remaining
problem is ncgen. Once that is fixed, I believe the netcdf-c library
will run memory clean with no limitations.

Notes
-----------
1. Memory checking was performed using gcc -fsanitize=address.
   Valgrind-based testing has yet to be performed.
2. The pnetcdf, hdf4, and examples code has not been tested.

Misc. Non-leak changes
1. Make tst_diskless2 only run when netcdf4 is enabled (issue 1162)
2. Fix CmakeLists.txt to turn off logging if ENABLE_NETCDF_4 is OFF
3. Isolated all my debug scripts into a single top-level directory
   called debug
4. Fix some USE_NETCDF4 dependencies in nc_test and nc_test4 Makefile.am
2018-10-30 20:48:12 -06:00
Ed Hartnett
452f75fadd commented out some tests 2018-10-22 15:04:44 -06:00
Ed Hartnett
958826d0af merged ejh_mem_check 2018-10-22 13:29:46 -06:00
Dennis Heimbigner
e40eb2e950 switch 2018-10-19 11:11:36 -06:00
Ed Hartnett
695e295734 now calling recursive function to close HDF5 objects in file 2018-10-18 03:29:21 -06:00
Ed Hartnett
fa86d3c488 continuing to separate hdf5/libsrc4 file close code 2018-10-18 03:20:39 -06:00
Ed Hartnett
c90ab24b48 moving towards separating HDF5 file close from netcdf4 file close 2018-10-18 03:17:38 -06:00
Dennis Heimbigner
979873f81d Fix provenance memory leak 2018-10-17 11:43:14 -06:00
Dennis Heimbigner
4636584d5b Revert/Improve nc_create + NC_DISKLESS behavior
re: https://github.com/Unidata/netcdf-c/issues/1154

Inadvertently, the behavior of NC_DISKLESS with nc_create() was
changed in release 4.6.1. Previously, the NC_WRITE flag needed
to be explicitly used with NC_DISKLESS in order to cause the
created file to be persisted to disk.

Additional analyis indicated that the current NC_DISKLESS
implementation was seriously flawed.

This PR attempts to clean up and regularize the situation with
respect to NC_DISKLESS control. One important aspect of diskless
operation is that there are two different notions of write.

1. The file is read-write vs read-only when using the netcdf API.
2. The file is persisted or not to disk at nc_close().

Previously, these two were conflated. The rules now are
as follows.

1. NC_DISKLESS + NC_WRITE means that the file is read/write using the netcdf API
2. NC_DISKLESS + NC_PERSIST means that the file is persisted to a disk file at nc_close.
3. NC_DISKLESS + NC_PERSIST + NC_WRITE means both 1 and 2.

The NC_PERSIST flag is new and takes over the obsolete NC_MPIPOSIX flag.
NC_MPIPOSIX is still defined, but is now an alias for the NC_MPIIO flag.

It is also now the case that for netcdf-4, NC_DISKLESS is independent
of NC_INMEMORY and in fact it is an error to specify both flags
simultaneously.

Finally, the MMAP code was fixed to use NC_PERSIST as well.
Also marked MMAP as deprecated.

Also added a test case to test various combinations of NC_DISKLESS,
NC_PERSIST, and NC_WRITE.

This PR affects a number of files and especially test cases
that used NC_DISKLESS.

Misc. Unrelated fixes
1. fixed some warnings in ncdump/dumplib.c
2018-10-10 13:32:17 -06:00
Ed Hartnett
d9ef143d1e separated cache code from hdf5file.c 2018-09-14 13:33:22 -06:00
Ed Hartnett
b501748f58 fixed merge error 2018-09-14 11:56:10 -06:00
Ed Hartnett
a009dab557 fixed inadvertant move of function 2018-09-14 11:39:57 -06:00
Ed Hartnett
e2839c120f
Merge branch 'master' into ejh_hdf5_sep_next_2 2018-09-14 11:33:59 -06:00
Ed Hartnett
eabb690949 fixing merge issue 2018-09-12 09:36:36 -06:00
Ed Hartnett
abf247de92 made dumpopenobjects static in attempt to get appvayor build working 2018-09-12 07:53:31 -06:00
Ed Hartnett
08a2dce904 merged master 2018-09-07 12:40:44 -06:00
Ed Hartnett
8390d572ad
Merge branch 'master' into ejh_hdf5_sep_next 2018-09-06 17:30:37 -06:00
Ward Fisher
784d777bff Merge branch 'master' into provenance.dmh 2018-09-06 15:13:09 -06:00
Ed Hartnett
86e002d794 merged master 2018-09-06 14:01:59 -06:00
Ed Hartnett
4213f10ed6 moved function 2018-09-06 13:57:39 -06:00
Ed Hartnett
80dc5bc0f7 merged master 2018-09-06 12:24:29 -06:00
Ed Hartnett
6c86ad8229 moved functions back 2018-09-06 12:19:17 -06:00
Ward Fisher
fbe0a18b1c
Merge branch 'master' into ejh_loop_cleanup_2 2018-09-05 11:22:55 -06:00
Dennis Heimbigner
d62a9e623c Fix the NC_INMEMORY code to work in all cases with HDF5 1.10.
re: github issue https://github.com/Unidata/netcdf-c/issues/1111

One of the less common use cases for the in-memory feature is
apparently failing with HDF5-1.10.x.  The fix is complicated and
requires significant changes to libhdf5/nc4memcb.c. The current
setup is detailed in the file docs/inmeminternal.dox.

Additionally, it was discovered that the program
nc_test/tst_inmemory.c, which is invoked by
nc_test/run_inmemory.sh, actually was failing because of the
above problem. But the failure is not detected since the script
does not return non-zero value.

Other Changes:
1. Fix nc_test_tst_inmemory to return errors correctly.
2. Make ncdap_tests/findtestserver.c and dap4_tests/findtestserver4.c
   be generated from ncdap_test/findtestserver.c.in.
3. Make LOG() print output to stderr instead of stdout to
   avoid contaminating e.g. ncdump output.
4. Modify the handling of NC_INMEMORY and NC_DISKLESS flags
   to properly handle that NC_DISKLESS => NC_INMEMORY. This
   affects a number of code pieces, especially memio.c.
2018-09-04 11:27:47 -06:00
Dennis Heimbigner
2ea1cf5f1b There was a request to extend the provenance information
stored in the _NCProperties attribute to allow two things:
1. capture of additional library dependencies (over and above
   hdf5)
2. Recognition of non-netcdf libraries that create netcdf-4 format
   files.

To this end, the _NCProperties format has been extended to be
and arbitrary set of key=value pairs separated by commas.
This new format has version = 2, and uses commas as the pair separator.
Thus the general form is:
    _NCProperties = "version=2,key1=value,key2=value2..." ;

This new version is accompanied by a new ./configure option of the form
    --with-ncproperties="key1=value1,key2=value2..."
that specifies pairs to add to the _NCProperties attribute for all
files created with that netcdf library.

At this point, what is missing is some programmatic way to
specify either all the pairs or additional pairs
to the _NCProperties attribute. Not sure of the best way
to do this.

Builders using non-netcdf libraries can specify
whatever they want in the key value pairs (as long
as the version=2 is specified first).

By convention, the primary library is expected to be the
the first pair after the leading version=2 pair, but this
is convention only and is neither required nor enforced.

Related changes:
1. Fixed the tests that check _NCProperties to properly operate with version=2.
2. When reading a version 1 _NCProperties attribute, convert it to look
   like a version 2 attribute.
2. Added some version 2 tests to ncdump/tst_fileinfo.c and
   ncdump/tst_fileinfo.sh

Misc Changes:
1. Fix minor problem in ncdap_test/testurl.sh where a parameter to
   buildurl needed to be quoted.
2. Minor fix to ncgen to swap switches -H and -h to be consistent
   with other utilities.
3. Document the -M flag in nccopy usage() and the nccopy man page.
4. Modify a test case to use the nccopy -M flag.
2018-08-25 21:44:41 -06:00
Ed Hartnett
8885c75ade removing unneeded lookups 2018-08-22 06:08:19 -06:00
Ed Hartnett
ff1b71a1e4 cleanup of unneeded find functions 2018-08-21 16:46:44 -06:00
Ed Hartnett
580fc89776 cleanup of NC4_abort 2018-08-21 16:41:57 -06:00
Ed Hartnett
f4c36b532f cleanup of NC4_abort 2018-08-21 16:40:32 -06:00
Ed Hartnett
8688b9cbf0 cleanup of NC4_sync 2018-08-21 16:37:12 -06:00
Ed Hartnett
42b9dc778f removing unneeded function nc4_rec_find_grp 2018-08-21 10:28:44 -06:00
Ed Hartnett
8d0844fa7d removing unneeded function calls 2018-08-21 10:20:32 -06:00
Ed Hartnett
e0bdcf5b64 clean up 2018-08-21 08:40:53 -06:00
Ed Hartnett
06db182eff cleaned up error handling in nc4_close_netcdf4_file 2018-08-21 08:32:39 -06:00
Ed Hartnett
f77350c66d testing error for HDF5 file with circular groups 2018-08-20 09:26:50 -06:00
Ward Fisher
5f89204bdb
Merge branch 'master' into ejh_func_cleanup3 2018-08-06 11:32:45 -06:00