From bfc039550751118a400351bad921b63d4bbd274f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 22 Feb 2015 05:44:41 -0500 Subject: [svn-r26272] Merge of r26071 from features/autotools_rework Removes the --with-default-vfd option from configure. This was basically useless and only allowed selecting the stdio VFD. Since this is a demo VFD and not really a production VFD, we decided to retire this option. Fixes: HDFFV-9081 Tested on: h5committest NOTE: platypus cmake fails, but this is not a new error. --- config/cmake/H5pubconf.h.in | 3 --- configure | 42 +----------------------------------------- configure.ac | 29 +---------------------------- src/H5config.h.in | 3 --- src/H5private.h | 4 ++++ 5 files changed, 6 insertions(+), 75 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 05058d2..310fff2 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -57,9 +57,6 @@ /* Define the default plugins path to compile */ #cmakedefine H5_DEFAULT_PLUGINDIR "@H5_DEFAULT_PLUGINDIR@" -/* Define the default virtual file driver to compile */ -#cmakedefine H5_DEFAULT_VFD @H5_DEFAULT_VFD@ - /* Define if `dev_t' is a scalar */ #cmakedefine H5_DEV_T_IS_SCALAR @H5_DEV_T_IS_SCALAR@ diff --git a/configure b/configure index 36ded58..5392f18 100755 --- a/configure +++ b/configure @@ -921,7 +921,6 @@ enable_using_memchecker enable_parallel with_mpe enable_filters -with_default_vfd enable_direct_vfd with_default_plugindir enable_dconv_exception @@ -1659,8 +1658,6 @@ Optional Packages: --with-pthread=DIR Specify alternative path to Pthreads library when thread-safe capability is built --with-mpe=DIR Use MPE instrumentation [default=no] - --with-default-vfd=driver - Specify default file driver [default=sec2] --with-default-plugindir=location Specify default location for plugins [default="/usr/local/hdf5/lib/plugin"] @@ -28267,6 +28264,7 @@ $as_echo "#define HAVE_MPE 1" >>confdefs.h fi fi + ## ---------------------------------------------------------------------- ## Turn on internal I/O filters by setting macros in header files ## Internal I/O filters are contained entirely within the library and do @@ -28340,44 +28338,6 @@ $as_echo "#define HAVE_FILTER_SCALEOFFSET 1" >>confdefs.h done fi -## -------------------------------------------------------------------------- -## Should the Default Virtual File Driver be compiled? -## - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Default Virtual File Driver definition" >&5 -$as_echo_n "checking for Default Virtual File Driver definition... " >&6; } - -# Check whether --with-default-vfd was given. -if test "${with_default_vfd+set}" = set; then : - withval=$with_default_vfd; -else - withval=sec2 -fi - - -if test "X$withval" = "Xsec2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - default_vfd=yes - vfd_define=H5FD_SEC2 -elif test "X$withval" = "Xstdio"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - default_vfd=yes - vfd_define=H5FD_STDIO -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - default_vfd=no -fi - -if test "X$default_vfd" = "Xyes"; then - -cat >>confdefs.h <<_ACEOF -#define DEFAULT_VFD $vfd_define -_ACEOF - -fi ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd diff --git a/configure.ac b/configure.ac index aff469f..812ea9a 100644 --- a/configure.ac +++ b/configure.ac @@ -2464,6 +2464,7 @@ if test -n "$PARALLEL"; then fi fi + ## ---------------------------------------------------------------------- ## Turn on internal I/O filters by setting macros in header files ## Internal I/O filters are contained entirely within the library and do @@ -2531,34 +2532,6 @@ if test -n "$FILTERS"; then done fi -## -------------------------------------------------------------------------- -## Should the Default Virtual File Driver be compiled? -## - -AC_MSG_CHECKING([for Default Virtual File Driver definition]) -AC_ARG_WITH([default-vfd], - [AS_HELP_STRING([--with-default-vfd=driver], - [Specify default file driver - [default=sec2]])],, - withval=sec2) - -if test "X$withval" = "Xsec2"; then - AC_MSG_RESULT([yes]) - default_vfd=yes - vfd_define=H5FD_SEC2 -elif test "X$withval" = "Xstdio"; then - AC_MSG_RESULT([yes]) - default_vfd=yes - vfd_define=H5FD_STDIO -else - AC_MSG_RESULT([no]) - default_vfd=no -fi - -if test "X$default_vfd" = "Xyes"; then - AC_DEFINE_UNQUOTED([DEFAULT_VFD], [$vfd_define], - [Define the default virtual file driver to compile]) -fi ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd diff --git a/src/H5config.h.in b/src/H5config.h.in index eb18a5e..0c09fe6 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -20,9 +20,6 @@ /* Define the default plugins path to compile */ #undef DEFAULT_PLUGINDIR -/* Define the default virtual file driver to compile */ -#undef DEFAULT_VFD - /* Define if `dev_t' is a scalar */ #undef DEV_T_IS_SCALAR diff --git a/src/H5private.h b/src/H5private.h index 32b605b..f70530d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -160,6 +160,10 @@ #include #endif +/* Define the default VFD for this platform. + * Since the removal of the Windows VFD, this is sec2 for all platforms. + */ +#define H5_DEFAULT_VFD H5FD_SEC2 #ifdef H5_HAVE_WIN32_API /* The following two defines must be before any windows headers are included */ -- cgit v0.12 From 7c134068147c8313fb4303b4d6608a665880e22e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 22 Feb 2015 10:09:26 -0500 Subject: [svn-r26275] Merge of r26042, 26083, 26084, 26085 from features/autotools_rework - Updated configure.ac so that the direct VFD can now be built without specifying _GNU_SOURCE, etc. on the command line. - The direct VFD is now disabled by default. It was previously enabled, but the configuration script couldn't configure it properly, making it a moot point. Fixes: HDFFV-9057, HDFFV-7567, HDFFV-9088, HDFFV-7566 Tested on: h5committest jam w/ direct VFD (*very* slow!) NOTE: platypus cmake fails, but this is not a new error. --- configure | 125 +++++++++++++++++++++++------------------------------- configure.ac | 72 +++++++++++++++++-------------- src/H5config.h.in | 2 +- 3 files changed, 94 insertions(+), 105 deletions(-) diff --git a/configure b/configure index 5392f18..80fe73b 100755 --- a/configure +++ b/configure @@ -1616,8 +1616,9 @@ Optional Features: --enable-filters=all Turn on all internal I/O filters. One may also specify a comma-separated list of filters or the word no. The default is all internal I/O filters. - --enable-direct-vfd Build the Direct I/O Virtual File Driver - [default=yes] + --enable-direct-vfd Build the direct I/O virtual file driver (VFD). This + is based on the POSIX (sec2) VFD and requires the + open() call to take the O_DIRECT flag. [default=no] --enable-dconv-exception if exception handling functions is checked during data conversions [default=yes] @@ -23099,19 +23100,28 @@ case "$host_cpu-$host_vendor-$host_os" in ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen ## defined correctly in . + ## ## This flag was removed from h5cc as of 2009-10-17 when it was found ## that the flag broke compiling netCDF-4 code with h5cc, but kept in ## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen ## is used only by H5_debug_mask which is used only when debugging in ## H5_init_library (all in H5.c). When the flag was removed this was ## the only compile failure noted. + ## ## This was originally defined as _POSIX_SOURCE which was updated to ## _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX ## functionality so clock_gettime and CLOCK_MONOTONIC are defined - ## correctly. + ## correctly. This was later updated to 200112L so that + ## posix_memalign() is visible for the direct VFD code on Linux + ## systems. + ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - H5_CPPFLAGS="-D_POSIX_C_SOURCE=199506L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + + ## Need to add this so that O_DIRECT is visible for the direct + ## VFD on Linux systems. + AM_CPPFLAGS="-D_GNU_SOURCE $AM_CPPFLAGS" ## Also add BSD support on Linux systems, so defines ## __USE_BSD, which is required to get the prototype for strdup @@ -28343,94 +28353,65 @@ fi ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Direct Virtual File Driver support" >&5 -$as_echo_n "checking for Direct Virtual File Driver support... " >&6; } +## Check these regardless. If the checks are moved inside the main +## direct VFD block, the output is nested. -# Check whether --enable-direct-vfd was given. -if test "${enable_direct_vfd+set}" = set; then : - enableval=$enable_direct_vfd; DIRECT_VFD=$enableval -else - DIRECT_VFD=yes -fi - - -if test "$DIRECT_VFD" = "yes"; then - if ${hdf5_cv_direct_io+:} false; then : +if ${hdf5_cv_direct_io+:} false; then : $as_echo_n "(cached) " >&6 else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include - #include - int main(void) - { - int fid; - if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0) - exit(1); - close(fid); - remove("tst_file"); - exit (0); - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -posix_memalign() - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : + ac_fn_c_check_decl "$LINENO" "O_DIRECT" "ac_cv_have_decl_O_DIRECT" "#include +" +if test "x$ac_cv_have_decl_O_DIRECT" = xyes; then : hdf5_cv_direct_io=yes else hdf5_cv_direct_io=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +fi + +if ${hdf5_cv_posix_memalign+:} false; then : + $as_echo_n "(cached) " >&6 else - hdf5_cv_direct_io=no + ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" +if test "x$ac_cv_func_posix_memalign" = xyes; then : + hdf5_cv_posix_memalign=yes +else + hdf5_cv_posix_memalign=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the direct I/O virtual file driver (VFD) is enabled" >&5 +$as_echo_n "checking if the direct I/O virtual file driver (VFD) is enabled... " >&6; } + +# Check whether --enable-direct-vfd was given. +if test "${enable_direct_vfd+set}" = set; then : + enableval=$enable_direct_vfd; DIRECT_VFD=$enableval +else + DIRECT_VFD=no fi - if test ${hdf5_cv_direct_io} = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +if test "X$DIRECT_VFD" = "Xyes"; then + if test ${hdf5_cv_direct_io} = "yes" && test ${hdf5_cv_posix_memalign} = "yes" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HAVE_DIRECT 1" >>confdefs.h - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - DIRECT_VFD=no - fi + DIRECT_VFD=no + as_fn_error $? "The direct VFD was requested but cannot be built. This is either + due to O_DIRECT not being found in fcntl.h or a lack of + posix_memalign() on your system. Please re-configure without + specifying --enable-direct-vfd." "$LINENO" 5 + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5 -$as_echo "suppressed" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "X$DIRECT_VFD" = "Xyes"; then diff --git a/configure.ac b/configure.ac index 812ea9a..3b8b2eb 100644 --- a/configure.ac +++ b/configure.ac @@ -1110,19 +1110,28 @@ case "$host_cpu-$host_vendor-$host_os" in ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen ## defined correctly in . + ## ## This flag was removed from h5cc as of 2009-10-17 when it was found ## that the flag broke compiling netCDF-4 code with h5cc, but kept in ## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen ## is used only by H5_debug_mask which is used only when debugging in ## H5_init_library (all in H5.c). When the flag was removed this was ## the only compile failure noted. + ## ## This was originally defined as _POSIX_SOURCE which was updated to ## _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX ## functionality so clock_gettime and CLOCK_MONOTONIC are defined - ## correctly. + ## correctly. This was later updated to 200112L so that + ## posix_memalign() is visible for the direct VFD code on Linux + ## systems. + ## ## POSIX feature information can be found in the gcc manual at: ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html - H5_CPPFLAGS="-D_POSIX_C_SOURCE=199506L $H5_CPPFLAGS" + H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS" + + ## Need to add this so that O_DIRECT is visible for the direct + ## VFD on Linux systems. + AM_CPPFLAGS="-D_GNU_SOURCE $AM_CPPFLAGS" ## Also add BSD support on Linux systems, so defines ## __USE_BSD, which is required to get the prototype for strdup @@ -2537,40 +2546,39 @@ fi ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## -AC_MSG_CHECKING([for Direct Virtual File Driver support]) +## Check these regardless. If the checks are moved inside the main +## direct VFD block, the output is nested. + +AC_CACHE_VAL([hdf5_cv_direct_io], + AC_CHECK_DECL([O_DIRECT], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no], [[#include ]])) +AC_CACHE_VAL([hdf5_cv_posix_memalign], + AC_CHECK_FUNC([posix_memalign], [hdf5_cv_posix_memalign=yes], [hdf5_cv_posix_memalign=no])) + +AC_MSG_CHECKING([if the direct I/O virtual file driver (VFD) is enabled]) AC_ARG_ENABLE([direct-vfd], [AS_HELP_STRING([--enable-direct-vfd], - [Build the Direct I/O Virtual File Driver - [default=yes]])], - [DIRECT_VFD=$enableval], [DIRECT_VFD=yes]) - -if test "$DIRECT_VFD" = "yes"; then - AC_CACHE_VAL([hdf5_cv_direct_io], - [AC_TRY_RUN([ - #include - #include - #include - int main(void) - { - int fid; - if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0) - exit(1); - close(fid); - remove("tst_file"); - exit (0); - }], [AC_TRY_LINK(, [posix_memalign()], [hdf5_cv_direct_io=yes], [hdf5_cv_direct_io=no])], [hdf5_cv_direct_io=no],)]) - - if test ${hdf5_cv_direct_io} = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_DIRECT], [1], - [Define if the direct I/O virtual file driver should be compiled]) - else - AC_MSG_RESULT([no]) - DIRECT_VFD=no - fi + [Build the direct I/O virtual file driver (VFD). + This is based on the POSIX (sec2) VFD and + requires the open() call to take the O_DIRECT + flag. [default=no]])], + [DIRECT_VFD=$enableval], [DIRECT_VFD=no]) + +if test "X$DIRECT_VFD" = "Xyes"; then + if test ${hdf5_cv_direct_io} = "yes" && test ${hdf5_cv_posix_memalign} = "yes" ; then + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_DIRECT], [1], + [Define if the direct I/O virtual file driver (VFD) should be compiled]) + else + AC_MSG_RESULT([no]) + DIRECT_VFD=no + AC_MSG_ERROR([The direct VFD was requested but cannot be built. This is either + due to O_DIRECT not being found in fcntl.h or a lack of + posix_memalign() on your system. Please re-configure without + specifying --enable-direct-vfd.]) + fi else - AC_MSG_RESULT([suppressed]) + AC_MSG_RESULT([no]) fi AM_CONDITIONAL([DIRECT_VFD_CONDITIONAL], [test "X$DIRECT_VFD" = "Xyes"]) diff --git a/src/H5config.h.in b/src/H5config.h.in index 0c09fe6..6b6ffdd 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -87,7 +87,7 @@ /* Define to 1 if you have the `difftime' function. */ #undef HAVE_DIFFTIME -/* Define if the direct I/O virtual file driver should be compiled */ +/* Define if the direct I/O virtual file driver (VFD) should be compiled */ #undef HAVE_DIRECT /* Define to 1 if you have the header file. */ -- cgit v0.12 From 7e220930da7e77df1531329d8897befa0dc6399f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 23 Feb 2015 01:56:16 -0500 Subject: [svn-r26276] Merged r26075-80, 86 from features/autotools_rework branch. Cleans up time functions in the autotools input files. Removed deprecated gettimeofday() time zone code and configure processing. Also removed some unused time function configure checks and defines. Fixes: HDFFV-9083 and HDFFV-9085 Tested on: 32-bit linux, serial and parallel (jam) OS X (kite) Solaris (emu) --- config/cmake/H5pubconf.h.in | 23 -- configure | 499 ++++++----------------------------------- configure.ac | 73 +----- src/H5Omtime.c | 38 +--- src/H5config.h.in | 30 --- src/H5private.h | 3 - testpar/t_cache.c | 3 +- tools/perform/sio_standalone.h | 1 - 8 files changed, 83 insertions(+), 587 deletions(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 310fff2..a557364 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -86,9 +86,6 @@ long long values. */ #cmakedefine H5_FP_TO_ULLONG_RIGHT_MAXIMUM @H5_FP_TO_ULLONG_RIGHT_MAXIMUM@ -/* Define if gettimeofday() populates the tz pointer passed in */ -#cmakedefine H5_GETTIMEOFDAY_GIVES_TZ @H5_GETTIMEOFDAY_GIVES_TZ@ - /* Define to 1 if you have the `alarm' function. */ #cmakedefine H5_HAVE_ALARM @H5_HAVE_ALARM@ @@ -98,9 +95,6 @@ /* Define if the __attribute__(()) extension is present */ #cmakedefine H5_HAVE_ATTRIBUTE @H5_HAVE_ATTRIBUTE@ -/* Define to 1 if you have the `BSDgettimeofday' function. */ -#cmakedefine H5_HAVE_BSDGETTIMEOFDAY @H5_HAVE_BSDGETTIMEOFDAY@ - /* Define if the compiler understands C99 designated initialization of structs and unions */ #cmakedefine H5_HAVE_C99_DESIGNATED_INITIALIZER @H5_HAVE_C99_DESIGNATED_INITIALIZER@ @@ -374,12 +368,6 @@ /* Define if `struct text_info' is defined */ #cmakedefine H5_HAVE_STRUCT_TEXT_INFO @H5_HAVE_STRUCT_TEXT_INFO@ -/* Define if `struct timezone' is defined */ -#cmakedefine H5_HAVE_STRUCT_TIMEZONE @H5_HAVE_STRUCT_TIMEZONE@ - -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ -#cmakedefine H5_HAVE_STRUCT_TM_TM_ZONE @H5_HAVE_STRUCT_TM_TM_ZONE@ - /* Define if `struct videoconfig' is defined */ #cmakedefine H5_HAVE_STRUCT_VIDEOCONFIG @H5_HAVE_STRUCT_VIDEOCONFIG@ @@ -443,14 +431,6 @@ /* Define if `tm_gmtoff' is a member of `struct tm' */ #cmakedefine H5_HAVE_TM_GMTOFF @H5_HAVE_TM_GMTOFF@ -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ -#cmakedefine H5_HAVE_TM_ZONE @H5_HAVE_TM_ZONE@ - -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ -#cmakedefine H5_HAVE_TZNAME @H5_HAVE_TZNAME@ - /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_UNISTD_H @H5_HAVE_UNISTD_H@ @@ -481,9 +461,6 @@ /* Define to 1 if you have the `_scrsize' function. */ #cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@ -/* Define if `__tm_gmtoff' is a member of `struct tm' */ -#cmakedefine H5_HAVE___TM_GMTOFF @H5_HAVE___TM_GMTOFF@ - /* Define if your system can't handle converting floating-point values to long long. */ #cmakedefine H5_HW_FP_TO_LLONG_NOT_WORKS @H5_HW_FP_TO_LLONG_NOT_WORKS@ diff --git a/configure b/configure index 80fe73b..c77990b 100755 --- a/configure +++ b/configure @@ -2680,79 +2680,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_decl - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if eval \${$4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -22538,113 +22465,6 @@ $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi -## ---------------------------------------------------------------------- -## Check for these two functions before the time headers are checked -## for, otherwise they are not detected correctly on Solaris (the -## configure test will fail due to multiply-defined symbols). -## -for ac_func in difftime -do : - ac_fn_c_check_func "$LINENO" "difftime" "ac_cv_func_difftime" -if test "x$ac_cv_func_difftime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DIFFTIME 1 -_ACEOF - -fi -done - -for ac_func in gettimeofday -do : - ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" -if test "x$ac_cv_func_gettimeofday" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETTIMEOFDAY 1 -_ACEOF - have_gettime="yes" -else - have_gettime="no" -fi -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 -$as_echo_n "checking for library containing clock_gettime... " >&6; } -if ${ac_cv_search_clock_gettime+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char clock_gettime (); -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return clock_gettime (); - ; - return 0; -} -_ACEOF -for ac_lib in '' rt posix4; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_c_try_link "$LINENO"; then : - ac_cv_search_clock_gettime=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_clock_gettime+:} false; then : - break -fi -done -if ${ac_cv_search_clock_gettime+:} false; then : - -else - ac_cv_search_clock_gettime=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 -$as_echo "$ac_cv_search_clock_gettime" >&6; } -ac_res=$ac_cv_search_clock_gettime -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - -fi - -for ac_func in clock_gettime -do : - ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime" -if test "x$ac_cv_func_clock_gettime" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CLOCK_GETTIME 1 -_ACEOF - have_clock_gettime="yes" -else - have_clock_gettime="no" -fi -done - - ## Unix for ac_header in sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h do : @@ -26335,42 +26155,6 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -## check if `struct tm' has a `__tm_gmtoff' member. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __tm_gmtoff in struct tm" >&5 -$as_echo_n "checking for __tm_gmtoff in struct tm... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -struct tm tm; tm.__tm_gmtoff=0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE___TM_GMTOFF 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ## Check whether the global variable `timezone' is defined. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for global timezone variable" >&5 $as_echo_n "checking for global timezone variable... " >&6; } @@ -26417,217 +26201,6 @@ rm -f core conftest.err conftest.$ac_objext \ ;; esac -## Check whether `struct timezone' is defined. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if ${ac_cv_struct_tm+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -struct tm tm; - int *p = &tm.tm_sec; - return !p; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_struct_tm=time.h -else - ac_cv_struct_tm=sys/time.h -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } -if test $ac_cv_struct_tm = sys/time.h; then - -$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h - -fi - -ac_fn_c_check_member "$LINENO" "struct tm" "tm_zone" "ac_cv_member_struct_tm_tm_zone" "#include -#include <$ac_cv_struct_tm> - -" -if test "x$ac_cv_member_struct_tm_tm_zone" = xyes; then : - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TM_TM_ZONE 1 -_ACEOF - - -fi - -if test "$ac_cv_member_struct_tm_tm_zone" = yes; then - -$as_echo "#define HAVE_TM_ZONE 1" >>confdefs.h - -else - ac_fn_c_check_decl "$LINENO" "tzname" "ac_cv_have_decl_tzname" "#include -" -if test "x$ac_cv_have_decl_tzname" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_TZNAME $ac_have_decl -_ACEOF - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tzname" >&5 -$as_echo_n "checking for tzname... " >&6; } -if ${ac_cv_var_tzname+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#if !HAVE_DECL_TZNAME -extern char *tzname[]; -#endif - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -return tzname[0][0]; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_var_tzname=yes -else - ac_cv_var_tzname=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_var_tzname" >&5 -$as_echo "$ac_cv_var_tzname" >&6; } - if test $ac_cv_var_tzname = yes; then - -$as_echo "#define HAVE_TZNAME 1" >>confdefs.h - - fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone" >&5 -$as_echo_n "checking for struct timezone... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include - #include -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus - extern "C" -# endif - int FC_DUMMY_MAIN() { return 1; } -#endif -#endif -int -main () -{ -struct timezone tz; tz.tz_minuteswest=0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -$as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h - - have_struct_tz="yes" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -## If gettimeofday() is going to be used, make sure it uses the timezone struct - -if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday() gives timezone" >&5 -$as_echo_n "checking whether gettimeofday() gives timezone... " >&6; } - if ${hdf5_cv_gettimeofday_tz+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - #include - int main(void) - { - struct timeval tv; - struct timezone tz; - tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ - tz.tz_dsttime = 7; - gettimeofday(&tv, &tz); - /* Check whether the function returned any value at all */ - if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); - } -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - hdf5_cv_gettimeofday_tz=yes -else - hdf5_cv_gettimeofday_tz=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi - - - if test ${hdf5_cv_gettimeofday_tz} = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define GETTIMEOFDAY_GIVES_TZ 1" >>confdefs.h - - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi -fi ## ---------------------------------------------------------------------- ## Does the struct stat have the st_blocks field? This field is not Posix. @@ -26847,7 +26420,73 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ## ---------------------------------------------------------------------- ## Check for functions. ## -for ac_func in alarm BSDgettimeofday fork frexpf frexpl +## NOTE: clock_gettime may require linking to the rt or posix4 library +## so we'll search for it before calling AC_CHECK_FUNCS. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt posix4; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break +fi +done +if ${ac_cv_search_clock_gettime+:} false; then : + +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +for ac_func in alarm clock_gettime difftime fork frexpf frexpl do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -26859,7 +26498,7 @@ _ACEOF fi done -for ac_func in gethostname getpwuid getrusage lstat +for ac_func in gethostname getpwuid getrusage gettimeofday do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -26871,7 +26510,7 @@ _ACEOF fi done -for ac_func in rand_r random setsysinfo +for ac_func in lstat rand_r random setsysinfo do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/configure.ac b/configure.ac index 3b8b2eb..f53c8a6 100644 --- a/configure.ac +++ b/configure.ac @@ -997,16 +997,6 @@ dnl AC_CHECK_LIB([coug], [main]) ## ...for ASCI/Red AC_HEADER_STDC AC_HEADER_TIME -## ---------------------------------------------------------------------- -## Check for these two functions before the time headers are checked -## for, otherwise they are not detected correctly on Solaris (the -## configure test will fail due to multiply-defined symbols). -## -AC_CHECK_FUNCS([difftime]) -AC_CHECK_FUNCS([gettimeofday], [have_gettime="yes"], [have_gettime="no"]) -AC_SEARCH_LIBS([clock_gettime], [rt posix4]) -AC_CHECK_FUNCS([clock_gettime],[have_clock_gettime="yes"],[have_clock_gettime="no"]) - ## Unix AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h]) AC_CHECK_HEADERS([sys/socket.h sys/types.h]) @@ -1741,16 +1731,6 @@ AC_TRY_COMPILE([ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) -## check if `struct tm' has a `__tm_gmtoff' member. -AC_MSG_CHECKING([for __tm_gmtoff in struct tm]) -AC_TRY_COMPILE([ - #include - #include ], [struct tm tm; tm.__tm_gmtoff=0;], - [AC_DEFINE([HAVE___TM_GMTOFF], [1], - [Define if `__tm_gmtoff' is a member of `struct tm']) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - ## Check whether the global variable `timezone' is defined. AC_MSG_CHECKING([for global timezone variable]) @@ -1769,50 +1749,6 @@ case "`uname`" in ;; esac -## Check whether `struct timezone' is defined. -AC_STRUCT_TIMEZONE -AC_MSG_CHECKING([for struct timezone]) -AC_TRY_COMPILE([ - #include - #include - #include ], [struct timezone tz; tz.tz_minuteswest=0;], - [AC_DEFINE([HAVE_STRUCT_TIMEZONE], [1], - [Define if `struct timezone' is defined]) - have_struct_tz="yes" - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) - -## If gettimeofday() is going to be used, make sure it uses the timezone struct - -if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then - AC_MSG_CHECKING(whether gettimeofday() gives timezone) - AC_CACHE_VAL([hdf5_cv_gettimeofday_tz], - [AC_TRY_RUN([ - #include - #include - int main(void) - { - struct timeval tv; - struct timezone tz; - tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ - tz.tz_dsttime = 7; - gettimeofday(&tv, &tz); - /* Check whether the function returned any value at all */ - if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); - }], - [hdf5_cv_gettimeofday_tz=yes], - [hdf5_cv_gettimeofday_tz=no])]) - - if test ${hdf5_cv_gettimeofday_tz} = "yes"; then - AC_MSG_RESULT([yes]) - AC_DEFINE([GETTIMEOFDAY_GIVES_TZ], [1], - [Define if gettimeofday() populates the tz pointer passed in]) - else - AC_MSG_RESULT([no]) - fi -fi ## ---------------------------------------------------------------------- ## Does the struct stat have the st_blocks field? This field is not Posix. @@ -1870,9 +1806,12 @@ AC_TRY_COMPILE([#include ],[int w=TIOCGETD;], ## ---------------------------------------------------------------------- ## Check for functions. ## -AC_CHECK_FUNCS([alarm BSDgettimeofday fork frexpf frexpl]) -AC_CHECK_FUNCS([gethostname getpwuid getrusage lstat]) -AC_CHECK_FUNCS([rand_r random setsysinfo]) +## NOTE: clock_gettime may require linking to the rt or posix4 library +## so we'll search for it before calling AC_CHECK_FUNCS. +AC_SEARCH_LIBS([clock_gettime], [rt posix4]) +AC_CHECK_FUNCS([alarm clock_gettime difftime fork frexpf frexpl]) +AC_CHECK_FUNCS([gethostname getpwuid getrusage gettimeofday]) +AC_CHECK_FUNCS([lstat rand_r random setsysinfo]) AC_CHECK_FUNCS([signal longjmp setjmp siglongjmp sigsetjmp sigprocmask]) AC_CHECK_FUNCS([snprintf srandom strdup symlink system]) AC_CHECK_FUNCS([tmpfile asprintf vasprintf waitpid]) diff --git a/src/H5Omtime.c b/src/H5Omtime.c index 612d656..c9375f9 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -200,8 +200,8 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, /* decode */ for(i = 0; i < 14; i++) - if(!HDisdigit(p[i])) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") + if(!HDisdigit(p[i])) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") /* * Convert YYYYMMDDhhmmss UTC to a time_t. This is a little problematic @@ -219,36 +219,14 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, tm.tm_sec = (p[12]-'0')*10 + (p[13]-'0'); tm.tm_isdst = -1; /*figure it out*/ if((time_t)-1 == (the_time = HDmktime(&tm))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "badly formatted modification time message") #if defined(H5_HAVE_TM_GMTOFF) - /* FreeBSD, OSF 4.0 */ + /* BSD-like systems */ the_time += tm.tm_gmtoff; -#elif defined(H5_HAVE___TM_GMTOFF) - /* Linux libc-4 */ - the_time += tm.__tm_gmtoff; #elif defined(H5_HAVE_TIMEZONE) - /* Linux libc-5 */ - the_time -= timezone - (tm.tm_isdst?3600:0); -#elif defined(H5_HAVE_BSDGETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE) - /* Irix5.3 */ - { - struct timezone tz; - - if(HDBSDgettimeofday(NULL, &tz) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") - the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); - } -#elif defined(H5_HAVE_GETTIMEOFDAY) && defined(H5_HAVE_STRUCT_TIMEZONE) && defined(H5_GETTIMEOFDAY_GIVES_TZ) - { - struct timezone tz; - struct timeval tv; /* Used as a placebo; some systems don't like NULL */ - - if(HDgettimeofday(&tv, &tz) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") - - the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); - } + /* GNU/Linux systems */ + the_time -= timezone - (tm.tm_isdst ? 3600 : 0); #else /* * The catch-all. If we can't convert a character string universal @@ -257,14 +235,12 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, * only way a user can get the modification time is from our internal * query routines, which can gracefully recover. */ - - /* Irix64 */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information") #endif /* The return value */ if(NULL == (mesg = H5FL_MALLOC(time_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") *mesg = the_time; /* Set return value */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 6b6ffdd..42dfcfb 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -49,9 +49,6 @@ long long values. */ #undef FP_TO_ULLONG_RIGHT_MAXIMUM -/* Define if gettimeofday() populates the tz pointer passed in */ -#undef GETTIMEOFDAY_GIVES_TZ - /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM @@ -61,9 +58,6 @@ /* Define if the __attribute__(()) extension is present */ #undef HAVE_ATTRIBUTE -/* Define to 1 if you have the `BSDgettimeofday' function. */ -#undef HAVE_BSDGETTIMEOFDAY - /* Define if the compiler understands C99 designated initialization of structs and unions */ #undef HAVE_C99_DESIGNATED_INITIALIZER @@ -80,10 +74,6 @@ /* Define if Darwin or Mac OS X */ #undef HAVE_DARWIN -/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. - */ -#undef HAVE_DECL_TZNAME - /* Define to 1 if you have the `difftime' function. */ #undef HAVE_DIFFTIME @@ -310,12 +300,6 @@ /* Define if `struct text_info' is defined */ #undef HAVE_STRUCT_TEXT_INFO -/* Define if `struct timezone' is defined */ -#undef HAVE_STRUCT_TIMEZONE - -/* Define to 1 if `tm_zone' is a member of `struct tm'. */ -#undef HAVE_STRUCT_TM_TM_ZONE - /* Define if `struct videoconfig' is defined */ #undef HAVE_STRUCT_VIDEOCONFIG @@ -376,14 +360,6 @@ /* Define if `tm_gmtoff' is a member of `struct tm' */ #undef HAVE_TM_GMTOFF -/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use - `HAVE_STRUCT_TM_TM_ZONE' instead. */ -#undef HAVE_TM_ZONE - -/* Define to 1 if you don't have `tm_zone' but do have the external array - `tzname'. */ -#undef HAVE_TZNAME - /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -411,9 +387,6 @@ /* Define to 1 if you have the `_scrsize' function. */ #undef HAVE__SCRSIZE -/* Define if `__tm_gmtoff' is a member of `struct tm' */ -#undef HAVE___TM_GMTOFF - /* Define if your system can't handle converting floating-point values to long long. */ #undef HW_FP_TO_LLONG_NOT_WORKS @@ -621,9 +594,6 @@ /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME -/* Define to 1 if your declares `struct tm'. */ -#undef TM_IN_SYS_TIME - /* Define if your system can compile unsigned long long to floating-point casts. */ #undef ULLONG_TO_FP_CAST_WORKS diff --git a/src/H5private.h b/src/H5private.h index f70530d..a532c79 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -571,9 +571,6 @@ typedef struct { #ifndef HDatol #define HDatol(S) atol(S) #endif /* HDatol */ -#ifndef HDBSDgettimeofday - #define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P) -#endif /* HDBSDgettimeofday */ #ifndef HDbsearch #define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F) #endif /* HDbsearch */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 20fb9fd..f526a8b 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -4245,7 +4245,6 @@ setup_rand(void) unsigned predefined_seeds[3] = {33402, 33505, 33422}; unsigned seed; struct timeval tv; - struct timezone tz; if ( ( use_predefined_seeds ) && ( world_mpi_size == num_predefined_seeds ) ) { @@ -4261,7 +4260,7 @@ setup_rand(void) } else { - if ( HDgettimeofday(&tv, &tz) != 0 ) { + if ( HDgettimeofday(&tv, NULL) != 0 ) { nerrors++; if ( verbose ) { diff --git a/tools/perform/sio_standalone.h b/tools/perform/sio_standalone.h index b2f8220..4eb1ded 100644 --- a/tools/perform/sio_standalone.h +++ b/tools/perform/sio_standalone.h @@ -87,7 +87,6 @@ #define HDatof(S) atof(S) #define HDatoi(S) atoi(S) #define HDatol(S) atol(S) -#define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P) #define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F) #define HDcalloc(N,Z) calloc(N,Z) #define HDceil(X) ceil(X) -- cgit v0.12 From f175fd25c8714b17b3f5912bfdc7eb78ab50a17d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 23 Feb 2015 08:54:40 -0500 Subject: [svn-r26277] remove filename extension --- CMakeInstallation.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index a702fc3..c83d6bb 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -1,4 +1,4 @@ -include (CMakePackageConfigHelpers.cmake) +include (CMakePackageConfigHelpers) #----------------------------------------------------------------------------- # Check for Installation Utilities -- cgit v0.12 From 0c29ac42cd986762e1fa1f937cabe2037f0d53b5 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Mon, 23 Feb 2015 10:14:43 -0500 Subject: [svn-r26279] re-commit 26260 that Dana moved out fixing the versioning of functions to work with v16 default API. --- MANIFEST | 2 + src/H5.c | 80 +++++++++++++++++++++------- testpar/CMakeLists.txt | 2 + testpar/Makefile.am | 5 +- testpar/Makefile.in | 34 +++++++++--- testpar/t_pflush1.c | 11 ++-- testpar/t_pflush2.c | 3 -- testpar/t_prestart.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++ testpar/t_pshutdown.c | 127 +++++++++++++++++++++++++++++++++++++++++++++ testpar/t_shapesame.c | 3 -- tools/perform/perf.c | 3 -- 11 files changed, 363 insertions(+), 45 deletions(-) create mode 100644 testpar/t_prestart.c create mode 100644 testpar/t_pshutdown.c diff --git a/MANIFEST b/MANIFEST index 34c60e4..cd8133c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1146,6 +1146,8 @@ ./testpar/t_pflush2.c ./testpar/t_prop.c ./testpar/t_shapesame.c +./testpar/t_pshutdown.c +./testpar/t_prestart.c ./testpar/t_span_tree.c ./testpar/testpar.h ./testpar/testphdf5.c diff --git a/src/H5.c b/src/H5.c index af8b668..52dc566 100644 --- a/src/H5.c +++ b/src/H5.c @@ -52,7 +52,9 @@ /* Local Prototypes */ /********************/ static void H5_debug_mask(const char*); - +#ifdef H5_HAVE_PARALLEL +static int H5_mpi_delete_cb(MPI_Comm comm, int keyval, void *attr_val, int *flag); +#endif /*H5_HAVE_PARALLEL*/ /*********************/ /* Package Variables */ @@ -109,6 +111,43 @@ H5_init_library(void) herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) + +#ifdef H5_HAVE_PARALLEL + { + int mpi_initialized; + int mpi_code; + + MPI_Initialized(&mpi_initialized); + +#ifdef H5_HAVE_MPE + /* Initialize MPE instrumentation library. */ + if (!H5_MPEinit_g) + { + int mpe_code; + if (mpi_initialized){ + mpe_code = MPE_Init_log(); + HDassert(mpe_code >=0); + H5_MPEinit_g = TRUE; + } + } +#endif /*H5_HAVE_MPE*/ + + /* add an attribute on MPI_COMM_SELF to call H5_term_library + when it is destroyed, i.e. on MPI_Finalize */ + if (mpi_initialized) { + int key_val; + + if(MPI_SUCCESS != (mpi_code = MPI_Comm_create_keyval(MPI_NULL_COPY_FN, + (MPI_Comm_delete_attr_function *)H5_mpi_delete_cb, + &key_val, NULL))) + HMPI_GOTO_ERROR(FAIL, "MPI_Comm_create_keyval failed", mpi_code) + + if(MPI_SUCCESS != (mpi_code = MPI_Comm_set_attr(MPI_COMM_SELF, key_val, NULL))) + HMPI_GOTO_ERROR(FAIL, "MPI_Comm_set_attr failed", mpi_code) + } + } +#endif /*H5_HAVE_PARALLEL*/ + /* * Make sure the package information is updated. */ @@ -132,24 +171,6 @@ H5_init_library(void) H5_debug_g.pkg[H5_PKG_V].name = "v"; H5_debug_g.pkg[H5_PKG_Z].name = "z"; -#ifdef H5_HAVE_MPE - /* Initialize MPE instrumentation library. May need to move this - * up earlier if any of the above initialization involves using - * the instrumentation code. - */ - if (!H5_MPEinit_g) - { - int mpe_code; - int mpi_initialized; - MPI_Initialized(&mpi_initialized); - if (mpi_initialized){ - mpe_code = MPE_Init_log(); - HDassert(mpe_code >=0); - H5_MPEinit_g = TRUE; - } - } -#endif - /* * Install atexit() library cleanup routines unless the H5dont_atexit() * has been called. Once we add something to the atexit() list it stays @@ -580,6 +601,27 @@ H5_debug_mask(const char *s) } } /* end H5_debug_mask() */ +#ifdef H5_HAVE_PARALLEL + +/*------------------------------------------------------------------------- + * Function: H5_mpi_delete_cb + * + * Purpose: Callback attribute on MPI_COMM_SELF to terminate the HDF5 + * library when the communicator is destroyed, i.e. on MPI_Finalize. + * + * Return: MPI_SUCCESS + * + * Programmer: Mohamad Chaarawi, February 2015 + * + *------------------------------------------------------------------------- + */ +static int H5_mpi_delete_cb(MPI_Comm UNUSED comm, int UNUSED keyval, void UNUSED *attr_val, int UNUSED *flag) +{ + H5_term_library(); + return MPI_SUCCESS; +} +#endif /*H5_HAVE_PARALLEL*/ + /*------------------------------------------------------------------------- * Function: H5get_libversion diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index 11437c0..d1db0b7 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -46,6 +46,8 @@ set (H5P_TESTS t_cache t_pflush1 t_pflush2 + t_pshutdown + t_prestart t_shapesame ) diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 448f745..1eae439 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -25,7 +25,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test # Test programs. These are our main targets. # -TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame +TEST_PROG_PARA=t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame check_PROGRAMS = $(TEST_PROG_PARA) @@ -39,7 +39,8 @@ LDADD = $(LIBH5TEST) $(LIBHDF5) # Temporary files # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf +# shutdown.h5 is from t_pshutdown # go is used for debugging. See testphdf5.c. -CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 go +CHECK_CLEANFILES+=MPItest.h5 Para*.h5 CacheTestDummy.h5 shutdown.h5 go include $(top_srcdir)/config/conclude.am diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 8857d47..959731e 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -112,7 +112,8 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = t_mpi$(EXEEXT) testphdf5$(EXEEXT) t_cache$(EXEEXT) \ - t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_shapesame$(EXEEXT) + t_pflush1$(EXEEXT) t_pflush2$(EXEEXT) t_pshutdown$(EXEEXT) \ + t_prestart$(EXEEXT) t_shapesame$(EXEEXT) t_cache_SOURCES = t_cache.c t_cache_OBJECTS = t_cache.$(OBJEXT) t_cache_LDADD = $(LDADD) @@ -133,6 +134,14 @@ t_pflush2_SOURCES = t_pflush2.c t_pflush2_OBJECTS = t_pflush2.$(OBJEXT) t_pflush2_LDADD = $(LDADD) t_pflush2_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) +t_prestart_SOURCES = t_prestart.c +t_prestart_OBJECTS = t_prestart.$(OBJEXT) +t_prestart_LDADD = $(LDADD) +t_prestart_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) +t_pshutdown_SOURCES = t_pshutdown.c +t_pshutdown_OBJECTS = t_pshutdown.$(OBJEXT) +t_pshutdown_LDADD = $(LDADD) +t_pshutdown_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) t_shapesame_SOURCES = t_shapesame.c t_shapesame_OBJECTS = t_shapesame.$(OBJEXT) t_shapesame_LDADD = $(LDADD) @@ -179,10 +188,10 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_shapesame.c \ - $(testphdf5_SOURCES) -DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_shapesame.c \ - $(testphdf5_SOURCES) +SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \ + t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES) +DIST_SOURCES = t_cache.c t_mpi.c t_pflush1.c t_pflush2.c t_prestart.c \ + t_pshutdown.c t_shapesame.c $(testphdf5_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -687,13 +696,14 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf +# shutdown.h5 is from t_pshutdown # go is used for debugging. See testphdf5.c. CHECK_CLEANFILES = *.chkexe *.chklog *.clog MPItest.h5 Para*.h5 \ - CacheTestDummy.h5 go + CacheTestDummy.h5 shutdown.h5 go # Test programs. These are our main targets. # -TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame +TEST_PROG_PARA = t_mpi testphdf5 t_cache t_pflush1 t_pflush2 t_pshutdown t_prestart t_shapesame testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c \ t_prop.c @@ -782,6 +792,14 @@ t_pflush2$(EXEEXT): $(t_pflush2_OBJECTS) $(t_pflush2_DEPENDENCIES) $(EXTRA_t_pfl @rm -f t_pflush2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_pflush2_OBJECTS) $(t_pflush2_LDADD) $(LIBS) +t_prestart$(EXEEXT): $(t_prestart_OBJECTS) $(t_prestart_DEPENDENCIES) $(EXTRA_t_prestart_DEPENDENCIES) + @rm -f t_prestart$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_prestart_OBJECTS) $(t_prestart_LDADD) $(LIBS) + +t_pshutdown$(EXEEXT): $(t_pshutdown_OBJECTS) $(t_pshutdown_DEPENDENCIES) $(EXTRA_t_pshutdown_DEPENDENCIES) + @rm -f t_pshutdown$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(t_pshutdown_OBJECTS) $(t_pshutdown_LDADD) $(LIBS) + t_shapesame$(EXEEXT): $(t_shapesame_OBJECTS) $(t_shapesame_DEPENDENCIES) $(EXTRA_t_shapesame_DEPENDENCIES) @rm -f t_shapesame$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t_shapesame_OBJECTS) $(t_shapesame_LDADD) $(LIBS) @@ -808,7 +826,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pflush1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pflush2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_ph5basic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_prestart.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_prop.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_pshutdown.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_shapesame.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_span_tree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testphdf5.Po@am__quote@ diff --git a/testpar/t_pflush1.c b/testpar/t_pflush1.c index ebe5c38..1bcfeb8 100644 --- a/testpar/t_pflush1.c +++ b/testpar/t_pflush1.c @@ -164,12 +164,9 @@ main(int argc, char* argv[]) } /* end else */ /* - * Some systems like Linux with mpich, if you just _exit without MPI_Finalize - * called, it would terminate but left the launching process waiting forever. - * OTHO, some systems like AIX do not like files not closed when MPI_Finalize - * is called. So, we need to get the MPI file handles, close them by hand, - * then MPI_Finalize. Then the _exit is still needed to stop at_exit from - * happening in some systems. + * Some systems like AIX do not like files not closed when MPI_Finalize + * is called. So, we need to get the MPI file handles, close them by hand. + * Then the _exit is still needed to stop at_exit from happening in some systems. * Note that MPIO VFD returns the address of the file-handle in the VFD struct * because MPI_File_close wants to modify the file-handle variable. */ @@ -195,13 +192,11 @@ main(int argc, char* argv[]) fflush(stdout); fflush(stderr); - MPI_Finalize(); HD_exit(0); error: fflush(stdout); fflush(stderr); - MPI_Finalize(); HD_exit(1); } diff --git a/testpar/t_pflush2.c b/testpar/t_pflush2.c index e450f75..03f7c82 100644 --- a/testpar/t_pflush2.c +++ b/testpar/t_pflush2.c @@ -209,9 +209,6 @@ main(int argc, char* argv[]) puts(" Test not compatible with current Virtual File Driver"); } - /* close HDF5 library */ - H5close(); - MPI_Finalize(); return 0; diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c new file mode 100644 index 0000000..fab4a7c --- /dev/null +++ b/testpar/t_prestart.c @@ -0,0 +1,138 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Mohamad Chaarawi + * February 2015 + * + * Purpose: This test opens a file created by the t_pshutdown program + * and makes sure the objects created are there. + */ + +#include "testphdf5.h" + +int nerrors = 0; /* errors count */ + +const char *FILENAME[] = { + "shutdown", + NULL +}; + +int +main (int argc, char **argv) +{ + hid_t file_id, dset_id, grp_id; + hid_t fapl, sid, mem_dataspace; + herr_t ret; + char filename[1024]; + int mpi_size, mpi_rank, ndims, i, j; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + hsize_t dims[RANK]; + hsize_t start[RANK]; + hsize_t count[RANK]; + hsize_t stride[RANK]; + hsize_t block[RANK]; + DATATYPE *data_array = NULL, *dataptr; /* data buffer */ + + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + if(MAINPROCESS) + TESTING("proper shutdown of HDF5 library"); + + /* Set up file access property list with parallel I/O access */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl >= 0), "H5Pcreate succeeded"); + ret = H5Pset_fapl_mpio(fapl, comm, info); + VRFY((ret >= 0), ""); + + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + file_id = H5Fopen(filename, H5F_ACC_RDONLY, fapl); + VRFY((file_id >= 0), "H5Fopen succeeded"); + + grp_id = H5Gopen2(file_id, "Group", H5P_DEFAULT); + VRFY((grp_id >= 0), "H5Gopen succeeded"); + + dset_id = H5Dopen2(grp_id, "Dataset", H5P_DEFAULT); + VRFY((dset_id >= 0), "H5Dopen succeeded"); + + sid = H5Dget_space(dset_id); + VRFY((dset_id >= 0), "H5Dget_space succeeded"); + + ndims = H5Sget_simple_extent_dims(sid, dims, NULL); + VRFY((ndims == 2), "H5Sget_simple_extent_dims succeeded"); + VRFY(dims[0] == ROW_FACTOR*mpi_size, "Wrong dataset dimensions"); + VRFY(dims[1] == COL_FACTOR*mpi_size, "Wrong dataset dimensions"); + + /* allocate memory for data buffer */ + data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + + /* Each process takes a slabs of rows. */ + block[0] = dims[0]/mpi_size; + block[1] = dims[1]; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = mpi_rank*block[0]; + start[1] = 0; + + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + + /* create a memory dataspace independently */ + mem_dataspace = H5Screate_simple (RANK, block, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* write data independently */ + ret = H5Dread(dset_id, H5T_NATIVE_INT, mem_dataspace, sid, + H5P_DEFAULT, data_array); + VRFY((ret >= 0), "H5Dwrite succeeded"); + + dataptr = data_array; + + for (i=0; i < block[0]; i++){ + for (j=0; j < block[1]; j++){ + if(*dataptr != mpi_rank+1) { + printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n", + (unsigned long)i, (unsigned long)j, + (unsigned long)(i+start[0]), (unsigned long)(j+start[1]), + mpi_rank+1, *(dataptr)); + nerrors ++; + } + dataptr++; + } + } + MPI_Finalize(); + HDremove(filename); + + /* release data buffers */ + if(data_array) + HDfree(data_array); + + nerrors += GetTestNumErrs(); + + if(MAINPROCESS) { + if(0 == nerrors) + PASSED() + else + H5_FAILED() + } + + return (nerrors!=0); +} diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c new file mode 100644 index 0000000..be9734f --- /dev/null +++ b/testpar/t_pshutdown.c @@ -0,0 +1,127 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Mohamad Chaarawi + * February 2015 + * + * Purpose: This test creates a file and a bunch of objects in the + * file and then calls MPI_Finalize without closing anything. The + * library should exercise the attribute callback destroy attached to + * MPI_COMM_SELF and terminate the HDF5 library closing all open + * objects. The t_prestart test will read back the file and make sure + * all created objects are there. + */ + +#include "testphdf5.h" + +int nerrors = 0; /* errors count */ + +const char *FILENAME[] = { + "shutdown", + NULL +}; + +int +main (int argc, char **argv) +{ + hid_t file_id, dset_id, grp_id; + hid_t fapl, sid, mem_dataspace; + hsize_t dims[RANK], i; + herr_t ret; + char filename[1024]; + int mpi_size, mpi_rank; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + hsize_t start[RANK]; + hsize_t count[RANK]; + hsize_t stride[RANK]; + hsize_t block[RANK]; + DATATYPE *data_array = NULL; /* data buffer */ + + MPI_Init(&argc, &argv); + MPI_Comm_size(comm, &mpi_size); + MPI_Comm_rank(comm, &mpi_rank); + + if(MAINPROCESS) + TESTING("proper shutdown of HDF5 library"); + + /* Set up file access property list with parallel I/O access */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl >= 0), "H5Pcreate succeeded"); + ret = H5Pset_fapl_mpio(fapl, comm, info); + VRFY((ret >= 0), ""); + + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + VRFY((file_id >= 0), "H5Fcreate succeeded"); + grp_id = H5Gcreate2(file_id, "Group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((grp_id >= 0), "H5Gcreate succeeded"); + + dims[0] = ROW_FACTOR*mpi_size; + dims[1] = COL_FACTOR*mpi_size; + sid = H5Screate_simple (RANK, dims, NULL); + VRFY((sid >= 0), "H5Screate_simple succeeded"); + + dset_id = H5Dcreate2(grp_id, "Dataset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dset_id >= 0), "H5Dcreate succeeded"); + + /* allocate memory for data buffer */ + data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE)); + VRFY((data_array != NULL), "data_array HDmalloc succeeded"); + + /* Each process takes a slabs of rows. */ + block[0] = dims[0]/mpi_size; + block[1] = dims[1]; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = mpi_rank*block[0]; + start[1] = 0; + + /* put some trivial data in the data_array */ + for(i=0 ; i= 0), "H5Sset_hyperslab succeeded"); + + /* create a memory dataspace independently */ + mem_dataspace = H5Screate_simple (RANK, block, NULL); + VRFY((mem_dataspace >= 0), ""); + + /* write data independently */ + ret = H5Dwrite(dset_id, H5T_NATIVE_INT, mem_dataspace, sid, + H5P_DEFAULT, data_array); + VRFY((ret >= 0), "H5Dwrite succeeded"); + + /* release data buffers */ + if(data_array) + HDfree(data_array); + + MPI_Finalize(); + + nerrors += GetTestNumErrs(); + + if(MAINPROCESS) { + if(0 == nerrors) + PASSED() + else + H5_FAILED() + } + + return (nerrors!=0); +} diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index d167687..9088470 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -5142,10 +5142,7 @@ int main(int argc, char **argv) printf("Shape Same tests finished with no errors\n"); printf("===================================\n"); } - /* close HDF5 library */ - H5close(); - /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ MPI_Finalize(); /* cannot just return (nerrors) because exit code is limited to 1byte */ diff --git a/tools/perform/perf.c b/tools/perform/perf.c index 58db6cc..1bd33b6 100644 --- a/tools/perform/perf.c +++ b/tools/perform/perf.c @@ -391,9 +391,6 @@ die_jar_jar_die: free(tmp); if (opt_correct) free(tmp2); - /* close HDF5 library */ - H5close(); - MPI_Finalize(); return(0); -- cgit v0.12 From e171ee01f180cbd326efbdf3254cee94bc4d9622 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 23 Feb 2015 10:58:12 -0500 Subject: [svn-r26280] Removed tab indenting for Fortran source, tab indenting is not F2003 standard compliant. --- configure | 12 ++++++------ m4/aclocal_fc.m4 | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configure b/configure index c77990b..de1641c 100755 --- a/configure +++ b/configure @@ -6620,13 +6620,13 @@ $as_echo_n "checking if Fortran compiler version compatible with Fortran 2003 HD program main - USE iso_c_binding - IMPLICIT NONE - TYPE(C_PTR) :: ptr - TYPE(C_FUNPTR) :: funptr - CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr - ptr = C_LOC(ichr(1:1)) + ptr = C_LOC(ichr(1:1)) end diff --git a/m4/aclocal_fc.m4 b/m4/aclocal_fc.m4 index be3336f..cda2fee 100644 --- a/m4/aclocal_fc.m4 +++ b/m4/aclocal_fc.m4 @@ -156,13 +156,13 @@ dnl HAVE_F2003_REQUIREMENTS="no" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ - USE iso_c_binding - IMPLICIT NONE - TYPE(C_PTR) :: ptr - TYPE(C_FUNPTR) :: funptr - CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr - ptr = C_LOC(ichr(1:1)) + ptr = C_LOC(ichr(1:1)) ])],[AC_MSG_RESULT([yes]) HAVE_F2003_REQUIREMENTS=[yes]], -- cgit v0.12 From 48d9c30923a5d298670cf1f8e930c9a9624f80b9 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 24 Feb 2015 15:30:07 -0500 Subject: [svn-r26294] Fix for HDFFV-9132. tested: h5committest --- hl/src/H5LT.c | 3 ++- hl/test/test_lite.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index ed725a3..9d6123b 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -1981,7 +1981,8 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(HDstrncmp(name, (char *)op_data, HDstrlen((char *)op_data)) == 0) + + if(HDstrncmp(name, (char *)op_data, MAX(HDstrlen((char *)op_data),HDstrlen(name))) == 0) ret = H5_ITER_STOP; return ret; diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index d61d6cf..19d3759 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -36,10 +36,12 @@ #define DIM 6 +#define ATTR_NAME_SUB "att" #define ATTR1_NAME "attr string" #define ATTR2_NAME "attr char" #define ATTR3_NAME "attr short" #define ATTR4_NAME "attr int" +#define ATTR_NAME_EXT "att int ext" #define ATTR5_NAME "attr long" #define ATTR6_NAME "attr uchar" #define ATTR7_NAME "attr ushort" @@ -646,6 +648,14 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) if ( H5LTset_attribute_int( loc_id, obj_name, ATTR4_NAME, attr_int_in, (size_t)5 ) < 0 ) return -1; + /* Set the attribute which is a substring of an existing attribute */ + if ( H5LTset_attribute_int( loc_id, obj_name, ATTR_NAME_SUB, attr_int_in, (size_t)5 ) < 0 ) + return -1; + + /* Set the attribute which is an extension of an existing attribute */ + if ( H5LTset_attribute_int( loc_id, obj_name, ATTR_NAME_EXT, attr_int_in, (size_t)5 ) < 0 ) + return -1; + PASSED(); /*------------------------------------------------------------------------- @@ -666,6 +676,26 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) } } + if ( H5LTget_attribute_int( loc_id, obj_name, ATTR_NAME_SUB, attr_int_out ) < 0 ) + return -1; + + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } + + if ( H5LTget_attribute_int( loc_id, obj_name, ATTR_NAME_EXT, attr_int_out ) < 0 ) + return -1; + + for (i = 0; i < 5; i++) + { + if ( attr_int_in[i] != attr_int_out[i] ) { + return -1; + } + } + /* Get the attribute */ if ( H5LTget_attribute( loc_id, obj_name, ATTR4_NAME, H5T_NATIVE_INT, attr_int_out ) < 0 ) return -1; -- cgit v0.12 From 2dae07556928721290360fb2393bb928e2367527 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 25 Feb 2015 12:05:16 -0500 Subject: [svn-r26300] Description: Add H5Sis_regular_hyperslab() and H5Sget_regular_hyperslab() API routines, along with tests. Tested on: Mac OSX/64 10.10.2 (amazon) w/serial (h5committest forthcoming) --- src/H5Shyper.c | 105 ++++++++++++++++++++++++++++++++++++ src/H5Spublic.h | 3 ++ test/tselect.c | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 272 insertions(+) diff --git a/src/H5Shyper.c b/src/H5Shyper.c index c97c9b6..93a93b7 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -8856,3 +8856,108 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_hyper_get_seq_list() */ + +/*-------------------------------------------------------------------------- + NAME + H5Sis_regular_hyperslab + PURPOSE + Determine if a hyperslab selection is regular + USAGE + htri_t H5Sis_regular_hyperslab(dsid) + hid_t dsid; IN: Dataspace ID of hyperslab selection to query + RETURNS + TRUE/FALSE for hyperslab selection, FAIL on error or when querying other + selection types. + DESCRIPTION + If a hyperslab can be represented as a single call to H5Sselect_hyperslab, + with the H5S_SELECT_SET option, it is regular. If the hyperslab selection + would require multiple calls to H5Sselect_hyperslab, it is irregular. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +htri_t +H5Sis_regular_hyperslab(hid_t spaceid) +{ + H5S_t *space; /* Dataspace to query */ + htri_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE1("Hs", "i", spaceid); + + /* Check args */ + if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection") + + ret_value = H5S_hyper_is_regular(space); + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Sis_regular_hyperslab() */ + + +/*-------------------------------------------------------------------------- + NAME + H5Sgetregular_hyperslab + PURPOSE + Retrieve a regular hyperslab selection + USAGE + herr_t H5Sget_regular_hyperslab(dsid, start, stride, block, count) + hid_t dsid; IN: Dataspace ID of hyperslab selection to query + hsize_t start[]; OUT: Offset of start of hyperslab + hsize_t stride[]; OUT: Hyperslab stride + hsize_t count[]; OUT: Number of blocks included in hyperslab + hsize_t block[]; OUT: Size of block in hyperslab + RETURNS + Non-negative on success/Negative on failure. (It is an error to query + the regular hyperslab selections for non-regular hyperslab selections) + DESCRIPTION + Retrieve the start/stride/count/block for a regular hyperslab selection. + GLOBAL VARIABLES + COMMENTS, BUGS, ASSUMPTIONS + Note that if a hyperslab is originally regular, then becomes irregular + through selection operations, and then becomes regular again, the new + final regular selection may be equivalent but not identical to the + original regular selection. + EXAMPLES + REVISION LOG +--------------------------------------------------------------------------*/ +herr_t +H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], + hsize_t count[], hsize_t block[]) +{ + H5S_t *space; /* Dataspace to query */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* Check args */ + if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace") + if(H5S_GET_SELECT_TYPE(space) != H5S_SEL_HYPERSLABS) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a hyperslab selection") + if(TRUE != H5S_hyper_is_regular(space)) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a regular hyperslab selection") + + /* Retrieve hyperslab parameters */ + if(start) + for(u = 0; u < space->extent.rank; u++) + start[u] = space->select.sel_info.hslab->app_diminfo[u].start; + if(stride) + for(u = 0; u < space->extent.rank; u++) + stride[u] = space->select.sel_info.hslab->app_diminfo[u].stride; + if(count) + for(u = 0; u < space->extent.rank; u++) + count[u] = space->select.sel_info.hslab->app_diminfo[u].count; + if(block) + for(u = 0; u < space->extent.rank; u++) + block[u] = space->select.sel_info.hslab->app_diminfo[u].block; + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Sget_regular_hyperslab() */ + diff --git a/src/H5Spublic.h b/src/H5Spublic.h index 0a39ce1..37d3866 100644 --- a/src/H5Spublic.h +++ b/src/H5Spublic.h @@ -137,6 +137,9 @@ H5_DLL herr_t H5Sselect_all(hid_t spaceid); H5_DLL herr_t H5Sselect_none(hid_t spaceid); H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset); H5_DLL htri_t H5Sselect_valid(hid_t spaceid); +H5_DLL htri_t H5Sis_regular_hyperslab(hid_t spaceid); +H5_DLL htri_t H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], + hsize_t stride[], hsize_t count[], hsize_t block[]); H5_DLL hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid); H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid); H5_DLL herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, diff --git a/test/tselect.c b/test/tselect.c index d5a1f4c..b34d095 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -162,6 +162,12 @@ /* #defines for shape same / different rank tests */ #define SS_DR_MAX_RANK 5 +/* Information for regular hyperslab query test */ +#define SPACE13_RANK 3 +#define SPACE13_DIM1 50 +#define SPACE13_DIM2 50 +#define SPACE13_DIM3 50 +#define SPACE13_NPOINTS 4 /* Location comparison function */ @@ -13069,6 +13075,161 @@ test_select_bounds(void) /**************************************************************** ** +** test_hyper_regular(): Tests query operations on regular hyperslabs +** +****************************************************************/ +static void +test_hyper_regular(void) +{ + hid_t sid; /* Dataspace ID */ + const hsize_t dims[SPACE13_RANK] = {SPACE13_DIM1, SPACE13_DIM2, SPACE13_DIM3}; /* Dataspace dimensions */ + hsize_t coord[SPACE13_NPOINTS][SPACE13_RANK]; /* Coordinates for point selection */ + hsize_t start[SPACE13_RANK]; /* The start of the hyperslab */ + hsize_t stride[SPACE13_RANK]; /* The stride between block starts for the hyperslab */ + hsize_t count[SPACE13_RANK]; /* The number of blocks for the hyperslab */ + hsize_t block[SPACE13_RANK]; /* The size of each block for the hyperslab */ + hsize_t t_start[SPACE13_RANK]; /* Temporary start of the hyperslab */ + hsize_t t_count[SPACE13_RANK]; /* Temporary number of blocks for the hyperslab */ + hsize_t q_start[SPACE13_RANK]; /* The queried start of the hyperslab */ + hsize_t q_stride[SPACE13_RANK]; /* The queried stride between block starts for the hyperslab */ + hsize_t q_count[SPACE13_RANK]; /* The queried number of blocks for the hyperslab */ + hsize_t q_block[SPACE13_RANK]; /* The queried size of each block for the hyperslab */ + htri_t is_regular; /* Whether a hyperslab selection is regular */ + unsigned u; /* Local index variable */ + herr_t ret; /* Generic return value */ + + /* Output message about test being performed */ + MESSAGE(6, ("Testing queries on regular hyperslabs\n")); + + /* Create dataspace */ + sid = H5Screate_simple(SPACE13_RANK, dims, NULL); + CHECK(sid, FAIL, "H5Screate_simple"); + + /* Query if 'all' selection is regular hyperslab (should fail) */ + H5E_BEGIN_TRY { + is_regular = H5Sis_regular_hyperslab(sid); + } H5E_END_TRY; + VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab"); + + /* Query regular hyperslab selection info (should fail) */ + H5E_BEGIN_TRY { + ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Sget_regular_hyperslab"); + + /* Set 'none' selection */ + ret = H5Sselect_none(sid); + CHECK(ret, FAIL, "H5Sselect_none"); + + /* Query if 'none' selection is regular hyperslab (should fail) */ + H5E_BEGIN_TRY { + is_regular = H5Sis_regular_hyperslab(sid); + } H5E_END_TRY; + VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab"); + + /* Query regular hyperslab selection info (should fail) */ + H5E_BEGIN_TRY { + ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Sget_regular_hyperslab"); + + /* Set point selection */ + coord[0][0] = 3; coord[0][1] = 3; coord[0][2] = 3; + coord[1][0] = 3; coord[1][1] = 48; coord[1][2] = 48; + coord[2][0] = 48; coord[2][1] = 3; coord[2][2] = 3; + coord[3][0] = 48; coord[3][1] = 48; coord[3][2] = 48; + ret = H5Sselect_elements(sid, H5S_SELECT_SET, (size_t)SPACE13_NPOINTS, (const hsize_t *)coord); + CHECK(ret, FAIL, "H5Sselect_elements"); + + /* Query if 'point' selection is regular hyperslab (should fail) */ + H5E_BEGIN_TRY { + is_regular = H5Sis_regular_hyperslab(sid); + } H5E_END_TRY; + VERIFY(is_regular, FAIL, "H5Sis_regular_hyperslab"); + + /* Query regular hyperslab selection info (should fail) */ + H5E_BEGIN_TRY { + ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Sget_regular_hyperslab"); + + /* Set "regular" hyperslab selection */ + start[0] = 2; start[1] = 2; start[2] = 2; + stride[0] = 5; stride[1] = 5; stride[2] = 5; + count[0] = 3; count[1] = 3; count[2] = 3; + block[0] = 4; block[1] = 4; block[2] = 4; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Query if 'hyperslab' selection is regular hyperslab (should be TRUE) */ + is_regular = H5Sis_regular_hyperslab(sid); + VERIFY(is_regular, TRUE, "H5Sis_regular_hyperslab"); + + /* Retrieve the hyperslab parameters */ + ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); + CHECK(ret, FAIL, "H5Sget_regular_hyperslab"); + + /* Verify the hyperslab parameters */ + for(u = 0; u < SPACE13_RANK; u++) { + if(start[u] != q_start[u]) + ERROR("H5Sget_regular_hyperslab, start"); + if(stride[u] != q_stride[u]) + ERROR("H5Sget_regular_hyperslab, stride"); + if(count[u] != q_count[u]) + ERROR("H5Sget_regular_hyperslab, count"); + if(block[u] != q_block[u]) + ERROR("H5Sget_regular_hyperslab, block"); + } /* end for */ + + /* 'OR' in another point */ + t_start[0] = 0; t_start[1] = 0; t_start[2] = 0; + t_count[0] = 1; t_count[1] = 1; t_count[2] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_OR, t_start, NULL, t_count, NULL); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Query if 'hyperslab' selection is regular hyperslab (should be FALSE) */ + is_regular = H5Sis_regular_hyperslab(sid); + VERIFY(is_regular, FALSE, "H5Sis_regular_hyperslab"); + + /* Query regular hyperslab selection info (should fail) */ + H5E_BEGIN_TRY { + ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); + } H5E_END_TRY; + VERIFY(ret, FAIL, "H5Sget_regular_hyperslab"); + + /* 'XOR' in the point again, to remove it, which should make it regular again */ + t_start[0] = 0; t_start[1] = 0; t_start[2] = 0; + t_count[0] = 1; t_count[1] = 1; t_count[2] = 1; + ret = H5Sselect_hyperslab(sid, H5S_SELECT_XOR, t_start, NULL, t_count, NULL); + CHECK(ret, FAIL, "H5Sselect_hyperslab"); + + /* Query if 'hyperslab' selection is regular hyperslab (should be TRUE) */ + is_regular = H5Sis_regular_hyperslab(sid); + VERIFY(is_regular, TRUE, "H5Sis_regular_hyperslab"); + + /* Retrieve the hyperslab parameters */ + ret = H5Sget_regular_hyperslab(sid, q_start, q_stride, q_count, q_block); + CHECK(ret, FAIL, "H5Sget_regular_hyperslab"); + + /* Verify the hyperslab parameters */ + for(u = 0; u < SPACE13_RANK; u++) { + if(start[u] != q_start[u]) + ERROR("H5Sget_regular_hyperslab, start"); + if(stride[u] != q_stride[u]) + ERROR("H5Sget_regular_hyperslab, stride"); + if(count[u] != q_count[u]) + ERROR("H5Sget_regular_hyperslab, count"); + if(block[u] != q_block[u]) + ERROR("H5Sget_regular_hyperslab, block"); + } /* end for */ + + /* Close the dataspace */ + ret = H5Sclose(sid); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_hyper_regular() */ + +/**************************************************************** +** ** test_select(): Main H5S selection testing routine. ** ****************************************************************/ @@ -13228,6 +13389,9 @@ test_select(void) /* Test selection bounds with & without offsets */ test_select_bounds(); + /* Test 'regular' hyperslab query routines */ + test_hyper_regular(); + } /* test_select() */ -- cgit v0.12 From 0ce8fddc735c588dcd5667f9fce44033500a4465 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 25 Feb 2015 12:29:30 -0500 Subject: [svn-r26301] Description: Bring Neil's fix for error in H5S_extent_copy() back to the trunk. Tested on: Mac OSX/64 10.10.2 (amazon) w/serial (h5committest forthcoming) --- src/H5Osdspace.c | 4 +-- src/H5S.c | 6 +++- test/th5s.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 3 deletions(-) diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 9ca8436..875cd56 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -308,7 +308,7 @@ H5O_sdspace_copy(const void *_mesg, void *_dest) /* check args */ HDassert(mesg); - if(!dest && NULL == (dest = H5FL_MALLOC(H5S_extent_t))) + if(!dest && NULL == (dest = H5FL_CALLOC(H5S_extent_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy extent information */ @@ -463,7 +463,7 @@ H5O_sdspace_pre_copy_file(H5F_t UNUSED *file_src, const void *mesg_src, */ if(udata) { /* Allocate copy of dataspace extent */ - if(NULL == (udata->src_space_extent = H5FL_MALLOC(H5S_extent_t))) + if(NULL == (udata->src_space_extent = H5FL_CALLOC(H5S_extent_t))) HGOTO_ERROR(H5E_DATASPACE, H5E_NOSPACE, FAIL, "dataspace extent allocation failed") /* Create a copy of the dataspace extent */ diff --git a/src/H5S.c b/src/H5S.c index 1146ab4..346e908 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -509,6 +509,10 @@ H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src, hbool_t copy_max) FUNC_ENTER_NOAPI(FAIL) + /* Release destination extent before we copy over it */ + if(H5S_extent_release(dst) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release dataspace extent") + /* Copy the regular fields */ dst->type = src->type; dst->version = src->version; @@ -583,7 +587,7 @@ H5S_copy(const H5S_t *src, hbool_t share_selection, hbool_t copy_max) FUNC_ENTER_NOAPI(NULL) - if(NULL == (dst = H5FL_MALLOC(H5S_t))) + if(NULL == (dst = H5FL_CALLOC(H5S_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy the source dataspace's extent */ diff --git a/test/th5s.c b/test/th5s.c index 43ad1bb..d3a651c 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -2207,6 +2207,97 @@ test_h5s_extent_equal(void) /**************************************************************** ** +** test_h5s_extent_copy(): Exercise extent copy code +** +****************************************************************/ +static void +test_h5s_extent_copy(void) +{ + hid_t spaces[14] = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; /* Array of all dataspaces */ + hid_t tmp_space = -1; + hsize_t d1_dims1[1] = {10}, /* 1-D dimensions */ + d1_dims2[1] = {20}, + d1_dims3[1] = {H5S_UNLIMITED}; + hsize_t d2_dims1[2] = {10, 10}, /* 2-D dimensions */ + d2_dims2[2] = {20, 20}, + d2_dims3[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t d3_dims1[3] = {10, 10, 10}, /* 3-D dimensions */ + d3_dims2[3] = {20, 20, 20}, + d3_dims3[3] = {H5S_UNLIMITED, H5S_UNLIMITED, H5S_UNLIMITED}; + htri_t ext_equal; /* Whether two dataspace extents are equal */ + const unsigned num_spaces = sizeof(spaces) / sizeof(spaces[0]); + unsigned i, j; + herr_t ret; /* Generic error return */ + + /* Create dataspaces */ + spaces[0] = H5Screate(H5S_NULL); + CHECK(spaces[0], FAIL, "H5Screate"); + + spaces[1] = H5Screate(H5S_SCALAR); + CHECK(spaces[1], FAIL, "H5Screate"); + + spaces[2] = H5Screate_simple(1, d1_dims1, NULL); + CHECK(spaces[2], FAIL, "H5Screate"); + spaces[3] = H5Screate_simple(1, d1_dims2, NULL); + CHECK(spaces[3], FAIL, "H5Screate"); + spaces[4] = H5Screate_simple(1, d1_dims1, d1_dims2); + CHECK(spaces[4], FAIL, "H5Screate"); + spaces[5] = H5Screate_simple(1, d1_dims1, d1_dims3); + CHECK(spaces[5], FAIL, "H5Screate"); + + spaces[6] = H5Screate_simple(2, d2_dims1, NULL); + CHECK(spaces[6], FAIL, "H5Screate"); + spaces[7] = H5Screate_simple(2, d2_dims2, NULL); + CHECK(spaces[7], FAIL, "H5Screate"); + spaces[8] = H5Screate_simple(2, d2_dims1, d2_dims2); + CHECK(spaces[8], FAIL, "H5Screate"); + spaces[9] = H5Screate_simple(2, d2_dims1, d2_dims3); + CHECK(spaces[9], FAIL, "H5Screate"); + + spaces[10] = H5Screate_simple(3, d3_dims1, NULL); + CHECK(spaces[10], FAIL, "H5Screate"); + spaces[11] = H5Screate_simple(3, d3_dims2, NULL); + CHECK(spaces[11], FAIL, "H5Screate"); + spaces[12] = H5Screate_simple(3, d3_dims1, d3_dims2); + CHECK(spaces[12], FAIL, "H5Screate"); + spaces[13] = H5Screate_simple(3, d3_dims1, d3_dims3); + CHECK(spaces[13], FAIL, "H5Screate"); + + tmp_space = H5Screate(H5S_NULL); + CHECK(tmp_space, FAIL, "H5Screate"); + + /* Copy between all dataspace combinations. Note there are a few + * duplicates. */ + for(i = 0; i < num_spaces; i++) + for(j = i; j < num_spaces; j++) { + /* Copy from i to j, unless the inner loop just restarted, in which + * case i and j are the same, so the second call to H5Sextent_copy() + * will test copying from i/j to i/j */ + ret = H5Sextent_copy(tmp_space, spaces[j]); + CHECK(ret, FAIL, "H5Sextent_copy"); + ext_equal = H5Sextent_equal(tmp_space, spaces[j]); + VERIFY(ext_equal, TRUE, "H5Sextent_equal"); + + /* Copy from j to i */ + ret = H5Sextent_copy(tmp_space, spaces[i]); + CHECK(ret, FAIL, "H5Sextent_copy"); + ext_equal = H5Sextent_equal(tmp_space, spaces[i]); + VERIFY(ext_equal, TRUE, "H5Sextent_equal"); + } /* end for */ + + /* Close dataspaces */ + for(i = 0; i < num_spaces; i++) { + ret = H5Sclose(spaces[i]); + CHECK(ret, FAIL, "H5Sclose"); + spaces[i] = -1; + } /* end for */ + + ret = H5Sclose(tmp_space); + CHECK(ret, FAIL, "H5Sclose"); +} /* test_h5s_extent_copy() */ + +/**************************************************************** +** ** test_h5s(): Main H5S (dataspace) testing routine. ** ****************************************************************/ @@ -2230,6 +2321,7 @@ test_h5s(void) test_h5s_chunk(); /* Exercise bug fix for chunked I/O */ test_h5s_extent_equal(); /* Test extent comparison code */ + test_h5s_extent_copy(); /* Test extent copy code */ } /* test_h5s() */ -- cgit v0.12 From 3550004b200ef695c973fcf2310e95512c560c73 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 25 Feb 2015 13:03:52 -0500 Subject: [svn-r26302] Description: Revise dataspace encode/decode routines to make them work better with future virtual dataset feature. Tested on: Mac OSX/64 10.10.2 (amazon) w/serial (h5committest forthcoming) --- src/H5R.c | 4 +-- src/H5S.c | 4 +-- src/H5Sall.c | 41 +++++++++++++++++----------- src/H5Shyper.c | 82 +++++++++++++++++++++++++++++--------------------------- src/H5Snone.c | 35 ++++++++++++++---------- src/H5Spkg.h | 4 +-- src/H5Spoint.c | 56 ++++++++++++++++++++------------------ src/H5Sprivate.h | 4 +-- src/H5Sselect.c | 81 ++++++++++++++++++++++++++++++++++++++++++------------- 9 files changed, 190 insertions(+), 121 deletions(-) diff --git a/src/H5R.c b/src/H5R.c index 8396dcc..26f4b9d 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -291,7 +291,7 @@ H5R_create(void *_ref, H5G_loc_t *loc, const char *name, H5R_type_t ref_type, H5 H5F_addr_encode(loc->oloc->file, &p, obj_loc.oloc->addr); /* Serialize the selection into heap buffer */ - if(H5S_SELECT_SERIALIZE(space, p) < 0) + if(H5S_SELECT_SERIALIZE(space, &p) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTCOPY, FAIL, "Unable to serialize selection") /* Save the serialized buffer for later */ @@ -659,7 +659,7 @@ H5R_get_region(H5F_t *file, hid_t dxpl_id, const void *_ref) HGOTO_ERROR(H5E_DATASPACE, H5E_NOTFOUND, NULL, "not found") /* Unserialize the selection */ - if(H5S_select_deserialize(ret_value, p) < 0) + if(H5S_SELECT_DESERIALIZE(&ret_value, &p) < 0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTDECODE, NULL, "can't deserialize selection") done: diff --git a/src/H5S.c b/src/H5S.c index 346e908..a9812695 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -1540,7 +1540,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) buf += extent_size; /* Encode the selection part of dataspace. */ - if(H5S_SELECT_SERIALIZE(obj, buf) < 0) + if(H5S_SELECT_SERIALIZE(obj, &buf) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode select space") } /* end else */ @@ -1659,7 +1659,7 @@ H5S_decode(const unsigned char *buf) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection") /* Decode the select part of dataspace. I believe this part always exists. */ - if(H5S_SELECT_DESERIALIZE(ds, buf) < 0) + if(H5S_SELECT_DESERIALIZE(&ds, &buf) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode space selection") /* Set return value */ diff --git a/src/H5Sall.c b/src/H5Sall.c index 24caad2..1105915 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -39,8 +39,8 @@ static herr_t H5S_all_get_seq_list(const H5S_t *space, unsigned flags, static herr_t H5S_all_release(H5S_t *space); static htri_t H5S_all_is_valid(const H5S_t *space); static hssize_t H5S_all_serial_size(const H5S_t *space); -static herr_t H5S_all_serialize(const H5S_t *space, uint8_t *buf); -static herr_t H5S_all_deserialize(H5S_t *space, const uint8_t *buf); +static herr_t H5S_all_serialize(const H5S_t *space, uint8_t **p); +static herr_t H5S_all_deserialize(H5S_t *space, const uint8_t **p); static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S_all_offset(const H5S_t *space, hsize_t *off); static htri_t H5S_all_is_contiguous(const H5S_t *space); @@ -496,9 +496,11 @@ H5S_all_serial_size (const H5S_t UNUSED *space) PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_all_serialize(space, buf) - H5S_t *space; IN: Dataspace pointer of selection to serialize - uint8 *buf; OUT: Buffer to put serialized selection into + herr_t H5S_all_serialize(space, p) + const H5S_t *space; IN: Dataspace with selection to serialize + uint8_t **p; OUT: Pointer to buffer to put serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -510,17 +512,19 @@ H5S_all_serial_size (const H5S_t UNUSED *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_serialize (const H5S_t *space, uint8_t *buf) +H5S_all_serialize (const H5S_t *space, uint8_t **p) { FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); + HDassert(p); + HDassert(*p); /* Store the preamble information */ - UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(buf, (uint32_t)1); /* Store the version number */ - UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */ - UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */ + UINT32ENCODE(*p, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(*p, (uint32_t)1); /* Store the version number */ + UINT32ENCODE(*p, (uint32_t)0); /* Store the un-used padding */ + UINT32ENCODE(*p, (uint32_t)0); /* Store the additional information length */ FUNC_LEAVE_NOAPI(SUCCEED) } /* H5S_all_serialize() */ @@ -532,9 +536,12 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) PURPOSE Deserialize the current selection from a user-provided buffer. USAGE - herr_t H5S_all_deserialize(space, buf) - H5S_t *space; IN/OUT: Dataspace pointer to place selection into - uint8 *buf; IN: Buffer to retrieve serialized selection from + herr_t H5S_all_deserialize(space, p) + H5S_t *space; IN/OUT: Dataspace pointer to place + selection into + uint8 **p; OUT: Pointer to buffer holding serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -546,16 +553,18 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_all_deserialize(H5S_t *space, const uint8_t UNUSED *buf) +H5S_all_deserialize(H5S_t *space, const uint8_t UNUSED **p) { - herr_t ret_value; /* return value */ + herr_t ret_value = SUCCEED; /* return value */ FUNC_ENTER_NOAPI(FAIL) HDassert(space); + HDassert(p); + HDassert(*p); /* Change to "all" selection */ - if((ret_value = H5S_select_all(space, TRUE)) < 0) + if(H5S_select_all(space, TRUE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") done: diff --git a/src/H5Shyper.c b/src/H5Shyper.c index 93a93b7..dfc0d06 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -54,8 +54,8 @@ static herr_t H5S_hyper_get_seq_list(const H5S_t *space, unsigned flags, static herr_t H5S_hyper_release(H5S_t *space); static htri_t H5S_hyper_is_valid(const H5S_t *space); static hssize_t H5S_hyper_serial_size(const H5S_t *space); -static herr_t H5S_hyper_serialize(const H5S_t *space, uint8_t *buf); -static herr_t H5S_hyper_deserialize(H5S_t *space, const uint8_t *buf); +static herr_t H5S_hyper_serialize(const H5S_t *space, uint8_t **p); +static herr_t H5S_hyper_deserialize(H5S_t *space, const uint8_t **p); static herr_t H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end); static herr_t H5S_hyper_offset(const H5S_t *space, hsize_t *offset); static htri_t H5S_hyper_is_contiguous(const H5S_t *space); @@ -1994,7 +1994,7 @@ H5S_hyper_serial_size(const H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **buf) +H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **p) { H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */ hsize_t u; /* Index variable */ @@ -2007,7 +2007,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, HDassert(start); HDassert(end); HDassert(rank < H5O_LAYOUT_NDIMS); - HDassert(buf && *buf); + HDassert(p && *p); /* Walk through the list of spans, recursing or outputing them */ curr=spans->head; @@ -2019,7 +2019,7 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, end[rank]=curr->high; /* Recurse down to the next dimension */ - if(H5S_hyper_serialize_helper(curr->down,start,end,rank+1,buf)<0) + if(H5S_hyper_serialize_helper(curr->down,start,end,rank+1,p)<0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "failed to release hyperslab spans") } /* end if */ else { @@ -2027,17 +2027,17 @@ H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, /* Encode previous starting points */ for(u=0; ulow); + UINT32ENCODE(*p, (uint32_t)curr->low); /* Encode previous ending points */ for(u=0; uhigh); + UINT32ENCODE(*p, (uint32_t)curr->high); } /* end else */ /* Advance to next node */ @@ -2055,9 +2055,11 @@ done: PURPOSE Serialize the current selection into a user-provided buffer. USAGE - herr_t H5S_hyper_serialize(space, buf) - H5S_t *space; IN: Dataspace pointer of selection to serialize - uint8 *buf; OUT: Buffer to put serialized selection into + herr_t H5S_hyper_serialize(space, p) + const H5S_t *space; IN: Dataspace with selection to serialize + uint8_t **p; OUT: Pointer to buffer to put serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -2069,7 +2071,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) +H5S_hyper_serialize (const H5S_t *space, uint8_t **p) { const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */ hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary hyperslab counts */ @@ -2089,14 +2091,14 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) HDassert(space); /* Store the preamble information */ - UINT32ENCODE(buf, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ - UINT32ENCODE(buf, (uint32_t)1); /* Store the version number */ - UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */ - lenp = buf; /* keep the pointer to the length location for later */ - buf += 4; /* skip over space for length */ + UINT32ENCODE(*p, (uint32_t)H5S_GET_SELECT_TYPE(space)); /* Store the type of selection */ + UINT32ENCODE(*p, (uint32_t)1); /* Store the version number */ + UINT32ENCODE(*p, (uint32_t)0); /* Store the un-used padding */ + lenp = *p; /* keep the pointer to the length location for later */ + *p += 4; /* skip over space for length */ /* Encode number of dimensions */ - UINT32ENCODE(buf, (uint32_t)space->extent.rank); + UINT32ENCODE(*p, (uint32_t)space->extent.rank); len += 4; /* Check for a "regular" hyperslab selection */ @@ -2114,7 +2116,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Encode number of hyperslabs */ H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); - UINT32ENCODE(buf, (uint32_t)block_count); + UINT32ENCODE(*p, (uint32_t)block_count); len+=4; /* Now serialize the information for the regular hyperslab */ @@ -2137,11 +2139,11 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Encode hyperslab starting location */ for(u = 0; u < ndims; u++) - UINT32ENCODE(buf, (uint32_t)offset[u]); + UINT32ENCODE(*p, (uint32_t)offset[u]); /* Encode hyperslab ending location */ for(u = 0; u < ndims; u++) - UINT32ENCODE(buf, (uint32_t)(offset[u] + (diminfo[u].block - 1))); + UINT32ENCODE(*p, (uint32_t)(offset[u] + (diminfo[u].block - 1))); /* Move the offset to the next sequence to start */ offset[fast_dim]+=diminfo[fast_dim].stride; @@ -2192,15 +2194,15 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Encode number of hyperslabs */ block_count = H5S_hyper_span_nblocks(space->select.sel_info.hslab->span_lst); H5_CHECK_OVERFLOW(block_count, hsize_t, uint32_t); - UINT32ENCODE(buf, (uint32_t)block_count); + UINT32ENCODE(*p, (uint32_t)block_count); len+=4; /* Add 8 bytes times the rank for each hyperslab selected */ H5_CHECK_OVERFLOW((8 * space->extent.rank * block_count), hsize_t, size_t); - len += (size_t)(8 * space->extent.rank * block_count); + len += (uint32_t)(8 * space->extent.rank * block_count); /* Encode each hyperslab in selection */ - H5S_hyper_serialize_helper(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, &buf); + H5S_hyper_serialize_helper(space->select.sel_info.hslab->span_lst, start, end, (hsize_t)0, p); } /* end else */ /* Encode length */ @@ -2216,9 +2218,12 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) PURPOSE Deserialize the current selection from a user-provided buffer. USAGE - herr_t H5S_hyper_deserialize(space, buf) - H5S_t *space; IN/OUT: Dataspace pointer to place selection into - uint8 *buf; IN: Buffer to retrieve serialized selection from + herr_t H5S_hyper_deserialize(space, p) + H5S_t *space; IN/OUT: Dataspace pointer to place + selection into + uint8 **p; OUT: Pointer to buffer holding serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -2230,9 +2235,9 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf) +H5S_hyper_deserialize (H5S_t *space, const uint8_t **p) { - uint32_t rank; /* rank of points */ + unsigned rank; /* rank of points */ size_t num_elem=0; /* number of elements in selection */ hsize_t start[H5O_LAYOUT_NDIMS]; /* hyperslab start information */ hsize_t end[H5O_LAYOUT_NDIMS]; /* hyperslab end information */ @@ -2251,14 +2256,13 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf) /* Check args */ HDassert(space); - HDassert(buf); + HDassert(p); + HDassert(*p); /* Deserialize slabs to select */ - buf+=16; /* Skip over selection header */ - UINT32DECODE(buf,rank); /* decode the rank of the point selection */ - if(rank!=space->extent.rank) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace") - UINT32DECODE(buf,num_elem); /* decode the number of points */ + /* (The header and rank have already beed decoded) */ + rank = space->extent.rank; /* Retrieve rank from space */ + UINT32DECODE(*p,num_elem); /* decode the number of points */ /* Set the count & stride for all blocks */ for(tcount=count,tstride=stride,j=0; jextent.rank); + UINT32ENCODE(*p, (uint32_t)space->extent.rank); len+=4; /* Encode number of elements */ - UINT32ENCODE(buf, (uint32_t)space->select.num_elem); + UINT32ENCODE(*p, (uint32_t)space->select.num_elem); len+=4; /* Encode each point in selection */ @@ -852,7 +854,7 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) /* Encode each point */ for(u=0; uextent.rank; u++) - UINT32ENCODE(buf, (uint32_t)curr->pnt[u]); + UINT32ENCODE(*p, (uint32_t)curr->pnt[u]); curr=curr->next; } /* end while */ @@ -870,9 +872,12 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) PURPOSE Deserialize the current selection from a user-provided buffer. USAGE - herr_t H5S_point_deserialize(space, buf) - H5S_t *space; IN/OUT: Dataspace pointer to place selection into - uint8 *buf; IN: Buffer to retrieve serialized selection from + herr_t H5S_point_deserialize(space, p) + H5S_t *space; IN/OUT: Dataspace pointer to place + selection into + uint8 **p; OUT: Pointer to buffer holding serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -884,10 +889,10 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5S_point_deserialize (H5S_t *space, const uint8_t *buf) +H5S_point_deserialize (H5S_t *space, const uint8_t **p) { H5S_seloper_t op=H5S_SELECT_SET; /* Selection operation */ - uint32_t rank; /* Rank of points */ + unsigned rank; /* Rank of points */ size_t num_elem=0; /* Number of elements in selection */ hsize_t *coord=NULL, *tcoord; /* Pointer to array of elements */ unsigned i, j; /* local counting variables */ @@ -897,14 +902,13 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf) /* Check args */ HDassert(space); - HDassert(buf); + HDassert(p); + HDassert(*p); /* Deserialize points to select */ - buf += 16; /* Skip over selection header */ - UINT32DECODE(buf, rank); /* decode the rank of the point selection */ - if(rank != space->extent.rank) - HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of pointer does not match dataspace") - UINT32DECODE(buf, num_elem); /* decode the number of points */ + /* (The header and rank have already beed decoded) */ + rank = space->extent.rank; /* Retrieve rank from space */ + UINT32DECODE(*p, num_elem); /* decode the number of points */ /* Allocate space for the coordinates */ if(NULL == (coord = (hsize_t *)H5MM_malloc(num_elem * rank * sizeof(hsize_t)))) @@ -913,7 +917,7 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf) /* Retrieve the coordinates from the buffer */ for(tcoord = coord, i = 0; i < num_elem; i++) for(j = 0; j < (unsigned)rank; j++, tcoord++) - UINT32DECODE(buf, *tcoord); + UINT32DECODE(*p, *tcoord); /* Select points */ if(H5S_select_elements(space, op, num_elem, (const hsize_t *)coord) < 0) diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index 44cd6c3..7b7b8c6 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -206,7 +206,7 @@ H5_DLL int H5S_extent_get_dims(const H5S_extent_t *ext, hsize_t dims[], hsize_t H5_DLL htri_t H5S_extent_equal(const H5S_t *ds1, const H5S_t *ds2); /* Operations on selections */ -H5_DLL herr_t H5S_select_deserialize(H5S_t *space, const uint8_t *buf); +H5_DLL herr_t H5S_select_deserialize(H5S_t **space, const uint8_t **p); H5_DLL H5S_sel_type H5S_get_select_type(const H5S_t *space); H5_DLL herr_t H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, void *operator_data); @@ -227,7 +227,7 @@ H5_DLL herr_t H5S_select_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len); H5_DLL hssize_t H5S_select_serial_size(const H5S_t *space); -H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t *buf); +H5_DLL herr_t H5S_select_serialize(const H5S_t *space, uint8_t **p); H5_DLL htri_t H5S_select_is_contiguous(const H5S_t *space); H5_DLL htri_t H5S_select_is_single(const H5S_t *space); H5_DLL htri_t H5S_select_is_regular(const H5S_t *space); diff --git a/src/H5Sselect.c b/src/H5Sselect.c index 2cb4b38..a4f13d7 100644 --- a/src/H5Sselect.c +++ b/src/H5Sselect.c @@ -239,9 +239,11 @@ H5S_select_serial_size(const H5S_t *space) PURPOSE Serialize the selection for a dataspace into a buffer USAGE - herr_t H5S_select_serialize(space, buf) + herr_t H5S_select_serialize(space, p) const H5S_t *space; IN: Dataspace with selection to serialize - uint8_t *buf; OUT: Buffer to put serialized selection + uint8_t **p; OUT: Pointer to buffer to put serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -256,17 +258,17 @@ H5S_select_serial_size(const H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_serialize(const H5S_t *space, uint8_t *buf) +H5S_select_serialize(const H5S_t *space, uint8_t **p) { herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(space); - HDassert(buf); + HDassert(p); /* Call the selection type's serialize function */ - ret_value=(*space->select.type->serialize)(space,buf); + ret_value=(*space->select.type->serialize)(space,p); FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_select_serialize() */ @@ -428,9 +430,13 @@ H5S_select_valid(const H5S_t *space) Deserialize the current selection from a user-provided buffer into a real selection in the dataspace. USAGE - herr_t H5S_select_deserialize(space, buf) - H5S_t *space; IN/OUT: Dataspace pointer to place selection into - uint8 *buf; IN: Buffer to retrieve serialized selection from + herr_t H5S_select_deserialize(space, p) + H5S_t **space; IN/OUT: Dataspace pointer to place + selection into. Will be allocated if not + provided. + uint8 **p; OUT: Pointer to buffer holding serialized + selection. Will be advanced to end of + serialized selection. RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -444,42 +450,81 @@ H5S_select_valid(const H5S_t *space) REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5S_select_deserialize (H5S_t *space, const uint8_t *buf) +H5S_select_deserialize (H5S_t **space, const uint8_t **p) { - const uint8_t *tbuf; /* Temporary pointer to the selection type */ - uint32_t sel_type; /* Pointer to the selection type */ + H5S_t *tmp_space; /* Pointer to actual dataspace to use, either + *space or a newly allocated one */ + uint32_t sel_type; /* Pointer to the selection type */ herr_t ret_value=FAIL; /* return value */ FUNC_ENTER_NOAPI(FAIL) HDassert(space); - tbuf=buf; - UINT32DECODE(tbuf, sel_type); + /* Allocate space if not provided */ + if(!*space) { + if(NULL == (tmp_space = H5S_create(H5S_SIMPLE))) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create dataspace") + } /* end if */ + else + tmp_space = *space; + + /* Decode selection type */ + UINT32DECODE(*p, sel_type); + + /* Skip over the remainder of the header */ + *p += 12; + + /* Decode and check or patch rank for point and hyperslab selections */ + if((sel_type == H5S_SEL_POINTS) || (sel_type == H5S_SEL_HYPERSLABS)) { + uint32_t rank; /* Rank of dataspace */ + + /* Decode the rank of the point selection */ + UINT32DECODE(*p,rank); + + if(!*space) + /* Patch the rank of the allocated dataspace */ + tmp_space->extent.rank = rank; + else + /* Verify the rank of the provided dataspace */ + if(rank != tmp_space->extent.rank) + HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "rank of serialized selection does not match dataspace") + } /* end if */ + + /* Make routine for selection type */ switch(sel_type) { case H5S_SEL_POINTS: /* Sequence of points selected */ - ret_value=(*H5S_sel_point->deserialize)(space,buf); + ret_value = (*H5S_sel_point->deserialize)(tmp_space, p); break; case H5S_SEL_HYPERSLABS: /* Hyperslab selection defined */ - ret_value=(*H5S_sel_hyper->deserialize)(space,buf); + ret_value = (*H5S_sel_hyper->deserialize)(tmp_space, p); break; case H5S_SEL_ALL: /* Entire extent selected */ - ret_value=(*H5S_sel_all->deserialize)(space,buf); + ret_value = (*H5S_sel_all->deserialize)(tmp_space, p); break; case H5S_SEL_NONE: /* Nothing selected */ - ret_value=(*H5S_sel_none->deserialize)(space,buf); + ret_value = (*H5S_sel_none->deserialize)(tmp_space, p); break; default: break; } - if(ret_value<0) + if(ret_value < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTLOAD, FAIL, "can't deserialize selection") + /* Return space to the caller if allocated */ + if(!*space) + *space = tmp_space; + done: + /* Free temporary space if not passed to caller (only happens on error) */ + if(!*space && tmp_space) + if(H5S_close(tmp_space) < 0) + HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "can't close dataspace") + FUNC_LEAVE_NOAPI(ret_value) } /* H5S_select_deserialize() */ -- cgit v0.12 From c4044e0c85778e6bd3eda61b7bfdf6bb0fd0a8e9 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Wed, 25 Feb 2015 13:48:31 -0500 Subject: [svn-r26303] remove files with .clog2 extension generated by MPE when doing make clean. --- Makefile.in | 4 ++-- c++/Makefile.in | 4 ++-- c++/examples/Makefile.in | 4 ++-- c++/src/Makefile.in | 4 ++-- c++/test/Makefile.in | 6 +++--- config/commence.am | 4 ++-- examples/Makefile.in | 5 +++-- fortran/Makefile.in | 4 ++-- fortran/examples/Makefile.in | 4 ++-- fortran/src/Makefile.in | 4 ++-- fortran/test/Makefile.in | 4 ++-- fortran/testpar/Makefile.in | 4 ++-- hl/Makefile.in | 4 ++-- hl/c++/Makefile.in | 4 ++-- hl/c++/examples/Makefile.in | 4 ++-- hl/c++/src/Makefile.in | 4 ++-- hl/c++/test/Makefile.in | 4 ++-- hl/examples/Makefile.in | 4 ++-- hl/fortran/Makefile.in | 4 ++-- hl/fortran/examples/Makefile.in | 4 ++-- hl/fortran/src/Makefile.in | 4 ++-- hl/fortran/test/Makefile.in | 6 +++--- hl/src/Makefile.in | 4 ++-- hl/test/Makefile.in | 12 ++++++------ hl/tools/Makefile.in | 4 ++-- hl/tools/gif2h5/Makefile.in | 4 ++-- src/H5Shyper.c | 3 ++- src/Makefile.in | 4 ++-- test/Makefile.in | 6 +++--- testpar/Makefile.in | 6 +++--- tools/Makefile.in | 4 ++-- tools/h5copy/Makefile.in | 4 ++-- tools/h5diff/Makefile.in | 4 ++-- tools/h5dump/Makefile.in | 4 ++-- tools/h5import/Makefile.in | 4 ++-- tools/h5jam/Makefile.in | 6 +++--- tools/h5ls/Makefile.in | 4 ++-- tools/h5repack/Makefile.in | 4 ++-- tools/h5stat/Makefile.in | 4 ++-- tools/lib/Makefile.in | 4 ++-- tools/misc/Makefile.in | 4 ++-- tools/perform/Makefile.in | 4 ++-- 42 files changed, 94 insertions(+), 92 deletions(-) diff --git a/Makefile.in b/Makefile.in index f9c1263..9c1d71e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -501,10 +501,10 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Some files/directories generated during check that should be cleaned -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *-tmp +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *-tmp @BUILD_PARALLEL_CONDITIONAL_FALSE@TESTPARALLEL_DIR = # Define subdirectories to build. diff --git a/c++/Makefile.in b/c++/Makefile.in index ad4923f..45aeb34 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -661,8 +661,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 @BUILD_CXX_CONDITIONAL_TRUE@SUBDIRS = src test DIST_SUBDIRS = src test examples diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 8a6f4dc..d4a652f 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -609,8 +609,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 INSTALL_SCRIPT_FILES = run-c++-ex.sh # These are the programs that 'make all' or 'make prog' will build and diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 0faf8d9..a55cfac 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -675,8 +675,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index f6e2044..8b0b90f 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -666,10 +666,10 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files -CHECK_CLEANFILES = *.chkexe *.chklog *.clog tattr_multi.h5 tfattrs.h5 \ - tattr_scalar.h5 tattr_compound.h5 tattr_dtype.h5 \ +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 tattr_multi.h5 \ + tfattrs.h5 tattr_scalar.h5 tattr_compound.h5 tattr_dtype.h5 \ tattr_basic.h5 # These are our main targets. They should be listed in the order to be diff --git a/config/commence.am b/config/commence.am index 4bc005e..554c9fb 100644 --- a/config/commence.am +++ b/config/commence.am @@ -89,8 +89,8 @@ F9XMODFLAG=@F9XMODFLAG@ # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES=*.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES=*.chkexe *.chklog *.clog *.clog2 # List all build rules defined by HDF5 Makefiles as "PHONY" targets here. # This tells the Makefiles that these targets are not files to be built but diff --git a/examples/Makefile.in b/examples/Makefile.in index 5327842..7400481 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -609,8 +609,9 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog $(EXTLINK_DIRS) *.h5 +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 $(EXTLINK_DIRS) \ + *.h5 @BUILD_PARALLEL_CONDITIONAL_TRUE@EXAMPLE_PROG_PARA = ph5example INSTALL_SCRIPT_FILES = run-c-ex.sh INSTALL_TOP_SCRIPT_FILES = run-all-ex.sh diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 2d0e0b7..74914fb 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -665,8 +665,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 @BUILD_PARALLEL_CONDITIONAL_TRUE@TESTPARALLEL_DIR = testpar # Subdirectories in build order, not including examples directory diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index c468739..eca49ec 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -617,8 +617,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # Compile parallel fortran examples only if parallel is enabled @BUILD_PARALLEL_CONDITIONAL_TRUE@EXAMPLE_PROG_PARA = ph5example diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 7466528..cf29fed 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -726,8 +726,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index c2055c4..4d1e458 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -735,10 +735,10 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.raw +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.raw # The Fortran test library noinst_LTLIBRARIES = libh5test_fortran.la diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index 97e59ed..fb38854 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -661,10 +661,10 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files -CHECK_CLEANFILES = *.chkexe *.chklog *.clog parf[12].h5 +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 parf[12].h5 # These are our main targets TEST_PROG_PARA = parallel_test diff --git a/hl/Makefile.in b/hl/Makefile.in index 6ca0805..f3d6c04 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -665,8 +665,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 @BUILD_FORTRAN_CONDITIONAL_TRUE@FORTRAN_DIR = fortran @BUILD_CXX_CONDITIONAL_TRUE@CXX_DIR = c++ @BUILD_HDF5_HL_CONDITIONAL_TRUE@SUBDIRS = src test tools $(CXX_DIR) $(FORTRAN_DIR) diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index f16130a..0367469 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -661,8 +661,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 SUBDIRS = src test DIST_SUBDIRS = src test examples diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index 83f07f2..a9ecd9e 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -608,8 +608,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # These are the programs that 'make all' or 'make prog' will build and # which 'make check' will run. List them in the order they should be run. diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 98110b9..7e8c4ba 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -667,8 +667,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 7e50ec4..1160548 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -664,8 +664,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # These are our main targets. They should be listed in the order to be # executed, generally most specific tests to least specific tests. diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 43c6e3c..92a8301 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -608,8 +608,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 @BUILD_PARALLEL_CONDITIONAL_TRUE@EXAMPLE_PROG_PARA = # Example directory diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index ff02a60..7c6f2e2 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -665,8 +665,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 SUBDIRS = src test DIST_SUBDIRS = src test examples diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 27b1dee..af5a18a 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -608,8 +608,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # Compile parallel fortran examples only if parallel is enabled @BUILD_PARALLEL_CONDITIONAL_TRUE@EXAMPLE_PROG_PARA = diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 6979867..3ccfb9d 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -682,8 +682,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index 50b8780..e1b28a5 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -673,11 +673,11 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog dsetf[1-5].h5 f1img.h5 \ - f1tab.h5 tstds.h5 +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 dsetf[1-5].h5 \ + f1img.h5 f1tab.h5 tstds.h5 # Our main target, the test programs TEST_PROG = tstds tstlite tstimage tsttable diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index a848280..ee3ef49 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -663,8 +663,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index e0ce927..75350ec 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -700,14 +700,14 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. These files are the ones created by running `make test'. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog combine_tables[1-2].h5 \ - test_ds[1-9].h5 test_ds10.h5 test_image[1-3].h5 \ - file_img[1-2].h5 test_lite[1-4].h5 test_table.h5 \ - test_packet_table.h5 test_packet_compress.h5 test_detach.h5 \ - test_dectris.h5 +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 \ + combine_tables[1-2].h5 test_ds[1-9].h5 test_ds10.h5 \ + test_image[1-3].h5 file_img[1-2].h5 test_lite[1-4].h5 \ + test_table.h5 test_packet_table.h5 test_packet_compress.h5 \ + test_detach.h5 test_dectris.h5 # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index bb7f71a..9d4359e 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -662,8 +662,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # All subdirectories SUBDIRS = gif2h5 diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index 2317975..b8fdd3a 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -676,8 +676,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.gif +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.gif # These are our main targets, the tools TEST_SCRIPT = h52giftest.sh diff --git a/src/H5Shyper.c b/src/H5Shyper.c index dfc0d06..9b1562f 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -8888,7 +8888,7 @@ H5Sis_regular_hyperslab(hid_t spaceid) htri_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE1("Hs", "i", spaceid); + H5TRACE1("t", "i", spaceid); /* Check args */ if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) @@ -8938,6 +8938,7 @@ H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE5("e", "i*h*h*h*h", spaceid, start, stride, count, block); /* Check args */ if(NULL == (space = (H5S_t *)H5I_object_verify(spaceid, H5I_DATASPACE))) diff --git a/src/Makefile.in b/src/Makefile.in index 3ba2e3c..46e48a0 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -725,8 +725,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. diff --git a/test/Makefile.in b/test/Makefile.in index cd089e8..918a803 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1068,15 +1068,15 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. These files are the ones created by setting the # HDF5_NOCLEANUP environment variable and running `make test' without # specifying a file prefix or low-level driver. Changing the file # prefix or low-level driver with environment variables will influence # the temporary file name in ways that the makefile is not aware of. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ - compact_dataset.h5 dataset.h5 dset_offset.h5 \ +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 accum.h5 \ + cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offset.h5 \ max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 \ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 959731e..23ae44a 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -691,15 +691,15 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files # MPItest.h5 is from t_mpi # Para*.h5 are from testphdf # shutdown.h5 is from t_pshutdown # go is used for debugging. See testphdf5.c. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog MPItest.h5 Para*.h5 \ - CacheTestDummy.h5 shutdown.h5 go +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 MPItest.h5 \ + Para*.h5 CacheTestDummy.h5 shutdown.h5 go # Test programs. These are our main targets. # diff --git a/tools/Makefile.in b/tools/Makefile.in index ef0d6ab..4bd80af 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -662,8 +662,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 CONFIG = ordered # All subdirectories diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index 2cb3a1e..e9a5e62 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -670,11 +670,11 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 # Test programs and scripts TEST_PROG = h5copygentest diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 860590c..29543a4 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -677,11 +677,11 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by h5diff. They should # be copied to the testfiles/ directory if update is required -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 expect_sorted \ +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 expect_sorted \ actual_sorted # Always build and test h5diff but build and test ph5diff only if parallel diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 287713d..fb8cc9b 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -676,11 +676,11 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.bin +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin # Test programs and scripts TEST_PROG = h5dumpgentest diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 7b9eadc..ed26aab 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -670,10 +670,10 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files from h5importtest -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.bin +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.bin # Test programs and scripts TEST_PROG = h5importtest diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 4c40784..855b708 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -682,12 +682,12 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by jamgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 testfiles/h5jam-*-sav \ - testfiles/h5unjam-*-sav +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 \ + testfiles/h5jam-*-sav testfiles/h5unjam-*-sav TEST_SCRIPT = testh5jam.sh # Add h5jam and h5unjam specific linker flags here diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index bd1244c..0a33e29 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -662,8 +662,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Test programs and scripts TEST_SCRIPT = testh5ls.sh diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 9edb827..698b8a3 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -694,11 +694,11 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by h5repack. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.bin \ +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 *.bin \ testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5 # Test programs and scripts diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 9e9a6aa..993a226 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -672,12 +672,12 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by h5repart_gentest. They should # copied to the testfiles/ directory if update is required. fst_family*.h5 # and scd_family*.h5 were created by setting the HDF5_NOCLEANUP variable. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 \ +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 \ ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5 #test script and program diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 26e88ee..607f1ed 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -659,8 +659,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # This is our main target, the h5tools library. noinst_LTLIBRARIES = libh5tools.la diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index 06396f8..e11838f 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -697,12 +697,12 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. +# *.clog and *.clog2 are from the MPE option. # Temporary files. *.h5 are generated by h5repart_gentest. They should # copied to the testfiles/ directory if update is required. fst_family*.h5 # and scd_family*.h5 were created by setting the HDF5_NOCLEANUP variable. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 \ +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 *.h5 \ ../testfiles/fst_family*.h5 ../testfiles/scd_family*.h5 #test script and program diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 728ce45..1f903c5 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -701,8 +701,8 @@ TRACE = perl $(top_srcdir)/bin/trace # .chkexe files are used to mark tests that have run successfully. # .chklog files are output from those tests. -# *.clog are from the MPE option. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog +# *.clog and *.clog2 are from the MPE option. +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 # Add h5perf and h5perf_serial specific linker flags here h5perf_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) -- cgit v0.12 From aad4250bd6f90e914ab71ce85c7d9e8793554b96 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 25 Feb 2015 15:20:31 -0500 Subject: [svn-r26305] convert dump_dcpl to use switch statement Add default case refactor out start ctx and end ctx Tested: local linux --- tools/lib/h5tools_dump.c | 430 +++++++++++++++++++++-------------------------- 1 file changed, 189 insertions(+), 241 deletions(-) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index ba1af19..26cac47 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2468,7 +2468,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ /* Close array base type */ if(H5Tclose(super) < 0) HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tclose failed"); - } + } else HERROR(H5E_tools_g, H5E_tools_min_id_g, "H5Tget_super failed"); @@ -2842,17 +2842,13 @@ h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, } + /*------------------------------------------------------------------------- * Function: dump_fill_value * * Purpose: prints the fill value * * Return: void - * - * Programmer: pvn - * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -2883,15 +2879,11 @@ h5tools_print_fill_value(h5tools_str_t *buffer/*in,out*/, const h5tool_format_t * Purpose: prints several dataset create property list properties * * Return: void - * - * Modifications: pvn, March 28, 2008 - * Add a COMPRESSION ratio information for cases when filters are present - * *------------------------------------------------------------------------- */ void h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t dcpl_id,hid_t type_id, hid_t obj_id) + h5tools_context_t *ctx, hid_t dcpl_id, hid_t type_id, hid_t obj_id) { int nfilters; /* number of filters */ int rank; /* rank */ @@ -2905,16 +2897,18 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, H5D_fill_value_t fvstatus; H5D_alloc_time_t at; H5D_fill_time_t ft; - size_t ncols = 80; /* available output width */ + H5D_layout_t stl; + size_t ncols = 80; /* available output width */ size_t cd_nelmts; /* filter client number of values */ off_t offset; /* offset of external file */ char f_name[256]; /* filter name */ - char name[256]; /* external file name */ + char name[256]; /* external or virtual file name */ + char dsetname[256]; /* virtual datset name */ hsize_t chsize[64]; /* chunk size in elements */ hsize_t size; /* size of external file */ hsize_t storage_size; - hsize_t curr_pos = 0; /* total data element position */ - h5tools_str_t buffer; /* string into which to render */ + hsize_t curr_pos = 0; /* total data element position */ + h5tools_str_t buffer; /* string into which to render */ /* setup */ HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2936,216 +2930,172 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_str_append(&buffer, "%s %s", STORAGE_LAYOUT, BEGIN); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - if(H5D_CHUNKED == H5Pget_layout(dcpl_id)) { - ctx->indent_level++; + ctx->indent_level++; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s ", CHUNKED); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - rank = H5Pget_chunk(dcpl_id,(int)NELMTS(chsize),chsize); - h5tools_str_append(&buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin, chsize[0]); - for(i = 1; i < rank; i++) - h5tools_str_append(&buffer, ", " HSIZE_T_FORMAT, chsize[i]); - h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + stl = H5Pget_layout(dcpl_id); + switch (stl) { + case H5D_CHUNKED: + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s ", CHUNKED); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); + rank = H5Pget_chunk(dcpl_id, (int) NELMTS(chsize), chsize); + h5tools_str_append(&buffer, "%s " HSIZE_T_FORMAT, h5tools_dump_header_format->dataspacedimbegin, chsize[0]); + for(i = 1; i < rank; i++) + h5tools_str_append(&buffer, ", " HSIZE_T_FORMAT, chsize[i]); + h5tools_str_append(&buffer, " %s", h5tools_dump_header_format->dataspacedimend); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); - /* if there are filters, print a compression ratio */ - if(nfilters) { - hsize_t dims[H5S_MAX_RANK]; - hsize_t nelmts = 1; - double ratio = 0; - int ok = 0; - - hid_t tid = H5Dget_type(obj_id); - hid_t sid = H5Dget_space(obj_id); - size_t datum_size = H5Tget_size(tid); - int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); - - /* only print the compression ratio for these filters */ - for(i = 0; i < nfilters && !ok; i++) { - cd_nelmts = NELMTS(cd_values); - filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, - cd_values, sizeof(f_name), f_name, NULL); - ok = (filtn>=0); - - /* this following code will not show compression ratio for - user defined filter. For example, see HDFFV-8344 --xcao@hdfgroup.org - switch(filtn) { - case H5Z_FILTER_DEFLATE: - case H5Z_FILTER_SZIP: - case H5Z_FILTER_NBIT: - case H5Z_FILTER_SCALEOFFSET: - ok = 1; - break; - } - */ - } + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - if(ndims && ok) { - hsize_t uncomp_size; + h5tools_str_reset(&buffer); - for(i = 0; i < ndims; i++) { - nelmts *= dims[i]; + /* if there are filters, print a compression ratio */ + if (nfilters) { + hsize_t dims[H5S_MAX_RANK]; + hsize_t nelmts = 1; + double ratio = 0; + int ok = 0; + + hid_t tid = H5Dget_type(obj_id); + hid_t sid = H5Dget_space(obj_id); + size_t datum_size = H5Tget_size(tid); + int ndims = H5Sget_simple_extent_dims(sid, dims, NULL); + + /* only print the compression ratio for these filters */ + for (i = 0; i < nfilters && !ok; i++) { + cd_nelmts = NELMTS(cd_values); + filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), + f_name, NULL); + ok = (filtn >= 0); } - uncomp_size = nelmts * datum_size; - /* compression ratio = uncompressed size / compressed size */ + if(ndims && ok) { + hsize_t uncomp_size; - if(storage_size != 0) - ratio = (double) uncomp_size / (double) storage_size; + for(i = 0; i < ndims; i++) { + nelmts *= dims[i]; + } + uncomp_size = nelmts * datum_size; - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio); + /* compression ratio = uncompressed size / compressed size */ - } - else - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + if(storage_size != 0) + ratio = (double) uncomp_size / (double) storage_size; - H5Sclose(sid); - H5Tclose(tid); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT" (%.3f:1 COMPRESSION)", storage_size, ratio); - } - else { - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - } - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + } + else + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - ctx->indent_level--; + H5Sclose(sid); + H5Tclose(tid); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else if(H5D_COMPACT == H5Pget_layout(dcpl_id)) { - ctx->indent_level++; + } + else { + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + } + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + break; + case H5D_COMPACT: + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", COMPACT); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", COMPACT); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "SIZE " HSIZE_T_FORMAT, storage_size); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + break; + case H5D_CONTIGUOUS: + { + int next; - ctx->indent_level--; + next = H5Pget_external_count(dcpl_id); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else if(H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) { - int next; + /*------------------------------------------------------------------------- + * EXTERNAL_FILE + *------------------------------------------------------------------------- + */ + if (next) { + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); - next = H5Pget_external_count(dcpl_id); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - /*------------------------------------------------------------------------- - * EXTERNAL_FILE - *------------------------------------------------------------------------- - */ - if(next) { - ctx->indent_level++; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", CONTIGUOUS); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->indent_level++; + for (j = 0; j < (unsigned) next; j++) { + H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s %s", EXTERNAL, BEGIN); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->indent_level++; - for(j = 0; j < (unsigned)next; j++) { - H5Pget_external(dcpl_id, j, sizeof(name), name, &offset, &size); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size); + h5tools_str_append(&buffer, " OFFSET %ld", offset); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + } + ctx->indent_level--; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "FILENAME %s SIZE " HSIZE_T_FORMAT, name, size); - h5tools_str_append(&buffer, " OFFSET %ld", offset); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - ctx->indent_level--; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + } + else { + haddr_t ioffset; - ctx->indent_level--; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", CONTIGUOUS); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - else { - haddr_t ioffset; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->indent_level++; + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s", CONTIGUOUS); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - + h5tools_str_reset(&buffer); + ioffset = H5Dget_offset(obj_id); + h5tools_str_append(&buffer, "OFFSET "H5_PRINTF_HADDR_FMT, ioffset); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + } + } + break; + default: h5tools_str_reset(&buffer); - h5tools_str_append(&buffer,"SIZE " HSIZE_T_FORMAT, storage_size); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_append(&buffer, "%s", "Unknown layout"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t) ncols, (hsize_t) 0, (hsize_t) 0); + }/*switch*/ - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - ioffset = H5Dget_offset(obj_id); - h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->indent_level--; - ctx->indent_level--; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } - } - /*------------------------------------------------------------------------- + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + /*------------------------------------------------------------------------- * FILTERS *------------------------------------------------------------------------- */ @@ -3165,7 +3115,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, filtn = H5Pget_filter2(dcpl_id, (unsigned)i, &filt_flags, &cd_nelmts, cd_values, sizeof(f_name), f_name, NULL); - if (filtn<0) + if (filtn < 0) continue; /* nothing to print for invalid filter */ ctx->need_prefix = TRUE; @@ -3186,70 +3136,68 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); break; case H5Z_FILTER_SZIP: - { - szip_options_mask = cd_values[0];; - szip_pixels_per_block = cd_values[1]; + szip_options_mask = cd_values[0];; + szip_pixels_per_block = cd_values[1]; - h5tools_str_append(&buffer, "%s %s",SZIP, BEGIN); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_append(&buffer, "%s %s", SZIP, BEGIN); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->indent_level++; + ctx->indent_level++; - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) - h5tools_str_append(&buffer, "MODE %s", "HARDWARE"); - else if(szip_options_mask & H5_SZIP_ALLOW_K13_OPTION_MASK) - h5tools_str_append(&buffer, "MODE %s", "K13"); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "PIXELS_PER_BLOCK %d", szip_pixels_per_block); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - if(szip_options_mask & H5_SZIP_EC_OPTION_MASK) - h5tools_str_append(&buffer, "CODING %s", "ENTROPY"); - else if(szip_options_mask & H5_SZIP_NN_OPTION_MASK) - h5tools_str_append(&buffer, "CODING %s", "NEAREST NEIGHBOUR"); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK) - h5tools_str_append(&buffer, "BYTE_ORDER %s", "LSB"); - else if(szip_options_mask & H5_SZIP_MSB_OPTION_MASK) - h5tools_str_append(&buffer, "BYTE_ORDER %s", "MSB"); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + h5tools_str_reset(&buffer); + if(szip_options_mask & H5_SZIP_CHIP_OPTION_MASK) + h5tools_str_append(&buffer, "MODE %s", "HARDWARE"); + else if(szip_options_mask & H5_SZIP_ALLOW_K13_OPTION_MASK) + h5tools_str_append(&buffer, "MODE %s", "K13"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { - ctx->need_prefix = TRUE; - h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); - - h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "HEADER %s", "RAW"); - h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - } + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + if(szip_options_mask & H5_SZIP_EC_OPTION_MASK) + h5tools_str_append(&buffer, "CODING %s", "ENTROPY"); + else if(szip_options_mask & H5_SZIP_NN_OPTION_MASK) + h5tools_str_append(&buffer, "CODING %s", "NEAREST NEIGHBOUR"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); - ctx->indent_level--; + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + h5tools_str_reset(&buffer); + if(szip_options_mask & H5_SZIP_LSB_OPTION_MASK) + h5tools_str_append(&buffer, "BYTE_ORDER %s", "LSB"); + else if(szip_options_mask & H5_SZIP_MSB_OPTION_MASK) + h5tools_str_append(&buffer, "BYTE_ORDER %s", "MSB"); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); + + if(szip_options_mask & H5_SZIP_RAW_OPTION_MASK) { ctx->need_prefix = TRUE; h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); - h5tools_str_append(&buffer, "%s",END); + h5tools_str_append(&buffer, "HEADER %s", "RAW"); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); } + + ctx->indent_level--; + + ctx->need_prefix = TRUE; + h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); + + h5tools_str_reset(&buffer); + h5tools_str_append(&buffer, "%s", END); + h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); break; case H5Z_FILTER_NBIT: h5tools_str_append(&buffer, "%s", NBIT); @@ -3260,7 +3208,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); break; default: - /* filter do not have to be avaiable for showing registered filter info. + /* filters do not have to be available for showing registered filter info. see HDFFV-8346 for details. --xcao@hdfgroup.org if(H5Zfilter_avail(filtn)) h5tools_str_append(&buffer, "%s %s", "USER_REGISTERED_FILTER", BEGIN); -- cgit v0.12 From a83b6d665123ed36b72607b1e17aa7cb96696eb9 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 26 Feb 2015 09:02:48 -0500 Subject: [svn-r26311] Merged r26266-7 from features/autotools_rework Updates the bin/chkmanifest script so that it parses the output of svn commands instead of hacking at the .svn/entries file. This will make the script more future-proof and allows it to work with current Subversion repositories. Tested on: jam (bin/chkmanifest only) --- bin/chkmanifest | 136 +++++++++++++++++++------------------------------------- 1 file changed, 46 insertions(+), 90 deletions(-) diff --git a/bin/chkmanifest b/bin/chkmanifest index 70c38a9..6188eab 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -20,75 +20,17 @@ verbose=yes MANIFEST=/tmp/HD_MANIFEST.$$ -SVNENTRY=/tmp/HD_SVNENTRY.$$ - -# function definitions - -GETSVNENTRIES_13 () -# Purpose: Extract filenames from the svn v1.3.* entries file -# $1: directory name in which the svn entries is. -# steps: -# 1. remove all single line entries so that step 2 does not fail on them. -# 2. merge all multiple lines entries into single lines. -# 3. remove all non file entries. -# 4. insert a blank line because some entries files has no kind="file" -# entry and ed does not like to do g on an empty file. -# 5. remove everything except the file name. -# 6. remove all blank lines, including the inserted one. -{ -cp $1/entries $SVNENTRY -chmod u+w $SVNENTRY # entries file is not writable. -ed - $SVNENTRY <$/d -g/^$/j -v/kind="file"/d -a - -. -g/.*name="/s/// -g/".*/s/// -g/^$/d -w -q -EOF -cat $SVNENTRY -rm $SVNENTRY -} - -GETSVNENTRIES_14 () -# Purpose: Extract filenames from the svn v1.4.* entries file -# $1: directory name in which the svn entries is. -# steps: -# 1. all valid files are followed by a line containing "file" only. -# 2. find them by looking for "file" first, then mark its preceding line as -# wanted. -# 3. remove all non-marked line. -# 4. insert a blank line because some entries files has no kind="file" -# entry and ed does not like to do g on an empty file. -# 5. remove the marks. -{ -cp $1/entries $SVNENTRY -chmod u+w $SVNENTRY # entries file is not writable. -ed - $SVNENTRY <&2 # clean up $MANIFEST file when exits trap "rm -f $MANIFEST" 0 +# Only split lines on newline, not whitespace +set -f +IFS=' +' + # First make sure i am in the directory in which there is an MANIFEST file # and then do the checking from there. Will try the following, # current directory, parent directory, the directory this command resides. @@ -132,36 +74,50 @@ for file in `cat $MANIFEST`; do fi done +# Get the list of files under version control and check that they are +# present. +# +# First get a list of all the pending files with svn stat and +# check those. +svn_stat="$(svn stat -q)" +for file in $svn_stat; do + # Newly added files are not listed by svn ls, which + # we check below.. + # The line listing them starts with 'A'. + letter="$(echo $file | head -c 1)" + if [ "$letter" = "A" ]; then + # Convert 'A ' to './' so it matches + # the manifest file name. + path=`echo $file | sed 's/^A\s*/\.\//g'` + # Ignore directories + if [ ! -d $path ]; then + if (grep ^$path$ $MANIFEST >/dev/null); then + : + else + echo "+ $path" + fail=yes + fi + fi + fi +done -# Inspect the .svn/entries to figure out what version of svn file entry is -# used. -# The following algorithm is formed via reverse engineering. -# I don't know what the official svn format is if such a specification exists. -# Algorithm: -# If the first line of the file has 'xml version="1.0"' in it, it is created -# by svn 1.3 or older; else if it has '^file$' in it, it is created by svn 1.4. -svn_entry_file=.svn/entries -if head -1 $svn_entry_file | grep 'xml version="1.0"' > /dev/null 2>&1;then - getsvnentries=GETSVNENTRIES_13 -elif grep '^file$' $svn_entry_file > /dev/null 2>&1; then - getsvnentries=GETSVNENTRIES_14 -else - echo "Unknown svn entries format. Aborted" - exit 1 -fi - -for svn in `find . -type d -name .svn -print`; do - path=`echo $svn |sed 's/\/.svn//'` - for file in `$getsvnentries $svn`; do - if (grep ^$path/$file$ $MANIFEST >/dev/null); then - : - else - echo "+ $path/$file" - fail=yes - fi - done +# Next check svn ls, which gets a list of all files that are +# checked in. +svn_ls="$(svn ls -R)" +for file in $svn_ls; do + path="./${file}" + # Ignore directories + if [ ! -d $path ]; then + if (grep ^$path$ $MANIFEST >/dev/null); then + : + else + echo "+ $path" + fail=yes + fi + fi done +# Finish up if [ "X$fail" = "Xyes" ]; then cat 1>&2 < Date: Thu, 26 Feb 2015 13:19:41 -0500 Subject: [svn-r26320] Trigger component install options --- CMakeInstallation.cmake | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/CMakeInstallation.cmake b/CMakeInstallation.cmake index c83d6bb..f5c2dda 100644 --- a/CMakeInstallation.cmake +++ b/CMakeInstallation.cmake @@ -80,10 +80,10 @@ configure_package_config_file ( if (NOT HDF5_EXTERNALLY_CONFIGURED) configure_file ( ${HDF_RESOURCES_DIR}/FindHDF5.cmake.in - ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY + ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindHDF5${HDF_PACKAGE_EXT}.cmake @ONLY ) install ( - FILES ${HDF5_BINARY_DIR}/CMakeFiles/FindHDF5${HDF_PACKAGE_EXT}.cmake + FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindHDF5${HDF_PACKAGE_EXT}.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) @@ -97,14 +97,14 @@ set (SHARE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${HDF5_INSTALL_CMAKE_DIR}" ) set (CURRENT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}" ) configure_package_config_file ( ${HDF_RESOURCES_DIR}/hdf5-config.cmake.in - "${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" + "${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake" INSTALL_DESTINATION "${HDF5_INSTALL_CMAKE_DIR}" PATH_VARS INCLUDE_INSTALL_DIR SHARE_INSTALL_DIR CURRENT_BUILD_DIR ) if (NOT HDF5_EXTERNALLY_CONFIGURED) install ( - FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake + FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) @@ -116,10 +116,10 @@ endif (NOT HDF5_EXTERNALLY_CONFIGURED) if (NOT HDF5_EXTERNALLY_CONFIGURED) configure_file ( ${HDF_RESOURCES_DIR}/hdf5-config-version.cmake.in - ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY + ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake @ONLY ) install ( - FILES ${HDF5_BINARY_DIR}/CMakeFiles/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake + FILES ${HDF5_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${HDF5_PACKAGE}${HDF_PACKAGE_EXT}-config-version.cmake DESTINATION ${HDF5_INSTALL_CMAKE_DIR} COMPONENT configinstall ) @@ -317,7 +317,6 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}\\\\hdf.bmp") set (CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}") set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_VENDOR}\\\\${CPACK_PACKAGE_NAME}\\\\${CPACK_PACKAGE_VERSION}") - set (CPACK_MONOLITHIC_INSTALL ON) set (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") set (CPACK_NSIS_MODIFY_PATH ON) @@ -361,12 +360,16 @@ if (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) # # This image must be 493 by 312 pixels. # + set(CPACK_WIX_PROPERTY_ARPCOMMENTS "HDF5 (Hierarchical Data Format 5) Software Library and Utilities") + set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${HDF5_PACKAGE_URL}") + set(CPACK_WIX_PROPERTY_ARPHELPLINK "${HDF5_PACKAGE_BUGREPORT}") elseif (APPLE) list (APPEND CPACK_GENERATOR "DragNDrop") set (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) set (CPACK_PACKAGING_INSTALL_PREFIX "/${CPACK_PACKAGE_INSTALL_DIRECTORY}") set (CPACK_PACKAGE_ICON "${HDF_RESOURCES_EXT_DIR}/hdf.icns") + option (HDF5_PACK_MACOSX_BUNDLE "Package the HDF5 Library in a Bundle" OFF) if (HDF5_PACK_MACOSX_BUNDLE) list (APPEND CPACK_GENERATOR "Bundle") set (CPACK_BUNDLE_NAME "${HDF5_PACKAGE_STRING}") @@ -466,6 +469,21 @@ The HDF5 data model, file format, API, library, and tools are open and distribut include (CPack) + cpack_add_install_type(Full DISPLAY_NAME "Everything") + cpack_add_install_type(Developer) + + cpack_add_component_group(Runtime) + + cpack_add_component_group(Development + EXPANDED + DESCRIPTION "All of the tools you'll need to develop HDF5 applications" + ) + + cpack_add_component_group(Applications + EXPANDED + DESCRIPTION "Tools for HDF5 files" + ) + #--------------------------------------------------------------------------- # Now list the cpack commands #--------------------------------------------------------------------------- -- cgit v0.12 From 2048e0bff92e65442c454d7bd103d15a1a298325 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 26 Feb 2015 15:39:51 -0500 Subject: [svn-r26321] Fix for HDFFV-9042. tested: h5commit --- hl/src/H5PT.c | 3 ++ hl/test/test_packet.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index 7a0bc20..6ed1ac0 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -130,6 +130,9 @@ hid_t H5PTcreate_fl ( hid_t loc_id, if((table->type_id = H5Tcopy(dtype_id)) < 0) goto out; + if((table->type_id = H5Tget_native_type(table->type_id, H5T_DIR_DEFAULT)) < 0) + goto out; + H5PT_create_index(table); table->size = 0; diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 9d3074d..c7a1c27 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -895,6 +895,92 @@ error: return -1; } +/*------------------------------------------------------------------------- + * test_rw_non-native_dt + * + * test reading and writing packet table using datatypes that are not + * native. + * + *------------------------------------------------------------------------- + */ +static int test_rw_nonnative_dt(hid_t fid) +{ + hid_t ptable; /* Packet table identifier */ + + herr_t err; /* Function return status */ + hsize_t count; /* Number of records in the table */ + + int x; /* Loop variable */ + + /* Buffers to hold data */ + int writeBuffer[5]; + int readBuffer[5]; + + TESTING("reading/writing non-native packet table"); + + /* Initialize buffers */ + for(x=0; x<5; x++) { + writeBuffer[x]=x; + readBuffer[x] = -1; + } + + /* Create a fixed-length packet table within the file */ + /* This table's "packets" will be simple integers and it will use no compression */ + if(H5Tget_order(H5T_NATIVE_INT) == H5T_ORDER_LE) { + ptable = H5PTcreate_fl(fid, "Packet Test Dataset, Non-native", H5T_STD_I32BE, (hsize_t)100, -1); + } else { + ptable = H5PTcreate_fl(fid, "Packet Test Dataset, Non-native", H5T_STD_I32LE, (hsize_t)100, -1); + } + if(ptable == H5I_INVALID_HID) + goto out; + + /* Write one packet to the packet table */ + if( (err = H5PTappend(ptable, (hsize_t)1, &(writeBuffer[0]))) < 0 ) + goto out; + + /* Write several packets to the packet table */ + if( (err = H5PTappend(ptable, (hsize_t)4, &(writeBuffer[1]))) < 0) + goto out; + + if( (err = H5PTclose(ptable)) < 0) + goto out; + + /* Open the Packet table */ + if( (ptable = H5PTopen(fid, "Packet Test Dataset, Non-native")) < 0) + goto out; + + /* Get the number of packets in the packet table. This should be five. */ + if( (err = H5PTget_num_packets(ptable, &count)) < 0) + goto out; + + if( (int)count != 5 ) + goto out; + + /* Initialize packet table's "current record" */ + if( (err = H5PTcreate_index(ptable)) < 0) + goto out; + + /* Iterate through packets, read each one back */ + for(x=0; x<5; x++) { + if( (err = H5PTget_next(ptable, (hsize_t)1, &(readBuffer[x]))) < 0) + goto out; + if( x != readBuffer[x]) + goto out; + } + + /* Close the packet table */ + if( (err = H5PTclose(ptable)) < 0) + goto out; + + PASSED(); + return 0; + + out: + H5_FAILED(); + if( H5PTis_valid(ptable) < 0) + H5PTclose(ptable); + return -1; +} /*------------------------------------------------------------------------- * test_error @@ -1035,6 +1121,7 @@ static int test_packet_table(hid_t fid) test_read(fid); test_get_next(fid); test_big_table(fid); + test_rw_nonnative_dt(fid); #ifdef VLPT_REMOVED test_varlen(fid); #endif /* VLPT_REMOVED */ -- cgit v0.12 From 4c2749fb1da5181528e8b48caeda056d331e4e40 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 26 Feb 2015 19:49:32 -0500 Subject: [svn-r26324] Fixes another bug in bin/trace that prevents adding TRACE macros to API calls that use a FUNC_ENTER macro that does not include parentheses. This does not affect any source code at this time. Part of: HDFFV-9141 Tested on: jam (bin/trace behavior only) --- bin/trace | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/trace b/bin/trace index 5d5c5be..2823982 100755 --- a/bin/trace +++ b/bin/trace @@ -285,7 +285,7 @@ sub rewrite_func ($$$$$) { # Ignored due to NO TRACE comment. } elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) { # Replaced an H5TRACE macro. - } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*\(.*?\);??)\n/"$1$2$trace"/es) { + } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*(\(.*?\))?;??)\n/"$1$2$trace"/es) { # Added an H5TRACE macro after a FUNC_ENTER macro. } else { errmesg $file, $name, "unable to insert tracing information"; -- cgit v0.12 From c16d23010120083bdf8070b1e3920ca77f83ae50 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 26 Feb 2015 22:33:25 -0500 Subject: [svn-r26327] Added public API functions that expose the C library's memory allocator for use in filter functions that need to allocate or resize buffers. Intended for use with filter plugins, particularly on Windows, where C runtime (CRT) issues can cause problems. Fixes: HDFFV-9100 tested on: jam (minor, localized change) --- src/H5.c | 89 ++++++++++++++++++++++++++++++++++++++++-- src/H5MM.c | 114 +++++++++++++++++++++++++++++------------------------- src/H5MMprivate.h | 6 --- src/H5public.h | 2 + test/testhdf5.h | 12 ++++++ test/tmisc.c | 68 ++++++++++++++++++++++++++++++++ 6 files changed, 230 insertions(+), 61 deletions(-) diff --git a/src/H5.c b/src/H5.c index 52dc566..68b339a 100644 --- a/src/H5.c +++ b/src/H5.c @@ -860,27 +860,109 @@ H5close(void) /*------------------------------------------------------------------------- + * Function: H5allocate_memory + * + * Purpose: Allocate a memory buffer with the semantics of malloc(). + * + * NOTE: This function is intended for use with filter + * plugins so that all allocation and free operations + * use the same memory allocator. It is not intended for + * use as a general memory allocator in applications. + * + * Parameters: + * + * size: The size of the buffer. + * + * clear: Whether or not to memset the buffer to 0. + * + * Return: + * + * Success: A pointer to the allocated buffer. + * + * Failure: NULL + * + *------------------------------------------------------------------------- + */ +void * +H5allocate_memory(size_t size, hbool_t clear) +{ + void *ret_value = NULL; + + FUNC_ENTER_API_NOINIT; + H5TRACE2("*x", "zb", size, clear); + + if(clear) + ret_value = H5MM_calloc(size); + else + ret_value = H5MM_malloc(size); + + FUNC_LEAVE_API(ret_value) + +} /* end H5allocate_memory() */ + + +/*------------------------------------------------------------------------- + * Function: H5resize_memory + * + * Purpose: Resize a memory buffer with the semantics of realloc(). + * + * NOTE: This function is intended for use with filter + * plugins so that all allocation and free operations + * use the same memory allocator. It is not intended for + * use as a general memory allocator in applications. + * + * Parameters: + * + * mem: The buffer to be resized. + * + * size: The size of the buffer. + * + * Return: + * + * Success: A pointer to the resized buffer. + * + * Failure: NULL (the input buffer will be unchanged) + * + *------------------------------------------------------------------------- + */ +void * +H5resize_memory(void *mem, size_t size) +{ + void *ret_value = NULL; + + FUNC_ENTER_API_NOINIT; + H5TRACE2("*x", "*xz", mem, size); + + ret_value = H5MM_realloc(mem, size); + + FUNC_LEAVE_API(ret_value) + +} /* end H5resize_memory() */ + + +/*------------------------------------------------------------------------- * Function: H5free_memory * - * Purpose: Frees memory allocated by the library that it is the user's + * Purpose: Frees memory allocated by the library that it is the user's * responsibility to free. Ensures that the same library * that was used to allocate the memory frees it. Passing * NULL pointers is allowed. * - * Return: SUCCEED/FAIL + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5free_memory(void *mem) { - FUNC_ENTER_API_NOINIT + FUNC_ENTER_API_NOINIT; H5TRACE1("e", "*x", mem); /* At this time, it is impossible for this to fail. */ HDfree(mem); FUNC_LEAVE_API(SUCCEED) + } /* end H5free_memory() */ @@ -944,3 +1026,4 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved) return fOkay; } #endif /* H5_HAVE_WIN32_API && H5_BUILT_AS_DYNAMIC_LIB && H5_HAVE_WIN_THREADS && H5_HAVE_THREADSAFE*/ + diff --git a/src/H5MM.c b/src/H5MM.c index caeac37..8073bdb 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -31,93 +31,107 @@ #include "H5Eprivate.h" #include "H5MMprivate.h" -#ifndef NDEBUG /*------------------------------------------------------------------------- - * Function: H5MM_malloc + * Function: H5MM_malloc * - * Purpose: Just like the POSIX version of malloc(3). This routine - * specifically checks for allocations of 0 bytes and fails - * in that case. This routine is not called when NDEBUG is - * defined. + * Purpose: Similar to the C89 version of malloc(). * - * Return: Success: Ptr to new memory + * On size of 0, we return a NULL pointer instead of the + * standard-allowed 'special' pointer since that's more + * difficult to check as a return value. This is still + * considered an error condition since allocations of zero + * bytes usually indicate problems. + * + * Return: Success: Pointer new memory * - * Failure: NULL + * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Nov 8 2003 - * - * Modifications: + * Programmer: Quincey Koziol + * Nov 8 2003 * *------------------------------------------------------------------------- */ void * H5MM_malloc(size_t size) { + void *ret_value; + + HDassert(size); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(size); + if(size) + ret_value = HDmalloc(size); + else + ret_value = NULL; - FUNC_LEAVE_NOAPI(HDmalloc(size)); + FUNC_LEAVE_NOAPI(ret_value); } /* end H5MM_malloc() */ /*------------------------------------------------------------------------- - * Function: H5MM_calloc + * Function: H5MM_calloc * - * Purpose: Similar to the POSIX version of calloc(3), except this routine - * just takes a 'size' parameter. This routine - * specifically checks for allocations of 0 bytes and fails - * in that case. This routine is not called when NDEBUG is - * defined. + * Purpose: Similar to the C89 version of calloc(), except this + * routine just takes a 'size' parameter. * - * Return: Success: Ptr to new memory + * On size of 0, we return a NULL pointer instead of the + * standard-allowed 'special' pointer since that's more + * difficult to check as a return value. This is still + * considered an error condition since allocations of zero + * bytes usually indicate problems. * - * Failure: NULL * - * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Nov 8 2003 + * Return: Success: Pointer new memory * - * Modifications: + * Failure: NULL + * + * Programmer: Quincey Koziol + * Nov 8 2003 * *------------------------------------------------------------------------- */ void * H5MM_calloc(size_t size) { + void *ret_value; + + HDassert(size); + /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(size); + if(size) + ret_value = HDcalloc((size_t)1, size); + else + ret_value = NULL; - FUNC_LEAVE_NOAPI(HDcalloc(1,size)); + FUNC_LEAVE_NOAPI(ret_value); } /* end H5MM_calloc() */ -#endif /* NDEBUG */ /*------------------------------------------------------------------------- - * Function: H5MM_realloc + * Function: H5MM_realloc * - * Purpose: Just like the POSIX version of realloc(3). Specifically, the - * following calls are equivalent + * Purpose: Similar semantics as C89's realloc(). Specifically, the + * following calls are equivalent: * - * H5MM_realloc (NULL, size) <==> H5MM_malloc (size) - * H5MM_realloc (ptr, 0) <==> H5MM_xfree (ptr) - * H5MM_realloc (NULL, 0) <==> NULL + * H5MM_realloc(NULL, size) <==> H5MM_malloc(size) + * H5MM_realloc(ptr, 0) <==> H5MM_xfree(ptr) + * H5MM_realloc(NULL, 0) <==> NULL * - * Return: Success: Ptr to new memory or NULL if the memory - * was freed or HDrealloc couldn't allocate - * memory. + * Note that the (NULL, 0) combination is undefined behavior + * in the C standard. * - * Failure: NULL + * Return: Success: Ptr to new memory if size > 0 + * NULL if size is zero * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jul 10 1997 + * Failure: NULL (input buffer is unchanged on failure) + * + * Programmer: Robb Matzke + * Jul 10 1997 * *------------------------------------------------------------------------- */ @@ -129,16 +143,12 @@ H5MM_realloc(void *mem, size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - if(NULL == mem) { - if(0 == size) - ret_value = NULL; - else - ret_value = H5MM_malloc(size); - } /* end if */ - else if(0 == size) - ret_value = H5MM_xfree(mem); + HDassert(mem || size); + + if(NULL == mem && 0 == size) + ret_value = NULL; /* Not defined in the standard, return NULL */ else - ret_value = HDrealloc(mem, size); + ret_value = HDrealloc(mem, size); FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_realloc() */ diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index a3c39f0..0d608b2 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -33,19 +33,13 @@ /* Private headers needed by this file */ #include "H5private.h" -#ifdef NDEBUG -#define H5MM_malloc(Z) HDmalloc(Z) -#define H5MM_calloc(Z) HDcalloc((size_t)1,Z) -#endif /* NDEBUG */ #define H5MM_free(Z) HDfree(Z) /* * Library prototypes... */ -#ifndef NDEBUG H5_DLL void *H5MM_malloc(size_t size); H5_DLL void *H5MM_calloc(size_t size); -#endif /* NDEBUG */ H5_DLL void *H5MM_realloc(void *mem, size_t size); H5_DLL char *H5MM_xstrdup(const char *s); H5_DLL char *H5MM_strdup(const char *s); diff --git a/src/H5public.h b/src/H5public.h index 673aa6f..0e866be 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -332,6 +332,8 @@ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); H5_DLL herr_t H5free_memory(void *mem); +H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); +H5_DLL void *H5resize_memory(void *mem, size_t size); #ifdef __cplusplus } diff --git a/test/testhdf5.h b/test/testhdf5.h index 907fce9..62dadde 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -68,6 +68,18 @@ } \ } +#define CHECK_PTR_NULL(ret,where) { \ + if (VERBOSE_HI) { \ + print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ + (where), (int)__LINE__, __FILE__, (ret)); \ + } \ + if (ret) { \ + TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ + (where), (int)__LINE__, __FILE__); \ + H5Eprint2(H5E_DEFAULT, stdout); \ + } \ +} + /* Used to make certain a return value _is_ a value */ #define VERIFY(_x, _val, where) do { \ long __x = (long)_x, __val = (long)_val; \ diff --git a/test/tmisc.c b/test/tmisc.c index cac6b04..80f4fc7 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5304,6 +5304,73 @@ test_misc31(void) /**************************************************************** + * + * test_misc32(): Simple test of filter memory allocation + * functions. + * + ***************************************************************/ +static void +test_misc32(void) +{ + void *buffer; + void *resized; + size_t size; + + /* Output message about test being performed */ + MESSAGE(5, ("Edge case test of filter memory allocation functions\n")); + + /* Test that the filter memory allocation functions behave correctly + * at edge cases. + */ + + /* FREE */ + + /* Test freeing a NULL pointer. + * No real confirmation check here, but Valgrind will confirm no + * shenanigans. + */ + buffer = NULL; + H5free_memory(buffer); + + /* ALLOCATE */ + + /* Size zero returns NULL. + * Also checks that a size of zero and setting the buffer clear flag + * to TRUE can be used together. + * + * Note that we have asserts in the code, so only check when NDEBUG + * is defined. + */ +#ifdef NDEBUG + buffer = H5allocate_memory(0, FALSE); + CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ + buffer = H5allocate_memory(0, TRUE); + CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/a +#endif /* NDEBUG */ + + /* RESIZE */ + + /* Size zero returns NULL. Valgrind will confirm buffer is freed. */ + size = 1024; + buffer = H5allocate_memory(size, TRUE); + resized = H5resize_memory(buffer, 0); + CHECK_PTR_NULL(resized, "H5resize_memory"); + + /* NULL input pointer returns new buffer */ + resized = H5resize_memory(NULL, 1024); + CHECK_PTR(resized, "H5resize_memory"); + H5free_memory(resized); + + /* NULL input pointer and size zero returns NULL */ +#ifdef NDEBUG + resized = H5resize_memory(NULL, 0); + CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/ +#endif /* NDEBUG */ + +} /* end test_misc32() */ + + +/**************************************************************** ** ** test_misc(): Main misc. test routine. ** @@ -5349,6 +5416,7 @@ test_misc(void) test_misc29(); /* Test that speculative metadata reads are handled correctly */ test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ + test_misc32(); /* Test filter memory allocation functions */ } /* test_misc() */ -- cgit v0.12 From 7b7f0eafc57c083298d87a09df70a33f93e4760d Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 27 Feb 2015 06:05:02 -0500 Subject: [svn-r26328] Fixed a typo in tmisc.c. --- test/tmisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/tmisc.c b/test/tmisc.c index 80f4fc7..31d15ac 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5345,7 +5345,7 @@ test_misc32(void) buffer = H5allocate_memory(0, FALSE); CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ buffer = H5allocate_memory(0, TRUE); - CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/a + CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ #endif /* NDEBUG */ /* RESIZE */ -- cgit v0.12 From 7462a7ef1c3542b8812c8da86e79b15ce22d21cb Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 27 Feb 2015 07:50:38 -0500 Subject: [svn-r26329] Merge of r26069, r26070, and r26072 from the features/autotools_rework branch. Removed the configure option that allows selective disabling of individual internal filters (fletcher32, shuffle, etc.). This feature mucked up the code with a lot of #ifdefs, saved very little space, and was not scalable to a general scheme for library size reduction. We've decided to remove the feature while we investigate a more general scheme for decreasing the library size. Part of: HDFFV-9086 Tested on: h5committest --- CMakeFilters.cmake | 5 - Makefile.in | 5 - c++/Makefile.in | 5 - c++/examples/Makefile.in | 5 - c++/src/Makefile.in | 5 - c++/test/Makefile.in | 5 - config/cmake/H5pubconf.h.in | 12 -- configure | 84 --------- configure.ac | 69 ------- examples/Makefile.in | 5 - fortran/Makefile.in | 5 - fortran/examples/Makefile.in | 5 - fortran/src/Makefile.in | 5 - fortran/test/Makefile.in | 5 - fortran/testpar/Makefile.in | 5 - hl/Makefile.in | 5 - hl/c++/Makefile.in | 5 - hl/c++/examples/Makefile.in | 5 - hl/c++/src/Makefile.in | 5 - hl/c++/test/Makefile.in | 5 - hl/examples/Makefile.in | 5 - hl/fortran/Makefile.in | 5 - hl/fortran/examples/Makefile.in | 5 - hl/fortran/src/Makefile.in | 5 - hl/fortran/test/Makefile.in | 5 - hl/src/Makefile.in | 5 - hl/test/Makefile.in | 5 - hl/tools/Makefile.in | 5 - hl/tools/gif2h5/Makefile.in | 5 - src/H5Z.c | 33 ++-- src/H5Zfletcher32.c | 3 - src/H5Znbit.c | 4 +- src/H5Zpkg.h | 55 +++--- src/H5Zscaleoffset.c | 3 - src/H5Zshuffle.c | 3 - src/H5config.h.in | 12 -- src/Makefile.in | 5 - src/libhdf5.settings.in | 1 - test/Makefile.in | 5 - test/cross_read.c | 90 --------- test/dsets.c | 364 ++++--------------------------------- test/gen_cross.c | 84 +-------- test/gen_filters.c | 4 - testpar/Makefile.in | 5 - testpar/t_dset.c | 30 ++- testpar/t_filter_read.c | 25 +-- tools/Makefile.in | 5 - tools/h5copy/Makefile.in | 5 - tools/h5diff/Makefile.in | 5 - tools/h5dump/Makefile.in | 5 - tools/h5dump/h5dumpgentest.c | 18 +- tools/h5dump/testh5dump.sh.in | 6 +- tools/h5dump/testh5dumppbits.sh.in | 4 - tools/h5import/Makefile.in | 5 - tools/h5jam/Makefile.in | 5 - tools/h5jam/testh5jam.sh.in | 2 - tools/h5ls/Makefile.in | 5 - tools/h5repack/Makefile.in | 5 - tools/h5repack/h5repack.sh.in | 94 ++-------- tools/h5repack/h5repacktst.c | 107 ++--------- tools/h5stat/Makefile.in | 5 - tools/h5stat/testh5stat.sh.in | 4 - tools/lib/Makefile.in | 5 - tools/lib/h5tools_filters.c | 32 ---- tools/misc/Makefile.in | 5 - tools/perform/Makefile.in | 5 - 66 files changed, 132 insertions(+), 1216 deletions(-) diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 3b9b4f7..bd39dd3 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -11,11 +11,6 @@ MACRO (HDF5_SETUP_FILTERS FILTER) # message (STATUS "Filter ${FILTER} is ${HDF5_USE_FILTER_${FILTER}}") ENDMACRO (HDF5_SETUP_FILTERS) -HDF5_SETUP_FILTERS (SHUFFLE) -HDF5_SETUP_FILTERS (FLETCHER32) -HDF5_SETUP_FILTERS (NBIT) -HDF5_SETUP_FILTERS (SCALEOFFSET) - include (ExternalProject) #option (HDF5_ALLOW_EXTERNAL_SUPPORT "Allow External Library Building (NO SVN TGZ)" "NO") set (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building (NO SVN TGZ)") diff --git a/Makefile.in b/Makefile.in index 9c1d71e..1b6b590 100644 --- a/Makefile.in +++ b/Makefile.in @@ -296,7 +296,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -384,10 +383,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/c++/Makefile.in b/c++/Makefile.in index 45aeb34..36364eb 100644 --- a/c++/Makefile.in +++ b/c++/Makefile.in @@ -456,7 +456,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -544,10 +543,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index d4a652f..734fdc8 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -404,7 +404,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -492,10 +491,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index a55cfac..bc39d22 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -470,7 +470,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -558,10 +557,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/c++/test/Makefile.in b/c++/test/Makefile.in index 8b0b90f..709a97e 100644 --- a/c++/test/Makefile.in +++ b/c++/test/Makefile.in @@ -461,7 +461,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -549,10 +548,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index a557364..ff05373 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -139,18 +139,6 @@ /* Define if support for deflate (zlib) filter is enabled */ #cmakedefine H5_HAVE_FILTER_DEFLATE @H5_HAVE_FILTER_DEFLATE@ -/* Define if support for Fletcher32 checksum is enabled */ -#cmakedefine H5_HAVE_FILTER_FLETCHER32 @H5_HAVE_FILTER_FLETCHER32@ - -/* Define if support for nbit filter is enabled */ -#cmakedefine H5_HAVE_FILTER_NBIT @H5_HAVE_FILTER_NBIT@ - -/* Define if support for scaleoffset filter is enabled */ -#cmakedefine H5_HAVE_FILTER_SCALEOFFSET @H5_HAVE_FILTER_SCALEOFFSET@ - -/* Define if support for shuffle filter is enabled */ -#cmakedefine H5_HAVE_FILTER_SHUFFLE @H5_HAVE_FILTER_SHUFFLE@ - /* Define if support for szip filter is enabled */ #cmakedefine H5_HAVE_FILTER_SZIP @H5_HAVE_FILTER_SZIP@ diff --git a/configure b/configure index de1641c..77ee69a 100755 --- a/configure +++ b/configure @@ -668,11 +668,6 @@ CONFIG_DATE H5_VERSION DIRECT_VFD_CONDITIONAL_FALSE DIRECT_VFD_CONDITIONAL_TRUE -USE_FILTER_SCALEOFFSET -USE_FILTER_NBIT -USE_FILTER_FLETCHER32 -USE_FILTER_SHUFFLE -FILTERS ADD_PARALLEL_FILES USINGMEMCHECKER CLEARFILEBUF @@ -920,7 +915,6 @@ enable_clear_file_buffers enable_using_memchecker enable_parallel with_mpe -enable_filters enable_direct_vfd with_default_plugindir enable_dconv_exception @@ -1613,9 +1607,6 @@ Optional Features: picky about it's memory operations and also disables the library's free space manager code. Default=no. --enable-parallel Search for MPI-IO and MPI support files - --enable-filters=all Turn on all internal I/O filters. One may also - specify a comma-separated list of filters or the - word no. The default is all internal I/O filters. --enable-direct-vfd Build the direct I/O virtual file driver (VFD). This is based on the POSIX (sec2) VFD and requires the open() call to take the O_DIRECT flag. [default=no] @@ -27913,81 +27904,6 @@ $as_echo "#define HAVE_MPE 1" >>confdefs.h fi fi - -## ---------------------------------------------------------------------- -## Turn on internal I/O filters by setting macros in header files -## Internal I/O filters are contained entirely within the library and do -## not depend on external headers or libraries. The shuffle filter is -## an example of an internal filter, while the gzip filter is an example of -## an external filter. Each external filter is controlled with an -## "--with-foo=" configure flag. -## - - USE_FILTER_SHUFFLE="no" - USE_FILTER_FLETCHER32="no" - USE_FILTER_NBIT="no" - USE_FILTER_SCALEOFFSET="no" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for I/O filters" >&5 -$as_echo_n "checking for I/O filters... " >&6; } -# Check whether --enable-filters was given. -if test "${enable_filters+set}" = set; then : - enableval=$enable_filters; FILTERS=$enableval -fi - - -## Eventually: all_filters="shuffle,foo,bar,baz" -all_filters="shuffle,fletcher32,nbit,scaleoffset" -case "X-$FILTERS" in - X-|X-all) - FILTERS=$all_filters - { $as_echo "$as_me:${as_lineno-$LINENO}: result: all ($FILTERS)" >&5 -$as_echo "all ($FILTERS)" >&6; } - ;; - X-no|X-none) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } - FILTERS="none" - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FILTERS" >&5 -$as_echo "$FILTERS" >&6; } - ;; -esac - -if test -n "$FILTERS"; then - for filter in `echo $FILTERS | tr ${as_cr_letters}',' ${as_cr_LETTERS}' '`; do - ## ------------------------------------------------------------------ - ## Have to use separate 'if' construct for each filter, so that - ## autoheader can detect the AC_DEFINE for each one... - ## - if test $filter = "SHUFFLE"; then - -$as_echo "#define HAVE_FILTER_SHUFFLE 1" >>confdefs.h - - USE_FILTER_SHUFFLE="yes" - fi - if test $filter = "FLETCHER32"; then - -$as_echo "#define HAVE_FILTER_FLETCHER32 1" >>confdefs.h - - USE_FILTER_FLETCHER32="yes" - fi - if test $filter = "NBIT"; then - -$as_echo "#define HAVE_FILTER_NBIT 1" >>confdefs.h - - USE_FILTER_NBIT="yes" - fi - if test $filter = "SCALEOFFSET"; then - -$as_echo "#define HAVE_FILTER_SCALEOFFSET 1" >>confdefs.h - - USE_FILTER_SCALEOFFSET="yes" - fi - done -fi - - ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## diff --git a/configure.ac b/configure.ac index f53c8a6..b93ba86 100644 --- a/configure.ac +++ b/configure.ac @@ -2412,75 +2412,6 @@ if test -n "$PARALLEL"; then fi fi - -## ---------------------------------------------------------------------- -## Turn on internal I/O filters by setting macros in header files -## Internal I/O filters are contained entirely within the library and do -## not depend on external headers or libraries. The shuffle filter is -## an example of an internal filter, while the gzip filter is an example of -## an external filter. Each external filter is controlled with an -## "--with-foo=" configure flag. -## -AC_SUBST([FILTERS]) -AC_SUBST([USE_FILTER_SHUFFLE]) USE_FILTER_SHUFFLE="no" -AC_SUBST([USE_FILTER_FLETCHER32]) USE_FILTER_FLETCHER32="no" -AC_SUBST([USE_FILTER_NBIT]) USE_FILTER_NBIT="no" -AC_SUBST([USE_FILTER_SCALEOFFSET]) USE_FILTER_SCALEOFFSET="no" -AC_MSG_CHECKING([for I/O filters]) -AC_ARG_ENABLE([filters], - [AS_HELP_STRING([--enable-filters=all], - [Turn on all internal I/O filters. One may - also specify a comma-separated list of filters - or the word no. The default is all internal - I/O filters.])], - [FILTERS=$enableval]) - -## Eventually: all_filters="shuffle,foo,bar,baz" -all_filters="shuffle,fletcher32,nbit,scaleoffset" -case "X-$FILTERS" in - X-|X-all) - FILTERS=$all_filters - AC_MSG_RESULT([all ($FILTERS)]) - ;; - X-no|X-none) - AC_MSG_RESULT([none]) - FILTERS="none" - ;; - *) - AC_MSG_RESULT([$FILTERS]) - ;; -esac - -if test -n "$FILTERS"; then - for filter in `echo $FILTERS | tr ${as_cr_letters}',' ${as_cr_LETTERS}' '`; do - ## ------------------------------------------------------------------ - ## Have to use separate 'if' construct for each filter, so that - ## autoheader can detect the AC_DEFINE for each one... - ## - if test $filter = "SHUFFLE"; then - AC_DEFINE([HAVE_FILTER_SHUFFLE], [1], - [Define if support for shuffle filter is enabled]) - USE_FILTER_SHUFFLE="yes" - fi - if test $filter = "FLETCHER32"; then - AC_DEFINE([HAVE_FILTER_FLETCHER32], [1], - [Define if support for Fletcher32 checksum is enabled]) - USE_FILTER_FLETCHER32="yes" - fi - if test $filter = "NBIT"; then - AC_DEFINE([HAVE_FILTER_NBIT], [1], - [Define if support for nbit filter is enabled]) - USE_FILTER_NBIT="yes" - fi - if test $filter = "SCALEOFFSET"; then - AC_DEFINE([HAVE_FILTER_SCALEOFFSET], [1], - [Define if support for scaleoffset filter is enabled]) - USE_FILTER_SCALEOFFSET="yes" - fi - done -fi - - ## ---------------------------------------------------------------------- ## Check if Direct I/O driver is enabled by --enable-direct-vfd ## diff --git a/examples/Makefile.in b/examples/Makefile.in index 7400481..d0b3423 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -404,7 +404,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -492,10 +491,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/fortran/Makefile.in b/fortran/Makefile.in index 74914fb..9812745 100644 --- a/fortran/Makefile.in +++ b/fortran/Makefile.in @@ -460,7 +460,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -548,10 +547,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index eca49ec..fb56b0d 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -412,7 +412,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -500,10 +499,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index cf29fed..c776a44 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -521,7 +521,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -609,10 +608,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in index 4d1e458..2be9485 100644 --- a/fortran/test/Makefile.in +++ b/fortran/test/Makefile.in @@ -530,7 +530,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -618,10 +617,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/fortran/testpar/Makefile.in b/fortran/testpar/Makefile.in index fb38854..9a30c6e 100644 --- a/fortran/testpar/Makefile.in +++ b/fortran/testpar/Makefile.in @@ -456,7 +456,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -544,10 +543,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/Makefile.in b/hl/Makefile.in index f3d6c04..a4464b7 100644 --- a/hl/Makefile.in +++ b/hl/Makefile.in @@ -460,7 +460,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -548,10 +547,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/c++/Makefile.in b/hl/c++/Makefile.in index 0367469..f20104d 100644 --- a/hl/c++/Makefile.in +++ b/hl/c++/Makefile.in @@ -456,7 +456,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -544,10 +543,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index a9ecd9e..6421eda 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -403,7 +403,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -491,10 +490,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 7e8c4ba..783861d 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -462,7 +462,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -550,10 +549,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/c++/test/Makefile.in b/hl/c++/test/Makefile.in index 1160548..df525e5 100644 --- a/hl/c++/test/Makefile.in +++ b/hl/c++/test/Makefile.in @@ -459,7 +459,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -547,10 +546,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index 92a8301..af1c2de 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -403,7 +403,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -491,10 +490,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/fortran/Makefile.in b/hl/fortran/Makefile.in index 7c6f2e2..14eb219 100644 --- a/hl/fortran/Makefile.in +++ b/hl/fortran/Makefile.in @@ -460,7 +460,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -548,10 +547,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index af5a18a..e2bbddc 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -403,7 +403,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -491,10 +490,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 3ccfb9d..5b43512 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -477,7 +477,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -565,10 +564,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/fortran/test/Makefile.in b/hl/fortran/test/Makefile.in index e1b28a5..baa8eb2 100644 --- a/hl/fortran/test/Makefile.in +++ b/hl/fortran/test/Makefile.in @@ -468,7 +468,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -556,10 +555,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index ee3ef49..58d4150 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -458,7 +458,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -546,10 +545,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 75350ec..4a3e8fc 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -495,7 +495,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -583,10 +582,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/tools/Makefile.in b/hl/tools/Makefile.in index 9d4359e..f37e1ba 100644 --- a/hl/tools/Makefile.in +++ b/hl/tools/Makefile.in @@ -457,7 +457,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -545,10 +544,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in index b8fdd3a..d3245ed 100644 --- a/hl/tools/gif2h5/Makefile.in +++ b/hl/tools/gif2h5/Makefile.in @@ -471,7 +471,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -559,10 +558,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/src/H5Z.c b/src/H5Z.c index 8a3315e..5dca3b4 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -93,35 +93,28 @@ H5Z_init_interface (void) FUNC_ENTER_NOAPI_NOINIT + /* Internal filters */ + if (H5Z_register (H5Z_SHUFFLE)<0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") + if (H5Z_register (H5Z_FLETCHER32)<0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") + if (H5Z_register (H5Z_NBIT)<0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") + if (H5Z_register (H5Z_SCALEOFFSET)<0) + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") + + /* External filters */ #ifdef H5_HAVE_FILTER_DEFLATE if (H5Z_register (H5Z_DEFLATE)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register deflate filter") #endif /* H5_HAVE_FILTER_DEFLATE */ -#ifdef H5_HAVE_FILTER_SHUFFLE - if (H5Z_register (H5Z_SHUFFLE)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register shuffle filter") -#endif /* H5_HAVE_FILTER_SHUFFLE */ -#ifdef H5_HAVE_FILTER_FLETCHER32 - if (H5Z_register (H5Z_FLETCHER32)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register fletcher32 filter") -#endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); if (H5Z_register (H5Z_SZIP)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") + HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") #endif /* H5_HAVE_FILTER_SZIP */ -#ifdef H5_HAVE_FILTER_NBIT - if (H5Z_register (H5Z_NBIT)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register nbit filter") -#endif /* H5_HAVE_FILTER_NBIT */ -#ifdef H5_HAVE_FILTER_SCALEOFFSET - if (H5Z_register (H5Z_SCALEOFFSET)<0) - HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register scaleoffset filter") -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ -#if (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_FLETCHER32 | defined H5_HAVE_FILTER_SHUFFLE | defined H5_HAVE_FILTER_SZIP | defined H5_HAVE_FILTER_NBIT | defined H5_HAVE_FILTER_SCALEOFFSET) done: -#endif /* (defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_FLETCHER32 | defined H5_HAVE_FILTER_SHUFFLE | defined H5_HAVE_FILTER_SZIP | defined H5_HAVE_FILTER_NBIT | defined H5_HAVE_FILTER_SCALEOFFSET) */ FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 8d2643d..7f67015 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -27,8 +27,6 @@ #include "H5MMprivate.h" /* Memory management */ #include "H5Zpkg.h" /* Data filters */ -#ifdef H5_HAVE_FILTER_FLETCHER32 - /* Local function prototypes */ static size_t H5Z_filter_fletcher32 (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); @@ -164,5 +162,4 @@ done: H5MM_xfree(outbuf); FUNC_LEAVE_NOAPI(ret_value) } -#endif /* H5_HAVE_FILTER_FLETCHER32 */ diff --git a/src/H5Znbit.c b/src/H5Znbit.c index ebb534b..9506ace 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -25,8 +25,6 @@ #include "H5Tprivate.h" /* Datatypes */ #include "H5Zpkg.h" /* Data filters */ -#ifdef H5_HAVE_FILTER_NBIT - /* Struct of parameters needed for compressing/decompressing * one nbit atomic datatype: integer or floating-point */ @@ -1424,4 +1422,4 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c * the last byte, increment the value by 1. */ *buffer_size = new_size + 1; } -#endif /* H5_HAVE_FILTER_NBIT */ + diff --git a/src/H5Zpkg.h b/src/H5Zpkg.h index b0df856..e2cec89 100644 --- a/src/H5Zpkg.h +++ b/src/H5Zpkg.h @@ -23,48 +23,35 @@ /* Include private header file */ #include "H5Zprivate.h" /* Filter functions */ +/********************/ +/* Internal filters */ +/********************/ -#ifdef H5_HAVE_FILTER_DEFLATE -/* - * Deflate filter - */ -H5_DLLVAR const H5Z_class2_t H5Z_DEFLATE[1]; -#endif /* H5_HAVE_FILTER_DEFLATE */ - -#ifdef H5_HAVE_FILTER_SHUFFLE -/* - * Shuffle filter - */ +/* Shuffle filter */ H5_DLLVAR const H5Z_class2_t H5Z_SHUFFLE[1]; -#endif /* H5_HAVE_FILTER_SHUFFLE */ -#ifdef H5_HAVE_FILTER_FLETCHER32 -/* - * Fletcher32 filter - */ +/* Fletcher32 filter */ H5_DLLVAR const H5Z_class2_t H5Z_FLETCHER32[1]; -#endif /* H5_HAVE_FILTER_FLETCHER32 */ -#ifdef H5_HAVE_FILTER_SZIP -/* - * szip filter - */ -H5_DLLVAR H5Z_class2_t H5Z_SZIP[1]; -#endif /* H5_HAVE_FILTER_SZIP */ - -#ifdef H5_HAVE_FILTER_NBIT -/* - * nbit filter - */ +/* n-bit filter */ H5_DLLVAR H5Z_class2_t H5Z_NBIT[1]; -#endif /* H5_HAVE_FILTER_NBIT */ -#ifdef H5_HAVE_FILTER_SCALEOFFSET -/* - * scaleoffset filter - */ +/* Scale/offset filter */ H5_DLLVAR H5Z_class2_t H5Z_SCALEOFFSET[1]; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ + +/********************/ +/* External filters */ +/********************/ + +/* Deflate filter */ +#ifdef H5_HAVE_FILTER_DEFLATE +H5_DLLVAR const H5Z_class2_t H5Z_DEFLATE[1]; +#endif /* H5_HAVE_FILTER_DEFLATE */ + +/* szip filter */ +#ifdef H5_HAVE_FILTER_SZIP +H5_DLLVAR H5Z_class2_t H5Z_SZIP[1]; +#endif /* H5_HAVE_FILTER_SZIP */ #endif /* _H5Zpkg_H */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index 83864b9..38e2986 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -26,8 +26,6 @@ #include "H5Tprivate.h" /* Datatypes */ #include "H5Zpkg.h" /* Data filters */ -#ifdef H5_HAVE_FILTER_SCALEOFFSET - /* Struct of parameters needed for compressing/decompressing one atomic datatype */ typedef struct { size_t size; /* datatype size */ @@ -1722,5 +1720,4 @@ H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, for(i = 0; i < d_nelmts; i++) H5Z_scaleoffset_compress_one_atomic(data, i * p.size, buffer, &j, &buf_len, p); } -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 4a67839..4138bf1 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -24,8 +24,6 @@ #include "H5Tprivate.h" /* Datatypes */ #include "H5Zpkg.h" /* Data filters */ -#ifdef H5_HAVE_FILTER_SHUFFLE - /* Local function prototypes */ static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id); static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, @@ -291,5 +289,4 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], done: FUNC_LEAVE_NOAPI(ret_value) } -#endif /*H5_HAVE_FILTER_SHUFFLE */ diff --git a/src/H5config.h.in b/src/H5config.h.in index 42dfcfb..a2fa0ad 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -98,18 +98,6 @@ /* Define if support for deflate (zlib) filter is enabled */ #undef HAVE_FILTER_DEFLATE -/* Define if support for Fletcher32 checksum is enabled */ -#undef HAVE_FILTER_FLETCHER32 - -/* Define if support for nbit filter is enabled */ -#undef HAVE_FILTER_NBIT - -/* Define if support for scaleoffset filter is enabled */ -#undef HAVE_FILTER_SCALEOFFSET - -/* Define if support for shuffle filter is enabled */ -#undef HAVE_FILTER_SHUFFLE - /* Define if support for szip filter is enabled */ #undef HAVE_FILTER_SZIP diff --git a/src/Makefile.in b/src/Makefile.in index 46e48a0..52f64f9 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -520,7 +520,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -608,10 +607,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/src/libhdf5.settings.in b/src/libhdf5.settings.in index 424334d..1b1ae96 100644 --- a/src/libhdf5.settings.in +++ b/src/libhdf5.settings.in @@ -62,7 +62,6 @@ Features: Default API Mapping: @DEFAULT_API_VERSION@ With Deprecated Public Symbols: @DEPRECATED_SYMBOLS@ I/O filters (external): @EXTERNAL_FILTERS@ - I/O filters (internal): @FILTERS@ MPE: @MPE@ Direct VFD: @DIRECT_VFD@ dmalloc: @HAVE_DMALLOC@ diff --git a/test/Makefile.in b/test/Makefile.in index 918a803..6243cb1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -863,7 +863,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -951,10 +950,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/test/cross_read.c b/test/cross_read.c index ba99c9e..2d95d15 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -213,116 +213,46 @@ static int open_dataset(char *fname) nerrors += check_data(DATASETNAME1, file, TRUE); TESTING("dataset of LE FLOAT with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME2, file, TRUE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of BE FLOAT with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME3, file, TRUE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of LE DOUBLE with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME4, file, TRUE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of BE DOUBLE with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME5, file, TRUE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of LE CHAR with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME6, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of BE CHAR with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME7, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of LE SHORT with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME8, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of BE SHORT with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME9, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of LE INT with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME10, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of BE INT with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME11, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of LE LONG LONG with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME12, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of BE LONG LONG with scale-offset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET nerrors += check_data(DATASETNAME13, file, FALSE); -#else /*H5_HAVE_FILTER_SCALEOFFSET*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SCALEOFFSET*/ TESTING("dataset of LE FLOAT with Fletcher32 filter"); -#ifdef H5_HAVE_FILTER_FLETCHER32 nerrors += check_data(DATASETNAME14, file, TRUE); -#else /*H5_HAVE_FILTER_FLETCHER32*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_FLETCHER32*/ TESTING("dataset of BE FLOAT with Fletcher32 filter"); -#ifdef H5_HAVE_FILTER_FLETCHER32 nerrors += check_data(DATASETNAME15, file, TRUE); -#else /*H5_HAVE_FILTER_FLETCHER32*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_FLETCHER32*/ TESTING("dataset of LE FLOAT with Deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE @@ -357,36 +287,16 @@ static int open_dataset(char *fname) #endif /*H5_HAVE_FILTER_SZIP*/ TESTING("dataset of LE FLOAT with Shuffle filter"); -#ifdef H5_HAVE_FILTER_SHUFFLE nerrors += check_data(DATASETNAME20, file, TRUE); -#else /*H5_HAVE_FILTER_SHUFFLE*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SHUFFLE*/ TESTING("dataset of BE FLOAT with Shuffle filter"); -#ifdef H5_HAVE_FILTER_SHUFFLE nerrors += check_data(DATASETNAME21, file, TRUE); -#else /*H5_HAVE_FILTER_SHUFFLE*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_SHUFFLE*/ TESTING("dataset of LE FLOAT with Nbit filter"); -#ifdef H5_HAVE_FILTER_NBIT nerrors += check_data(DATASETNAME22, file, TRUE); -#else /*H5_HAVE_FILTER_NBIT*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_NBIT*/ TESTING("dataset of BE FLOAT with Nbit filter"); -#ifdef H5_HAVE_FILTER_NBIT nerrors += check_data(DATASETNAME23, file, TRUE); -#else /*H5_HAVE_FILTER_NBIT*/ - SKIPPED(); - puts(not_supported); -#endif /*H5_HAVE_FILTER_NBIT*/ if(H5Fclose(file)) TEST_ERROR diff --git a/test/dsets.c b/test/dsets.c index 3055943..c782e70 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -70,19 +70,17 @@ const char *FILENAME[] = { #define DSET_CONV_BUF_NAME "conv_buf" #define DSET_TCONV_NAME "tconv" #define DSET_DEFLATE_NAME "deflate" -#ifdef H5_HAVE_FILTER_SZIP -#define DSET_SZIP_NAME "szip" -#endif /* H5_HAVE_FILTER_SZIP */ #define DSET_SHUFFLE_NAME "shuffle" #define DSET_FLETCHER32_NAME "fletcher32" #define DSET_FLETCHER32_NAME_2 "fletcher32_2" #define DSET_FLETCHER32_NAME_3 "fletcher32_3" #define DSET_SHUF_DEF_FLET_NAME "shuffle+deflate+fletcher32" #define DSET_SHUF_DEF_FLET_NAME_2 "shuffle+deflate+fletcher32_2" -#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#ifdef H5_HAVE_FILTER_SZIP +#define DSET_SZIP_NAME "szip" #define DSET_SHUF_SZIP_FLET_NAME "shuffle+szip+fletcher32" #define DSET_SHUF_SZIP_FLET_NAME_2 "shuffle+szip+fletcher32_2" -#endif /* defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 */ +#endif /* H5_HAVE_FILTER_SZIP */ #define DSET_BOGUS_NAME "bogus" #define DSET_MISSING_NAME "missing" @@ -2006,21 +2004,17 @@ test_get_filter_info(void) /* Verify that each filter is reported as having the right combination * of encoder and decoder. */ -#ifdef H5_HAVE_FILTER_FLETCHER32 if(H5Zget_filter_info(H5Z_FILTER_FLETCHER32, &flags) < 0) TEST_ERROR if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR -#endif -#ifdef H5_HAVE_FILTER_SHUFFLE if(H5Zget_filter_info(H5Z_FILTER_SHUFFLE, &flags) < 0) TEST_ERROR if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) || ((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0)) TEST_ERROR -#endif #ifdef H5_HAVE_FILTER_DEFLATE if(H5Zget_filter_info(H5Z_FILTER_DEFLATE, &flags) < 0) TEST_ERROR @@ -2083,10 +2077,8 @@ UNUSED const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */ hsize_t null_size; /* Size of dataset with null filter */ -#ifdef H5_HAVE_FILTER_FLETCHER32 hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */ unsigned data_corrupt[3]; /* position and length of data to be corrupted */ -#endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_DEFLATE hsize_t deflate_size; /* Size of dataset with deflate filter */ @@ -2098,13 +2090,11 @@ UNUSED unsigned szip_pixels_per_block=4; #endif /* H5_HAVE_FILTER_SZIP */ -#ifdef H5_HAVE_FILTER_SHUFFLE hsize_t shuffle_size; /* Size of dataset with shuffle filter */ -#endif /* H5_HAVE_FILTER_SHUFFLE */ -#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 - hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */ -#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ +#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) + hsize_t combo_size; /* Size of dataset with multiple filters */ +#endif /* defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP */ /* test the H5Zget_filter_info function */ if(test_get_filter_info() < 0) goto error; @@ -2128,7 +2118,6 @@ UNUSED * STEP 1: Test Fletcher32 Checksum by itself. *---------------------------------------------------------- */ -#ifdef H5_HAVE_FILTER_FLETCHER32 puts("Testing Fletcher32 checksum(enabled for read)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; @@ -2169,11 +2158,6 @@ UNUSED /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; -#else /* H5_HAVE_FILTER_FLETCHER32 */ - TESTING("fletcher32 checksum"); - SKIPPED(); - puts(" Fletcher32 checksum not enabled"); -#endif /* H5_HAVE_FILTER_FLETCHER32 */ /*---------------------------------------------------------- * STEP 2: Test deflation by itself. @@ -2231,7 +2215,6 @@ UNUSED * STEP 4: Test shuffling by itself. *---------------------------------------------------------- */ -#ifdef H5_HAVE_FILTER_SHUFFLE puts("Testing shuffle filter"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; @@ -2246,17 +2229,12 @@ UNUSED /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; -#else /* H5_HAVE_FILTER_SHUFFLE */ - TESTING("shuffle filter"); - SKIPPED(); - puts(" Shuffle filter not enabled"); -#endif /* H5_HAVE_FILTER_SHUFFLE */ /*---------------------------------------------------------- * STEP 5: Test shuffle + deflate + checksum in any order. *---------------------------------------------------------- */ -#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#ifdef H5_HAVE_FILTER_DEFLATE puts("Testing shuffle+deflate+checksum filters(checksum first)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error; @@ -2280,17 +2258,17 @@ UNUSED /* Clean up objects used for this test */ if(H5Pclose (dc) < 0) goto error; -#else /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ +#else /* H5_HAVE_FILTER_DEFLATE */ TESTING("shuffle+deflate+fletcher32 filters"); SKIPPED(); - puts(" Deflate, shuffle, or fletcher32 checksum filter not enabled"); -#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ + puts(" Deflate filter not enabled"); +#endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- * STEP 6: Test shuffle + szip + checksum in any order. *---------------------------------------------------------- */ -#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#ifdef H5_HAVE_FILTER_SZIP TESTING("shuffle+szip+checksum filters(checksum first, with encoder)"); if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; @@ -2339,11 +2317,11 @@ UNUSED SKIPPED(); } -#else /* H5_HAVE_FILTER_SZIP && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ +#else /* H5_HAVE_FILTER_SZIP */ TESTING("shuffle+szip+fletcher32 filters"); SKIPPED(); - puts(" Szip, shuffle, or fletcher32 checksum filter not enabled"); -#endif /* H5_HAVE_FILTER_SZIP && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ + puts(" szip filter not enabled"); +#endif /* H5_HAVE_FILTER_SZIP */ return 0; error: @@ -2610,20 +2588,15 @@ error: static herr_t test_onebyte_shuffle(hid_t file) { -#ifdef H5_HAVE_FILTER_SHUFFLE hid_t dataset, space,dc; const hsize_t size[2] = {10, 20}; const hsize_t chunk_size[2] = {10, 20}; unsigned char orig_data[10][20]; unsigned char new_data[10][20]; size_t i, j; -#else /* H5_HAVE_FILTER_SHUFFLE */ - const char *not_supported= " Data shuffling is not enabled."; -#endif /* H5_HAVE_FILTER_SHUFFLE */ TESTING("8-bit shuffling (setup)"); -#ifdef H5_HAVE_FILTER_SHUFFLE /* Create the data space */ if((space = H5Screate_simple(2, size, NULL)) < 0) goto error; @@ -2641,10 +2614,6 @@ test_onebyte_shuffle(hid_t file) orig_data[i][j] = (unsigned char)HDrandom(); PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test shuffling by setting up a chunked dataset and writing @@ -2653,16 +2622,11 @@ test_onebyte_shuffle(hid_t file) */ TESTING("8-bit shuffling (write)"); -#ifdef H5_HAVE_FILTER_SHUFFLE if(H5Dwrite(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -2670,7 +2634,6 @@ test_onebyte_shuffle(hid_t file) */ TESTING("8-bit shuffling (read)"); -#ifdef H5_HAVE_FILTER_SHUFFLE /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -2697,10 +2660,6 @@ test_onebyte_shuffle(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif return 0; @@ -2726,7 +2685,6 @@ error: static herr_t test_nbit_int(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT hid_t dataset, datatype, mem_datatype, space, dc; hsize_t size[2] = {2, 5}; hsize_t chunk_size[2] = {2,5}; @@ -2735,13 +2693,10 @@ test_nbit_int(hid_t file) unsigned int mask; size_t precision, offset; size_t i, j; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ puts("Testing nbit filter"); TESTING(" nbit int (setup)"); -#ifdef H5_HAVE_FILTER_NBIT + /* Define dataset datatype (integer), and set precision, offset */ datatype = H5Tcopy(H5T_NATIVE_INT); precision = 17; /* precision includes sign bit */ @@ -2779,10 +2734,6 @@ test_nbit_int(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -2791,15 +2742,10 @@ test_nbit_int(hid_t file) */ TESTING(" nbit int (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -2807,7 +2753,6 @@ test_nbit_int(hid_t file) */ TESTING(" nbit int (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, mem_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -2839,10 +2784,7 @@ test_nbit_int(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -2866,7 +2808,6 @@ error: static herr_t test_nbit_float(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT hid_t dataset, datatype, space, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2, 5}; @@ -2878,12 +2819,9 @@ test_nbit_float(hid_t file) float new_data[2][5]; size_t precision, offset; size_t i, j; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit float (setup)"); -#ifdef H5_HAVE_FILTER_NBIT + /* Define user-defined single-precision floating-point type for dataset */ datatype = H5Tcopy(H5T_IEEE_F32BE); if(H5Tset_fields(datatype, (size_t)26, (size_t)20, (size_t)6, (size_t)7, (size_t)13) < 0) goto error; @@ -2906,10 +2844,6 @@ test_nbit_float(hid_t file) if((dataset = H5Dcreate2(file, DSET_NBIT_FLOAT_NAME, datatype, space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -2918,16 +2852,11 @@ test_nbit_float(hid_t file) */ TESTING(" nbit float (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -2935,7 +2864,6 @@ test_nbit_float(hid_t file) */ TESTING(" nbit float (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -2966,10 +2894,6 @@ test_nbit_float(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif return 0; @@ -2996,7 +2920,6 @@ static herr_t test_nbit_double(hid_t file) { /* assume unsigned int and float has the same number of bytes */ -#ifdef H5_HAVE_FILTER_NBIT hid_t dataset, datatype, space, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2, 5}; @@ -3009,12 +2932,9 @@ test_nbit_double(hid_t file) double new_data[2][5]; size_t precision, offset; size_t i, j; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit double (setup)"); -#ifdef H5_HAVE_FILTER_NBIT + /* Define user-defined doule-precision floating-point type for dataset */ datatype = H5Tcopy(H5T_IEEE_F64BE); if(H5Tset_fields(datatype, (size_t)55, (size_t)46, (size_t)9, (size_t)5, (size_t)41) < 0) goto error; @@ -3038,10 +2958,6 @@ test_nbit_double(hid_t file) space, H5P_DEFAULT, dc, H5P_DEFAULT)) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -3050,15 +2966,10 @@ test_nbit_double(hid_t file) */ TESTING(" nbit double (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -3066,7 +2977,6 @@ test_nbit_double(hid_t file) */ TESTING(" nbit double (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -3097,10 +3007,6 @@ test_nbit_double(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif return 0; @@ -3126,7 +3032,6 @@ error: static herr_t test_nbit_array(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT hid_t dataset, base_datatype, array_datatype, space, dc; hid_t mem_base_datatype, mem_array_datatype; const hsize_t size[2] = {2, 5}; @@ -3136,12 +3041,9 @@ test_nbit_array(hid_t file) unsigned int new_data[2][5][3][2]; size_t precision, offset; size_t i, j, m, n; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit array (setup)"); -#ifdef H5_HAVE_FILTER_NBIT + /* Define dataset array datatype's base datatype and set precision, offset */ base_datatype = H5Tcopy(H5T_NATIVE_UINT); precision = 22; @@ -3181,10 +3083,6 @@ test_nbit_array(hid_t file) orig_data[i][j][m][n] = (unsigned int)(((long long)HDrandom() % (long long)HDpow(2.0, (double)precision)) << offset); PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -3193,16 +3091,11 @@ test_nbit_array(hid_t file) */ TESTING(" nbit array (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -3210,7 +3103,6 @@ test_nbit_array(hid_t file) */ TESTING(" nbit array (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, mem_array_datatype, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -3244,10 +3136,7 @@ test_nbit_array(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: @@ -3272,7 +3161,6 @@ error: static herr_t test_nbit_compound(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT typedef struct { /* Struct with atomic fields */ int i; char c; @@ -3294,12 +3182,9 @@ test_nbit_compound(hid_t file) unsigned int i_mask, s_mask, c_mask; size_t i, j; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit compound (setup)"); -#ifdef H5_HAVE_FILTER_NBIT + /* Define datatypes of members of compound datatype */ i_tid=H5Tcopy(H5T_NATIVE_INT); c_tid=H5Tcopy(H5T_NATIVE_CHAR); @@ -3370,10 +3255,6 @@ test_nbit_compound(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -3382,15 +3263,10 @@ test_nbit_compound(hid_t file) */ TESTING(" nbit compound (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -3398,7 +3274,6 @@ test_nbit_compound(hid_t file) */ TESTING(" nbit compound (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, mem_cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -3440,10 +3315,7 @@ test_nbit_compound(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: @@ -3468,7 +3340,6 @@ error: static herr_t test_nbit_compound_2(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT typedef struct { /* Struct with atomic fields */ int i; char c; @@ -3505,12 +3376,9 @@ test_nbit_compound_2(hid_t file) unsigned int i_mask, s_mask, c_mask, b_mask; size_t i, j, m, n, b_failed, d_failed; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit compound complex (setup)"); -#ifdef H5_HAVE_FILTER_NBIT + /* Define datatypes of members of compound datatype */ i_tid=H5Tcopy(H5T_NATIVE_INT); c_tid=H5Tcopy(H5T_NATIVE_CHAR); @@ -3626,10 +3494,6 @@ test_nbit_compound_2(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -3638,15 +3502,10 @@ test_nbit_compound_2(hid_t file) */ TESTING(" nbit compound complex (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -3654,7 +3513,6 @@ test_nbit_compound_2(hid_t file) */ TESTING(" nbit compound complex (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, mem_cmpd_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -3738,10 +3596,7 @@ test_nbit_compound_2(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: @@ -3766,7 +3621,6 @@ error: static herr_t test_nbit_compound_3(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT typedef struct { /* Struct with some no-op type fields */ int i; /* integer field, NOT a no-op type */ char str[30]; /* fixed-length string, no-op type */ @@ -3784,12 +3638,8 @@ test_nbit_compound_3(hid_t file) atomic new_data[5]; size_t i, k, j; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit compound with no-op type (setup)"); -#ifdef H5_HAVE_FILTER_NBIT /* Define datatypes of members of compound datatype */ i_tid=H5Tcopy(H5T_NATIVE_INT); @@ -3849,10 +3699,6 @@ test_nbit_compound_3(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test nbit by setting up a chunked dataset and writing @@ -3861,15 +3707,10 @@ test_nbit_compound_3(hid_t file) */ TESTING(" nbit compound with no-op type (write)"); -#ifdef H5_HAVE_FILTER_NBIT if(H5Dwrite(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -3877,7 +3718,6 @@ test_nbit_compound_3(hid_t file) */ TESTING(" nbit compound with no-op type (read)"); -#ifdef H5_HAVE_FILTER_NBIT /* Read the dataset back */ if(H5Dread(dataset, cmpd_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) @@ -3934,10 +3774,7 @@ test_nbit_compound_3(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: @@ -3962,19 +3799,14 @@ error: static herr_t test_nbit_int_size(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT hid_t dataspace, dataset, datatype, mem_datatype, dset_create_props; hsize_t dims[2], chunk_size[2]; hsize_t dset_size = 0; int orig_data[DSET_DIM1][DSET_DIM2]; int i, j; size_t precision, offset; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit integer dataset size"); -#ifdef H5_HAVE_FILTER_NBIT /* Define dataset datatype (integer), and set precision, offset */ if((datatype = H5Tcopy(H5T_NATIVE_INT)) < 0) { @@ -4107,10 +3939,6 @@ test_nbit_int_size(hid_t file) H5Pclose (dset_create_props); PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif return 0; error: @@ -4136,7 +3964,6 @@ error: static herr_t test_nbit_flt_size(hid_t file) { -#ifdef H5_HAVE_FILTER_NBIT hid_t dataspace, dataset, datatype, dset_create_props; hsize_t dims[2], chunk_size[2]; hsize_t dset_size = 0; @@ -4144,12 +3971,8 @@ test_nbit_flt_size(hid_t file) int i, j; size_t precision, offset; size_t spos, epos, esize, mpos, msize; -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= " Nbit is not enabled."; -#endif /* H5_HAVE_FILTER_NBIT */ TESTING(" nbit floating-number dataset size"); -#ifdef H5_HAVE_FILTER_NBIT /* Define floating-point type for dataset *------------------------------------------------------------------- @@ -4313,10 +4136,6 @@ test_nbit_flt_size(hid_t file) H5Pclose (dset_create_props); PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif return 0; error: @@ -4341,20 +4160,16 @@ error: static herr_t test_scaleoffset_int(hid_t file) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset, datatype, space, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2,5}; int orig_data[2][5]; int new_data[2][5]; size_t i, j; -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= " Scaleoffset is not enabled."; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ puts("Testing scaleoffset filter"); TESTING(" scaleoffset int without fill value (setup)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET + datatype = H5Tcopy(H5T_NATIVE_INT); /* Set order of dataset datatype */ @@ -4388,10 +4203,6 @@ test_scaleoffset_int(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test scaleoffset by setting up a chunked dataset and writing @@ -4400,14 +4211,9 @@ test_scaleoffset_int(hid_t file) */ TESTING(" scaleoffset int without fill value (write)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -4415,7 +4221,6 @@ test_scaleoffset_int(hid_t file) */ TESTING(" scaleoffset int without fill value (read)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; @@ -4442,10 +4247,7 @@ test_scaleoffset_int(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -4470,7 +4272,6 @@ error: static herr_t test_scaleoffset_int_2(hid_t file) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset, datatype, space, mspace, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2,5}; @@ -4482,12 +4283,9 @@ test_scaleoffset_int_2(hid_t file) hsize_t block[2]; /* Block sizes */ int fillval; size_t j; -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= " Scaleoffset is not enabled."; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ TESTING(" scaleoffset int with fill value (setup)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET + datatype = H5Tcopy(H5T_NATIVE_INT); /* Set order of dataset datatype */ @@ -4534,10 +4332,6 @@ test_scaleoffset_int_2(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test scaleoffset by setting up a chunked dataset and writing @@ -4546,15 +4340,10 @@ test_scaleoffset_int_2(hid_t file) */ TESTING(" scaleoffset int with fill value (write)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ if(H5Dwrite(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -4562,7 +4351,6 @@ test_scaleoffset_int_2(hid_t file) */ TESTING(" scaleoffset int with fill value (read)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_INT, mspace, mspace, H5P_DEFAULT, new_data) < 0) goto error; @@ -4587,10 +4375,7 @@ test_scaleoffset_int_2(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -4615,19 +4400,15 @@ error: static herr_t test_scaleoffset_float(hid_t file) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset, datatype, space, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2,5}; float orig_data[2][5]; float new_data[2][5]; size_t i, j; -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= " Scaleoffset is not enabled."; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ TESTING(" scaleoffset float without fill value, D-scaling (setup)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET + datatype = H5Tcopy(H5T_NATIVE_FLOAT); /* Set order of dataset datatype */ @@ -4663,10 +4444,6 @@ test_scaleoffset_float(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test scaleoffset by setting up a chunked dataset and writing @@ -4675,14 +4452,9 @@ test_scaleoffset_float(hid_t file) */ TESTING(" scaleoffset float without fill value, D-scaling (write)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -4690,7 +4462,6 @@ test_scaleoffset_float(hid_t file) */ TESTING(" scaleoffset float without fill value, D-scaling (read)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; @@ -4717,10 +4488,7 @@ test_scaleoffset_float(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -4745,7 +4513,6 @@ error: static herr_t test_scaleoffset_float_2(hid_t file) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset, datatype, space, mspace, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2,5}; @@ -4757,12 +4524,9 @@ test_scaleoffset_float_2(hid_t file) hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ size_t j; -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= " Scaleoffset is not enabled."; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ TESTING(" scaleoffset float with fill value, D-scaling (setup)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET + datatype = H5Tcopy(H5T_NATIVE_FLOAT); /* Set order of dataset datatype */ @@ -4811,10 +4575,6 @@ test_scaleoffset_float_2(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test scaleoffset by setting up a chunked dataset and writing @@ -4823,15 +4583,10 @@ test_scaleoffset_float_2(hid_t file) */ TESTING(" scaleoffset float with fill value, D-scaling (write)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ if(H5Dwrite(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -4839,7 +4594,6 @@ test_scaleoffset_float_2(hid_t file) */ TESTING(" scaleoffset float with fill value, D-scaling (read)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_FLOAT, mspace, mspace, H5P_DEFAULT, new_data) < 0) goto error; @@ -4863,10 +4617,7 @@ test_scaleoffset_float_2(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -4891,19 +4642,15 @@ error: static herr_t test_scaleoffset_double(hid_t file) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset, datatype, space, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2,5}; double orig_data[2][5]; double new_data[2][5]; size_t i, j; -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= " Scaleoffset is not enabled."; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ TESTING(" scaleoffset double without fill value, D-scaling (setup)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET + datatype = H5Tcopy(H5T_NATIVE_DOUBLE); /* Set order of dataset datatype */ @@ -4939,10 +4686,6 @@ test_scaleoffset_double(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test scaleoffset by setting up a chunked dataset and writing @@ -4951,14 +4694,9 @@ test_scaleoffset_double(hid_t file) */ TESTING(" scaleoffset double without fill value, D-scaling (write)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -4966,7 +4704,6 @@ test_scaleoffset_double(hid_t file) */ TESTING(" scaleoffset double without fill value, D-scaling (read)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, new_data) < 0) goto error; @@ -4993,10 +4730,7 @@ test_scaleoffset_double(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -5021,7 +4755,6 @@ error: static herr_t test_scaleoffset_double_2(hid_t file) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset, datatype, space, mspace, dc; const hsize_t size[2] = {2, 5}; const hsize_t chunk_size[2] = {2,5}; @@ -5033,12 +4766,9 @@ test_scaleoffset_double_2(hid_t file) hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ size_t j; -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= " Scaleoffset is not enabled."; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ TESTING(" scaleoffset double with fill value, D-scaling (setup)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET + datatype = H5Tcopy(H5T_NATIVE_DOUBLE); /* Set order of dataset datatype */ @@ -5087,10 +4817,6 @@ test_scaleoffset_double_2(hid_t file) } PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 1: Test scaleoffset by setting up a chunked dataset and writing @@ -5099,15 +4825,10 @@ test_scaleoffset_double_2(hid_t file) */ TESTING(" scaleoffset double with fill value, D-scaling (write)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* only data in the hyperslab will be written, other value should be fill value */ if(H5Dwrite(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, orig_data) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif /*---------------------------------------------------------------------- * STEP 2: Try to read the data we just wrote. @@ -5115,7 +4836,6 @@ test_scaleoffset_double_2(hid_t file) */ TESTING(" scaleoffset double with fill value, D-scaling (read)"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET /* Read the dataset back */ if(H5Dread(dataset, H5T_NATIVE_DOUBLE, mspace, mspace, H5P_DEFAULT, new_data) < 0) goto error; @@ -5140,10 +4860,7 @@ test_scaleoffset_double_2(hid_t file) if(H5Dclose(dataset) < 0) goto error; PASSED(); -#else - SKIPPED(); - puts(not_supported); -#endif + return 0; error: return -1; @@ -6371,7 +6088,7 @@ test_filter_delete(hid_t file) TESTING("filter deletion"); -#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#ifdef H5_HAVE_FILTER_DEFLATE /* create the data space */ if((sid = H5Screate_simple(2, dims, NULL)) < 0) goto error; @@ -6576,7 +6293,6 @@ test_filters_endianess(void) TESTING("filters with big-endian/little-endian data"); -#if defined H5_HAVE_FILTER_FLETCHER32 /*------------------------------------------------------------------------- * step 1: open a file written on a little-endian machine *------------------------------------------------------------------------- @@ -6609,9 +6325,7 @@ test_filters_endianess(void) if(H5Fclose(fid) < 0) FAIL_STACK_ERROR PASSED(); -#else - SKIPPED(); -#endif + return 0; error: diff --git a/test/gen_cross.c b/test/gen_cross.c index 3b0a56f..1c73016 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -175,7 +175,6 @@ create_normal_dset(hid_t fid, hid_t fsid, hid_t msid) return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -183,7 +182,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -205,7 +203,6 @@ error: int create_scale_offset_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset; /* dataset handles */ hid_t dcpl; float data[NX][NY]; /* data to write */ @@ -267,15 +264,8 @@ create_scale_offset_dsets_float(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= "Scaleoffset filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ - return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -283,7 +273,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -305,7 +294,6 @@ error: int create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset; /* dataset handles */ hid_t dcpl; double data[NX][NY]; /* data to write */ @@ -367,15 +355,8 @@ create_scale_offset_dsets_double(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= "Scaleoffset filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ - return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -383,7 +364,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -405,7 +385,6 @@ error: int create_scale_offset_dsets_char(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset; /* dataset handles */ hid_t dcpl; char data[NX][NY]; /* data to write */ @@ -475,15 +454,8 @@ create_scale_offset_dsets_char(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= "Scaleoffset filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ - return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -491,7 +463,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -513,7 +484,6 @@ error: int create_scale_offset_dsets_short(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset; /* dataset handles */ hid_t dcpl; short data[NX][NY]; /* data to write */ @@ -583,15 +553,8 @@ create_scale_offset_dsets_short(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= "Scaleoffset filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ - return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -599,7 +562,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -621,7 +583,6 @@ error: int create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset; /* dataset handles */ hid_t dcpl; int data[NX][NY]; /* data to write */ @@ -691,15 +652,8 @@ create_scale_offset_dsets_int(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= "Scaleoffset filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ - return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -707,7 +661,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -730,7 +683,6 @@ error: int create_scale_offset_dsets_long_long(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SCALEOFFSET hid_t dataset; /* dataset handles */ hid_t dcpl; long long data[NX][NY]; /* data to write */ @@ -800,15 +752,8 @@ create_scale_offset_dsets_long_long(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SCALEOFFSET */ - const char *not_supported= "Scaleoffset filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ - return 0; -#ifdef H5_HAVE_FILTER_SCALEOFFSET error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -816,7 +761,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SCALEOFFSET */ } @@ -838,7 +782,6 @@ error: int create_fletcher_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_FLETCHER32 hid_t dataset; /* dataset handles */ hid_t dcpl; float data[NX][NY]; /* data to write */ @@ -900,15 +843,8 @@ create_fletcher_dsets_float(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_FLETCHER32 */ - const char *not_supported= "Fletcher filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_FLETCHER32 */ - return 0; -#ifdef H5_HAVE_FILTER_FLETCHER32 error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -916,7 +852,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_FLETCHER32 */ } @@ -1131,7 +1066,6 @@ error: int create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_SHUFFLE hid_t dataset; /* dataset handles */ hid_t dcpl; float data[NX][NY]; /* data to write */ @@ -1193,15 +1127,8 @@ create_shuffle_dsets_float(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_SHUFFLE */ - const char *not_supported= "Shuffle filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_SHUFFLE */ - return 0; -#ifdef H5_HAVE_FILTER_SHUFFLE error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -1209,7 +1136,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_SHUFFLE */ } @@ -1231,7 +1157,6 @@ error: int create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) { -#ifdef H5_HAVE_FILTER_NBIT hid_t dataset; /* dataset handles */ hid_t datatype; hid_t dcpl; @@ -1314,15 +1239,8 @@ create_nbit_dsets_float(hid_t fid, hid_t fsid, hid_t msid) if(H5Pclose(dcpl) < 0) TEST_ERROR -#else /* H5_HAVE_FILTER_NBIT */ - const char *not_supported= "Nbit filter is not enabled. Can't create the dataset."; - - puts(not_supported); -#endif /* H5_HAVE_FILTER_NBIT */ - return 0; -#ifdef H5_HAVE_FILTER_NBIT error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -1330,7 +1248,6 @@ error: } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_NBIT */ } @@ -1451,3 +1368,4 @@ main (void) return 0; } + diff --git a/test/gen_filters.c b/test/gen_filters.c index 58400d5..b44339d 100644 --- a/test/gen_filters.c +++ b/test/gen_filters.c @@ -48,7 +48,6 @@ static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, static herr_t test_filters_endianess(void) { -#if defined H5_HAVE_FILTER_FLETCHER32 hid_t fid = -1; /* file ID */ hid_t dsid = -1; /* dataset ID */ hid_t sid = -1; /* dataspace ID */ @@ -85,10 +84,8 @@ test_filters_endianess(void) if(H5Sclose(sid) < 0) goto error; if(H5Fclose(fid) < 0) goto error; -#endif /* H5_HAVE_FILTER_FLETCHER32 */ return 0; -#if defined H5_HAVE_FILTER_FLETCHER32 error: H5E_BEGIN_TRY { H5Pclose(dcpl); @@ -97,7 +94,6 @@ error: H5Fclose(fid); } H5E_END_TRY; return -1; -#endif /* H5_HAVE_FILTER_FLETCHER32 */ } /* end test_filters_endianess() */ /* This message derives from H5Z */ diff --git a/testpar/Makefile.in b/testpar/Makefile.in index 23ae44a..44c30fc 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -486,7 +486,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -574,10 +573,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/testpar/t_dset.c b/testpar/t_dset.c index e27cddc..ae022fb 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -2502,7 +2502,6 @@ extend_readAll(void) * Example of using the parallel HDF5 library to read a compressed * dataset in an HDF5 file with collective parallel access support. */ - #ifdef H5_HAVE_FILTER_DEFLATE void compress_readAll(void) @@ -3451,7 +3450,6 @@ actual_io_mode_tests(void) { #define DSET_NOCOLCAUSE "nocolcause" #define NELM 2 #define FILE_EXTERNAL "nocolcause_extern.data" -#undef H5_HAVE_FILTER_FLETCHER32 static void test_no_collective_cause_mode(int selection_mode) { @@ -3487,9 +3485,9 @@ test_no_collective_cause_mode(int selection_mode) hid_t file_space = -1; hsize_t chunk_dims[RANK]; herr_t ret; -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ H5Z_filter_t filter_info; -#endif +#endif /* LATER */ /* set to global value as default */ int l_facc_type = facc_type; char message[256]; @@ -3521,7 +3519,7 @@ test_no_collective_cause_mode(int selection_mode) is_chunked = 0; } -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ if (selection_mode & TEST_FILTERS) { ret = H5Zfilter_avail(H5Z_FILTER_FLETCHER32); VRFY ((ret >=0 ), "Fletcher32 filter is available.\n"); @@ -3532,7 +3530,7 @@ test_no_collective_cause_mode(int selection_mode) ret = H5Pset_fletcher32(dcpl); VRFY((ret >= 0),"set filter (flecher32) succeeded"); } -#endif /* H5_HAVE_FILTER_FLETCHER32 */ +#endif /* LATER */ if (selection_mode & TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES) { sid = H5Screate(H5S_NULL); @@ -3613,13 +3611,13 @@ test_no_collective_cause_mode(int selection_mode) no_collective_cause_global_expected |= H5D_MPIO_NOT_CONTIGUOUS_OR_CHUNKED_DATASET; } -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ if (selection_mode & TEST_FILTERS) { test_name = "Broken Collective I/O - Filter is required"; no_collective_cause_local_expected |= H5D_MPIO_FILTERS; no_collective_cause_global_expected |= H5D_MPIO_FILTERS; } -#endif /* H5_HAVE_FILTER_FLETCHER32 */ +#endif /* LATER */ if (selection_mode & TEST_COLLECTIVE) { test_name = "Broken Collective I/O - Not Broken"; @@ -3808,9 +3806,9 @@ test_no_collective_cause_mode_filter(int selection_mode) hid_t file_space = -1; hsize_t chunk_dims[RANK]; herr_t ret; -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ H5Z_filter_t filter_info; -#endif +#endif /* LATER */ char message[256]; /* Set up MPI parameters */ @@ -3829,7 +3827,7 @@ test_no_collective_cause_mode_filter(int selection_mode) VRFY((dcpl >= 0), "dataset creation plist created successfully"); if (selection_mode == TEST_FILTERS_READ ) { -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ ret = H5Zfilter_avail(H5Z_FILTER_FLETCHER32); VRFY ((ret >=0 ), "Fletcher32 filter is available.\n"); @@ -3838,7 +3836,7 @@ test_no_collective_cause_mode_filter(int selection_mode) ret = H5Pset_fletcher32(dcpl); VRFY((ret >= 0),"set filter (flecher32) succeeded"); -#endif /* H5_HAVE_FILTER_FLETCHER32 */ +#endif /* LATER */ } else { VRFY(0, "Unexpected mode, only test for TEST_FILTERS_READ."); @@ -3876,12 +3874,12 @@ test_no_collective_cause_mode_filter(int selection_mode) dcpl, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dcreate2() dataset succeeded"); -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ /* Set expected cause */ test_name = "Broken Collective I/O - Filter is required"; no_collective_cause_local_expected = H5D_MPIO_FILTERS; no_collective_cause_global_expected = H5D_MPIO_FILTERS; -#endif +#endif /* LATER */ /* Get the file dataspace */ file_space = H5Dget_space(dataset); @@ -4010,13 +4008,13 @@ no_collective_cause_tests(void) test_no_collective_cause_mode (TEST_NOT_SIMPLE_OR_SCALAR_DATASPACES); test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_COMPACT); test_no_collective_cause_mode (TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET_EXTERNAL); -#ifdef H5_HAVE_FILTER_FLETCHER32 +#ifdef LATER /* fletcher32 */ /* TODO: use this instead of below TEST_FILTERS_READ when H5Dcreate and * H5Dwrite is ready for mpio + filter feature. */ /* test_no_collective_cause_mode (TEST_FILTERS); */ test_no_collective_cause_mode_filter (TEST_FILTERS_READ); -#endif +#endif /* LATER */ /* * Test combined causes diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index 7e782ce..5e1cd04 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -215,9 +215,7 @@ test_filter_read(void) hsize_t null_size; /* Size of dataset without filters */ herr_t hrc; const char *filename; -#ifdef H5_HAVE_FILTER_FLETCHER32 hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */ -#endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_DEFLATE hsize_t deflate_size; /* Size of dataset with deflate filter */ @@ -229,13 +227,11 @@ test_filter_read(void) unsigned szip_pixels_per_block=4; #endif /* H5_HAVE_FILTER_SZIP */ -#ifdef H5_HAVE_FILTER_SHUFFLE hsize_t shuffle_size; /* Size of dataset with shuffle filter */ -#endif /* H5_HAVE_FILTER_SHUFFLE */ -#if(defined H5_HAVE_FILTER_DEFLATE | defined H5_HAVE_FILTER_SZIP) && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 - hsize_t combo_size; /* Size of dataset with shuffle+deflate filter */ -#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ +#if(defined H5_HAVE_FILTER_DEFLATE || defined H5_HAVE_FILTER_SZIP) + hsize_t combo_size; /* Size of dataset with multiple filters */ +#endif /* H5_HAVE_FILTER_DEFLATE || H5_HAVE_FILTER_SZIP */ filename = GetTestParameters(); @@ -262,7 +258,6 @@ test_filter_read(void) * STEP 1: Test Fletcher32 Checksum by itself. *---------------------------------------------------------- */ -#ifdef H5_HAVE_FILTER_FLETCHER32 dc = H5Pcreate(H5P_DATASET_CREATE); VRFY(dc>=0,"H5Pset_filter"); @@ -280,7 +275,6 @@ test_filter_read(void) hrc = H5Pclose (dc); VRFY(hrc>=0, "H5Pclose"); -#endif /* H5_HAVE_FILTER_FLETCHER32 */ /*---------------------------------------------------------- * STEP 2: Test deflation by itself. @@ -305,6 +299,7 @@ test_filter_read(void) #endif /* H5_HAVE_FILTER_DEFLATE */ + /*---------------------------------------------------------- * STEP 3: Test szip compression by itself. *---------------------------------------------------------- @@ -328,11 +323,12 @@ test_filter_read(void) } #endif /* H5_HAVE_FILTER_SZIP */ + /*---------------------------------------------------------- * STEP 4: Test shuffling by itself. *---------------------------------------------------------- */ -#ifdef H5_HAVE_FILTER_SHUFFLE + dc = H5Pcreate(H5P_DATASET_CREATE); VRFY(dc>=0, "H5Pcreate"); @@ -349,13 +345,12 @@ test_filter_read(void) hrc = H5Pclose (dc); VRFY(hrc>=0, "H5Pclose"); -#endif /* H5_HAVE_FILTER_SHUFFLE */ /*---------------------------------------------------------- * STEP 5: Test shuffle + deflate + checksum in any order. *---------------------------------------------------------- */ -#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#ifdef H5_HAVE_FILTER_DEFLATE /* Testing shuffle+deflate+checksum filters (checksum first) */ dc = H5Pcreate(H5P_DATASET_CREATE); VRFY(dc>=0, "H5Pcreate"); @@ -400,13 +395,13 @@ test_filter_read(void) hrc = H5Pclose (dc); VRFY(hrc>=0, "H5Pclose"); -#endif /* H5_HAVE_FILTER_DEFLATE && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ +#endif /* H5_HAVE_FILTER_DEFLATE */ /*---------------------------------------------------------- * STEP 6: Test shuffle + szip + checksum in any order. *---------------------------------------------------------- */ -#if defined H5_HAVE_FILTER_SZIP && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32 +#ifdef H5_HAVE_FILTER_SZIP /* Testing shuffle+szip(with encoder)+checksum filters(checksum first) */ dc = H5Pcreate(H5P_DATASET_CREATE); @@ -458,6 +453,6 @@ test_filter_read(void) VRFY(hrc>=0, "H5Pclose"); } -#endif /* H5_HAVE_FILTER_SZIP && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */ +#endif /* H5_HAVE_FILTER_SZIP */ } diff --git a/tools/Makefile.in b/tools/Makefile.in index 4bd80af..aa0247c 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -457,7 +457,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -545,10 +544,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index e9a5e62..3ba120c 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -465,7 +465,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -553,10 +552,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 29543a4..50534f4 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -472,7 +472,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -560,10 +559,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index fb8cc9b..aee2a6c 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -471,7 +471,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -559,10 +558,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 82273a3..36c9642 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -5433,7 +5433,7 @@ static void gent_filters(void) * shuffle *------------------------------------------------------------------------- */ -#if defined (H5_HAVE_FILTER_SHUFFLE) + /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); HDassert(ret >= 0); @@ -5444,14 +5444,13 @@ static void gent_filters(void) ret=make_dset(fid,"shuffle",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); -#endif /*------------------------------------------------------------------------- * checksum *------------------------------------------------------------------------- */ -#if defined (H5_HAVE_FILTER_FLETCHER32) + /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); HDassert(ret >= 0); @@ -5462,13 +5461,12 @@ static void gent_filters(void) ret=make_dset(fid,"fletcher32",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); -#endif /*------------------------------------------------------------------------- * nbit *------------------------------------------------------------------------- */ -#if defined (H5_HAVE_FILTER_NBIT) + /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); HDassert(ret >= 0); @@ -5481,13 +5479,12 @@ static void gent_filters(void) H5Tset_precision(tid,H5Tget_size(tid)-1); ret=make_dset(fid,"nbit",sid,tid,dcpl,buf1); HDassert(ret >= 0); -#endif /*------------------------------------------------------------------------- * scaleoffset *------------------------------------------------------------------------- */ -#if defined (H5_HAVE_FILTER_SCALEOFFSET) + /* remove the filters from the dcpl */ ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); HDassert(ret >= 0); @@ -5498,7 +5495,6 @@ static void gent_filters(void) ret=make_dset(fid,"scaleoffset",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); -#endif /*------------------------------------------------------------------------- * all filters @@ -5508,11 +5504,9 @@ static void gent_filters(void) ret = H5Premove_filter(dcpl,H5Z_FILTER_ALL); HDassert(ret >= 0); -#if defined (H5_HAVE_FILTER_SHUFFLE) /* set the shuffle filter */ ret = H5Pset_shuffle(dcpl); HDassert(ret >= 0); -#endif #ifdef H5_HAVE_FILTER_SZIP if(h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { @@ -5529,17 +5523,13 @@ static void gent_filters(void) HDassert(ret >= 0); #endif -#if defined (H5_HAVE_FILTER_FLETCHER32) /* set the checksum filter */ ret = H5Pset_fletcher32(dcpl); HDassert(ret >= 0); -#endif -#if defined (H5_HAVE_FILTER_NBIT) /* set the nbit filter */ ret = H5Pset_nbit(dcpl); HDassert(ret >= 0); -#endif ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); HDassert(ret >= 0); diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 0c72a8d..36f12a0 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -19,10 +19,6 @@ srcdir=@srcdir@ USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" -USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" -USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" -USE_FILTER_NBIT="@USE_FILTER_NBIT@" -USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" TESTNAME=h5dump EXIT_SUCCESS=0 @@ -1184,7 +1180,7 @@ TOOLTEST tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5 # user defined TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5 -if test $USE_FILTER_DEFLATE = "yes" -a $USE_FILTER_SHUFFLE = "yes" -a $USE_FILTER_FLETCHER32 = "yes" -a $USE_FILTER_NBIT = "yes" -a $USE_FILTER_SCALEOFFSET = "yes" ; then +if test $USE_FILTER_DEFLATE = "yes" ; then # data read internal filters TOOLTEST treadintfilter.ddl --enable-error-stack -d deflate -d shuffle -d fletcher32 -d nbit -d scaleoffset tfilters.h5 if test $USE_FILTER_SZIP = "yes"; then diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in index 0f6503d..6556ff5 100644 --- a/tools/h5dump/testh5dumppbits.sh.in +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -20,10 +20,6 @@ srcdir=@srcdir@ # Determine which filters are available USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" -USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" -USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" -USE_FILTER_NBIT="@USE_FILTER_NBIT@" -USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" TESTNAME=h5dump EXIT_SUCCESS=0 diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index ed26aab..01ec73b 100644 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -465,7 +465,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -553,10 +552,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 855b708..acf5a03 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -477,7 +477,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -565,10 +564,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index 36f0657..1664d6b 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -20,8 +20,6 @@ srcdir=@srcdir@ # Determine which filters are available USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" -USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" -USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" TESTNAME=h5jam/h5unjam EXIT_SUCCESS=0 diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index 0a33e29..d556d3d 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -457,7 +457,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -545,10 +544,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 698b8a3..43fe5c6 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -489,7 +489,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -577,10 +576,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index a4d12bd..e3bb939 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -24,10 +24,6 @@ srcdir=@srcdir@ USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" -USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" -USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" -USE_FILTER_NBIT="@USE_FILTER_NBIT@" -USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" TESTNAME=h5repack EXIT_SUCCESS=0 @@ -742,40 +738,24 @@ fi # shuffle with individual object arg="h5repack_layout.h5 -f dset2:SHUF -l dset2:CHUNK=20x10" -if test $USE_FILTER_SHUFFLE != "yes" ; then - SKIP $arg -else - TOOLTEST shuffle_individual $arg -fi +TOOLTEST shuffle_individual $arg # shuffle for all arg="h5repack_layout.h5 -f SHUF" -if test $USE_FILTER_SHUFFLE != "yes" ; then - SKIP $arg -else - TOOLTEST shuffle_all $arg -fi +TOOLTEST shuffle_all $arg # fletcher32 with individual object arg="h5repack_layout.h5 -f dset2:FLET -l dset2:CHUNK=20x10" -if test $USE_FILTER_FLETCHER32 != "yes" ; then - SKIP $arg -else - TOOLTEST fletcher_individual $arg -fi +TOOLTEST fletcher_individual $arg # fletcher32 for all arg="h5repack_layout.h5 -f FLET" -if test $USE_FILTER_FLETCHER32 != "yes" ; then - SKIP $arg -else - TOOLTEST fletcher_all $arg -fi +TOOLTEST fletcher_all $arg # all filters arg="h5repack_layout.h5 -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10" -if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then +if test $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else TOOLTEST all_filters $arg @@ -828,87 +808,47 @@ fi # shuffle copy arg="h5repack_shuffle.h5" -if test $USE_FILTER_SHUFFLE != "yes" ; then - SKIP $arg -else - TOOLTEST shuffle_copy $arg -fi +TOOLTEST shuffle_copy $arg # shuffle remove arg="h5repack_shuffle.h5 -f dset_shuffle:NONE" -if test $USE_FILTER_SHUFFLE != "yes" ; then - SKIP $arg -else - TOOLTEST shuffle_remove $arg -fi +TOOLTEST shuffle_remove $arg # fletcher32 copy arg="h5repack_fletcher.h5" -if test $USE_FILTER_FLETCHER32 != "yes" ; then - SKIP $arg -else - TOOLTEST fletcher_copy $arg -fi +TOOLTEST fletcher_copy $arg # fletcher32 remove arg="h5repack_fletcher.h5 -f dset_fletcher32:NONE" -if test $USE_FILTER_FLETCHER32 != "yes" ; then - SKIP $arg -else - TOOLTEST fletcher_remove $arg -fi +TOOLTEST fletcher_remove $arg # nbit copy arg="h5repack_nbit.h5" -if test $USE_FILTER_NBIT != "yes" ; then - SKIP $arg -else - TOOLTEST nbit_copy $arg -fi +TOOLTEST nbit_copy $arg # nbit remove arg="h5repack_nbit.h5 -f dset_nbit:NONE" -if test $USE_FILTER_NBIT != "yes" ; then - SKIP $arg -else - TOOLTEST nbit_remove $arg -fi +TOOLTEST nbit_remove $arg # nbit add arg="h5repack_nbit.h5 -f dset_int31:NBIT" -if test $USE_FILTER_NBIT != "yes" ; then - SKIP $arg -else - TOOLTEST nbit_add $arg -fi +TOOLTEST nbit_add $arg # scaleoffset copy arg="h5repack_soffset.h5" -if test $USE_FILTER_SCALEOFFSET != "yes" ; then - SKIP $arg -else - TOOLTEST scale_copy $arg -fi +TOOLTEST scale_copy $arg # scaleoffset add arg="h5repack_soffset.h5 -f dset_none:SOFF=31,IN" -if test $USE_FILTER_SCALEOFFSET != "yes" ; then - SKIP $arg -else - TOOLTEST scale_add $arg -fi +TOOLTEST scale_add $arg # scaleoffset remove arg="h5repack_soffset.h5 -f dset_scaleoffset:NONE" -if test $USE_FILTER_SCALEOFFSET != "yes" ; then - SKIP $arg -else - TOOLTEST scale_remove $arg -fi +TOOLTEST scale_remove $arg # remove all filters arg="h5repack_filters.h5 -f NONE" -if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" -o $USE_FILTER_SHUFFLE != "yes" -o $USE_FILTER_NBIT != "yes" -o $USE_FILTER_SCALEOFFSET != "yes" ; then +if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_SZIP_ENCODER != "yes" ; then SKIP $arg else TOOLTEST remove_all $arg @@ -1061,7 +1001,7 @@ fi # several global filters arg="h5repack_layout.h5 --filter GZIP=1 --filter SHUF" -if test $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then +if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else TOOLTEST global_filters $arg diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 5ec9a8d..0353955 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -445,8 +445,6 @@ int main (void) TESTING(" addding shuffle filter"); -#ifdef H5_HAVE_FILTER_SHUFFLE - /*------------------------------------------------------------------------- * test an individual object option *------------------------------------------------------------------------- @@ -468,9 +466,6 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif /*------------------------------------------------------------------------- * test all objects option @@ -479,8 +474,6 @@ int main (void) TESTING(" addding shuffle filter to all"); -#ifdef H5_HAVE_FILTER_SHUFFLE - /* fs_type = H5F_FILE_SPACE_ALL_PERSIST; fs_size = 1 */ if (h5repack_init (&pack_options, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; @@ -498,13 +491,9 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif - TESTING(" adding checksum filter"); -#ifdef H5_HAVE_FILTER_FLETCHER32 + TESTING(" adding checksum filter"); /*------------------------------------------------------------------------- * test an individual object option @@ -527,9 +516,6 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif /*------------------------------------------------------------------------- * test all objects option @@ -539,8 +525,6 @@ int main (void) TESTING(" adding checksum filter to all"); -#ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("FLET",&pack_options) < 0) @@ -557,9 +541,6 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif TESTING(" filter queue fletcher, shuffle, deflate, szip"); @@ -573,16 +554,10 @@ int main (void) GOERROR; if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0) GOERROR; - -#if defined (H5_HAVE_FILTER_FLETCHER32) if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) GOERROR; -#endif - -#ifdef H5_HAVE_FILTER_SHUFFLE if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) GOERROR; -#endif #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { @@ -1039,7 +1014,6 @@ int main (void) TESTING(" copy of shuffle filter"); -#ifdef H5_HAVE_FILTER_SHUFFLE if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) @@ -1052,13 +1026,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif + TESTING(" removing shuffle filter"); -#ifdef H5_HAVE_FILTER_SHUFFLE if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_shuffle:NONE",&pack_options) < 0) @@ -1073,13 +1044,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif + TESTING(" copy of fletcher filter"); -#ifdef H5_HAVE_FILTER_FLETCHER32 if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) @@ -1092,13 +1060,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif + TESTING(" removing fletcher filter"); -#ifdef H5_HAVE_FILTER_FLETCHER32 if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options) < 0) @@ -1113,14 +1078,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif TESTING(" copy of nbit filter"); -#ifdef H5_HAVE_FILTER_NBIT if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) @@ -1133,13 +1094,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif + TESTING(" removing nbit filter"); -#ifdef H5_HAVE_FILTER_NBIT if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_nbit:NONE",&pack_options) < 0) @@ -1154,14 +1112,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif TESTING(" adding nbit filter"); -#ifdef H5_HAVE_FILTER_NBIT if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_int31:NBIT",&pack_options) < 0) @@ -1176,14 +1130,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif TESTING(" copy of scaleoffset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) @@ -1196,13 +1146,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif + TESTING(" removing scaleoffset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options) < 0) @@ -1217,14 +1164,10 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif TESTING(" adding scaleoffset filter"); -#ifdef H5_HAVE_FILTER_SCALEOFFSET if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options) < 0) @@ -1239,10 +1182,6 @@ int main (void) GOERROR; PASSED(); -#else - SKIPPED(); -#endif - /*------------------------------------------------------------------------- @@ -1258,9 +1197,7 @@ int main (void) TESTING(" filter conversion from deflate to szip"); -#if defined (H5_HAVE_FILTER_SZIP) \ - && defined (H5_HAVE_FILTER_DEFLATE) \ - && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) +#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (szip_can_encode) { /* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */ @@ -1287,9 +1224,7 @@ int main (void) TESTING(" filter conversion from szip to deflate"); -#if defined (H5_HAVE_FILTER_SZIP) \ - && defined (H5_HAVE_FILTER_DEFLATE) \ - && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) +#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (szip_can_encode) { if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) @@ -1321,8 +1256,7 @@ int main (void) TESTING(" removing all filters"); -#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ - && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) +#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; @@ -2347,13 +2281,12 @@ int make_shuffle(hid_t loc_id) * shuffle *------------------------------------------------------------------------- */ -#if defined (H5_HAVE_FILTER_SHUFFLE) + /* set the shuffle filter */ if (H5Pset_shuffle(dcpl) < 0) goto out; if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf) < 0) goto out; -#endif /*------------------------------------------------------------------------- @@ -2414,7 +2347,7 @@ int make_fletcher32(hid_t loc_id) * fletcher32 *------------------------------------------------------------------------- */ -#if defined (H5_HAVE_FILTER_FLETCHER32) + /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) goto out; @@ -2423,7 +2356,6 @@ int make_fletcher32(hid_t loc_id) goto out; if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf) < 0) goto out; -#endif /*------------------------------------------------------------------------- * close space and dcpl @@ -2488,7 +2420,6 @@ int make_nbit(hid_t loc_id) goto out; } -#if defined H5_HAVE_FILTER_NBIT /* remove the filters from the dcpl */ if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) { @@ -2522,7 +2453,6 @@ int make_nbit(hid_t loc_id) goto out; } H5Dclose(dsid); -#endif /*------------------------------------------------------------------------- * close @@ -2584,7 +2514,6 @@ int make_scaleoffset(hid_t loc_id) dtid = H5Tcopy(H5T_NATIVE_INT); -#if defined (H5_HAVE_FILTER_SCALEOFFSET) /* remove the filters from the dcpl */ if(H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) { H5Tclose(dtid); @@ -2613,7 +2542,6 @@ int make_scaleoffset(hid_t loc_id) } H5Tclose(dtid); H5Dclose(dsid); -#endif /*------------------------------------------------------------------------- * close space and dcpl @@ -2647,10 +2575,8 @@ int make_all_filters(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ hid_t sid; /* dataspace ID */ -#if defined (H5_HAVE_FILTER_NBIT) hid_t dtid; hid_t dsid; -#endif /* H5_HAVE_FILTER_NBIT */ #if defined (H5_HAVE_FILTER_SZIP) unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK; unsigned szip_pixels_per_block=8; @@ -2680,17 +2606,13 @@ int make_all_filters(hid_t loc_id) if (H5Pset_chunk(dcpl, RANK, chunk_dims) < 0) goto out; -#if defined (H5_HAVE_FILTER_SHUFFLE) /* set the shuffle filter */ if (H5Pset_shuffle(dcpl) < 0) goto out; -#endif -#if defined (H5_HAVE_FILTER_FLETCHER32) /* set the checksum filter */ if (H5Pset_fletcher32(dcpl) < 0) goto out; -#endif #if defined (H5_HAVE_FILTER_SZIP) if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) @@ -2716,7 +2638,6 @@ int make_all_filters(hid_t loc_id) if (make_dset(loc_id,"dset_all",sid,dcpl,buf) < 0) goto out; -#if defined (H5_HAVE_FILTER_FLETCHER32) /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) goto out; @@ -2725,7 +2646,6 @@ int make_all_filters(hid_t loc_id) goto out; if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf) < 0) goto out; -#endif /* Make sure encoding is enabled */ @@ -2747,7 +2667,6 @@ int make_all_filters(hid_t loc_id) #endif -#if defined (H5_HAVE_FILTER_SHUFFLE) /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) goto out; @@ -2756,7 +2675,6 @@ int make_all_filters(hid_t loc_id) goto out; if (make_dset(loc_id,"dset_shuffle",sid,dcpl,buf) < 0) goto out; -#endif #if defined (H5_HAVE_FILTER_DEFLATE) @@ -2772,7 +2690,6 @@ int make_all_filters(hid_t loc_id) -#if defined (H5_HAVE_FILTER_NBIT) /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl, H5Z_FILTER_ALL) < 0) goto out; @@ -2793,8 +2710,6 @@ int make_all_filters(hid_t loc_id) return -1; if(H5Dclose(dsid) < 0) return -1; -#endif - if(H5Sclose(sid) < 0) goto out; diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 993a226..bfad3ad 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -467,7 +467,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -555,10 +554,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index cb0446b..4d698da 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -25,10 +25,6 @@ srcdir=@srcdir@ # Determine which filters are available USE_FILTER_SZIP="@USE_FILTER_SZIP@" USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" -USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" -USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" -USE_FILTER_NBIT="@USE_FILTER_NBIT@" -USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" TESTNAME=h5stat EXIT_SUCCESS=0 diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 607f1ed..c972bab 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -454,7 +454,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -542,10 +541,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 79cf253..ccdba26 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -107,44 +107,24 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr *------------------------------------------------------------------------- */ case H5Z_FILTER_SHUFFLE: -#ifndef H5_HAVE_FILTER_SHUFFLE - if (name) - print_warning(name,"shuffle"); - return 0; -#endif break; /*------------------------------------------------------------------------- * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC *------------------------------------------------------------------------- */ case H5Z_FILTER_FLETCHER32: -#ifndef H5_HAVE_FILTER_FLETCHER32 - if (name) - print_warning(name,"fletcher32"); - return 0; -#endif break; /*------------------------------------------------------------------------- * H5Z_FILTER_NBIT *------------------------------------------------------------------------- */ case H5Z_FILTER_NBIT: -#ifndef H5_HAVE_FILTER_NBIT - if (name) - print_warning(name,"nbit"); - return 0; -#endif break; /*------------------------------------------------------------------------- * H5Z_FILTER_SCALEOFFSET *------------------------------------------------------------------------- */ case H5Z_FILTER_SCALEOFFSET: -#ifndef H5_HAVE_FILTER_SCALEOFFSET - if (name) - print_warning(name,"scaleoffset"); - return 0; -#endif break; }/*switch*/ }/*for*/ @@ -211,24 +191,12 @@ int h5tools_can_encode(H5Z_filter_t filtn) { #endif break; case H5Z_FILTER_SHUFFLE: -#ifndef H5_HAVE_FILTER_SHUFFLE - return 0; -#endif break; case H5Z_FILTER_FLETCHER32: -#ifndef H5_HAVE_FILTER_FLETCHER32 - return 0; -#endif break; case H5Z_FILTER_NBIT: -#ifndef H5_HAVE_FILTER_NBIT - return 0; -#endif break; case H5Z_FILTER_SCALEOFFSET: -#ifndef H5_HAVE_FILTER_SCALEOFFSET - return 0; -#endif break; }/*switch*/ diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index e11838f..623bc8d 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -492,7 +492,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -580,10 +579,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ diff --git a/tools/perform/Makefile.in b/tools/perform/Makefile.in index 1f903c5..d28f307 100644 --- a/tools/perform/Makefile.in +++ b/tools/perform/Makefile.in @@ -496,7 +496,6 @@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FC_VERSION = @FC_VERSION@ FGREP = @FGREP@ -FILTERS = @FILTERS@ FSEARCH_DIRS = @FSEARCH_DIRS@ GREP = @GREP@ H5_CFLAGS = @H5_CFLAGS@ @@ -584,10 +583,6 @@ TR = @TR@ TRACE_API = @TRACE_API@ UNAME_INFO = @UNAME_INFO@ USE_FILTER_DEFLATE = @USE_FILTER_DEFLATE@ -USE_FILTER_FLETCHER32 = @USE_FILTER_FLETCHER32@ -USE_FILTER_NBIT = @USE_FILTER_NBIT@ -USE_FILTER_SCALEOFFSET = @USE_FILTER_SCALEOFFSET@ -USE_FILTER_SHUFFLE = @USE_FILTER_SHUFFLE@ USE_FILTER_SZIP = @USE_FILTER_SZIP@ USINGMEMCHECKER = @USINGMEMCHECKER@ VERSION = @VERSION@ -- cgit v0.12 From ac290b5e45412a0a93fde620490d703c773d27d4 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sat, 28 Feb 2015 12:00:03 -0500 Subject: [svn-r26331] Revert checking r 26327&8, which added new code and test that fails on solaris and macs. Tested h5committest + emu and quail. --- src/H5.c | 89 ++---------------------------------------- src/H5MM.c | 114 +++++++++++++++++++++++++----------------------------- src/H5MMprivate.h | 6 +++ src/H5public.h | 2 - test/testhdf5.h | 12 ------ test/tmisc.c | 68 -------------------------------- 6 files changed, 61 insertions(+), 230 deletions(-) diff --git a/src/H5.c b/src/H5.c index 68b339a..52dc566 100644 --- a/src/H5.c +++ b/src/H5.c @@ -860,109 +860,27 @@ H5close(void) /*------------------------------------------------------------------------- - * Function: H5allocate_memory - * - * Purpose: Allocate a memory buffer with the semantics of malloc(). - * - * NOTE: This function is intended for use with filter - * plugins so that all allocation and free operations - * use the same memory allocator. It is not intended for - * use as a general memory allocator in applications. - * - * Parameters: - * - * size: The size of the buffer. - * - * clear: Whether or not to memset the buffer to 0. - * - * Return: - * - * Success: A pointer to the allocated buffer. - * - * Failure: NULL - * - *------------------------------------------------------------------------- - */ -void * -H5allocate_memory(size_t size, hbool_t clear) -{ - void *ret_value = NULL; - - FUNC_ENTER_API_NOINIT; - H5TRACE2("*x", "zb", size, clear); - - if(clear) - ret_value = H5MM_calloc(size); - else - ret_value = H5MM_malloc(size); - - FUNC_LEAVE_API(ret_value) - -} /* end H5allocate_memory() */ - - -/*------------------------------------------------------------------------- - * Function: H5resize_memory - * - * Purpose: Resize a memory buffer with the semantics of realloc(). - * - * NOTE: This function is intended for use with filter - * plugins so that all allocation and free operations - * use the same memory allocator. It is not intended for - * use as a general memory allocator in applications. - * - * Parameters: - * - * mem: The buffer to be resized. - * - * size: The size of the buffer. - * - * Return: - * - * Success: A pointer to the resized buffer. - * - * Failure: NULL (the input buffer will be unchanged) - * - *------------------------------------------------------------------------- - */ -void * -H5resize_memory(void *mem, size_t size) -{ - void *ret_value = NULL; - - FUNC_ENTER_API_NOINIT; - H5TRACE2("*x", "*xz", mem, size); - - ret_value = H5MM_realloc(mem, size); - - FUNC_LEAVE_API(ret_value) - -} /* end H5resize_memory() */ - - -/*------------------------------------------------------------------------- * Function: H5free_memory * - * Purpose: Frees memory allocated by the library that it is the user's + * Purpose: Frees memory allocated by the library that it is the user's * responsibility to free. Ensures that the same library * that was used to allocate the memory frees it. Passing * NULL pointers is allowed. * - * Return: SUCCEED/FAIL + * Return: SUCCEED/FAIL * *------------------------------------------------------------------------- */ herr_t H5free_memory(void *mem) { - FUNC_ENTER_API_NOINIT; + FUNC_ENTER_API_NOINIT H5TRACE1("e", "*x", mem); /* At this time, it is impossible for this to fail. */ HDfree(mem); FUNC_LEAVE_API(SUCCEED) - } /* end H5free_memory() */ @@ -1026,4 +944,3 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved) return fOkay; } #endif /* H5_HAVE_WIN32_API && H5_BUILT_AS_DYNAMIC_LIB && H5_HAVE_WIN_THREADS && H5_HAVE_THREADSAFE*/ - diff --git a/src/H5MM.c b/src/H5MM.c index 8073bdb..caeac37 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -31,107 +31,93 @@ #include "H5Eprivate.h" #include "H5MMprivate.h" +#ifndef NDEBUG /*------------------------------------------------------------------------- - * Function: H5MM_malloc + * Function: H5MM_malloc * - * Purpose: Similar to the C89 version of malloc(). + * Purpose: Just like the POSIX version of malloc(3). This routine + * specifically checks for allocations of 0 bytes and fails + * in that case. This routine is not called when NDEBUG is + * defined. * - * On size of 0, we return a NULL pointer instead of the - * standard-allowed 'special' pointer since that's more - * difficult to check as a return value. This is still - * considered an error condition since allocations of zero - * bytes usually indicate problems. - * - * Return: Success: Pointer new memory + * Return: Success: Ptr to new memory * - * Failure: NULL + * Failure: NULL * - * Programmer: Quincey Koziol - * Nov 8 2003 + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Nov 8 2003 + * + * Modifications: * *------------------------------------------------------------------------- */ void * H5MM_malloc(size_t size) { - void *ret_value; - - HDassert(size); - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - if(size) - ret_value = HDmalloc(size); - else - ret_value = NULL; + HDassert(size); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(HDmalloc(size)); } /* end H5MM_malloc() */ /*------------------------------------------------------------------------- - * Function: H5MM_calloc - * - * Purpose: Similar to the C89 version of calloc(), except this - * routine just takes a 'size' parameter. - * - * On size of 0, we return a NULL pointer instead of the - * standard-allowed 'special' pointer since that's more - * difficult to check as a return value. This is still - * considered an error condition since allocations of zero - * bytes usually indicate problems. + * Function: H5MM_calloc * + * Purpose: Similar to the POSIX version of calloc(3), except this routine + * just takes a 'size' parameter. This routine + * specifically checks for allocations of 0 bytes and fails + * in that case. This routine is not called when NDEBUG is + * defined. * - * Return: Success: Pointer new memory + * Return: Success: Ptr to new memory * - * Failure: NULL + * Failure: NULL * * Programmer: Quincey Koziol - * Nov 8 2003 + * koziol@ncsa.uiuc.edu + * Nov 8 2003 + * + * Modifications: * *------------------------------------------------------------------------- */ void * H5MM_calloc(size_t size) { - void *ret_value; - - HDassert(size); - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - if(size) - ret_value = HDcalloc((size_t)1, size); - else - ret_value = NULL; + HDassert(size); - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(HDcalloc(1,size)); } /* end H5MM_calloc() */ +#endif /* NDEBUG */ /*------------------------------------------------------------------------- - * Function: H5MM_realloc - * - * Purpose: Similar semantics as C89's realloc(). Specifically, the - * following calls are equivalent: + * Function: H5MM_realloc * - * H5MM_realloc(NULL, size) <==> H5MM_malloc(size) - * H5MM_realloc(ptr, 0) <==> H5MM_xfree(ptr) - * H5MM_realloc(NULL, 0) <==> NULL + * Purpose: Just like the POSIX version of realloc(3). Specifically, the + * following calls are equivalent * - * Note that the (NULL, 0) combination is undefined behavior - * in the C standard. + * H5MM_realloc (NULL, size) <==> H5MM_malloc (size) + * H5MM_realloc (ptr, 0) <==> H5MM_xfree (ptr) + * H5MM_realloc (NULL, 0) <==> NULL * - * Return: Success: Ptr to new memory if size > 0 - * NULL if size is zero + * Return: Success: Ptr to new memory or NULL if the memory + * was freed or HDrealloc couldn't allocate + * memory. * - * Failure: NULL (input buffer is unchanged on failure) + * Failure: NULL * - * Programmer: Robb Matzke - * Jul 10 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jul 10 1997 * *------------------------------------------------------------------------- */ @@ -143,12 +129,16 @@ H5MM_realloc(void *mem, size_t size) /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOERR - HDassert(mem || size); - - if(NULL == mem && 0 == size) - ret_value = NULL; /* Not defined in the standard, return NULL */ + if(NULL == mem) { + if(0 == size) + ret_value = NULL; + else + ret_value = H5MM_malloc(size); + } /* end if */ + else if(0 == size) + ret_value = H5MM_xfree(mem); else - ret_value = HDrealloc(mem, size); + ret_value = HDrealloc(mem, size); FUNC_LEAVE_NOAPI(ret_value) } /* end H5MM_realloc() */ diff --git a/src/H5MMprivate.h b/src/H5MMprivate.h index 0d608b2..a3c39f0 100644 --- a/src/H5MMprivate.h +++ b/src/H5MMprivate.h @@ -33,13 +33,19 @@ /* Private headers needed by this file */ #include "H5private.h" +#ifdef NDEBUG +#define H5MM_malloc(Z) HDmalloc(Z) +#define H5MM_calloc(Z) HDcalloc((size_t)1,Z) +#endif /* NDEBUG */ #define H5MM_free(Z) HDfree(Z) /* * Library prototypes... */ +#ifndef NDEBUG H5_DLL void *H5MM_malloc(size_t size); H5_DLL void *H5MM_calloc(size_t size); +#endif /* NDEBUG */ H5_DLL void *H5MM_realloc(void *mem, size_t size); H5_DLL char *H5MM_xstrdup(const char *s); H5_DLL char *H5MM_strdup(const char *s); diff --git a/src/H5public.h b/src/H5public.h index 0e866be..673aa6f 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -332,8 +332,6 @@ H5_DLL herr_t H5get_libversion(unsigned *majnum, unsigned *minnum, H5_DLL herr_t H5check_version(unsigned majnum, unsigned minnum, unsigned relnum); H5_DLL herr_t H5free_memory(void *mem); -H5_DLL void *H5allocate_memory(size_t size, hbool_t clear); -H5_DLL void *H5resize_memory(void *mem, size_t size); #ifdef __cplusplus } diff --git a/test/testhdf5.h b/test/testhdf5.h index 62dadde..907fce9 100644 --- a/test/testhdf5.h +++ b/test/testhdf5.h @@ -68,18 +68,6 @@ } \ } -#define CHECK_PTR_NULL(ret,where) { \ - if (VERBOSE_HI) { \ - print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \ - (where), (int)__LINE__, __FILE__, (ret)); \ - } \ - if (ret) { \ - TestErrPrintf ("*** UNEXPECTED RETURN from %s is not NULL line %4d in %s\n", \ - (where), (int)__LINE__, __FILE__); \ - H5Eprint2(H5E_DEFAULT, stdout); \ - } \ -} - /* Used to make certain a return value _is_ a value */ #define VERIFY(_x, _val, where) do { \ long __x = (long)_x, __val = (long)_val; \ diff --git a/test/tmisc.c b/test/tmisc.c index 31d15ac..cac6b04 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -5304,73 +5304,6 @@ test_misc31(void) /**************************************************************** - * - * test_misc32(): Simple test of filter memory allocation - * functions. - * - ***************************************************************/ -static void -test_misc32(void) -{ - void *buffer; - void *resized; - size_t size; - - /* Output message about test being performed */ - MESSAGE(5, ("Edge case test of filter memory allocation functions\n")); - - /* Test that the filter memory allocation functions behave correctly - * at edge cases. - */ - - /* FREE */ - - /* Test freeing a NULL pointer. - * No real confirmation check here, but Valgrind will confirm no - * shenanigans. - */ - buffer = NULL; - H5free_memory(buffer); - - /* ALLOCATE */ - - /* Size zero returns NULL. - * Also checks that a size of zero and setting the buffer clear flag - * to TRUE can be used together. - * - * Note that we have asserts in the code, so only check when NDEBUG - * is defined. - */ -#ifdef NDEBUG - buffer = H5allocate_memory(0, FALSE); - CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ - buffer = H5allocate_memory(0, TRUE); - CHECK_PTR_NULL(buffer, "H5allocate_memory"); /*BAD*/ -#endif /* NDEBUG */ - - /* RESIZE */ - - /* Size zero returns NULL. Valgrind will confirm buffer is freed. */ - size = 1024; - buffer = H5allocate_memory(size, TRUE); - resized = H5resize_memory(buffer, 0); - CHECK_PTR_NULL(resized, "H5resize_memory"); - - /* NULL input pointer returns new buffer */ - resized = H5resize_memory(NULL, 1024); - CHECK_PTR(resized, "H5resize_memory"); - H5free_memory(resized); - - /* NULL input pointer and size zero returns NULL */ -#ifdef NDEBUG - resized = H5resize_memory(NULL, 0); - CHECK_PTR_NULL(resized, "H5resize_memory"); /*BAD*/ -#endif /* NDEBUG */ - -} /* end test_misc32() */ - - -/**************************************************************** ** ** test_misc(): Main misc. test routine. ** @@ -5416,7 +5349,6 @@ test_misc(void) test_misc29(); /* Test that speculative metadata reads are handled correctly */ test_misc30(); /* Exercise local heap loading bug where free lists were getting dropped */ test_misc31(); /* Test Reentering library through deprecated routines after H5close() */ - test_misc32(); /* Test filter memory allocation functions */ } /* test_misc() */ -- cgit v0.12 From d8e3d8e9082f0926e80e7e7010c00bda05a215b3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Sun, 1 Mar 2015 13:48:54 -0500 Subject: [svn-r26333] Eliminates gcc warnings due to -Wunsuffixed-float-constants. - Adds 'F' suffixes for most float constants. - A few constants MUST be of type double. These now receive the long double L suffix and are then cast to double. I do this via a new H5_DOUBLE() macro which was added to H5private.h. Fixes: HDFFV-9148 Tested on: h5committest --- hl/test/test_dset_opt.c | 2 +- hl/test/test_packet.c | 16 ++--- hl/test/test_table.c | 38 +++++----- src/H5MFaggr.c | 2 +- src/H5detect.c | 24 +++---- src/H5private.h | 42 +++++++++++ src/H5timer.c | 89 +++++++++++------------ src/H5trace.c | 14 ++-- test/cache.c | 7 +- test/cache_api.c | 8 +-- test/cache_common.c | 4 +- test/cross_read.c | 8 +-- test/dsets.c | 86 +++++++++++++---------- test/dt_arith.c | 4 +- test/dtransform.c | 2 +- test/fheap.c | 8 +-- test/fillval.c | 8 +-- test/flush2.c | 14 ++-- test/hyperslab.c | 6 +- test/links.c | 2 +- test/mtime.c | 2 +- test/objcopy.c | 20 +++--- test/set_extent.c | 4 +- test/tarray.c | 10 +-- test/tattr.c | 20 +++--- test/tfile.c | 4 +- test/tgenprop.c | 4 +- test/th5s.c | 6 +- test/tmisc.c | 24 +++---- test/tsohm.c | 4 +- test/tunicode.c | 4 +- test/tvltypes.c | 16 ++--- tools/h5diff/h5diffgentest.c | 160 ++++++++++++++++++++++-------------------- tools/h5dump/h5dumpgentest.c | 74 +++++++++---------- tools/h5import/h5importtest.c | 12 ++-- tools/h5jam/h5jamgentest.c | 4 +- tools/lib/io_timer.c | 2 +- tools/perform/chunk.c | 16 ++--- tools/perform/iopipe.c | 18 ++--- tools/perform/overhead.c | 2 +- tools/perform/sio_perf.c | 20 +++--- tools/perform/zip_perf.c | 8 +-- 42 files changed, 436 insertions(+), 382 deletions(-) diff --git a/hl/test/test_dset_opt.c b/hl/test/test_dset_opt.c index bddd162..b0800a0 100644 --- a/hl/test/test_dset_opt.c +++ b/hl/test/test_dset_opt.c @@ -41,7 +41,7 @@ #define CHUNK_NX 4 #define CHUNK_NY 4 -#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001)+12) +#define DEFLATE_SIZE_ADJUST(s) (ceil(((double)(s))*1.001F)+12) /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS1 305 diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index c7a1c27..62e9ae3 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -54,14 +54,14 @@ typedef struct particle_t *------------------------------------------------------------------------- */ static particle_t testPart[NRECORDS] = { - {"zero", 0,0, 0.0f, 0.0}, - {"one", 10,10, 1.0f, 10.0}, - {"two", 20,20, 2.0f, 20.0}, - {"three",30,30, 3.0f, 30.0}, - {"four", 40,40, 4.0f, 40.0}, - {"five", 50,50, 5.0f, 50.0}, - {"six", 60,60, 6.0f, 60.0}, - {"seven",70,70, 7.0f, 70.0} + {"zero", 0,0, 0.0f, 0.0f}, + {"one", 10,10, 1.0f, 10.0f}, + {"two", 20,20, 2.0f, 20.0f}, + {"three",30,30, 3.0f, 30.0f}, + {"four", 40,40, 4.0f, 40.0f}, + {"five", 50,50, 5.0f, 50.0f}, + {"six", 60,60, 6.0f, 60.0f}, + {"seven",70,70, 7.0f, 70.0f} }; /*------------------------------------------------------------------------- diff --git a/hl/test/test_table.c b/hl/test/test_table.c index c312296..8af6d28 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -218,7 +218,7 @@ static int test_table(hid_t fid, int do_write) hsize_t chunk_size=10; int compress=0; int *fill=NULL; - particle_t fill1[1] = { {"no data",-1, -99.0f, -99.0, -1} }; + particle_t fill1[1] = { {"no data",-1, -99.0f, -99.0f, -1} }; int fill1_new[1] = { -100 }; hsize_t position; char tname[20]; @@ -246,18 +246,18 @@ static int test_table(hid_t fid, int do_write) particle2_t rbuf2[NRECORDS]; particle3_t rbuf3[NRECORDS]; particle_t rbufc[NRECORDS*2]; - particle_t abuf[2]={{"eight",80,8.0f,80.0,80},{"nine",90,9.0f,90.0,90}}; - particle_t ibuf[2]={{"zero", 0, 0.0f, 0.0, 0},{"zero", 0, 0.0f, 0.0, 0}}; + particle_t abuf[2]={{"eight",80,8.0f,80.0f,80},{"nine",90,9.0f,90.0f,90}}; + particle_t ibuf[2]={{"zero", 0, 0.0f, 0.0f, 0},{"zero", 0, 0.0f, 0.0f, 0}}; particle_t wbufd[NRECORDS]; particle_t wbuf[NRECORDS] = { - {"zero", 0, 0.0f, 0.0, 0,}, - {"one", 10, 1.0f, 10.0, 10}, - {"two", 20, 2.0f, 20.0, 20}, - {"three",30, 3.0f, 30.0, 30}, - {"four", 40, 4.0f, 40.0, 40}, - {"five", 50, 5.0f, 50.0, 50}, - {"six", 60, 6.0f, 60.0, 60}, - {"seven",70, 7.0f, 70.0, 70} + {"zero", 0, 0.0f, 0.0f, 0,}, + {"one", 10, 1.0f, 10.0f, 10}, + {"two", 20, 2.0f, 20.0f, 20}, + {"three",30, 3.0f, 30.0f, 30}, + {"four", 40, 4.0f, 40.0f, 40}, + {"five", 50, 5.0f, 50.0f, 50}, + {"six", 60, 6.0f, 60.0f, 60}, + {"seven",70, 7.0f, 70.0f, 70} }; /* buffers for the field "Pressure" and "New_field" */ float pressure_in [NRECORDS] = { 0.0f,1.0f,2.0f,3.0f,4.0f,5.0f,6.0f,7.0f }; @@ -390,14 +390,14 @@ static int test_table(hid_t fid, int do_write) /* Define an array of Particles */ particle4_t p_data[NRECORDS] = { - {12112, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12113, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12114, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12115, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12116, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12117, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12118, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}}, - {12119, 1.4, 2.5, {1,2,3},{4,5,6}, {99,100}} + {12112, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12113, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12114, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12115, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12116, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12117, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12118, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}}, + {12119, 1.4f, 2.5f, {1,2,3},{4,5,6}, {99,100}} }; /*------------------------------------------------------------------------- diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index f015b19..29d21fd 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -46,7 +46,7 @@ /******************/ /* Local Typedefs */ /******************/ -#define EXTEND_THRESHOLD .10 +#define EXTEND_THRESHOLD 0.10F /********************/ diff --git a/src/H5detect.c b/src/H5detect.c index aed7514..b902af4 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -323,7 +323,7 @@ precision (detected_t *d) * steps). This is necessary because padding bits can change arbitrarily \ * and interfere with detection of the various properties below unless we \ * know to ignore them. */ \ - _v1 = 4.0; \ + _v1 = (TYPE)4.0L; \ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ for(_i = 0; _i < (int)sizeof(TYPE); _i++) \ for(_byte_mask = (unsigned char)1; _byte_mask; _byte_mask <<= 1) { \ @@ -335,10 +335,10 @@ precision (detected_t *d) } /* end for */ \ \ /* Byte Order */ \ - for(_i = 0, _v1 = 0.0, _v2 = 1.0; _i < (int)sizeof(TYPE); _i++) { \ + for(_i = 0, _v1 = (TYPE)0.0L, _v2 = (TYPE)1.0L; _i < (int)sizeof(TYPE); _i++) { \ _v3 = _v1; \ _v1 += _v2; \ - _v2 /= 256.0; \ + _v2 /= (TYPE)256.0L; \ HDmemcpy(_buf1, (const void *)&_v1, sizeof(TYPE)); \ HDmemcpy(_buf3, (const void *)&_v3, sizeof(TYPE)); \ _j = byte_cmp(sizeof(TYPE), _buf3, _buf1, _pad_mask); \ @@ -353,20 +353,20 @@ precision (detected_t *d) INFO.is_vax = TRUE; \ \ /* Implicit mantissa bit */ \ - _v1 = 0.5; \ - _v2 = 1.0; \ + _v1 = (TYPE)0.5L; \ + _v2 = (TYPE)1.0L; \ INFO.imp = imp_bit (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \ \ /* Sign bit */ \ - _v1 = 1.0; \ - _v2 = -1.0; \ + _v1 = (TYPE)1.0L; \ + _v2 = (TYPE)-1.0L; \ INFO.sign = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \ \ /* Mantissa */ \ INFO.mpos = 0; \ \ - _v1 = 1.0; \ - _v2 = 1.5; \ + _v1 = (TYPE)1.0L; \ + _v2 = (TYPE)1.5L; \ INFO.msize = bit_cmp (sizeof(TYPE), INFO.perm, &_v1, &_v2, _pad_mask); \ INFO.msize += 1 + (INFO.imp?0:1) - INFO.mpos; \ \ @@ -375,7 +375,7 @@ precision (detected_t *d) \ INFO.esize = INFO.sign - INFO.epos; \ \ - _v1 = 1.0; \ + _v1 = (TYPE)1.0L; \ INFO.bias = find_bias (INFO.epos, INFO.esize, INFO.perm, &_v1); \ precision (&(INFO)); \ ALIGNMENT(TYPE, INFO); \ @@ -1381,8 +1381,8 @@ detect_C89_integers(void) static void detect_C89_floats(void) { - DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; - DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; + DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } diff --git a/src/H5private.h b/src/H5private.h index a532c79..1164a2d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -480,6 +480,48 @@ # define H5_DEC_ENUM(TYPE,VAR) (VAR)=((TYPE)((VAR)-1)) #endif +/* Double constant wrapper + * + * Quiets gcc warnings from -Wunsuffixed-float-constants. + * + * This is a really annoying warning since the standard specifies that + * constants of type double do NOT get a suffix so there's no way + * to specify a constant of type double. To quiet gcc, we specify floating + * point constants as type long double and cast to double. + * + * Note that this macro only needs to be used where using a double + * is important. For most code, suffixing constants with F will quiet the + * compiler and not produce erroneous code. + */ +#define H5_DOUBLE(S) ((double) S ## L) + +/* + * Methods to compare the equality of floating-point values: + * + * 1. H5_XXX_ABS_EQUAL - check if the difference is smaller than the + * Epsilon value. The Epsilon values, FLT_EPSILON, DBL_EPSILON, + * and LDBL_EPSILON, are defined by compiler in float.h. + * + * 2. H5_XXX_REL_EQUAL - check if the relative difference is smaller than a + * predefined value M. See if two values are relatively equal. + * It's the developer's responsibility not to pass in the value 0, which + * may cause the equation to fail. + */ +#define H5_FLT_ABS_EQUAL(X,Y) (HDfabsf(X-Y) < FLT_EPSILON) +#define H5_DBL_ABS_EQUAL(X,Y) (HDfabs (X-Y) < DBL_EPSILON) +#define H5_LDBL_ABS_EQUAL(X,Y) (HDfabsl(X-Y) < LDBL_EPSILON) + +#define H5_FLT_REL_EQUAL(X,Y,M) (HDfabsf((Y-X) / X) < M) +#define H5_DBL_REL_EQUAL(X,Y,M) (HDfabs ((Y-X) / X) < M) +#define H5_LDBL_REL_EQUAL(X,Y,M) (HDfabsl((Y-X) / X) < M) + +/* KiB, MiB, GiB, TiB, EiB - Used in profiling and timing code */ +#define H5_KB (1024.0F) +#define H5_MB (1024.0F * 1024.0F) +#define H5_GB (1024.0F * 1024.0F * 1024.0F) +#define H5_TB (1024.0F * 1024.0F * 1024.0F * 1024.0F) +#define H5_EB (1024.0F * 1024.0F * 1024.0F * 1024.0F * 1024.0F) + /* * Data types and functions for timing certain parts of the library. */ diff --git a/src/H5timer.c b/src/H5timer.c index 301d98b..94f2883 100644 --- a/src/H5timer.c +++ b/src/H5timer.c @@ -90,8 +90,6 @@ * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -112,8 +110,6 @@ H5_timer_reset (H5_timer_t *timer) * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -131,18 +127,18 @@ H5_timer_begin (H5_timer_t *timer) #ifdef H5_HAVE_GETRUSAGE HDgetrusage (RUSAGE_SELF, &rusage); timer->utime = (double)rusage.ru_utime.tv_sec + - ((double)rusage.ru_utime.tv_usec / 1e6); + ((double)rusage.ru_utime.tv_usec / 1e6F); timer->stime = (double)rusage.ru_stime.tv_sec + - ((double)rusage.ru_stime.tv_usec / 1e6); + ((double)rusage.ru_stime.tv_usec / 1e6F); #else - timer->utime = 0.0; - timer->stime = 0.0; + timer->utime = 0.0F; + timer->stime = 0.0F; #endif #ifdef H5_HAVE_GETTIMEOFDAY HDgettimeofday (&etime, NULL); - timer->etime = (double)etime.tv_sec + ((double)etime.tv_usec / 1e6); + timer->etime = (double)etime.tv_sec + ((double)etime.tv_usec / 1e6F); #else - timer->etime = 0.0; + timer->etime = 0.0F; #endif } /* end H5_timer_begin() */ @@ -160,8 +156,6 @@ H5_timer_begin (H5_timer_t *timer) * Programmer: Robb Matzke * Thursday, April 16, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -170,16 +164,16 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) H5_timer_t now; HDassert(timer); - H5_timer_begin (&now); + H5_timer_begin(&now); - timer->utime = MAX(0.0, now.utime - timer->utime); - timer->stime = MAX(0.0, now.stime - timer->stime); - timer->etime = MAX(0.0, now.etime - timer->etime); + timer->utime = MAX(0.0F, now.utime - timer->utime); + timer->stime = MAX(0.0F, now.stime - timer->stime); + timer->etime = MAX(0.0F, now.etime - timer->etime); if (sum) { - sum->utime += timer->utime; - sum->stime += timer->stime; - sum->etime += timer->etime; + sum->utime += timer->utime; + sum->stime += timer->stime; + sum->etime += timer->etime; } } /* end H5_timer_end() */ @@ -207,8 +201,6 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) * Programmer: Robb Matzke * Wednesday, August 5, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ void @@ -216,35 +208,34 @@ H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds) { double bw; - if(nseconds <= 0.0) - HDstrcpy(buf, " NaN"); + if(nseconds <= 0.0F) + HDstrcpy(buf, " NaN"); else { - bw = nbytes/nseconds; - if(HDfabs(bw) < 0.0000000001) - /* That is == 0.0, but direct comparison between floats is bad */ - HDstrcpy(buf, "0.000 B/s"); - else if(bw < 1.0) - sprintf(buf, "%10.4e", bw); - else if(bw < 1024.0) { - sprintf(buf, "%05.4f", bw); - HDstrcpy(buf+5, " B/s"); - } else if(bw < (1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / 1024.0); - HDstrcpy(buf+5, " kB/s"); - } else if(bw < (1024.0 * 1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / (1024.0 * 1024.0)); - HDstrcpy(buf+5, " MB/s"); - } else if(bw < (1024.0 * 1024.0 * 1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / (1024.0 * 1024.0 * 1024.0)); - HDstrcpy(buf+5, " GB/s"); - } else if(bw < (1024.0 * 1024.0 * 1024.0 * 1024.0 * 1024.0)) { - sprintf(buf, "%05.4f", bw / (1024.0 * 1024.0 * 1024.0 * 1024.0)); - HDstrcpy(buf+5, " TB/s"); - } else { - sprintf(buf, "%10.4e", bw); - if(HDstrlen(buf) > 10) - sprintf(buf, "%10.3e", bw); - } + bw = nbytes/nseconds; + if(H5_DBL_ABS_EQUAL(bw, 0.0F)) + HDstrcpy(buf, "0.000 B/s"); + else if(bw < 1.0F) + sprintf(buf, "%10.4e", bw); + else if(bw < H5_KB) { + sprintf(buf, "%05.4f", bw); + HDstrcpy(buf+5, " B/s"); + } else if(bw < H5_MB) { + sprintf(buf, "%05.4f", bw / H5_KB); + HDstrcpy(buf+5, " kB/s"); + } else if(bw < H5_GB) { + sprintf(buf, "%05.4f", bw / H5_MB); + HDstrcpy(buf+5, " MB/s"); + } else if(bw < H5_TB) { + sprintf(buf, "%05.4f", bw / H5_GB); + HDstrcpy(buf+5, " GB/s"); + } else if(bw < H5_EB) { + sprintf(buf, "%05.4f", bw / H5_TB); + HDstrcpy(buf+5, " TB/s"); + } else { + sprintf(buf, "%10.4e", bw); + if(HDstrlen(buf) > 10) + sprintf(buf, "%10.3e", bw); + } } } /* end H5_bandwidth() */ diff --git a/src/H5trace.c b/src/H5trace.c index 3a84489..6634a2a 100644 --- a/src/H5trace.c +++ b/src/H5trace.c @@ -110,7 +110,7 @@ * SO MAY CAUSE H5_trace() TO BE INVOKED RECURSIVELY OR MAY * CAUSE LIBRARY INITIALIZATIONS THAT ARE NOT DESIRED. * - * Return: void + * Return: Execution time for an API call * * Programmer: Robb Matzke * Tuesday, June 16, 1998 @@ -129,34 +129,34 @@ H5_trace(const double *returning, const char *func, const char *type, ...) void *vp = NULL; FILE *out = H5_debug_g.trace; H5_timer_t event_time; - static H5_timer_t first_time = {0.0, 0.0, 0.0}; + static H5_timer_t first_time = {0.0F, 0.0F, 0.0F}; static int current_depth = 0; static int last_call_depth = 0; /* FUNC_ENTER() should not be called */ if(!out) - return 0.0; /*tracing is off*/ + return 0.0F; /*tracing is off*/ va_start(ap, type); if(H5_debug_g.ttop) { if(returning) { if(current_depth > 1) { --current_depth; - return 0.0; + return 0.0F; } /* end if */ } /* end if */ else { if(current_depth > 0) { /*do not update last_call_depth*/ current_depth++; - return 0.0; + return 0.0F; } /* end if */ } /* end else */ } /* end if */ - /* Get tim for event */ - if(HDfabs(first_time.etime) < 0.0000000001) + /* Get time for event */ + if(HDfabs(first_time.etime) < 0.0000000001F) /* That is == 0.0, but direct comparison between floats is bad */ H5_timer_begin(&first_time); if(H5_debug_g.ttimes) diff --git a/test/cache.c b/test/cache.c index 5ad1314..8725b31 100644 --- a/test/cache.c +++ b/test/cache.c @@ -20340,7 +20340,10 @@ check_auto_cache_resize(void) auto_size_ctl.decr_mode = H5C_decr__age_out_with_threshold; - auto_size_ctl.upper_hr_threshold = 0.999; /* for ease of testing */ + /* NOTE: upper_hr_threshold MUST be type double (not float) + * or the cache test will fail on 64-bit systems. + */ + auto_size_ctl.upper_hr_threshold = H5_DOUBLE(0.999); /* for ease of testing */ auto_size_ctl.decrement = 0.5f; @@ -28353,7 +28356,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_hit_rate failed.\n"; - } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ + } else if ( ! DBL_REL_EQUAL(hit_rate, 0.5F, FP_EPSILON) ) { /* i.e. hit_rate != 0.5 */ pass = FALSE; failure_mssg = diff --git a/test/cache_api.c b/test/cache_api.c index b1ccef1..8f556be 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -2173,7 +2173,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* long int epoch_length = */ 50000, /* enum H5C_cache_incr_mode incr_mode = */ H5C_incr__threshold, /* double lower_hr_threshold = */ 0.9f, - /* double increment = */ 0.999999999999, + /* double increment = */ H5_DOUBLE(0.999999999999), /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (4 * 1024 * 1024), /* enum H5C_cache_flash_incr_mode */ @@ -2532,7 +2532,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__threshold, /* double upper_hr_threshold = */ 0.999f, - /* double decrement = */ 1.0000000001, + /* double decrement = */ H5_DOUBLE(1.0000000001), /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), /* int epochs_before_eviction = */ 3, @@ -2712,7 +2712,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* size_t max_decrement = */ (1 * 1024 * 1024), /* int epochs_before_eviction = */ 3, /* hbool_t apply_empty_reserve = */ TRUE, - /* double empty_reserve = */ 1.00000000001, + /* double empty_reserve = */ H5_DOUBLE(1.00000000001), /* int dirty_bytes_threshold = */ (256 * 1024), /* int metadata_write_strategy = */ H5AC__DEFAULT_METADATA_WRITE_STRATEGY @@ -2776,7 +2776,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = /* double flash_multiple = */ 2.0f, /* double flash_threshold = */ 0.5f, /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, - /* double upper_hr_threshold = */ 1.00000001, + /* double upper_hr_threshold = */ H5_DOUBLE(1.00000001), /* double decrement = */ 0.9f, /* hbool_t apply_max_decrement = */ TRUE, /* size_t max_decrement = */ (1 * 1024 * 1024), diff --git a/test/cache_common.c b/test/cache_common.c index 7b26714..0231a11 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -5161,7 +5161,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, } else { - expected_hit_rate = 0.0; + expected_hit_rate = 0.0F; } result = H5Fget_mdc_hit_rate(file_id, &hit_rate); @@ -5171,7 +5171,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, pass = FALSE; failure_mssg = "H5Fget_mdc_hit_rate() failed."; - } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001) ) { + } else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001F) ) { pass = FALSE; failure_mssg = "unexpected hit rate."; diff --git a/test/cross_read.c b/test/cross_read.c index 2d95d15..35dd2ce 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -100,15 +100,15 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number) for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) { data_in[j][i] = ((double)(i + j + 1))/3; - data_out[j][i] = 0; + data_out[j][i] = 0.0F; int_data_in[j][i] = i + j; int_data_out[j][i] = 0; } } for (i = 0; i < NY; i++) { - data_in[NX][i] = -2.2; - data_out[NX][i] = 0; + data_in[NX][i] = -2.2F; + data_out[NX][i] = 0.0F; int_data_in[NX][i] = -2; int_data_out[NX][i] = 0; @@ -126,7 +126,7 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number) /* Check results */ for (j=0; j<(NX+1); j++) { for (i=0; i HDpow(10.0, -3.0)) { + if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -3.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -4539,7 +4551,7 @@ test_scaleoffset_float_2(hid_t file) if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ - fillval = 10000.0; + fillval = 10000.0F; if(H5Pset_fill_value(dc, H5T_NATIVE_FLOAT, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 3, @@ -4567,7 +4579,7 @@ test_scaleoffset_float_2(hid_t file) /* Initialize data of hyperslab */ for(j = 0; j < (size_t)size[1]; j++) { - orig_data[0][j] = (float)((HDrandom() % 100000) / (float)1000.0); + orig_data[0][j] = (float)((HDrandom() % 100000) / 1000.0F); /* even-numbered values are negtive */ if((j+1)%2 == 0) @@ -4600,7 +4612,7 @@ test_scaleoffset_float_2(hid_t file) /* Check that the values read are the same as the values written */ for(j=0; j<(size_t)size[1]; j++) { - if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -3.0)) { + if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -3.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -4678,7 +4690,7 @@ test_scaleoffset_double(hid_t file) /* Initialize data */ for(i= 0;i< (size_t)size[0]; i++) for(j = 0; j < (size_t)size[1]; j++) { - orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0; + orig_data[i][j] = (HDrandom() % 10000000) / 10000000.0F; /* even-numbered values are negtive */ if((i*size[1]+j+1)%2 == 0) @@ -4711,7 +4723,7 @@ test_scaleoffset_double(hid_t file) /* Check that the values read are the same as the values written */ for(i=0; i<(size_t)size[0]; i++) { for(j=0; j<(size_t)size[1]; j++) { - if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0, -7.0)) { + if(HDfabs(new_data[i][j]-orig_data[i][j]) > HDpow(10.0F, -7.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); @@ -4781,7 +4793,7 @@ test_scaleoffset_double_2(hid_t file) if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; /* Set fill value */ - fillval = 10000.0; + fillval = 10000.0F; if(H5Pset_fill_value(dc, H5T_NATIVE_DOUBLE, &fillval) < 0) goto error; /* Set up to use scaleoffset filter, decimal scale factor is 7, @@ -4809,7 +4821,7 @@ test_scaleoffset_double_2(hid_t file) /* Initialize data of hyperslab */ for(j = 0; j < (size_t)size[1]; j++) { - orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0; + orig_data[0][j] = (HDrandom() % 10000000) / 10000000.0F; /* even-numbered values are negtive */ if((j+1)%2 == 0) @@ -4842,7 +4854,7 @@ test_scaleoffset_double_2(hid_t file) /* Check that the values read are the same as the values written */ for(j=0; j<(size_t)size[1]; j++) { - if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0, -7.0)) { + if(HDfabs(new_data[0][j]-orig_data[0][j]) > HDpow(10.0F, -7.0F)) { H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)0, (unsigned long)j); @@ -5609,11 +5621,11 @@ test_set_local(hid_t fapl) h5_fixname(FILENAME[5], fapl, filename, sizeof filename); /* Initialize the integer & floating-point dataset */ - n=1.0; + n=1.0F; for(i = 0; i < DSET_DIM1; i++) for(j = 0; j < DSET_DIM2; j++) { points[i][j] = (int)n++; - points_dbl[i][j] = (double)1.5*n++; + points_dbl[i][j] = (double)1.5F*n++; } /* Open file */ @@ -5807,7 +5819,7 @@ test_set_local(hid_t fapl) for(j=0; j 0.0001) { - H5_FAILED(); - printf(" dset[%lu][%lu] = %g\n", - (unsigned long)i, (unsigned long)j, the_data[i][j]); - printf(" should be %g\n", - (double)(hssize_t)i/(hssize_t)(j+1)); - goto error; + if(error > 0.0001F) { + H5_FAILED(); + printf(" dset[%lu][%lu] = %g\n", + (unsigned long)i, (unsigned long)j, the_data[i][j]); + printf(" should be %g\n", + (double)(hssize_t)i/(hssize_t)(j+1)); + goto error; } } if(H5Dclose(dset) < 0) goto error; diff --git a/test/hyperslab.c b/test/hyperslab.c index 5e2c109..9bc085c 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -609,10 +609,10 @@ test_multifill(size_t nx) for(i = 0; i < nx; i++) { src[i].left = 1111111; - src[i].mid = 12345.6789; + src[i].mid = 12345.6789F; src[i].right = 2222222; dst[i].left = 3333333; - dst[i].mid = 98765.4321; + dst[i].mid = 98765.4321F; dst[i].right = 4444444; } /* end for */ @@ -621,7 +621,7 @@ test_multifill(size_t nx) * over and over again. */ fill.left = 55555555; - fill.mid = 3.1415927; + fill.mid = 3.1415927F; fill.right = 66666666; src_stride = 0; diff --git a/test/links.c b/test/links.c index 6119bb3..891b5e4 100644 --- a/test/links.c +++ b/test/links.c @@ -141,7 +141,7 @@ const char *FILENAME[] = { #define H5L_DIM1 100 #define H5L_DIM2 100 -#define FILTER_FILESIZE_MAX_FRACTION .9 +#define FILTER_FILESIZE_MAX_FRACTION 0.9F /* Creation order macros */ #define CORDER_GROUP_NAME "corder_group" diff --git a/test/mtime.c b/test/mtime.c index 6e00fe0..0c0c923 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -114,7 +114,7 @@ main(void) puts(" Modification times will be mantained in the file but"); puts(" cannot be queried on this system. See H5O_mtime_decode()."); return 0; - } else if(HDfabs(HDdifftime(now, oi1.ctime)) > 60.0) { + } else if(HDfabs(HDdifftime(now, oi1.ctime)) > 60.0F) { H5_FAILED(); tm = HDlocaltime(&(oi1.ctime)); HDstrftime((char*)buf1, sizeof buf1, "%Y-%m-%d %H:%M:%S", tm); diff --git a/test/objcopy.c b/test/objcopy.c index 0a1d7a0..71a7236 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -2315,7 +2315,7 @@ test_copy_dataset_compound(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t #endif /* H5_CLEAR_MEMORY */ for(i = 0; i < DIM_SIZE_1; i++) { buf[i].a = i; - buf[i].d = 1. / (i + 1); + buf[i].d = 1.0F / (i + 1); } /* end for */ /* Initialize the filenames */ @@ -2447,9 +2447,9 @@ test_copy_dataset_chunked(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t /* set initial data values */ for(i = 0; i < DIM_SIZE_1; i++) { - buf1d[i] = (float)(i / 2.0); + buf1d[i] = (float)(i / 2.0F); for(j = 0; j < DIM_SIZE_2; j++) - buf2d[i][j] = (float)(i + (j / 100.0)); + buf2d[i][j] = (float)(i + (j / 100.0F)); } /* end for */ /* Initialize the filenames */ @@ -2790,9 +2790,9 @@ test_copy_dataset_chunked_sparse(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, /* set initial data values */ for(i = 0; i < DIM_SIZE_1; i++) { - buf1d[i] = (float)(i / 10.0); + buf1d[i] = (float)(i / 10.0F); for(j = 0; j < DIM_SIZE_2; j++) - buf2d[i][j] = (float)(i + (j / 100.0)); + buf2d[i][j] = (float)(i + (j / 100.0F)); } /* end for */ /* Initialize the filenames */ @@ -2985,7 +2985,7 @@ test_copy_dataset_compressed(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid /* set initial data values */ for (i=0; i 0.0) { + if(diff > 0.0F) { /* Output message about test being performed */ MESSAGE(1, ("Testing to verify that nothing is written if nothing is changed: This test is skipped on this system because the modification time from stat is the same as the last access time (We know OpenVMS behaves in this way).\n")); } /* end if */ @@ -2395,7 +2395,7 @@ test_rw_noupdate(void) /* Ensure That Timestamps Are Equal */ diff = HDdifftime(sb2.st_mtime, sb1.st_mtime); - ret = (diff > 0.0); + ret = (diff > 0.0F); VERIFY(ret, 0, "Timestamp"); } /* end else */ } /* end test_rw_noupdate() */ diff --git a/test/tgenprop.c b/test/tgenprop.c index 004e346..d147099 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -47,7 +47,7 @@ int prop1_def=10; /* Property 1 default value */ #define PROP1_DEF_VALUE (&prop1_def) #define PROP2_NAME "Property 2" -float prop2_def=(float)3.14; /* Property 2 default value */ +float prop2_def=3.14F; /* Property 2 default value */ #define PROP2_SIZE sizeof(prop2_def) #define PROP2_DEF_VALUE (&prop2_def) @@ -57,7 +57,7 @@ char prop3_def[10]="Ten chars"; /* Property 3 default value */ #define PROP3_DEF_VALUE (&prop3_def) #define PROP4_NAME "Property 4" -double prop4_def=1.41; /* Property 4 default value */ +double prop4_def=1.41F; /* Property 4 default value */ #define PROP4_SIZE sizeof(prop4_def) #define PROP4_DEF_VALUE (&prop4_def) diff --git a/test/th5s.c b/test/th5s.c index d3a651c..94268a7 100644 --- a/test/th5s.c +++ b/test/th5s.c @@ -79,7 +79,7 @@ struct space4_struct { unsigned u; float f; char c2; - } space4_data={'v',987123,(float)-3.14,'g'}; /* Test data for 4th dataspace */ + } space4_data={'v',987123,-3.14F,'g'}; /* Test data for 4th dataspace */ /**************************************************************** ** @@ -1647,7 +1647,7 @@ test_h5s_chunk(void) /* Initialize float array */ for(i = 0; i < 50000; i++) for(j = 0; j < 3; j++) - chunk_data_flt[i][j] = (float)((i + 1) * 2.5 - j * 100.3); + chunk_data_flt[i][j] = (float)((i + 1) * 2.5F - j * 100.3F); status = H5Dwrite(dsetID, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, chunk_data_flt); CHECK(status, FAIL, "H5Dwrite"); @@ -1683,7 +1683,7 @@ test_h5s_chunk(void) for(i=0; i<50000; i++) { for(j=0; j<3; j++) { /* Check if the two values are within 0.001% range. */ - if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001)) + if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F)) TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, chunk_data_flt[i][j]); } /* end for */ } /* end for */ diff --git a/test/tmisc.c b/test/tmisc.c index cac6b04..cffb3df 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2427,17 +2427,17 @@ test_misc13(void) static void test_misc14(void) { - hid_t file_id; /* File ID */ - hid_t fapl; /* File access property list ID */ - hid_t DataSpace; /* Dataspace ID */ - hid_t Dataset1; /* Dataset ID #1 */ - hid_t Dataset2; /* Dataset ID #2 */ - hid_t Dataset3; /* Dataset ID #3 */ - double data1 = 5.0; /* Data to write for dataset #1 */ - double data2 = 10.0; /* Data to write for dataset #2 */ - double data3 = 15.0; /* Data to write for dataset #3 */ - double rdata; /* Data read in */ - herr_t ret; /* Generic return value */ + hid_t file_id; /* File ID */ + hid_t fapl; /* File access property list ID */ + hid_t DataSpace; /* Dataspace ID */ + hid_t Dataset1; /* Dataset ID #1 */ + hid_t Dataset2; /* Dataset ID #2 */ + hid_t Dataset3; /* Dataset ID #3 */ + double data1 = 5.0F; /* Data to write for dataset #1 */ + double data2 = 10.0F; /* Data to write for dataset #2 */ + double data3 = 15.0F; /* Data to write for dataset #3 */ + double rdata; /* Data read in */ + herr_t ret; /* Generic return value */ /* Test creating two datasets and deleting the second */ @@ -4949,7 +4949,7 @@ test_misc28(void) * bytes). */ fapl = H5Pcreate(H5P_FILE_ACCESS); CHECK(fapl, FAIL, "H5Pcreate"); - ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75); + ret = H5Pset_cache(fapl, MISC28_NSLOTS, MISC28_NSLOTS, MISC28_SIZE, 0.75F); CHECK(ret, FAIL, "H5Pset_cache"); /* Create the dcpl and set the chunk size */ diff --git a/test/tsohm.c b/test/tsohm.c index 8ebfd52..9da655e 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -57,7 +57,7 @@ const unsigned test_minsizes[H5O_SHMESG_MAX_NINDEXES] = {0, 2, 40, 100, 3, 1000} #define NAME_BUF_SIZE 512 /* How much overhead counts as "not much" when converting B-trees, etc. */ -#define OVERHEAD_ALLOWED 1.15 +#define OVERHEAD_ALLOWED 1.15F #define NUM_DATASETS 10 #define NUM_ATTRIBUTES 100 @@ -600,7 +600,7 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos wdata.i6 = 66; wdata.i7 = 77; wdata.i8 = 88; - wdata.f1 = 0.0; + wdata.f1 = 0.0F; /* Intialize rdata */ HDmemset(&rdata, 0, sizeof(rdata)); diff --git a/test/tunicode.c b/test/tunicode.c index 7dc3391..82dc429 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -39,8 +39,8 @@ #define RANK 1 #define COMP_INT_VAL 7 -#define COMP_FLOAT_VAL -42.0 -#define COMP_DOUBLE_VAL 42.0 +#define COMP_FLOAT_VAL -42.0F +#define COMP_DOUBLE_VAL 42.0F /* Test function prototypes */ void test_fl_string(hid_t fid, const char *string); diff --git a/test/tvltypes.c b/test/tvltypes.c index 516974e..2928e57 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -731,7 +731,7 @@ test_vltypes_vlen_compound(void) wdata[i].len=i+1; for(j=0; j<(i+1); j++) { ((s1 *)wdata[i].p)[j].i=i*10+j; - ((s1 *)wdata[i].p)[j].f=(float)((i*20+j)/3.0); + ((s1 *)wdata[i].p)[j].f=(float)((i*20+j)/3.0F); } /* end for */ } /* end for */ @@ -877,7 +877,7 @@ rewrite_vltypes_vlen_compound(void) wdata[i].len = i + increment; for(j = 0; j < (i + increment); j++) { ((s1 *)wdata[i].p)[j].i = i * 40 + j; - ((s1 *)wdata[i].p)[j].f = (float)((i * 60 + j) / 3.0); + ((s1 *)wdata[i].p)[j].f = (float)((i * 60 + j) / 3.0F); } /* end for */ } /* end for */ @@ -1018,7 +1018,7 @@ test_vltypes_compound_vlen_vlen(void) /* Allocate and initialize VL data to write */ for(i=0; iru_utime.tv_sec)+ - (double)(r_stop->ru_utime.tv_usec)/1000000.0) - + (double)(r_stop->ru_utime.tv_usec)/1000000.0F) - ((double)(r_start->ru_utime.tv_sec)+ - (double)(r_start->ru_utime.tv_usec)/1000000.0); + (double)(r_start->ru_utime.tv_usec)/1000000.0F); s_time = ((double)(r_stop->ru_stime.tv_sec)+ - (double)(r_stop->ru_stime.tv_usec)/1000000.0) - + (double)(r_stop->ru_stime.tv_usec)/1000000.0F) - ((double)(r_start->ru_stime.tv_sec)+ - (double)(r_start->ru_stime.tv_usec)/1000000.0); + (double)(r_start->ru_stime.tv_usec)/1000000.0F); #endif #ifndef H5_HAVE_SYS_TIMEB e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/1000000.0) - + (double)(t_stop->tv_usec)/1000000.0F) - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/1000000.0); + (double)(t_start->tv_usec)/1000000.0F); #else e_time = ((double)(t_stop->tv_sec)+ - (double)(t_stop->tv_usec)/1000.0) - + (double)(t_stop->tv_usec)/1000.0F) - ((double)(t_start->tv_sec)+ - (double)(t_start->tv_usec)/1000.0); + (double)(t_start->tv_usec)/1000.0F); #endif bw = (double)nbytes / e_time; @@ -191,7 +191,7 @@ main (void) * 1998-11-06 ptl */ printf ("I/O request size is %1.1fMB\n", - (double)(hssize_t)(size[0]*size[1])/1024.0*1024); + (double)(hssize_t)(size[0]*size[1])/1024.0F*1024); /* Open the files */ file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/tools/perform/overhead.c b/tools/perform/overhead.c index 9341e64..046668f 100644 --- a/tools/perform/overhead.c +++ b/tools/perform/overhead.c @@ -209,7 +209,7 @@ test(fill_t fill_style, const double splits[], if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; if(!use_rdcc) { if(H5Pget_cache(fapl, &mdc_nelmts, NULL, NULL, NULL) < 0) goto error; - if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0) < 0) goto error; + if(H5Pset_cache(fapl, mdc_nelmts, 0, 0, 0.0F) < 0) goto error; } if((file = H5Fcreate(FILE_NAME_1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; diff --git a/tools/perform/sio_perf.c b/tools/perform/sio_perf.c index 1828d6f..7d75a2d 100644 --- a/tools/perform/sio_perf.c +++ b/tools/perform/sio_perf.c @@ -68,7 +68,7 @@ #define SIO_HDF5 0x4 /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) (((t)==0.0F) ? 0.0F : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -451,14 +451,14 @@ run_test(iotype iot, parameters parms, struct options *opts) minmax *read_mm_table=NULL; minmax *read_gross_mm_table=NULL; minmax *read_raw_mm_table=NULL; - minmax write_sys_mm = {0.0, 0.0, 0.0, 0}; - minmax write_mm = {0.0, 0.0, 0.0, 0}; - minmax write_gross_mm = {0.0, 0.0, 0.0, 0}; - minmax write_raw_mm = {0.0, 0.0, 0.0, 0}; - minmax read_sys_mm = {0.0, 0.0, 0.0, 0}; - minmax read_mm = {0.0, 0.0, 0.0, 0}; - minmax read_gross_mm = {0.0, 0.0, 0.0, 0}; - minmax read_raw_mm = {0.0, 0.0, 0.0, 0}; + minmax write_sys_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax write_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax write_gross_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax write_raw_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_sys_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_gross_mm = {0.0F, 0.0F, 0.0F, 0}; + minmax read_raw_mm = {0.0F, 0.0F, 0.0F, 0}; raw_size = (off_t)parms.num_bytes; parms.io_type = iot; @@ -717,7 +717,7 @@ accumulate_minmax_stuff(minmax *mm, int count) int i; minmax total_mm; - total_mm.sum = 0.0; + total_mm.sum = 0.0F; total_mm.max = -DBL_MAX; total_mm.min = DBL_MAX; total_mm.num = count; diff --git a/tools/perform/zip_perf.c b/tools/perform/zip_perf.c index edd5b0f..f73ba40 100644 --- a/tools/perform/zip_perf.c +++ b/tools/perform/zip_perf.c @@ -43,10 +43,10 @@ #define ONE_MB (ONE_KB * ONE_KB) #define ONE_GB (ONE_MB * ONE_KB) -#define MICROSECOND 1000000.0 +#define MICROSECOND 1000000.0F /* report 0.0 in case t is zero too */ -#define MB_PER_SEC(bytes,t) ((fabs(t)<0.0000000001) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) +#define MB_PER_SEC(bytes,t) ((fabs(t)<0.0000000001F) ? 0.0F : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -182,7 +182,7 @@ write_file(Bytef *source, uLongf sourceLen) /* destination buffer needs to be at least 0.1% larger than sourceLen * plus 12 bytes */ - destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12; + destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1F)) + 12; dest = (Bytef *)HDmalloc(destLen); if (!dest) @@ -464,7 +464,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size, error("out of memory"); } - compression_time = 0.0; + compression_time = 0.0F; if (random_test) fill_with_random_data(src, src_len); -- cgit v0.12 From 6c7aa17753f16b6b7a0a43c724d4a659bf070a91 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 2 Mar 2015 12:11:59 -0500 Subject: [svn-r26338] Remove references to vms and vms files to be updated by this script. VMS has been removed from HDF5 code. Tested on jam. --- bin/h5vers | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/bin/h5vers b/bin/h5vers index 475ff5a..cb4b9e0 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -159,10 +159,10 @@ while ($_ = shift) { die "mutually exclusive options given\n" if $set && $inc; # Determine file to use as H5public.h, README.txt, -# release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h, -# vms/src/h5pubconf.h and config/lt_vers.am. +# release_docs/RELEASE.txt, configure.ac, windows/src/H5pubconf.h +# and config/lt_vers.am. # The README.txt, release_docs/RELEASE.txt, configure.ac, -# vms/src/h5pubconf.h, windows/src/H5pubconf.h, and config/lt_vers.am +# windows/src/H5pubconf.h, and config/lt_vers.am # files are always in the directory above H5public.h unless ($file) { for (@files) { @@ -187,10 +187,6 @@ die "unable to read file: $RELEASE\n" unless -r $file; my $CONFIGURE = $file; $CONFIGURE =~ s/[^\/]*$/..\/configure.ac/; die "unable to read file: $CONFIGURE\n" unless -r $file; -# vms/src/h5pubconf.h -my $H5VMSPUBCONF = $file; -$H5VMSPUBCONF =~ s/[^\/]*$/..\/vms\/src\/h5pubconf.h/; -die "unable to read file: $H5VMSPUBCONF\n" unless -r $file; # Get the current version number. open FILE, $file or die "unable to open $file: $!\n"; @@ -238,7 +234,6 @@ if ($set) { $README = ""; $RELEASE = ""; $CONFIGURE = ""; - $H5VMSPUBCONF = ""; $LT_VERS = ""; @newver = @curver; } @@ -387,9 +382,6 @@ sub gen_h5pubconf { close FILE; } -# Update the VMS-maintained h5pubconf.h file -gen_h5pubconf("HDF5", $H5VMSPUBCONF, @newver) if $H5VMSPUBCONF; - # Print the new version number if ($verbose) { printf("version %d.%d release %d%s\n", @newver[0,1,2], -- cgit v0.12 From f56cb6a8f0e5f5314f3c439efc566e7815b88f9c Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 3 Mar 2015 17:27:21 -0500 Subject: [svn-r26347] Moves large file and POSIX/GNU defines from AM_CPPFLAGS to H5_CPPFLAGS, which is where the rest of the #defines reside. The key difference is that AM_CPPFLAGS is exported to h5cc. These #defines are not necessary to consume the HDF5 API and it's bad form to inflict our build configuration on users. In particular, the GNU/POSIX defines could easily conflict with a user's. Fixes: HDFFV-9152 Tested on: h5committest --- acsite.m4 | 2 +- configure | 10 +++++----- configure.ac | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/acsite.m4 b/acsite.m4 index eaab535..722d606 100644 --- a/acsite.m4 +++ b/acsite.m4 @@ -48,7 +48,7 @@ done]) case $$3 in #( no | unknown) ;; *) AC_DEFINE_UNQUOTED([$1], [$$3], [$4]) - AM_CPPFLAGS="-D$1=$$3 $AM_CPPFLAGS";; + H5_CPPFLAGS="-D$1=$$3 $H5_CPPFLAGS";; esac rm -rf conftest*[]dnl ])# _AC_SYS_LARGEFILE_MACRO_VALUE diff --git a/configure b/configure index 77ee69a..14795ab 100755 --- a/configure +++ b/configure @@ -22806,7 +22806,7 @@ cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - AM_CPPFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits $AM_CPPFLAGS";; + H5_CPPFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits $H5_CPPFLAGS";; esac rm -rf conftest* @@ -22894,7 +22894,7 @@ cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - AM_CPPFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $AM_CPPFLAGS";; + H5_CPPFLAGS="-D_LARGE_FILES=$ac_cv_sys_large_files $H5_CPPFLAGS";; esac rm -rf conftest* fi @@ -22906,7 +22906,7 @@ case "$host_cpu-$host_vendor-$host_os" in *linux*) ## Make available various LFS-related routines using the following ## _LARGEFILE*_SOURCE macros. - AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" + H5_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $H5_CPPFLAGS" ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen @@ -22932,7 +22932,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. - AM_CPPFLAGS="-D_GNU_SOURCE $AM_CPPFLAGS" + H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ## Also add BSD support on Linux systems, so defines ## __USE_BSD, which is required to get the prototype for strdup @@ -22942,7 +22942,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html ## however, we do not do this since it breaks the big test on some ## older platforms. - AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS" + H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" ;; esac diff --git a/configure.ac b/configure.ac index b93ba86..e75bd27 100644 --- a/configure.ac +++ b/configure.ac @@ -1095,7 +1095,7 @@ case "$host_cpu-$host_vendor-$host_os" in *linux*) ## Make available various LFS-related routines using the following ## _LARGEFILE*_SOURCE macros. - AM_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $AM_CPPFLAGS" + H5_CPPFLAGS="-D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE $H5_CPPFLAGS" ## Add POSIX support on Linux systems, so defines ## __USE_POSIX, which is required to get the prototype for fdopen @@ -1121,7 +1121,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## Need to add this so that O_DIRECT is visible for the direct ## VFD on Linux systems. - AM_CPPFLAGS="-D_GNU_SOURCE $AM_CPPFLAGS" + H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS" ## Also add BSD support on Linux systems, so defines ## __USE_BSD, which is required to get the prototype for strdup @@ -1131,7 +1131,7 @@ case "$host_cpu-$host_vendor-$host_os" in ## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html ## however, we do not do this since it breaks the big test on some ## older platforms. - AM_CPPFLAGS="-D_BSD_SOURCE $AM_CPPFLAGS" + H5_CPPFLAGS="-D_BSD_SOURCE $H5_CPPFLAGS" ;; esac -- cgit v0.12 From 6ee9ea656fad6f408e81bd995eb465e0dd4ce0db Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 3 Mar 2015 18:31:31 -0500 Subject: [svn-r26348] Updates bin/chkmanifest to correctly handle the seven Subversion status columns that are output by svn stat. Previously, the script assumed that they would all be blank for newly- added files. This is not always true when merging. Part of: HDFFV-8895 Tested on: jam (bin/chkmanifest only) --- bin/chkmanifest | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/chkmanifest b/bin/chkmanifest index 6188eab..8abd8ea 100755 --- a/bin/chkmanifest +++ b/bin/chkmanifest @@ -86,15 +86,18 @@ for file in $svn_stat; do # The line listing them starts with 'A'. letter="$(echo $file | head -c 1)" if [ "$letter" = "A" ]; then - # Convert 'A ' to './' so it matches + # Convert the seven Subversion status columns to './' so it matches # the manifest file name. - path=`echo $file | sed 's/^A\s*/\.\//g'` + # + # There is a space between the status columns and file name, hence + # the '8' instead of '7'. + path=`echo $file | sed 's/^.\{8\}/\.\//g'` # Ignore directories if [ ! -d $path ]; then if (grep ^$path$ $MANIFEST >/dev/null); then : else - echo "+ $path" + echo "- $path" fail=yes fi fi -- cgit v0.12