Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.6.3 prep, upstream propegation #1332

Merged
merged 42 commits into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5d1f639
Updated release notes.
WardF Feb 21, 2019
d6c8453
Added fenceposting around H5free_memory, H5allocate_memory, H5resize_…
WardF Feb 21, 2019
3892b43
Syntax tweak.
WardF Feb 21, 2019
9c7bdbb
Fix typo in tst_filterparser.c
opoplawski Feb 24, 2019
1eb7e7a
added comment describing netcdf-4 behavior in data mode dim renames w…
edhartnett Feb 25, 2019
f02d115
documentation work
edhartnett Feb 25, 2019
953e0ab
documentation work
edhartnett Feb 25, 2019
3997511
documentation work
edhartnett Feb 25, 2019
05d549e
fixed doxygen warnings in RELEASE_NOTES.md
edhartnett Feb 25, 2019
7b373ec
fixed documentation warnings
edhartnett Feb 25, 2019
fba4c19
documentation cleanup
edhartnett Feb 25, 2019
f83c8a5
documentation of dim rename for netcdf-4 vs classic
edhartnett Feb 25, 2019
2dd178b
documentation cleanup
edhartnett Feb 25, 2019
7dc9097
cleaned away uncorrect section
edhartnett Feb 25, 2019
0e204eb
formatting cleanup
edhartnett Feb 25, 2019
3277ef2
formatting cleanup
edhartnett Feb 25, 2019
2f8f5ba
more documentation cleanup
edhartnett Feb 25, 2019
c620d8c
more documentation cleanup
edhartnett Feb 25, 2019
c2c2f8e
cleanup of var docs
edhartnett Feb 25, 2019
160186d
more doc cleanup
edhartnett Feb 25, 2019
d47006f
fixing some documentation issues in hdf5var.c
edhartnett Feb 25, 2019
d08bbe0
Merge branch 'master' into v4.6.3-dev-branch.wif
WardF Feb 25, 2019
ea5e7f9
fixing some documentation issues in hdf5var.c
edhartnett Feb 25, 2019
d0a6e9c
more work on var documentation
edhartnett Feb 25, 2019
26f4bfd
added comment about function ordering
edhartnett Feb 25, 2019
6d86aab
Modify tst_filterparser to use baseline array
DennisHeimbigner Feb 25, 2019
482e5cc
Added inclusion of config.h
WardF Feb 25, 2019
5820705
Merge branch 'v4.6.3-dev-branch.wif' of github.com:Unidata/netcdf-c i…
WardF Feb 25, 2019
9b493b9
Modified Makefile.am in plugins/ directory
WardF Feb 25, 2019
c7529d3
Refactor
WardF Feb 26, 2019
18c403a
Prepping for 4.6.3 release, bumping to subsequent version in dev branch.
WardF Feb 26, 2019
bac16d6
Merge branch 'master' into v4.6.3-dev-branch.wif
WardF Feb 26, 2019
b933a31
Some .travis.yml scaffolding.
WardF Feb 27, 2019
980082a
Merge remote-tracking branch 'origin/fixfilterparser.dmh' into v4.6.3…
WardF Feb 27, 2019
e906114
Merge branch 'typo' of https://github.com/opoplawski/netcdf-c into v4…
WardF Feb 27, 2019
f940969
Fix typo, exploring solution to https://github.com/Unidata/netcdf-c/i…
WardF Feb 27, 2019
eb9f609
Bringing netcdf.pc generated by cmake in line with netcdf.pc generate…
WardF Feb 27, 2019
62109e5
Merge branch 'ejh_rename_docs' of https://github.com/NetCDF-World-Dom…
WardF Feb 27, 2019
371cb33
Updated release notes. Starting process of release.
WardF Feb 27, 2019
513481c
Updated release notes to reflect date of 4.6.3 release.
WardF Feb 27, 2019
415c19d
Corrected syntax error.
WardF Feb 27, 2019
a4d18bd
Bumped SO version in line with http://www.gnu.org/software/libtool/ma…
WardF Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,8 @@ IF(USE_HDF5 OR ENABLE_NETCDF_4)

CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5Pset_libver_bounds "" HDF5_HAS_LIBVER_BOUNDS)
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5free_memory "" HDF5_HAS_H5FREE)
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5allocate_memory "" HDF5_HAS_ALLOCATE_MEMORY)
CHECK_LIBRARY_EXISTS(${HDF5_C_LIBRARY_hdf5} H5resize_memory "" HDF5_HAS_RESIZE_MEMORY)

IF(HDF5_PARALLEL)
SET(HDF5_CC h5pcc)
Expand Down
7 changes: 4 additions & 3 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ This file contains a high-level description of this package's evolution. Release

## 4.6.3 - TBD

## 4.6.2.1 - February 15, 2019

### Maintenance Release

* Now always write hidden coordinates attribute, which allows faster file opens when present. See [Github #1262](https://github.com/Unidata/netcdf-c/issues/1262) for more information.
* Some fixes for rename, including fix for renumbering of varids after a rename (#1307), renaming var to dim without coordinate var. See [Github #1297](https://github.com/Unidata/netcdf-c/issues/1297).
* Fix of NULL parameter causing segfaults in put_vars functions. See [Github #1265](https://github.com/Unidata/netcdf-c/issues/1265) for more information.
* Fix of --enable-benchmark benchmark tests [Github #1211](https://github.com/Unidata/netcdf-c/issues/1211)
* Update the license from the home-brewed NetCDF license to the standard 3-Clause BSD License. This change does not result in any new restrictions; it is merely the adoption of a standard, well-known and well-understood license in place of the historic NetCDF license written at Unidata. This is part of a broader push by Unidata to adopt modern, standardized licensing.
* [BugFix] Corrected DAP-releated issues on big-endian machines. See [Github #1321](https://github.com/Unidata/netcdf-c/issues/1321), [Github #1302](https://github.com/Unidata/netcdf-c/issues/1302) for more information.
* [BugFix][Enhancement] Various and sundry bugfixes and performance enhancements, thanks to @edhartnett, @gsjaardema, @t-b, @wkliao, and all of our other contributors.
Expand Down
6 changes: 6 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,12 @@ are set when opening a binary file on Windows. */
nc4file. */
#cmakedefine HDF5_HAS_H5FREE 1

/* if true, H5allocate_memory() will be used. */
#cmakedefine HDF5_HAS_ALLOCATE_MEMORY 1

/* if true, H5resize_memory() will be used. */
#cmakedefine HDF5_HAS_RESIZE_MEMORY 1

/* if true, hdf5 has parallelism enabled */
#cmakedefine HDF5_PARALLEL 1

Expand Down
10 changes: 9 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ if test "x$enable_hdf5" = xyes; then

# H5Pset_fapl_mpiposix and H5Pget_fapl_mpiposix have been removed since HDF5 1.8.12.
# Use H5Pset_fapl_mpio and H5Pget_fapl_mpio, instead.
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops])
AC_CHECK_FUNCS([H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5resize_memory H5allocate_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops])

# Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then
Expand Down Expand Up @@ -1062,6 +1062,14 @@ if test "x$enable_hdf5" = xyes; then
AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.])
fi

if test "x$ac_cv_func_H5allocate_memory" = xyes; then
AC_DEFINE([HDF5_HAS_ALLOCATE_MEMORY], [1], [if true, H5allocate_memory() will be used.])
fi

if test "x$ac_cv_func_H5resize_memory" = xyes; then
AC_DEFINE([HDF5_HAS_resize_MEMORY], [1], [if true, H5resize_memory() will be used.])
fi

if test "x$ac_cv_func_H5Pset_libver_bounds" = xyes; then
AC_DEFINE([HDF5_HAS_LIBVER_BOUNDS], [1], [if true, netcdf4 file properties will be set using H5Pset_libver_bounds])
fi
Expand Down
25 changes: 25 additions & 0 deletions plugins/H5Zbzip2.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
/* Older versions of the hdf library may define H5PL_type_t here */
#include <H5PLextern.h>

#include "config.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to put config.h before any other includes. Some of the settings in config.h may well impact other includes, so config.h has to come first.


#ifndef DLL_EXPORT
#define DLL_EXPORT
#endif
Expand Down Expand Up @@ -90,7 +92,11 @@ size_t H5Z_filter_bzip2(unsigned int flags, size_t cd_nelmts,

/* Prepare the output buffer. */
outbuflen = nbytes * 3 + 1; /* average bzip2 compression ratio is 3:1 */
#ifdef HDF5_HAS_ALLOCATE_MEMORY
outbuf = H5allocate_memory(outbuflen,0);
#else
outbuf = (char*)malloc(outbuflen * sizeof(char));
#endif
if (outbuf == NULL) {
fprintf(stderr, "memory allocation failed for bzip2 decompression\n");
goto cleanupAndFail;
Expand Down Expand Up @@ -123,7 +129,11 @@ size_t H5Z_filter_bzip2(unsigned int flags, size_t cd_nelmts,
if (ret != BZ_STREAM_END && stream.avail_out == 0) {
/* Grow the output buffer. */
newbuflen = outbuflen * 2;
#ifdef HDF5_HAS_RESIZE_MEMORY
newbuf = H5resize_memory(outbuf, newbuflen);
#else
newbuf = realloc(outbuf,newbuflen);
#endif
if (newbuf == NULL) {
fprintf(stderr, "memory allocation failed for bzip2 decompression\n");
goto cleanupAndFail;
Expand Down Expand Up @@ -167,7 +177,12 @@ size_t H5Z_filter_bzip2(unsigned int flags, size_t cd_nelmts,

/* Prepare the output buffer. */
outbuflen = nbytes + nbytes / 100 + 600; /* worst case (bzip2 docs) */
#ifdef HDF5_HAS_ALLOCATE_MEMORY
outbuf = H5allocate_memory(outbuflen,0);
#else
outbuf = (char*)malloc(outbuflen * sizeof(char));
#endif

if (outbuf == NULL) {
fprintf(stderr, "memory allocation failed for bzip2 compression\n");
goto cleanupAndFail;
Expand All @@ -185,13 +200,23 @@ size_t H5Z_filter_bzip2(unsigned int flags, size_t cd_nelmts,
}

/* Always replace the input buffer with the output buffer. */
#ifdef HDF5_HAS_H5FREE
H5free_memory(*buf);
#else
free(*buf);
#endif

*buf = outbuf;
*buf_size = outbuflen;
return outdatalen;

cleanupAndFail:
if (outbuf)
#ifdef HDF5_HAS_H5FREE
H5free_memory(outbuf);
#else
free(outbuf);
#endif

return 0;
}
28 changes: 23 additions & 5 deletions plugins/H5Zmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
#include <H5PLextern.h>
#include "h5misc.h"

#include "config.h"

#ifndef DLL_EXPORT
#define DLL_EXPORT
#endif
Expand Down Expand Up @@ -109,21 +111,37 @@ H5Z_filter_test(unsigned int flags, size_t cd_nelmts,
if (flags & H5Z_FLAG_REVERSE) {

/* Replace buffer */
#ifdef HDF5_HAS_ALLOCATE_MEMORY
newbuf = H5allocate_memory(*buf_size,0);
#else
newbuf = malloc(*buf_size * sizeof(void));
#endif
if(newbuf == NULL) abort();
memcpy(newbuf,*buf,*buf_size);
/* reclaim old buffer */
H5free_memory(*buf);
/* reclaim old buffer */
#ifdef HDF5_HAS_H5FREE
H5free_memory(*buf);
#else
free(*buf);
#endif
*buf = newbuf;

} else {

/* Replace buffer */
newbuf = H5allocate_memory(*buf_size,0);
if(newbuf == NULL) abort();
#ifdef HDF5_HAS_ALLOCATE_MEMORY
newbuf = H5allocate_memory(*buf_size,0);
#else
newbuf = malloc(*buf_size * sizeof(void));
#endif
if(newbuf == NULL) abort();
memcpy(newbuf,*buf,*buf_size);
/* reclaim old buffer */
H5free_memory(*buf);
#ifdef HDF5_HAS_H5FREE
H5free_memory(*buf);
#else
free(*buf);
#endif
*buf = newbuf;

}
Expand Down