Commit Graph

150 Commits

Author SHA1 Message Date
Dennis Heimbigner
a6b04c0c66 Extend nccopy -F option syntax.
A user suggested that the nccopy -F option
syntax should be extended to support specification
of multiple (or all) variables in a single -F option.

The new syntax allows:

1. '*' as the name of the variable; this means apply the
   filter to all variables in the data set.
2. *var1|var2|...* as the variable name to indicate that the filter
   should be applied to the multiple specified variables.
2019-02-08 18:48:17 -07:00
Ward Fisher
6511599a6d Corrected issue in support of https://github.com/Unidata/netcdf-c/issues/1310 2019-02-07 12:43:07 -07:00
Ed Hartnett
59ee728b93 fixed parallel build problem with tst_files2.c when --enable-benchmarks is used 2019-01-20 10:07:13 -07:00
Ed Hartnett
35017d9549 fixed mistake in Makefile.am 2019-01-02 06:21:11 -07:00
Ed Hartnett
c15c3fa8d5 cleaned up makefile.am, added config.h to some tests 2019-01-02 05:31:15 -07:00
Ed Hartnett
dc982efb3d moved tst_attsperf to be with rest of benchmarks 2018-12-17 08:44:36 -07:00
Ed Hartnett
89b2c48d4c added benchmark program tst_wrf_reads.c 2018-12-11 06:32:25 -07:00
Dennis Heimbigner
751300ec59 Fix more memory leaks in netcdf-c library
This is a follow up to PR https://github.com/Unidata/netcdf-c/pull/1173

Sorry that it is so big, but leak suppression can be complex.

This PR fixes all remaining memory leaks -- as determined by
-fsanitize=address, and with the exceptions noted below.

Unfortunately. there remains a significant leak that I cannot
solve. It involves vlens, and it is unclear if the leak is
occurring in the netcdf-c library or the HDF5 library.

I have added a check_PROGRAM to the ncdump directory to show the
problem.  The program is called tst_vlen_demo.c To exercise it,
build the netcdf library with -fsanitize=address enabled. Then
go into ncdump and do a "make clean check".  This should build
tst_vlen_demo without actually executing it.  Then do the
command "./tst_vlen_demo" to see the output of the memory
checker.  Note the the lost malloc is deep in the HDF5 library
(in H5Tvlen.c).

I am temporarily working around this error in the following way.
1. I modified several test scripts to not execute known vlen tests
   that fail as described above.
2. Added an environment variable called NC_VLEN_NOTEST.
   If set, then those specific tests are suppressed.

This should mean that the --disable-utilities option to
./configure should not need to be set to get a memory leak clean
build.  This should allow for detection of any new leaks.

Note: I used an environment variable rather than a ./configure
option to control the vlen tests. This is because it is
temporary (I hope) and because it is a bit tricky for shell
scripts to access ./configure options.

Finally, as before, this only been tested with netcdf-4 and hdf5 support.
2018-11-15 10:00:38 -07: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
Dennis Heimbigner
8072d1f6bb Modify DAP2 and DAP4 to optionally allow Fillvalue/Variable mismatch
re: issue https://github.com/Unidata/netcdf-c/issues/1151

Modify DAP2 and DAP4 code to handle case when _FillValue type is not
same as the parent variable type.

Specifically:
1. Define a parameter [fillmismatch] to allow this mismatch;
   default is to disallow.
2. If allowed, forcibly change the type of the _FillValue to match
   the parent variable.
3. If allowed Convert the values to match new type
4. Generate a log message
5. if not allowed, then fail

Implementing this required some changes to ncdap_test/dapcvt.c
Also added test cases.

Minor Unrelated Changes:
1. There were a number of warnings about e.g.
   assigning a const char* to a char*. Fix these
