summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-23 03:12:43 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2017-03-23 03:12:43 (GMT)
commitf21b268812b10e11ee98be17dd121e6a43525aef (patch)
tree4cf800c09b03436b3de4dce2051256a1a1d7552f
parent3f1029a352800ee8ff7787c59ba161f97b293e13 (diff)
parentdfc0b2f4f68e8fb47d2526262d6e51523537369e (diff)
downloadhdf5-f21b268812b10e11ee98be17dd121e6a43525aef.zip
hdf5-f21b268812b10e11ee98be17dd121e6a43525aef.tar.gz
hdf5-f21b268812b10e11ee98be17dd121e6a43525aef.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~bmribler/hdf5_bmr_cpp3 into develop
-rwxr-xr-xbin/h5vers14
-rw-r--r--java/src/hdf/hdf5lib/H5.java4
-rw-r--r--java/test/TestH5.java4
-rw-r--r--src/H5AC.c26
-rw-r--r--src/H5Cprivate.h1
-rw-r--r--src/H5Cquery.c30
-rw-r--r--src/H5F.c40
-rw-r--r--src/H5Fpublic.h1
-rw-r--r--test/test_usecases.sh.in33
-rw-r--r--test/testflushrefresh.sh.in7
-rw-r--r--test/testswmr.sh.in18
-rw-r--r--test/testvdsswmr.sh.in31
-rw-r--r--tools/src/misc/h5clear.c19
-rw-r--r--tools/test/h5repack/h5repack_plugin.sh.in3
14 files changed, 198 insertions, 33 deletions
diff --git a/bin/h5vers b/bin/h5vers
index a72895c..d564d47 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,11 +375,11 @@ 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 .* <BR>/ * \@version HDF5 $version_string1 <BR>/;
- $data =~ s/ public final static int LIB_VERSION\[\] = { \d*, \d*, \d* };/ public final static int LIB_VERSION\[\] = { $version_string2 };/;
+ $data =~ s/\@version HDF5 .* <BR>/\@version HDF5 $version_string1 <BR>/;
+ $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..a1099d8 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.
* <hr>
*
- * * * * * * * * * * * * * @version HDF5 "1.11.0" <BR>
+ * @version HDF5 1.11.0 <BR>
* <b>See also: <a href ="./hdf.hdf5lib.HDFArray.html"> hdf.hdf5lib.HDFArray</a> </b><BR>
* <a href ="./hdf.hdf5lib.HDF5Constants.html"> hdf.hdf5lib.HDF5Constants</a><BR>
* <a href ="./hdf.hdf5lib.HDF5CDataTypes.html"> hdf.hdf5lib.HDF5CDataTypes</a><BR>
@@ -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";
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/src/H5AC.c b/src/H5AC.c
index be41b6a..e2271c5 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -3310,3 +3310,29 @@ 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_CANTGET, FAIL, "can't retrieve cache image info")
+
+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..5108013 100644
--- a/src/H5Cquery.c
+++ b/src/H5Cquery.c
@@ -454,3 +454,33 @@ 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_BADVALUE, FAIL, "bad cache_ptr on entry")
+ if(image_addr == NULL || image_len == NULL)
+ 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;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5C_get_mdc_image_info() */
+
diff --git a/src/H5F.c b/src/H5F.c
index a0f7599..aef9d1d 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -2086,3 +2086,43 @@ 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_CANTGET, FAIL, "can't retrieve cache image info")
+
+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/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."
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index b6c6ea3..5c33b72 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);
@@ -281,3 +269,4 @@ done:
leave(h5tools_getstatus());
} /* main() */
+
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"