Commit Graph

134 Commits

Author SHA1 Message Date
Ed Hartnett
9d40e0a2af made function static, removed unneeded if statement 2019-01-20 09:52:42 -07:00
Ed Hartnett
029aa5f626 now using hidden coordinates att to speed file opens 2018-12-20 05:59:31 -07:00
Ed Hartnett
6e3d284fcc write coordinates hidden attribute for all variables 2018-12-19 09:16:21 -07:00
Ed Hartnett
8ca5a1ac17
Merge branch 'master' into ejh_fast_var_prep 2018-12-12 07:05:45 -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
Ed Hartnett
28aa22f8cf cleanup and some comments for rec_write_metadata() 2018-12-11 09:33:46 -07:00
Ed Hartnett
8e1d781ea3 fixed error handling in write_dim(), also converted dimscale creation to H5Dcreate2() 2018-12-11 09:28:23 -07:00
Ed Hartnett
1a0cfb729e fixed error handling in write_var() 2018-12-11 08:10:08 -07:00
Ed Hartnett
26239a0897 cleaned up loop reattaching dimscales 2018-12-11 07:21:09 -07:00
Ed Hartnett
7b72d0b832 fixed error handling in attach_dimscales() 2018-12-11 07:15:46 -07:00
Ed Hartnett
39a0f822fa changed loop to use ncindexlookup() instead of looping through the names 2018-12-11 07:07:00 -07:00
Ed Hartnett
d7b657af4e cleaned up comments, changed loop to use ncindexlookup() instead of looping through the names 2018-12-11 06:43:27 -07:00
Ed Hartnett
53bdb74869 fixed error handling of write_netcdf4_dimid() 2018-12-11 06:38:23 -07:00
Ed Hartnett
3c9a141ee3 moved function detect_preserve_dimids and made it static 2018-12-11 06:15:47 -07:00
Ward Fisher
87110139f6 More synchronization of copyright stanzas. 2018-12-06 14:34:40 -07:00
Ed Hartnett
c824ad9ec9 further removal of libhdf5 code from libsrc4 2018-11-28 15:48:08 -07:00
Ed Hartnett
64b45b5e75 changes in support of separating HDF5 and libsrc4 2018-11-26 04:40:33 -07:00
Ed Hartnett
f6c3093fb3 moved convert function to libsrc4 2018-11-21 14:49:52 -07:00
Ed Hartnett
ab963e3d41 removing HDF5 type info from libsrc4 2018-11-20 14:24:40 -07:00
Ed Hartnett
52d58ecd2e changing over native_hdf_typeid 2018-11-20 10:49:26 -07:00
Ed Hartnett
5104262f6b changing types 2018-11-20 08:00:48 -07:00
Ed Hartnett
1d5307b600 merged in ejh_next_10 2018-11-19 09:25:04 -07:00
Ed Hartnett
3ec8b34bfb removed unneeded HDF5 fields 2018-11-19 09:23:43 -07:00
Ed Hartnett
262763c254 clean up 2018-11-16 10:01:31 -07:00
Ed Hartnett
8aa4577bef merged ejh_next_7 2018-11-15 16:40:14 -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
Ed Hartnett
d7fe095066 moving rest of var stuff 2018-11-13 16:59:07 -07:00
Ed Hartnett
4045588516 removing hid_t from NC_VAR_INFO_T 2018-11-13 16:10:34 -07:00
Ed Hartnett
9fee4db86b more var changes 2018-11-13 12:37:53 -07:00
Ed Hartnett
e1eeb309a1 more var changes to libhdf5 from libsrc4 2018-11-13 11:08:10 -07:00
Ed Hartnett
192a9b1b9e moving hdf5-specific var stuff 2018-11-13 10:18:29 -07:00
Ed Hartnett
49e0c1dc87 setting values in libhdf5 version of var hdf5-specific info 2018-11-13 09:00:15 -07:00
Ed Hartnett
87ddebac4b setting values for var hdf5 info 2018-11-13 07:31:59 -07:00
Ed Hartnett
825047b8f6 rest of moving HDF5 specific group info to libhdf5 2018-11-12 14:04:17 -07:00
Ed Hartnett
5c7fc1fb55 HDF5-specific group changes 2018-11-12 12:52:24 -07:00
Ed Hartnett
e74009c708 HDF5-specific group changes 2018-11-12 12:32:21 -07:00
Ed Hartnett
c59d6930f0 HDF5-specific group changes 2018-11-12 12:12:56 -07:00
Ed Hartnett
17552b7eb3 HDF5-specific group changes 2018-11-12 10:37:06 -07:00
Ed Hartnett
6b75bb483b allocating HDF5-specific group info struct for root group 2018-11-12 09:02:46 -07:00
Ed Hartnett
7534cb24fe cleanup 2018-11-08 11:12:38 -07:00
Ed Hartnett
e88b98daaa moving hdf5_objid field to hdf5-specific dim info 2018-11-08 11:05:20 -07:00
Ed Hartnett
856e4ead03 moved hdf_dimscaleid to hdf5-specific dim info 2018-11-08 10:55:21 -07:00
Ed Hartnett
7ab71a69bb more use of HDF5-specific dim info 2018-11-08 10:40:39 -07:00
Ed Hartnett
30da28edff using hdf5-specific dim info 2018-11-08 10:37:32 -07:00
Ed Hartnett
bff06f2c4d starting to use HDF5-specific dim info 2018-11-08 10:22:37 -07:00
Ed Hartnett
b85eec1bb8 starting to set hdf5-specific dim info struct 2018-11-08 10:07:59 -07:00
Ed Hartnett
3e80723525 continuing to find HDF5 specific dim info 2018-11-08 09:20:01 -07:00
Ed Hartnett
9373989931 allocating and freeing space for HDF5-specific dim info 2018-11-08 08:51:46 -07:00
Ed Hartnett
5faa166e8e removed duplicated constant 2018-08-25 05:51:50 -06:00
Ed Hartnett
8d0844fa7d removing unneeded function calls 2018-08-21 10:20:32 -06:00
Ed Hartnett
fda87a8d5f now check for max of 32 dims for a var in HDF5 file 2018-08-20 09:53:08 -06:00
Ed Hartnett
0ad7118064 no longer delete/re-create att if we dont have to 2018-08-20 05:10:34 -06:00
Ed Hartnett
e7b7430e75 trying to sort out nctest issue 2018-08-19 05:55:05 -06:00
Ed Hartnett
412c18a4a1 fixed error handling in read_coord_dimids 2018-08-18 05:59:30 -06:00
Ed Hartnett
2e7a7ea94e moved put and get vars functions from nc4hdf5.c to hdf5var.c 2018-08-09 06:44:38 -06:00
Ed Hartnett
5e9ffcaab3 renamed get_fill_value 2018-08-09 06:41:54 -06:00
Ed Hartnett
5a452c5815 bring in changes from lazy vars branch 2018-08-06 10:49:31 -06:00
Ed Hartnett
5631fa512a merged master 2018-07-24 01:51:51 -06:00
Ed Hartnett
a545c1526d further movement towards NC_HDF5_FILE_INFO_T 2018-07-19 13:00:34 -06:00
Ed Hartnett
2dd0ac6319 clean up 2018-07-16 04:50:15 -06:00
Ed Hartnett
786c5a8f2e moved hdf5 specific header stuff to hdf5internal.h 2018-07-12 07:05:21 -06:00
Ed Hartnett
697f033823 renamed NC_HDF5_FILE_INFO to NC_FILE_INFO 2018-06-22 07:08:09 -06:00
Ed Hartnett
2549bd7d70 clean up 2018-06-17 08:20:51 -06:00
Ed Hartnett
c7ab5573b4 removed get/put vara functions 2018-06-16 10:39:50 -06:00
Ed Hartnett
9230cb8aa9 now using put_vars too 2018-06-16 10:37:49 -06:00
Ed Hartnett
4f83e929c0 switch to vars 2018-06-16 08:38:52 -06:00
Ed Hartnett
11a51e47f3 cleanup 2018-06-16 08:35:30 -06:00
Ed Hartnett
6bfa4d4642 cleanup of put_vars handling of zero counts 2018-06-16 08:33:11 -06:00
Ed Hartnett
5e05d22bdf better handling of zero count for get_vars 2018-06-16 08:30:11 -06:00
Ed Hartnett
815f4f76dc clean up 2018-06-16 06:06:35 -06:00
Ed Hartnett
416da4cb4f took out is_long for vars functions 2018-06-16 05:55:50 -06:00
Ed Hartnett
3f9315d58f took out defaultvars 2018-06-16 05:52:07 -06:00
Ed Hartnett
b85f2e9e76 removed HDF5_CONVERT from vars functions 2018-06-16 05:38:39 -06:00
Ed Hartnett
19ae8b47d1 took out src_long and dest_long again. Getting good at it! ;-) 2018-06-16 05:33:04 -06:00
Ed Hartnett
037a3cb58c reverting 2018-06-09 06:17:52 -06:00
Ed Hartnett
09366bf43b removed longs from conver_type again 2018-06-09 06:14:14 -06:00
Ward Fisher
1d789d9d39 Additional reconciliation 2018-06-08 15:50:39 -06:00
Ward Fisher
df4942d280 Merge branch 'master' into vars.dmh 2018-06-08 15:50:28 -06:00
Ward Fisher
595f39ce42 Corrected an unlikely but possible passage of a null pointer to memcpy. 2018-06-08 11:18:08 -06:00
Ed Hartnett
9a2782b56c got long working with master 2018-06-05 14:40:49 -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
40c552bd43 cleaned up nc4hdf5.c 2018-05-16 03:18:50 -06:00
Ed Hartnett
af70577e6d merged master 2018-05-09 14:43:42 -06:00
Ed Hartnett
5526ca65d1 created libhdf5, moved some files 2018-05-08 11:58:01 -06:00