2. In nccopy.1, replace .NP with .IP "n"
   (re PR https://github.com/Unidata/netcdf-c/pull/1144)
3. fix minor error in ncdump/ocprint
2018-10-01 15:51:43 -06:00
Ed Hartnett
8847c843fb further cleanup for benchmark builds 2018-08-24 12:48:42 -06:00
Ed Hartnett
e1bd6f2c20 fixing cmake benchmarks, also removing unneeded run_bm.sh 2018-08-24 09:04:01 -06:00
Ed Hartnett
1310066494 getting parallel benchmarks to work, cleanup of benchmark scripts 2018-08-24 08:59:58 -06:00
Ed Hartnett
77d3a6db22 removed tst_ar5 from Makefile.am and cmake build 2018-08-24 07:11:51 -06:00
Ed Hartnett
933d91a556 fixed many benchmark warnings 2018-08-23 08:21:55 -06:00
Ed Hartnett
077a96471e got tst_chunks3 benchmark working 2018-08-23 07:02:44 -06:00
Ed Hartnett
a102f1c55d got knmi benchmark test working with parallel builds 2018-08-23 06:32:04 -06:00
Ed Hartnett
563052d4b8 removed unneeded enum test 2018-08-21 06:42:10 -06:00
Ed Hartnett
f77350c66d testing error for HDF5 file with circular groups 2018-08-20 09:26:50 -06:00
Ed Hartnett
5b2f6ecebc changed literal in netcdf.h 2018-08-18 05:22:07 -06:00
Ed Hartnett
9cf272f24e merged ejh_vars_null_count_issue_2 2018-08-18 04:21:21 -06:00
Ed Hartnett
1b318a01fb getting automake build working 2018-08-16 10:55:11 -06:00
Ed Hartnett
56a57a57f0 bring in changes from lazy vars branch 2018-08-06 10:57:19 -06:00
Dennis Heimbigner
30a4dea21c Disable tst_varsperf; should only be run manually 2018-06-26 15:14:31 -06:00
Ed Hartnett
eafe151f13 added test 2018-06-19 14:59:07 -06:00
Ward Fisher
5fe7d0ffad
Merge branch 'master' into ejh_udf 2018-06-08 16:52:20 -06:00
Ward Fisher
df4942d280 Merge branch 'master' into vars.dmh 2018-06-08 15:50:28 -06:00
Ed Hartnett
5112ef8c72 merged master 2018-06-07 07:27:47 -06:00
Dennis Heimbigner
ee509ff4f3 Re-Implement the nc_get/put_vars operations for netcdf-4 using the
corresponding HDF5 operations.

re: github issue https://github.com/Unidata/netcdf-c/issues/908
also in reference to https://github.com/pydata/xarray/issues/2004

The netcdf-c library has implemented the nc_get_vars and nc_put_vars
operations as element at a time. This has resulted in very slow
operation.

This pr attempts to improve the situation for netcdf-4/hdf5 files
by using the slab operations provided by the hdf5 library. The new
implementation passes the get/put vars stride information down to
the hdf5 slab operations.

The result appears to improve performance significantly. Some simple
tests on large 2-D arrays shows speedups in excess of 150.

Misc. other changes:
1. fix bug in ncgen/semantics.c; using a list's allocated length
   instead of actual length.
2. Added a temporary hook in the netcdf library plus a performance
   test case (tst_varsperf.c) to estimate the speedup. After users
   have had some experience with this, I will remove it, probably
   after the 4.7 release.
2018-05-22 16:50:52 -06:00
Ed Hartnett
fd23cb3cf2 cleanup makefile, develop test 2018-05-14 08:11:32 -06:00
Ed Hartnett
350946b1e0 user defined formats only if netcdf-4 is built 2018-05-13 16:03:04 -06:00
Ward Fisher
65f7dd0397
Merge branch 'master' into ejh_move_tests 2018-04-23 13:36:53 -06:00
Ed Hartnett
b5e282996c moved tests 2018-04-23 03:19:11 -06: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
e2e2c2117f
Merge branch 'master' into index.dmh 2018-04-02 18:13:34 -06:00
Ed Hartnett
af79dfa14d new method of using valgrind 2018-03-28 13:54:05 -06:00
Dennis Heimbigner
cc136cad08 Add a configurable "test case" that will create
and then open a file with a lot of metadata.
The test is configurable to determine the parameters
for the created metadata.
2018-03-17 16:25:13 -06:00
Ed Hartnett
17f7a76356 moved HDF4 tests 2018-03-05 03:45:18 -07:00
Ed Hartnett
45329862a8 removed valgrind stuff 2018-02-27 08:36:12 -07:00
Ed Hartnett
32e2798dde added rename test 2018-02-12 10:08:59 -07:00
Ward Fisher
d0339c8902 Merge branch 'pr-catchup' into v4.6.0-release-branch 2018-01-24 15:51:24 -06:00
Ed Hartnett
ef65bdf9af merged 786 2018-01-20 06:06:25 -07:00
Ed Hartnett
da928c1b83 merged 780 2018-01-20 06:05:34 -07:00
Ed Hartnett
986673ff49 attempted to fix parallel build issue 2018-01-19 06:53:04 -07:00
Ward Fisher
0f5fc7222b
Merge branch 'master' into plugins.dmh 2018-01-18 15:46:50 -07:00
Ed Hartnett
001483505f rehabilitated tst_types.c 2018-01-18 05:34:52 -07:00
Ed Hartnett
9949a11155 removed some unneeded HDF4 checks, added some needed parameter checks 2018-01-17 09:09:58 -07:00
Ward Fisher
ac5aabc3fc Tweaked for parallel autoconf tests with filters. 2018-01-16 17:49:21 -07:00
Dennis Heimbigner
99fccab359 1. Keep up to date by merging master
2. Fixed plugin building (nc_test4/hdf5plugins)
   to be done properly by cmake and automake.
4. Duplicated part of the nc_test4 filter test code
   in examples/C

An incomplete and untested set of hooks exist
for OS-X in nc_test4/findplugins.in. They need testing.
2018-01-16 11:00:09 -07:00
Ward Fisher
0ef6f3415a Making tst_hdf4_read_var.sh dependent on tst_interops2. 2017-12-06 15:07:54 -07:00