From 7e7121fec6a7ac5ef96d2a420e3c5302da60dfc9 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 21 Mar 2017 10:57:40 -0500 Subject: Remove incorrect " marks added to java files by bin/h5vers. Pull version from configure for version test in h5repack_plugin.sh.in --- bin/h5vers | 12 ++++++------ java/src/hdf/hdf5lib/H5.java | 4 ++-- java/test/TestH5.java | 4 ++-- tools/test/h5repack/h5repack_plugin.sh.in | 3 ++- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/bin/h5vers b/bin/h5vers index a72895c..efa97b1 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -366,7 +366,7 @@ if ($HDF5CONFIGCMAKE) { write_file($HDF5CONFIGCMAKE, $data); } -# Update the java/src/hdf/hdflib/H5.java file +# Update the java/src/hdf/hdf5lib/H5.java file if ($H5_JAVA) { my $data = read_file($H5_JAVA); # my $sub_rel_ver_str = ""; @@ -375,10 +375,10 @@ if ($H5_JAVA) { ? sprintf("\"%s\"", "") : sprintf("\"%s\"", "-".$newver[3].", currently under development") ); - my $version_string1 = sprintf("\"%d.%d.%d\"", @newver[0,1,2]); - my $version_string2 = sprintf("\"%d, %d, %d\"", @newver[0,1,2]); + my $version_string1 = sprintf("%d.%d.%d", @newver[0,1,2]); + my $version_string2 = sprintf("%d, %d, %d", @newver[0,1,2]); - $data =~ s/ * \@version HDF5 .*
/ * \@version HDF5 $version_string1
/; + $data =~ s/\@version HDF5 .*
/\@version HDF5 $version_string1
/; $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION\[\] = { $version_string2 };/; write_file($H5_JAVA, $data); @@ -393,8 +393,8 @@ if ($TESTH5_JAVA) { ? sprintf("\"%s\"", "") : sprintf("\"%s\"", "-".$newver[3].", currently under development") ); - my $version_string1 = sprintf("\"%d, %d, %d\"", @newver[0,1,2]); - my $version_string2 = sprintf("\"int majnum = %d, minnum = %d, relnum = %d\"", @newver[0,1,2]); + my $version_string1 = sprintf("%d, %d, %d", @newver[0,1,2]); + my $version_string2 = sprintf("int majnum = %d, minnum = %d, relnum = %d", @newver[0,1,2]); $data =~ s/ int libversion\[\] = { .* };/ int libversion\[\] = { $version_string1 };/; $data =~ s/ int majnum = \d*, minnum = \d*, relnum = \d*;/ $version_string2;/; diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 16b28fa..168e507 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -216,7 +216,7 @@ import hdf.hdf5lib.structs.H5O_info_t; * exception handlers to print out the HDF-5 error stack. *
* - * * * * * * * * * * * * * @version HDF5 "1.11.0"
+ * @version HDF5 1.11.0
* See also: hdf.hdf5lib.HDFArray
* hdf.hdf5lib.HDF5Constants
* hdf.hdf5lib.HDF5CDataTypes
@@ -239,7 +239,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { "1, 10, 1" }; + public final static int LIB_VERSION[] = { 1, 10, 1 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; diff --git a/java/test/TestH5.java b/java/test/TestH5.java index 173af8f..4c84988 100644 --- a/java/test/TestH5.java +++ b/java/test/TestH5.java @@ -164,7 +164,7 @@ public class TestH5 { */ @Test public void testH5get_libversion() { - int libversion[] = { "1, 11, 0" }; + int libversion[] = { 1, 11, 0 }; try { H5.H5get_libversion(libversion); @@ -186,7 +186,7 @@ public class TestH5 { */ @Test public void testH5check_version() { - "int majnum = 1, minnum = 10, relnum = 1"; + int majnum = 1, minnum = 11, relnum = 0; try { H5.H5check_version(majnum, minnum, relnum); diff --git a/tools/test/h5repack/h5repack_plugin.sh.in b/tools/test/h5repack/h5repack_plugin.sh.in index c7a9a6b..0b28f78 100644 --- a/tools/test/h5repack/h5repack_plugin.sh.in +++ b/tools/test/h5repack/h5repack_plugin.sh.in @@ -246,9 +246,10 @@ TOOLTEST_DUMP() ############################################################################## # prepare for test COPY_TESTFILES_TO_TESTDIR +version_str=`echo @H5_VERSION@ | awk -F"-" '{print $1}' | sed 's/\./,/g'` # Run the test -arg="h5repack_layout.h5 -v -f UD=260,4,9,1,9,235" +arg="h5repack_layout.h5 -v -f UD=260,4,9,$version_str" TOOLTEST_DUMP plugin_version_test $arg arg="h5repack_layout.h5 -v -f UD=257,1,9" -- cgit v0.12 From fa5ca5272d7aa6f25656541b72a24697b36dd52b Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 21 Mar 2017 11:40:11 -0500 Subject: Remove extra space added by h5vers to version string in H5.java, which then failed to match the pattern after the first run. --- bin/h5vers | 2 +- java/src/hdf/hdf5lib/H5.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/h5vers b/bin/h5vers index efa97b1..d564d47 100755 --- a/bin/h5vers +++ b/bin/h5vers @@ -379,7 +379,7 @@ if ($H5_JAVA) { my $version_string2 = sprintf("%d, %d, %d", @newver[0,1,2]); $data =~ s/\@version HDF5 .*
/\@version HDF5 $version_string1
/; - $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION\[\] = { $version_string2 };/; + $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION[] = { $version_string2 };/; write_file($H5_JAVA, $data); } diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 168e507..a1099d8 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -239,7 +239,7 @@ public class H5 implements java.io.Serializable { * * Make sure to update the versions number when a different library is used. */ - public final static int LIB_VERSION[] = { 1, 10, 1 }; + public final static int LIB_VERSION[] = { 1, 11, 0 }; public final static String H5PATH_PROPERTY_KEY = "hdf.hdf5lib.H5.hdf5lib"; -- cgit v0.12 From b461f1818b91ffafea3ca8b4ec984cb57d2e00db Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 21 Mar 2017 22:58:41 -0500 Subject: Run all scripts using signal files between processes in their own directories to avoid accidental deletion of the signal files. --- test/test_usecases.sh.in | 33 ++++++++++++++++++++++++++++++++- test/testflushrefresh.sh.in | 7 ++++++- test/testswmr.sh.in | 18 +++++++++++++++--- test/testvdsswmr.sh.in | 31 ++++++++++++++++++++++++++++++- 4 files changed, 83 insertions(+), 6 deletions(-) diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 1cae191..a1fda0e 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -113,6 +113,33 @@ TOOLTEST() { fi } +# HDF5 has several tests that create and delete signal files to communicate +# between processes, and it seems that even though the names of the files are +# different, occasionally the wrong file is deleted, interrupting the flow of +# the test. Running each of these tests in its own directory should eliminate +# the problem. +mkdir usecases_test +cp twriteorder usecases_test +for FILE in use_*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE usecases_test +done + +# With the --disable-shared option, swmr program files are built in the test +# directory, otherwise they are in test/.libs with a corresponding wrapper +# script in the test directory. The programs or wrapper scripts in test should +# always be copied, swmr files in .libs should be copied only if they exists. +if [ -f .libs/use_append_chunk ]; then + mkdir usecases_test/.libs + cp .libs/use_* usecases_test/.libs + cp .libs/twriteorder usecases_test/.libs +fi + +cd usecases_test + + # run tests for H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled here temporary USECORK=use_disable_mdc_flushes for p in $USECORK; do @@ -158,10 +185,14 @@ for p in $USECASES_PROGRAMS; do fi done - +cd .. # Report test results and exit if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf usecases_test + fi else echo "$TESTNAME tests failed with $nerrors errors." EXIT_VALUE=$EXIT_FAILURE diff --git a/test/testflushrefresh.sh.in b/test/testflushrefresh.sh.in index e7917a0..d894cee 100644 --- a/test/testflushrefresh.sh.in +++ b/test/testflushrefresh.sh.in @@ -84,7 +84,7 @@ fi # different, occasionally the wrong file is deleted, interrupting the flow of # the test. Running each of these tests in its own directory should eliminate # the problem. -mkdir -p flushrefresh_test/.libs +mkdir flushrefresh_test cp flushrefresh flushrefresh_test # With the --disable-shared option, flushrefresh is built in the test directory, @@ -92,6 +92,7 @@ cp flushrefresh flushrefresh_test # the test directory. test/flushrefresh should always be copied, # .libs/flushrefresh should be copied only if it exists. if [ -f .libs/flushrefresh ]; then + mkdir flushrefresh_test/.libs cp .libs/flushrefresh flushrefresh_test/.libs fi cd flushrefresh_test @@ -210,6 +211,10 @@ fi if test $nerrors -eq 0 ; then echo "flush/refresh objects tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf flushrefresh_test + fi exit 0 else echo "flush/refresh objects tests failed with $nerrors errors." diff --git a/test/testswmr.sh.in b/test/testswmr.sh.in index 85e169a..f70d083 100644 --- a/test/testswmr.sh.in +++ b/test/testswmr.sh.in @@ -128,7 +128,13 @@ done # different, occasionally the wrong file is deleted, interrupting the flow of # the test. Running each of these tests in its own directory should eliminate # the problem. -mkdir -p swmr_test/.libs +mkdir swmr_test +for FILE in swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE swmr_test +done cp swmr* swmr_test # With the --disable-shared option, swmr program files are built in the test @@ -136,7 +142,13 @@ cp swmr* swmr_test # script in the test directory. The programs or wrapper scripts in test should # always be copied, swmr files in .libs should be copied only if they exists. if [ -f .libs/swmr ]; then - cp .libs/swmr* swmr_test/.libs + mkdir swmr_test/.libs + for FILE in .libs/swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE swmr_test/.libs + done fi cd swmr_test @@ -536,7 +548,7 @@ done ############################################################################### ## Report and exit ############################################################################### - +cd .. $DPRINT nerrors=$nerrors if test $nerrors -eq 0 ; then echo "SWMR tests passed." diff --git a/test/testvdsswmr.sh.in b/test/testvdsswmr.sh.in index d69b8c0..3ada67b 100644 --- a/test/testvdsswmr.sh.in +++ b/test/testvdsswmr.sh.in @@ -109,6 +109,31 @@ while [ $# -gt 0 ]; do esac done +# HDF5 has several tests that create and delete signal files to communicate +# between processes, and it seems that even though the names of the files are +# different, occasionally the wrong file is deleted, interrupting the flow of +# the test. Running each of these tests in its own directory should eliminate +# the problem. +mkdir vds_swmr_test +for FILE in vds_swmr*; do + case "$FILE" in + *.o) continue ;; ## don't copy the .o files + esac + cp $FILE vds_swmr_test +done + +# With the --disable-shared option, swmr program files are built in the test +# directory, otherwise they are in test/.libs with a corresponding wrapper +# script in the test directory. The programs or wrapper scripts in test should +# always be copied, swmr files in .libs should be copied only if they exists. +if [ -f .libs/vds_swmr_writer ]; then + mkdir vds_swmr_test/.libs + cp .libs/vds_swmr* vds_swmr_test/.libs +fi + +cd vds_swmr_test + + echo echo "###############################################################################" echo "## Basic VDS SWMR test - writing to a tiled plane" @@ -187,10 +212,14 @@ fi ############################################################################### ## Report and exit ############################################################################### - +cd .. $DPRINT nerrors=$nerrors if test $nerrors -eq 0 ; then echo "VDS SWMR tests passed." + if test -z "$HDF5_NOCLEANUP"; then + # delete the test directory + rm -rf vds_swmr_test + fi exit 0 else echo "VDS SWMR tests failed with $nerrors errors." -- cgit v0.12 From 9c606c3d901f4190e456730266f25b0a65c88ab9 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 22 Mar 2017 09:58:40 -0700 Subject: Revert "Switch h5clear for cache images to use existing H5Pget_cache_image_config()" This reverts commit dd5105fc9912c77f6d6074700d83e5e8282e86c9. --- src/H5AC.c | 25 +++++++++++++++++++++++++ src/H5Cprivate.h | 1 + src/H5Cquery.c | 29 +++++++++++++++++++++++++++++ src/H5F.c | 41 +++++++++++++++++++++++++++++++++++++++++ src/H5Fpublic.h | 1 + tools/src/misc/h5clear.c | 18 +++--------------- 6 files changed, 100 insertions(+), 15 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index be41b6a..38d2aa7 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -3310,3 +3310,28 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_remove_entry() */ + +/*------------------------------------------------------------------------- + * Function: H5AC_get_mdc_image_info + * + * Purpose: Wrapper function for H5C_get_mdc_image_info(). + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + if(H5C_get_mdc_image_info((H5C_t *)cache_ptr, image_addr, image_len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_mdc_image_info() failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5AC_get_mdc_image_info() */ diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index 539dece..bdfb23e 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2321,6 +2321,7 @@ H5_DLL herr_t H5C_remove_entry(void *thing); H5_DLL herr_t H5C_cache_image_status(H5F_t * f, hbool_t *load_ci_ptr, hbool_t *write_ci_ptr); H5_DLL hbool_t H5C_cache_image_pending(const H5C_t *cache_ptr); +H5_DLL herr_t H5C_get_mdc_image_info(H5C_t *cache_ptr, haddr_t *image_addr, hsize_t *image_len); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t dxpl_id, diff --git a/src/H5Cquery.c b/src/H5Cquery.c index 33a322d..1ae70e2 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -454,3 +454,32 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_get_entry_ring() */ +/*------------------------------------------------------------------------- + * Function: H5C_get_mdc_image_info + * + * Purpose: To retrieve the address and size of the cache image in the file. + * + * Return: SUCCEED on success, and FAIL on failure. + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5C_get_mdc_image_info(H5C_t * cache_ptr, haddr_t *image_addr, hsize_t *image_len) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") + if(image_addr == NULL || image_len == NULL) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad image_addr or image_len on entry.") + + *image_addr = cache_ptr->image_addr; + *image_len = cache_ptr->image_len; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* H5C_get_mdc_image_info() */ diff --git a/src/H5F.c b/src/H5F.c index a0f7599..01fb58e 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2073,8 +2073,10 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2 /* Check args */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + if(NULL == file->shared->page_buf) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "page buffering not enabled on file") + if(NULL == accesses || NULL == hits || NULL == misses || NULL == evictions || NULL == bypasses) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL input parameters for stats") @@ -2085,4 +2087,43 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2 done: FUNC_LEAVE_API(ret_value) } /* H5Fget_page_buffering_stats() */ + +/*------------------------------------------------------------------------- + * Function: H5Fget_mdc_image_info + * + * Purpose: Retrieves the image_addr and image_len for the cache image in the file. + * image_addr: --base address of the on disk metadata cache image + * --HADDR_UNDEF if no cache image + * image_len: --size of the on disk metadata cache image + * --zero if no cache image + * + * Return: Success: SUCCEED + * Failure: FAIL + * + * Programmer: Vailin Choi; March 2017 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len) +{ + H5F_t *file; /* File object for file ID */ + herr_t ret_value = SUCCEED; /* Return value */ + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*a*h", file_id, image_addr, image_len); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + + if(NULL == image_addr || NULL == image_len) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL image addr or image len") + + /* Go get the address and size of the cache image */ + if(H5AC_get_mdc_image_info(file->shared->cache, image_addr, image_len) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_mdc_image_info() failed.") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fget_mdc_image_info() */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index f87aaad..84c0d38 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -267,6 +267,7 @@ H5_DLL herr_t H5Fformat_convert(hid_t fid); H5_DLL herr_t H5Freset_page_buffering_stats(hid_t file_id); H5_DLL herr_t H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2], unsigned misses[2], unsigned evictions[2], unsigned bypasses[2]); +H5_DLL herr_t H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_size); #ifdef H5_HAVE_PARALLEL H5_DLL herr_t H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag); diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index b6c6ea3..9ec562e 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -246,28 +246,16 @@ main (int argc, const char *argv[]) /* -m option */ if(remove_cache_image) { - H5AC_cache_image_config_t config; - - /* Retrieve cache image config */ - if((fapl = H5Fget_access_plist(fid)) < 0) { - error_msg("H5Fget_access_plist\n"); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - config.version = H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION; - if(H5Pget_mdc_image_config(fapl, &config) < 0) { - error_msg("H5Pget_mdc_image_config\n"); + if(H5Fget_mdc_image_info(fid, &image_addr, &image_len) < 0) { + error_msg("H5Fget_mdc_image_info\n"); h5tools_setstatus(EXIT_FAILURE); goto done; } - - /* Check for image */ - if(!config.generate_image) + if(image_addr == HADDR_UNDEF && image_len == 0) warn_msg("No cache image in the file\n"); } h5tools_setstatus(EXIT_SUCCESS); - done: if(fname) HDfree(fname); -- cgit v0.12 From 46c9ab600de491657520897322b75659c3bdfb5f Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 22 Mar 2017 10:54:25 -0700 Subject: Minor style cleanups --- src/H5AC.c | 3 ++- src/H5Cquery.c | 5 +++-- src/H5F.c | 7 +++---- tools/src/misc/h5clear.c | 1 + 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index 38d2aa7..e2271c5 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -3330,8 +3330,9 @@ H5AC_get_mdc_image_info(H5AC_t *cache_ptr, haddr_t *image_addr, hsize_t *image_l FUNC_ENTER_NOAPI(FAIL) if(H5C_get_mdc_image_info((H5C_t *)cache_ptr, image_addr, image_len) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_mdc_image_info() failed") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve cache image info") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5AC_get_mdc_image_info() */ + diff --git a/src/H5Cquery.c b/src/H5Cquery.c index 1ae70e2..5108013 100644 --- a/src/H5Cquery.c +++ b/src/H5Cquery.c @@ -473,9 +473,9 @@ H5C_get_mdc_image_info(H5C_t * cache_ptr, haddr_t *image_addr, hsize_t *image_le FUNC_ENTER_NOAPI(FAIL) if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC)) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad cache_ptr on entry") if(image_addr == NULL || image_len == NULL) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad image_addr or image_len on entry.") + HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "bad image_addr or image_len on entry") *image_addr = cache_ptr->image_addr; *image_len = cache_ptr->image_len; @@ -483,3 +483,4 @@ H5C_get_mdc_image_info(H5C_t * cache_ptr, haddr_t *image_addr, hsize_t *image_le done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C_get_mdc_image_info() */ + diff --git a/src/H5F.c b/src/H5F.c index 01fb58e..aef9d1d 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -2073,10 +2073,8 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2 /* Check args */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - if(NULL == file->shared->page_buf) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "page buffering not enabled on file") - if(NULL == accesses || NULL == hits || NULL == misses || NULL == evictions || NULL == bypasses) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL input parameters for stats") @@ -2087,6 +2085,7 @@ H5Fget_page_buffering_stats(hid_t file_id, unsigned accesses[2], unsigned hits[2 done: FUNC_LEAVE_API(ret_value) } /* H5Fget_page_buffering_stats() */ + /*------------------------------------------------------------------------- * Function: H5Fget_mdc_image_info @@ -2116,14 +2115,14 @@ H5Fget_mdc_image_info(hid_t file_id, haddr_t *image_addr, hsize_t *image_len) /* Check args */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") - if(NULL == image_addr || NULL == image_len) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL image addr or image len") /* Go get the address and size of the cache image */ if(H5AC_get_mdc_image_info(file->shared->cache, image_addr, image_len) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_get_mdc_image_info() failed.") + HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "can't retrieve cache image info") done: FUNC_LEAVE_API(ret_value) } /* H5Fget_mdc_image_info() */ + diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 9ec562e..5c33b72 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -269,3 +269,4 @@ done: leave(h5tools_getstatus()); } /* main() */ + -- cgit v0.12