summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlrknox <lrknox>2017-04-12 15:44:47 (GMT)
committerlrknox <lrknox>2017-04-12 15:44:47 (GMT)
commitf83622042a8a6271dd502194867c00e8a89ec9fc (patch)
treee50039c02e37815860ace3b0ebb0de7de8593047
parent7347da3187ab6f9e80c20770f17cbd35796405d7 (diff)
parent6efca6717c3c5fd12451ab0be8d27a342e46b9dc (diff)
downloadhdf5-f83622042a8a6271dd502194867c00e8a89ec9fc.zip
hdf5-f83622042a8a6271dd502194867c00e8a89ec9fc.tar.gz
hdf5-f83622042a8a6271dd502194867c00e8a89ec9fc.tar.bz2
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~lrknox/hdf5_lrk into hdf5_1_10_1
-rw-r--r--MANIFEST1
-rw-r--r--config/cmake/FindJNI.cmake9
-rw-r--r--java/src/hdf/hdf5lib/H5.java82
-rw-r--r--java/src/jni/exceptionImp.c2
-rw-r--r--java/src/jni/h5Constants.c2
-rw-r--r--java/src/jni/h5Imp.c2
-rw-r--r--java/src/jni/h5aImp.c2
-rw-r--r--java/src/jni/h5dImp.c2
-rw-r--r--java/src/jni/h5eImp.c2
-rw-r--r--java/src/jni/h5fImp.c2
-rw-r--r--java/src/jni/h5gImp.c2
-rw-r--r--java/src/jni/h5iImp.c2
-rw-r--r--java/src/jni/h5jni.h2
-rw-r--r--java/src/jni/h5lImp.c2
-rw-r--r--java/src/jni/h5oImp.c2
-rw-r--r--java/src/jni/h5pImp.c2
-rw-r--r--java/src/jni/h5plImp.c163
-rw-r--r--java/src/jni/h5plImp.h63
-rw-r--r--java/src/jni/h5rImp.c2
-rw-r--r--java/src/jni/h5sImp.c2
-rw-r--r--java/src/jni/h5tImp.c2
-rw-r--r--java/src/jni/h5util.c2
-rw-r--r--java/src/jni/h5util.h2
-rw-r--r--java/src/jni/h5zImp.c2
-rw-r--r--java/src/jni/nativeData.c2
-rw-r--r--java/test/JUnit-interface.txt3
-rw-r--r--java/test/TestH5PL.java30
-rw-r--r--release_docs/RELEASE.txt4
-rw-r--r--src/CMakeLists.txt1
-rw-r--r--src/H5Cdbg.c107
-rw-r--r--src/H5Cmpio.c102
-rw-r--r--src/H5Cprivate.h5
-rw-r--r--src/H5Dearray.c15
-rw-r--r--src/H5FDmpi.c39
-rw-r--r--src/H5FDmpio.c37
-rw-r--r--src/H5FDprivate.h2
-rw-r--r--src/H5Fmpi.c26
-rw-r--r--src/H5Fprivate.h1
-rw-r--r--src/H5L.c6
-rw-r--r--src/H5Oprivate.h1
-rw-r--r--src/H5PL.c282
-rw-r--r--src/H5PLpkg.h50
-rw-r--r--src/H5PLpublic.h7
-rw-r--r--test/CMakeTests.cmake4
-rw-r--r--test/fheap.c679
-rw-r--r--test/plugin.c946
-rw-r--r--test/set_extent.c13
47 files changed, 1951 insertions, 767 deletions
diff --git a/MANIFEST b/MANIFEST
index 13146a4..237f887 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -799,6 +799,7 @@
./src/H5PBprivate.h
./src/H5PL.c
./src/H5PLmodule.h
+./src/H5PLpkg.h
./src/H5PLprivate.h
./src/H5PLpublic.h
./src/H5PLextern.h
diff --git a/config/cmake/FindJNI.cmake b/config/cmake/FindJNI.cmake
index baab2ea..c82d308 100644
--- a/config/cmake/FindJNI.cmake
+++ b/config/cmake/FindJNI.cmake
@@ -137,7 +137,6 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/java/jre/lib/{libarch}
/usr/lib64/java/jre/lib/{libarch}
/usr/lib/jvm/jre/lib/{libarch}
- /usr/lib64/jvm/jre/lib/{libarch}
/usr/local/lib/java/jre/lib/{libarch}
/usr/local/share/java/jre/lib/{libarch}
/usr/lib/j2sdk1.4-sun/jre/lib/{libarch}
@@ -152,6 +151,9 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
/usr/lib/jvm/default-java/jre/lib/{libarch}
/usr/lib/jvm/default-java/jre/lib
/usr/lib/jvm/default-java/lib
+ # Arch Linux specific paths for default JVM
+ /usr/lib/jvm/default/jre/lib/{libarch}
+ /usr/lib/jvm/default/lib/{libarch}
# Ubuntu specific paths for default JVM
/usr/lib/jvm/java-8-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
/usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch} # Ubuntu 15.10
@@ -197,14 +199,11 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
/usr/lib64/java/include
/usr/local/lib/java/include
/usr/lib/jvm/java/include
- /usr/lib64/jvm/java/include
/usr/lib/jvm/java-6-sun/include
/usr/lib/jvm/java-1.5.0-sun/include
/usr/lib/jvm/java-6-sun-1.6.0.00/include # can this one be removed according to #8821 ? Alex
/usr/lib/jvm/java-6-openjdk/include
/usr/lib/jvm/java-7-openjdk/include
- /usr/lib/jvm/java-7-openjdk-i386/include
- /usr/lib/jvm/java-7-openjdk-amd64/include
/usr/lib64/jvm/java-7-openjdk/include
/usr/lib64/jvm/java-7-openjdk-amd64/include
/usr/lib/jvm/java-8-openjdk-{libarch}/include # ubuntu 15.10
@@ -216,6 +215,8 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_INCLUDE_DIRECTORIES
/opt/sun-jdk-1.5.0.04/include
# Debian specific path for default JVM
/usr/lib/jvm/default-java/include
+ # Arch specific path for default JVM
+ /usr/lib/jvm/default/include
# OpenBSD specific path for default JVM
/usr/local/jdk-1.7.0/include
/usr/local/jdk-1.6.0/include
diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java
index e8ed233..03d7b6b 100644
--- a/java/src/hdf/hdf5lib/H5.java
+++ b/java/src/hdf/hdf5lib/H5.java
@@ -7200,6 +7200,88 @@ public class H5 implements java.io.Serializable {
**/
public synchronized static native int H5PLget_loading_state() throws HDF5LibraryException;
+ /**
+ * H5PLappend inserts the plugin path at the end of the table.
+ *
+ * @param plugin_path
+ * IN: Path for location of filter plugin libraries.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5PLappend(String plugin_path) throws HDF5LibraryException;
+
+ /**
+ * H5PLprepend inserts the plugin path at the beginning of the table.
+ *
+ * @param plugin_path
+ * IN: Path for location of filter plugin libraries.
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5PLprepend(String plugin_path) throws HDF5LibraryException;
+
+ /**
+ * H5PLreplace replaces the plugin path at the specified index.
+ *
+ * @param plugin_path
+ * IN: Path for location of filter plugin libraries.
+ * @param index
+ * IN: The table index (0-based).
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5PLreplace(String plugin_path, int index) throws HDF5LibraryException;
+
+ /**
+ * H5PLinsert inserts the plugin path at the specified index.
+ *
+ * @param plugin_path
+ * IN: Path for location of filter plugin libraries.
+ * @param index
+ * IN: The table index (0-based).
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5PLinsert(String plugin_path, int index) throws HDF5LibraryException;
+
+ /**
+ * H5PLremove removes the plugin path at the specified index.
+ *
+ * @param index
+ * IN: The table index (0-based).
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native void H5PLremove(int index) throws HDF5LibraryException;
+
+ /**
+ * H5PLget retrieves the plugin path at the specified index.
+ *
+ * @param index
+ * IN: The table index (0-based).
+ *
+ * @return the current path at the index in plugin path table
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native String H5PLget(int index) throws HDF5LibraryException;
+
+ /**
+ * H5PLsize retrieves the size of the current list of plugin paths.
+ *
+ * @return the current number of paths in the plugin path table
+ *
+ * @exception HDF5LibraryException
+ * - Error from the HDF-5 Library.
+ **/
+ public synchronized static native int H5PLsize() throws HDF5LibraryException;
+
// ////////////////////////////////////////////////////////////
// //
// H5R: HDF5 1.8 Reference API Functions //
diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c
index 564a764..05c193f 100644
--- a/java/src/jni/exceptionImp.c
+++ b/java/src/jni/exceptionImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c
index 1aed6c4..cd1c2f0 100644
--- a/java/src/jni/h5Constants.c
+++ b/java/src/jni/h5Constants.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5Imp.c b/java/src/jni/h5Imp.c
index 07c9844..2eeb075 100644
--- a/java/src/jni/h5Imp.c
+++ b/java/src/jni/h5Imp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c
index a0c5546..26ec4fc 100644
--- a/java/src/jni/h5aImp.c
+++ b/java/src/jni/h5aImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c
index 31e9ea2..d869601 100644
--- a/java/src/jni/h5dImp.c
+++ b/java/src/jni/h5dImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c
index 1c6d4f0..24ddcbc 100644
--- a/java/src/jni/h5eImp.c
+++ b/java/src/jni/h5eImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c
index 0053770..8cf5252 100644
--- a/java/src/jni/h5fImp.c
+++ b/java/src/jni/h5fImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c
index 7bfa162..41ec382 100644
--- a/java/src/jni/h5gImp.c
+++ b/java/src/jni/h5gImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5iImp.c b/java/src/jni/h5iImp.c
index a070ed6..47574ca 100644
--- a/java/src/jni/h5iImp.c
+++ b/java/src/jni/h5iImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h
index 0bf1de5..2970e14 100644
--- a/java/src/jni/h5jni.h
+++ b/java/src/jni/h5jni.h
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c
index a94f209..bf2d7b1 100644
--- a/java/src/jni/h5lImp.c
+++ b/java/src/jni/h5lImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c
index f5c0702..e8abead 100644
--- a/java/src/jni/h5oImp.c
+++ b/java/src/jni/h5oImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c
index 4050811..df8b3c9 100644
--- a/java/src/jni/h5pImp.c
+++ b/java/src/jni/h5pImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c
index 5adb4b9..5a2d3ba 100644
--- a/java/src/jni/h5plImp.c
+++ b/java/src/jni/h5plImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
@@ -59,6 +59,167 @@ Java_hdf_hdf5lib_H5_H5PLget_1loading_1state
return (jint)plugin_type;
} /* end Java_hdf_hdf5lib_H5_H5PLget_1loading_1state */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLappend
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLappend
+ (JNIEnv *env, jclass clss, jobjectArray plugin_path)
+{
+ char *aName;
+ herr_t retVal = -1;
+
+ PIN_JAVA_STRING(plugin_path, aName);
+ if (aName != NULL) {
+ retVal = H5PLappend(aName);
+
+ UNPIN_JAVA_STRING(plugin_path, aName);
+
+ if (retVal < 0)
+ h5libraryError(env);
+ }
+} /* end Java_hdf_hdf5lib_H5_H5PLappend */
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLprepend
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLprepend
+ (JNIEnv *env, jclass clss, jobjectArray plugin_path)
+{
+ char *aName;
+ herr_t retVal = -1;
+
+ PIN_JAVA_STRING(plugin_path, aName);
+ if (aName != NULL) {
+ retVal = H5PLprepend(aName);
+
+ UNPIN_JAVA_STRING(plugin_path, aName);
+
+ if (retVal < 0)
+ h5libraryError(env);
+ }
+} /* end Java_hdf_hdf5lib_H5_H5PLprepend */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLreplace
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLreplace
+ (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index)
+{
+ char *aName;
+ herr_t retVal = -1;
+
+ PIN_JAVA_STRING(plugin_path, aName);
+ if (aName != NULL) {
+ retVal = H5PLreplace(aName, index);
+
+ UNPIN_JAVA_STRING(plugin_path, aName);
+
+ if (retVal < 0)
+ h5libraryError(env);
+ }
+} /* end Java_hdf_hdf5lib_H5_H5PLreplace */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLinsert
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLinsert
+ (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index)
+{
+ char *aName;
+ herr_t retVal = -1;
+
+ PIN_JAVA_STRING(plugin_path, aName);
+ if (aName != NULL) {
+ retVal = H5PLinsert(aName, index);
+
+ UNPIN_JAVA_STRING(plugin_path, aName);
+
+ if (retVal < 0)
+ h5libraryError(env);
+ }
+} /* end Java_hdf_hdf5lib_H5_H5PLinsert */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLremove
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLremove
+ (JNIEnv *env, jclass clss, jint index)
+{
+ if (H5PLremove(index) < 0)
+ h5libraryError(env);
+} /* end Java_hdf_hdf5lib_H5_H5PLremove */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLget
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5PLget
+ (JNIEnv *env, jclass clss, jint index)
+{
+ char *aName;
+ jstring str = NULL;
+ ssize_t buf_size;
+
+ /* get the length of the name */
+ buf_size = H5PLget(index, NULL, 0);
+
+ if (buf_size <= 0) {
+ h5badArgument(env, "H5PLget: buf_size <= 0");
+ } /* end if */
+ else {
+ buf_size++; /* add extra space for the null terminator */
+ aName = (char*)HDmalloc(sizeof(char) * (size_t)buf_size);
+ if (aName == NULL) {
+ h5outOfMemory(env, "H5PLget: malloc failed");
+ } /* end if */
+ else {
+ buf_size = H5PLget(index, aName, (size_t)buf_size);
+ if (buf_size < 0) {
+ h5libraryError(env);
+ } /* end if */
+ else {
+ str = ENVPTR->NewStringUTF(ENVPAR aName);
+ }
+ HDfree(aName);
+ }
+ }
+ return str;
+} /* end Java_hdf_hdf5lib_H5_H5PLget */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLsize
+ * Signature: (V)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5PLsize
+ (JNIEnv *env, jclass clss)
+{
+ int retVal = -1;
+
+ retVal = H5PLsize();
+ if (retVal < 0)
+ h5libraryError(env);
+
+ return (jint)retVal;
+} /* end Java_hdf_hdf5lib_H5_H5PLsize */
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h
index 901f02e..5336621 100644
--- a/java/src/jni/h5plImp.h
+++ b/java/src/jni/h5plImp.h
@@ -39,6 +39,69 @@ JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5PLget_1loading_1state
(JNIEnv *, jclass);
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLappend
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLappend
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLprepend
+ * Signature: (Ljava/lang/String;)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLprepend
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLreplace
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLreplace
+ (JNIEnv *, jclass, jobjectArray, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLinsert
+ * Signature: (Ljava/lang/String;I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLinsert
+ (JNIEnv *, jclass, jobjectArray, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLremove
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5PLremove
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLget
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL
+Java_hdf_hdf5lib_H5_H5PLget
+ (JNIEnv *, jclass, jint);
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5PLsize
+ * Signature: (V)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5PLsize
+ (JNIEnv *, jclass);
+
#ifdef __cplusplus
} /* end extern "C" */
#endif /* __cplusplus */
diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c
index 15720ae..b250550 100644
--- a/java/src/jni/h5rImp.c
+++ b/java/src/jni/h5rImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
#ifdef __cplusplus
diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c
index 84db125..c578ab8 100644
--- a/java/src/jni/h5sImp.c
+++ b/java/src/jni/h5sImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c
index 212ce84..7b4af56 100644
--- a/java/src/jni/h5tImp.c
+++ b/java/src/jni/h5tImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c
index aa2b529..8454815 100644
--- a/java/src/jni/h5util.c
+++ b/java/src/jni/h5util.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h
index 4d3e201..434a107 100644
--- a/java/src/jni/h5util.h
+++ b/java/src/jni/h5util.h
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/h5zImp.c b/java/src/jni/h5zImp.c
index e569870..a5e6cd8 100644
--- a/java/src/jni/h5zImp.c
+++ b/java/src/jni/h5zImp.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
diff --git a/java/src/jni/nativeData.c b/java/src/jni/nativeData.c
index 5d07abb..33f4953 100644
--- a/java/src/jni/nativeData.c
+++ b/java/src/jni/nativeData.c
@@ -13,7 +13,7 @@
/*
* For details of the HDF libraries, see the HDF Documentation at:
- * http://hdfdfgroup.org/HDF5/doc/
+ * http://hdfgroup.org/HDF5/doc/
*
*/
/*
diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt
index cae8cef..ab2f3b1 100644
--- a/java/test/JUnit-interface.txt
+++ b/java/test/JUnit-interface.txt
@@ -633,13 +633,14 @@ JUnit version 4.11
.testH5Ocomment_clear
.testH5Ocopy_cur_not_exists
.TestH5PLplugins
+.TestH5PLpaths
.testH5Zfilter_avail
.testH5Zunregister_predefined
.testH5Zget_filter_info
Time: XXXX
-OK (637 tests)
+OK (638 tests)
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists
diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java
index ad3dc34..aa59478 100644
--- a/java/test/TestH5PL.java
+++ b/java/test/TestH5PL.java
@@ -67,6 +67,36 @@ public class TestH5PL {
}
}
+ @Test
+ public void TestH5PLpaths() {
+ try {
+ int original_entries = H5.H5PLsize();
+ H5.H5PLappend("path_one");
+ int plugin_entries = H5.H5PLsize();
+ assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+1) == plugin_entries);
+ H5.H5PLprepend("path_two");
+ plugin_entries = H5.H5PLsize();
+ assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+2) == plugin_entries);
+ H5.H5PLinsert("path_three", original_entries);
+ plugin_entries = H5.H5PLsize();
+ assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+3) == plugin_entries);
+ String first_path = H5.H5PLget(original_entries);
+ assertTrue("First path was : "+first_path + " ",first_path.compareToIgnoreCase("path_three")==0);
+ H5.H5PLreplace("path_four", original_entries);
+ first_path = H5.H5PLget(original_entries);
+ assertTrue("First path changed to : "+first_path + " ",first_path.compareToIgnoreCase("path_four")==0);
+ H5.H5PLremove(original_entries);
+ first_path = H5.H5PLget(original_entries);
+ assertTrue("First path now : "+first_path + " ",first_path.compareToIgnoreCase("path_two")==0);
+ plugin_entries = H5.H5PLsize();
+ assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+2) == plugin_entries);
+ }
+ catch (Throwable err) {
+ err.printStackTrace();
+ fail("TestH5PLpaths " + err);
+ }
+ }
+
@Ignore
public void TestH5PLdlopen() {
long file_id = -1;
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index 7c4db76..3ab04d3 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -167,8 +167,8 @@ Other New Features and Enhancements
- A bin/restore.sh script was added that reverts autogen.sh processing.
(DER, 2016/11/08)
-
+
Fortran Library:
----------------
@@ -356,7 +356,7 @@ Bug Fixes since HDF5-1.10.0-patch1 release
(VC, 2016/05/29, HDFFV-9434)
- (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit.
- (b) Modifications to better handle error recovery when conversion by
+ (b) Modifications to better handle error recovery when conversion by
h5format_convert fails.
(VC 2016/05/29, HDFFV-9434)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9321bbd..e2acd30 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -520,6 +520,7 @@ set (H5PL_SOURCES
set (H5PL_HDRS
${HDF5_SRC_DIR}/H5PLextern.h
+ ${HDF5_SRC_DIR}/H5PLpkg.h
${HDF5_SRC_DIR}/H5PLpublic.h
)
IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SOURCES}" )
diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c
index 0bb00d7..4a08d9b 100644
--- a/src/H5Cdbg.c
+++ b/src/H5Cdbg.c
@@ -28,12 +28,16 @@
#include "H5Cmodule.h" /* This source code file is part of the H5C module */
+#define H5AC_FRIEND
+
+
+
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5ACprivate.h" /* Metadata Cache */
+#include "H5ACpkg.h" /* Metadata Cache */
#include "H5Cpkg.h" /* Cache */
#include "H5Eprivate.h" /* Error Handling */
@@ -338,6 +342,107 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
/*-------------------------------------------------------------------------
+ * Function: H5C_dump_coll_write_list
+ *
+ * Purpose: Debugging routine that prints a summary of the contents of
+ * the collective write skip list used by the metadata cache
+ * in the parallel case to maintain a list of entries to write
+ * collectively at a sync point.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: John Mainzer
+ * 4/1/17
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifdef H5_HAVE_PARALLEL
+#ifndef NDEBUG
+herr_t
+H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ int i;
+ int list_len;
+ H5AC_aux_t * aux_ptr = NULL;
+ H5C_cache_entry_t * entry_ptr = NULL;
+ H5SL_node_t * node_ptr = NULL;
+
+ FUNC_ENTER_NOAPI_NOERR
+
+ HDassert(cache_ptr != NULL);
+ HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
+ HDassert(cache_ptr->aux_ptr);
+
+ aux_ptr = (H5AC_aux_t *)cache_ptr->aux_ptr;
+
+ HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC);
+
+ HDassert(calling_fcn != NULL);
+
+ list_len = (int)H5SL_count(cache_ptr->coll_write_list);
+
+ HDfprintf(stdout, "\n\nDumping MDC coll write list from %d:%s.\n",
+ aux_ptr->mpi_rank, calling_fcn);
+ HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len);
+
+ if ( list_len > 0 ) {
+
+ /* scan the collective write list generating the desired output */
+ HDfprintf(stdout,
+ "Num: Addr: Len: Prot/Pind: Dirty: Type:\n");
+
+ i = 0;
+
+ node_ptr = H5SL_first(cache_ptr->coll_write_list);
+
+ if ( node_ptr != NULL )
+
+ entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+
+ else
+
+ entry_ptr = NULL;
+
+ while ( entry_ptr != NULL ) {
+
+ HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
+
+ HDfprintf(stdout,
+ "%s%d 0x%016llx %4lld %d/%d %d %s\n",
+ cache_ptr->prefix, i,
+ (long long)(entry_ptr->addr),
+ (long long)(entry_ptr->size),
+ (int)(entry_ptr->is_protected),
+ (int)(entry_ptr->is_pinned),
+ (int)(entry_ptr->is_dirty),
+ entry_ptr->type->name);
+
+ node_ptr = H5SL_next(node_ptr);
+
+ if ( node_ptr != NULL )
+
+ entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr);
+
+ else
+
+ entry_ptr = NULL;
+
+ i++;
+
+ } /* end while */
+ } /* end if */
+
+ HDfprintf(stdout, "\n\n");
+
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5C_dump_coll_write_list() */
+#endif /* NDEBUG */
+#endif /* H5_HAVE_PARALLEL */
+
+
+/*-------------------------------------------------------------------------
* Function: H5C_set_prefix
*
* Purpose: Set the values of the prefix field of H5C_t. This
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index a4afcd4..a75cd88 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -948,12 +948,15 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id)
/* Get original transfer mode */
if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \
+ "not a data transfer property list")
+
if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property")
/* Get number of entries in collective write list */
count = (int)H5SL_count(cache_ptr->coll_write_list);
+
if(count > 0) {
H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE;
H5SL_node_t *node;
@@ -962,21 +965,34 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id)
int i;
if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \
+ "can't set MPI-I/O property")
/* Allocate arrays */
- if(NULL == (length_array = (int *)H5MM_malloc((size_t)count * sizeof(int))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write table length array")
- if(NULL == (buf_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective buf table length array")
- if(NULL == (offset_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))))
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective offset table length array")
+ if ( NULL == (length_array =
+ (int *)H5MM_malloc((size_t)count * sizeof(int))) )
+
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \
+ "memory allocation failed for collective write table length array")
+
+ if ( NULL == (buf_array =
+ (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) )
+
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \
+ "memory allocation failed for collective buf table length array")
+
+ if(NULL == (offset_array =
+ (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) )
+
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \
+ "memory allocation failed for collective offset table length array")
/* Fill arrays */
node = H5SL_first(cache_ptr->coll_write_list);
HDassert(node);
if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node)))
- HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item")
+ HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \
+ "can't retrieve skip list item")
/* Set up initial array position & buffer base address */
length_array[0] = (int)entry_ptr->size;
@@ -987,8 +1003,10 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id)
node = H5SL_next(node);
i = 1;
while(node) {
+
if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node)))
- HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item")
+ HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \
+ "can't retrieve skip list item")
/* Set up array position */
length_array[i] = (int)entry_ptr->size;
@@ -1001,48 +1019,85 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id)
} /* end while */
/* Create memory MPI type */
- if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype)))
+ if(MPI_SUCCESS != (mpi_code =
+ MPI_Type_create_hindexed(count, length_array,
+ buf_array, MPI_BYTE,
+ &btype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
+
btype_created = TRUE;
+
if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&btype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
/* Create file MPI type */
- if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype)))
+ if(MPI_SUCCESS != (mpi_code =
+ MPI_Type_create_hindexed(count, length_array,
+ offset_array, MPI_BYTE,
+ &ftype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code)
+
ftype_created = TRUE;
+
if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code)
/* Pass buf type, file type to the file driver */
if(H5FD_mpi_setup_collective(dxpl_id, &btype, &ftype) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties")
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \
+ "can't set MPI-I/O properties")
/* Write data */
- if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, dxpl_id, base_buf) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to write entries collectively")
+ if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0,
+ (size_t)1, dxpl_id, base_buf) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \
+ "unable to write entries collectively")
+
} /* end if */
else {
MPI_Status mpi_stat;
- MPI_File mpi_fh_p;
+ MPI_File *mpi_fh_p;
MPI_File mpi_fh;
+ MPI_Info *info_p;
+ MPI_Info info;
if(H5F_get_mpi_handle(f, (MPI_File **)&mpi_fh_p) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file handle")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \
+ "can't get mpi file handle")
+
mpi_fh = *(MPI_File*)mpi_fh_p;
- /* just to match up with the 1st MPI_File_set_view from H5FD_mpio_write() */
- if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL)))
+ if (H5F_get_mpi_info(f, &info_p) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \
+ "can't get mpi file info")
+
+ info = *info_p;
+
+ /* just to match up with the 1st MPI_File_set_view from
+ * H5FD_mpio_write()
+ */
+ if(MPI_SUCCESS != (mpi_code =
+ MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE,
+ MPI_BYTE, "native",
+ info)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code)
/* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */
HDmemset(&mpi_stat, 0, sizeof(MPI_Status));
- if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat)))
+ if(MPI_SUCCESS != (mpi_code =
+ MPI_File_write_at_all(mpi_fh, (MPI_Offset)0,
+ NULL, 0, MPI_BYTE, &mpi_stat)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code)
- /* just to match up with the 2nd MPI_File_set_view (reset) in H5FD_mpio_write() */
- if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL)))
+ /* just to match up with the 2nd MPI_File_set_view (reset) in
+ * H5FD_mpio_write()
+ */
+ if(MPI_SUCCESS != (mpi_code =
+ MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE,
+ MPI_BYTE, "native",
+ info)))
HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code)
+
} /* end else */
done:
@@ -1061,7 +1116,8 @@ done:
if(orig_xfer_mode != H5FD_MPIO_COLLECTIVE) {
HDassert(plist);
if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0)
- HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property")
+ HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \
+ "can't set MPI-I/O property")
} /* end if */
FUNC_LEAVE_NOAPI(ret_value);
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index eb4c681..5335f80 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -2338,9 +2338,12 @@ H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name);
H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr);
H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring);
H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn);
+#ifdef H5_HAVE_PARALLEL
+H5_DLL herr_t H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn);
+#endif /* H5_HAVE_PARALLEL */
H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr,
void **entry_ptr_ptr);
-H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr,
+H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr,
haddr_t child_addr, hbool_t *fd_exists_ptr);
H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr,
const H5C_class_t *expected_type, hbool_t *in_cache_ptr,
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index eb8d702..1df0a58 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -1135,7 +1135,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda
H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks);
+ idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks);
} /* end if */
else {
/* Calculate the index of this chunk */
@@ -1200,7 +1200,8 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
/* "Swizzle" constant dimensions for this dataset */
if(layout->u.earray.unlim_dim > 0) {
- hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */
+ hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */
+ hsize_t swizzled_max_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of max # of chunks in each dimension */
/* Get the swizzled chunk dimensions */
HDmemcpy(layout->u.earray.swizzled_dim, layout->dim, (layout->ndims - 1) * sizeof(layout->dim[0]));
@@ -1213,6 +1214,14 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout)
/* Get the swizzled "down" sizes for each dimension */
if(H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
+
+ /* Get the swizzled max number of chunks in each dimension */
+ HDmemcpy(swizzled_max_chunks, layout->max_chunks, (layout->ndims - 1) * sizeof(swizzled_max_chunks[0]));
+ H5VM_swizzle_coords(hsize_t, swizzled_max_chunks, layout->u.earray.unlim_dim);
+
+ /* Get the swizzled max "down" sizes for each dimension */
+ if(H5VM_array_down((layout->ndims - 1), swizzled_max_chunks, layout->u.earray.swizzled_max_down_chunks) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value")
} /* end if */
done:
@@ -1412,7 +1421,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t
H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim);
/* Calculate the index of this chunk */
- idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks);
+ idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks);
} /* end if */
else {
/* Calculate the index of this chunk */
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index 3b2cdef..16be455 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -146,6 +146,45 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5FD_get_mpi_info
+ *
+ * Purpose: Retrieves the file's mpi info
+ *
+ * Return: Success: SUCCEED
+ *
+ * Failure: Negative
+ *
+ * Programmer: John Mainzer
+ * 4/4/17
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5FD_get_mpi_info(H5FD_t *file, void** mpi_info)
+{
+ const H5FD_class_mpi_t *cls;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ HDassert(file);
+ cls = (const H5FD_class_mpi_t *)(file->cls);
+ HDassert(cls);
+ HDassert(cls->get_mpi_info); /* All MPI drivers must implement this */
+
+ /* Dispatch to driver */
+ if ((ret_value=(cls->get_mpi_info)(file, mpi_info)) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, \
+ "driver get_mpi_info request failed")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5FD_get_mpi_info() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_mpi_MPIOff_to_haddr
*
* Purpose: Convert an MPI_Offset value to haddr_t.
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 3d55f3d..ace91f8 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -93,6 +93,7 @@ static herr_t H5FD_mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing);
static int H5FD_mpio_mpi_rank(const H5FD_t *_file);
static int H5FD_mpio_mpi_size(const H5FD_t *_file);
static MPI_Comm H5FD_mpio_communicator(const H5FD_t *_file);
+static herr_t H5FD_mpio_get_info(H5FD_t *_file, void** mpi_info);
/* The MPIO file driver information */
static const H5FD_class_mpi_t H5FD_mpio_g = {
@@ -132,7 +133,8 @@ static const H5FD_class_mpi_t H5FD_mpio_g = {
}, /* End of superclass information */
H5FD_mpio_mpi_rank, /*get_rank */
H5FD_mpio_mpi_size, /*get_size */
- H5FD_mpio_communicator /*get_comm */
+ H5FD_mpio_communicator, /*get_comm */
+ H5FD_mpio_get_info /*get_info */
};
#ifdef H5FDmpio_DEBUG
@@ -1306,6 +1308,39 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5FD_mpio_get_info
+ *
+ * Purpose: Returns the file info of MPIO file driver.
+ *
+ * Returns: Non-negative if succeed or negative if fails.
+ *
+ * Programmer: John Mainzer
+ * April 4, 2017
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+*/
+static herr_t
+H5FD_mpio_get_info(H5FD_t *_file, void** mpi_info)
+{
+ H5FD_mpio_t *file = (H5FD_mpio_t *)_file;
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT
+
+ if(!mpi_info)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mpi info not valid")
+
+ *mpi_info = &(file->info);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+
+} /* H5FD_mpio_get_info() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_mpio_read
*
* Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index e3e1b22..0fc2135 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -51,6 +51,7 @@ typedef struct H5FD_class_mpi_t {
int (*get_rank)(const H5FD_t *file); /* Get the MPI rank of a process */
int (*get_size)(const H5FD_t *file); /* Get the MPI size of a communicator */
MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */
+ herr_t (*get_mpi_info)(H5FD_t *file, void** mpi_info); /* get MPI_Info for a file */
} H5FD_class_mpi_t;
#endif
@@ -200,6 +201,7 @@ H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag);
H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file);
H5_DLL int H5FD_mpi_get_size(const H5FD_t *file);
H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file);
+H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info);
#endif /* H5_HAVE_PARALLEL */
#endif /* !_H5FDprivate_H */
diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c
index e4b4fc8..2ce454a 100644
--- a/src/H5Fmpi.c
+++ b/src/H5Fmpi.c
@@ -354,5 +354,31 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_mpi_retrieve_comm */
+/*-------------------------------------------------------------------------
+ * Function: H5F_get_mpi_info
+ *
+ * Purpose: Retrieves MPI File info.
+ *
+ * Return: Success: The size (positive)
+ * Failure: Negative
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info)
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI(FAIL)
+
+ HDassert(f && f->shared);
+
+ /* Dispatch to driver */
+ if ((ret_value = H5FD_get_mpi_info(f->shared->lf, (void **)f_info)) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F_get_mpi_info() */
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index f3aa46d..6f68a62 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -850,6 +850,7 @@ H5_DLL int H5F_mpi_get_rank(const H5F_t *f);
H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f);
H5_DLL int H5F_mpi_get_size(const H5F_t *f);
H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm);
+H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info);
#endif /* H5_HAVE_PARALLEL */
/* External file cache routines */
diff --git a/src/H5L.c b/src/H5L.c
index fcaa28b..469a86c 100644
--- a/src/H5L.c
+++ b/src/H5L.c
@@ -2349,9 +2349,11 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk,
if(name == NULL)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist")
- /* Check for removing '.' */
+ /* Check for non-existent (NULL) link.
+ * Note that this can also occur when attempting to remove '.'
+ */
if(lnk == NULL)
- HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "can't delete self")
+ HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)")
/* Remove the link from the group */
if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0)
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index e82bf1b..0f798b2 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -582,6 +582,7 @@ typedef struct H5O_layout_chunk_earray_t {
unsigned unlim_dim; /* Rank of unlimited dimension for dataset */
uint32_t swizzled_dim[H5O_LAYOUT_NDIMS]; /* swizzled chunk dimensions */
hsize_t swizzled_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled "down" size of number of chunks in each dimension */
+ hsize_t swizzled_max_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled max "down" size of number of chunks in each dimension */
} H5O_layout_chunk_earray_t;
typedef struct H5O_layout_chunk_bt2_t {
diff --git a/src/H5PL.c b/src/H5PL.c
index 7bd2e3b..512b00b 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -23,15 +23,33 @@
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5MMprivate.h" /* Memory management */
-#include "H5PLprivate.h" /* Plugin */
+#include "H5PLpkg.h" /* Plugin */
#include "H5Zprivate.h" /* Filter pipeline */
/****************/
/* Local Macros */
/****************/
-
-#define H5PL_MAX_PATH_NUM 16
+#ifdef H5_HAVE_WIN32_API
+#define H5PL_EXPAND_ENV_VAR { \
+ long bufCharCount; \
+ char *tempbuf; \
+ if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) \
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") \
+ if((bufCharCount = ExpandEnvironmentStringsA(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \
+ tempbuf = (char *)H5MM_xfree(tempbuf); \
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") \
+ } \
+ if(bufCharCount == 0) { \
+ tempbuf = (char *)H5MM_xfree(tempbuf); \
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") \
+ } \
+ dl_path = (char *)H5MM_xfree(dl_path); \
+ dl_path = tempbuf; \
+ }
+#else
+#define H5PL_EXPAND_ENV_VAR
+#endif /* H5_HAVE_WIN32_API */
/****************************/
/* Macros for supporting
@@ -388,6 +406,244 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5PLappend
+ *
+ * Purpose: Insert a plugin path at the end of the list.
+ *
+ * Return: Non-negative or success.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5PLappend(const char* plugin_path)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ char *dl_path = NULL;
+
+ FUNC_ENTER_API(FAIL)
+ if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table")
+ if(NULL == plugin_path)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided")
+ if(NULL == (dl_path = H5MM_strdup(plugin_path)))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
+
+ H5PL_EXPAND_ENV_VAR
+
+ H5PL_path_table_g[H5PL_num_paths_g] = dl_path;
+ H5PL_num_paths_g++;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5PLappend() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5PLprepend
+ *
+ * Purpose: Insert a plugin path at the beginning of the list.
+ *
+ * Return: Non-negative or success.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5PLprepend(const char* plugin_path)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ char *dl_path = NULL;
+ unsigned int plindex;
+
+ FUNC_ENTER_API(FAIL)
+ if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table")
+ if(NULL == plugin_path)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided")
+ if(NULL == (dl_path = H5MM_strdup(plugin_path)))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
+
+ H5PL_EXPAND_ENV_VAR
+
+ for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--)
+ H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1];
+ H5PL_path_table_g[0] = dl_path;
+ H5PL_num_paths_g++;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5PLprepend() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5PLreplace
+ *
+ * Purpose: Replace the path at the specified index.
+ *
+ * Return: Non-negative or success.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5PLreplace(const char* plugin_path, unsigned int index)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ char *dl_path = NULL;
+
+ FUNC_ENTER_API(FAIL)
+ if(NULL == plugin_path)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided")
+ if(index >= H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table")
+ if(NULL == (dl_path = H5MM_strdup(plugin_path)))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
+
+ H5PL_EXPAND_ENV_VAR
+
+ if(H5PL_path_table_g[index])
+ H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]);
+ H5PL_path_table_g[index] = dl_path;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5PLreplace() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5PLinsert
+ *
+ * Purpose: Insert a plugin path at the specified index, moving other paths after the index.
+ *
+ * Return: Non-negative or success.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5PLinsert(const char* plugin_path, unsigned int index)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ char *dl_path = NULL;
+ unsigned int plindex;
+
+ FUNC_ENTER_API(FAIL)
+ if(H5PL_num_paths_g == H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table")
+ if(NULL == plugin_path)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided")
+ if(index >= H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table")
+ if(NULL == (dl_path = H5MM_strdup(plugin_path)))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
+
+ H5PL_EXPAND_ENV_VAR
+
+ for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--)
+ H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1];
+ H5PL_path_table_g[index] = dl_path;
+ H5PL_num_paths_g++;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5PLinsert() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5PLremove
+ *
+ * Purpose: Remove the plugin path at the specifed index and compacting the list.
+ *
+ * Return: Non-negative or success.
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5PLremove(unsigned int index)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ unsigned int plindex;
+
+ FUNC_ENTER_API(FAIL)
+ if(H5PL_num_paths_g == 0)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table")
+ if(index >= H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table")
+ if(NULL == H5PL_path_table_g[index])
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index")
+ H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]);
+
+ H5PL_num_paths_g--;
+ for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++)
+ H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1];
+ H5PL_path_table_g[H5PL_num_paths_g] = NULL;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5PLremove() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5PLget
+ *
+ * Purpose: Query the plugin path at the specified index.
+ *
+ * Return: Success: The length of path.
+ *
+ * If `pathname' is non-NULL then write up to `size' bytes into that
+ * buffer and always return the length of the pathname.
+ * Otherwise `size' is ignored and the function does not store the pathname,
+ * just returning the number of characters required to store the pathname.
+ * If an error occurs then the buffer pointed to by `pathname' (NULL or non-NULL)
+ * is unchanged and the function returns a negative value.
+ * If a zero is returned for the name's length, then there is no pathname
+ * associated with the index.
+ *
+ *-------------------------------------------------------------------------
+ */
+ssize_t
+H5PLget(unsigned int index, char *pathname/*out*/, size_t size)
+{
+ ssize_t ret_value = 0; /* Return value */
+ ssize_t len = 0; /* Length of pathname */
+ char *dl_path = NULL;
+
+ FUNC_ENTER_API(FAIL)
+ if(H5PL_num_paths_g == 0)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table")
+ if(index >= H5PL_MAX_PATH_NUM)
+ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table")
+ if(NULL == (dl_path = H5PL_path_table_g[index]))
+ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index")
+ len = HDstrlen(dl_path);
+ if(pathname) {
+ HDstrncpy(pathname, dl_path, MIN((size_t)(len + 1), size));
+ if((size_t)len >= size)
+ pathname[size - 1] = '\0';
+ } /* end if */
+
+ /* Set return value */
+ ret_value = len;
+
+done:
+ FUNC_LEAVE_API(ret_value)
+} /* end H5PLget() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5PLsize
+ *
+ * Purpose: Query the size of the current list of plugin paths.
+ *
+ * Return: Non-negative or success.
+ *
+ *-------------------------------------------------------------------------
+ */
+unsigned int
+H5PLsize(void)
+{
+ return (unsigned int)H5PL_num_paths_g;
+} /* end H5PLsize() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5PL__init_path_table
*
* Purpose: Initialize the path table.
@@ -420,25 +676,7 @@ H5PL__init_path_table(void)
if(NULL == dl_path)
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path")
-#ifdef H5_HAVE_WIN32_API
- else { /* Expand windows env var*/
- long bufCharCount;
- char *tempbuf;
- if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE)))
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path")
- if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) {
- tempbuf = (char *)H5MM_xfree(tempbuf);
- HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long")
- }
- if(bufCharCount == 0) {
- tempbuf = (char *)H5MM_xfree(tempbuf);
- HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path")
- }
- dl_path = (char *)H5MM_xfree(dl_path);
- dl_path = H5MM_strdup(tempbuf);
- tempbuf = (char *)H5MM_xfree(tempbuf);
- }
-#endif /* H5_HAVE_WIN32_API */
+ H5PL_EXPAND_ENV_VAR
/* Put paths in the path table. They are separated by ":" */
dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR);
diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h
new file mode 100644
index 0000000..5cf3096
--- /dev/null
+++ b/src/H5PLpkg.h
@@ -0,0 +1,50 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * 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. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+#if !(defined H5PL_FRIEND || defined H5PL_MODULE)
+#error "Do not include this file outside the H5PL package!"
+#endif
+
+#ifndef _H5PLpkg_H
+#define _H5PLpkg_H
+
+/* Include private header file */
+#include "H5PLprivate.h" /* Filter functions */
+
+/* Other private headers needed by this file */
+
+/**************************/
+/* Package Private Macros */
+/**************************/
+
+#define H5PL_MAX_PATH_NUM 16
+
+
+/****************************/
+/* Package Private Typedefs */
+/****************************/
+
+
+/*****************************/
+/* Package Private Variables */
+/*****************************/
+
+
+/******************************/
+/* Package Private Prototypes */
+/******************************/
+
+#endif /* _H5PLpkg_H */
+
diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h
index 5b80a5c..fc638a0 100644
--- a/src/H5PLpublic.h
+++ b/src/H5PLpublic.h
@@ -42,6 +42,13 @@ extern "C" {
/* plugin state */
H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type);
H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/);
+H5_DLL herr_t H5PLappend(const char* plugin_path);
+H5_DLL herr_t H5PLprepend(const char* plugin_path);
+H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index);
+H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index);
+H5_DLL herr_t H5PLremove(unsigned int index);
+H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size);
+H5_DLL unsigned int H5PLsize(void);
#ifdef __cplusplus
}
diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake
index 017efba..94b099c 100644
--- a/test/CMakeTests.cmake
+++ b/test/CMakeTests.cmake
@@ -761,7 +761,7 @@ if (NOT CYGWIN)
endif ()
set_tests_properties (H5TEST-cache PROPERTIES
DEPENDS H5TEST-clear-cache-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}"
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 1800)
@@ -779,7 +779,7 @@ add_test (
add_test (NAME H5TEST-cache_image COMMAND $<TARGET_FILE:cache_image>)
set_tests_properties (H5TEST-cache_image PROPERTIES
DEPENDS H5TEST-clear-cache_image-objects
- ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST"
+ ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3"
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
)
diff --git a/test/fheap.c b/test/fheap.c
index 0d41db9..11ee760 100644
--- a/test/fheap.c
+++ b/test/fheap.c
@@ -79,6 +79,10 @@
#define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) /* Size of a direct block in a given row */
#define DBLOCK_FREE(fh, r) H5HF_get_dblock_free_test(fh, r) /* Free space in a direct block of a given row */
+/* The number of settings for testing: page buffering, file space strategy and persisting free-space */
+#define NUM_PB_FS 6
+#define PAGE_BUFFER_PAGE_SIZE 4096
+
const char *FILENAME[] = {
"fheap",
NULL
@@ -547,7 +551,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc,
del_str = get_del_string(tparam);
HDassert(del_str);
test_desc = (char *)H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc));
- sprintf(test_desc, base_desc, del_str);
+ HDsprintf(test_desc, base_desc, del_str);
TESTING(test_desc);
H5MM_xfree(del_str);
H5MM_xfree(test_desc);
@@ -7677,10 +7681,10 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_
TESTING("incremental object insertion and removal")
for(i = 0; i < 100; i++) {
- sprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
+ HDsprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i);
for(j = 0; j < i; j++) {
- sprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
+ HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j);
if(H5HF_remove(fh, dxpl, heap_id[j]) < 0)
FAIL_STACK_ERROR
@@ -16365,21 +16369,31 @@ main(void)
fheap_test_param_t tparam; /* Testing parameters */
H5HF_create_t small_cparam; /* Creation parameters for "small" heap */
H5HF_create_t large_cparam; /* Creation parameters for "large" heap */
- hid_t fapl = -1; /* File access property list for data files */
- hid_t fcpl = -1; /* File creation property list for data files */
- hid_t fcpl2 = -1; /* File creation property list for data files */
+ hid_t fapl = -1, def_fapl = -1; /* File access property list for data files */
+ hid_t pb_fapl = -1; /* File access property list for data files */
+ hid_t fcpl = -1, def_fcpl = -1; /* File creation property list for data files */
fheap_test_type_t curr_test; /* Current test being worked on */
- unsigned u; /* Local index variable */
+ unsigned u, v; /* Local index variable */
unsigned nerrors = 0; /* Cumulative error count */
- int ExpressMode; /* Express testing level */
+ unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */
+ int ExpressMode; /* Express testing level */
/* Reset library */
h5_reset();
- fapl = h5_fileaccess();
+ def_fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
+
+ /*
+ * Caution when turning on ExpressMode 0:
+ * It will activate testing with different combinations of
+ * page buffering and file space strategy and the
+ * running time will be long.
+ */
if(ExpressMode > 1)
- printf("***Express test mode on. Some tests may be skipped\n");
+ HDprintf("***Express test mode on. Some tests may be skipped\n");
+ else if(ExpressMode == 0)
+ num_pb_fs = NUM_PB_FS;
/* Initialize heap creation parameters */
init_small_cparam(&small_cparam);
@@ -16390,359 +16404,409 @@ main(void)
shared_wobj_g = (unsigned char *)H5MM_malloc(shared_obj_size_g);
shared_robj_g = (unsigned char *)H5MM_malloc(shared_obj_size_g);
- /* create a file creation property list */
- if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ /* Create a copy def_fapl and enable page buffering */
+ if((pb_fapl = H5Pcopy(def_fapl)) < 0)
+ TEST_ERROR
+ if(H5Pset_page_buffer_size(pb_fapl, PAGE_BUFFER_PAGE_SIZE, 0, 0) < 0)
TEST_ERROR
- if((fcpl2 = H5Pcopy(fcpl)) < 0) TEST_ERROR
- /* Set file space strategy and persisting free-space */
- /* This will be modified later on to run the test with different file space strategy setting */
- if(H5Pset_file_space_strategy(fcpl2, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1) < 0)
+ /* Create a file creation property list */
+ if((def_fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
TEST_ERROR
/* Initialize the shared write buffer for objects */
for(u = 0; u < shared_obj_size_g; u++)
shared_wobj_g[u] = (unsigned char)u;
- /* Iterate over the testing parameters */
- for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) {
- /* Clear the testing parameters */
- HDmemset(&tparam, 0, sizeof(fheap_test_param_t));
- tparam.actual_id_len = HEAP_ID_LEN;
+ for(v = 0; v < num_pb_fs; v++) {
- /* This will be modified later on to run the test with different file space strategy setting */
- tparam.my_fcpl = fcpl2;
+ if((fcpl = H5Pcopy(def_fcpl)) < 0)
+ TEST_ERROR
- /* Set appropriate testing parameters for each test */
- switch(curr_test) {
- /* "Normal" testing parameters */
- case FHEAP_TEST_NORMAL:
- puts("Testing with normal parameters");
+ switch(v) {
+ case 0:
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1) < 0)
+ TEST_ERROR
+ fapl = def_fapl;
break;
-
- /* "Re-open heap" testing parameters */
- case FHEAP_TEST_REOPEN:
- puts("Testing with reopen heap flag set");
- tparam.reopen_heap = FHEAP_TEST_REOPEN;
+ case 1:
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
+ TEST_ERROR
+ fapl = def_fapl;
+ break;
+ case 2:
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0)
+ TEST_ERROR
+ fapl = def_fapl;
+ break;
+ case 3:
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0)
+ TEST_ERROR
+ fapl = def_fapl;
+ break;
+ case 4:
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0)
+ TEST_ERROR
+ fapl = pb_fapl;
+ break;
+ case 5:
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0)
+ TEST_ERROR
+ fapl = pb_fapl;
break;
- /* An unknown test? */
- case FHEAP_TEST_NTESTS:
+ case NUM_PB_FS:
default:
goto error;
- } /* end switch */
-
- /* Test fractal heap creation */
- nerrors += test_create(fapl, &small_cparam, &tparam);
- nerrors += test_reopen(fapl, &small_cparam, &tparam);
- nerrors += test_open_twice(fapl, &small_cparam, &tparam);
- nerrors += test_delete_open(fapl, &small_cparam, &tparam);
+ }
- nerrors += test_id_limits(fapl, &small_cparam, tparam.my_fcpl);
- nerrors += test_filtered_create(fapl, &small_cparam, tparam.my_fcpl);
- nerrors += test_size(fapl, &small_cparam, tparam.my_fcpl);
- nerrors += test_reopen_hdr(fapl, &small_cparam, tparam.my_fcpl);
+ /* Iterate over the testing parameters */
+ for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) {
+ /* Clear the testing parameters */
+ HDmemset(&tparam, 0, sizeof(fheap_test_param_t));
+ tparam.actual_id_len = HEAP_ID_LEN;
- {
- fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */
-
- /* Filling with different sized objects */
- for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) {
- tparam.fill = fill;
+ /* Set to run with different file space setting */
+ tparam.my_fcpl = fcpl;
/* Set appropriate testing parameters for each test */
- switch(fill) {
- /* "Bulk fill" heap blocks with 'large' objects */
- case FHEAP_TEST_FILL_LARGE:
- puts("Bulk-filling blocks w/large objects");
+ switch(curr_test) {
+ /* "Normal" testing parameters */
+ case FHEAP_TEST_NORMAL:
+ HDputs("Testing with normal parameters");
break;
- /* "Bulk fill" heap blocks with 'single' objects */
- case FHEAP_TEST_FILL_SINGLE:
- puts("Bulk-filling blocks w/single object");
+ /* "Re-open heap" testing parameters */
+ case FHEAP_TEST_REOPEN:
+ HDputs("Testing with reopen heap flag set");
+ tparam.reopen_heap = FHEAP_TEST_REOPEN;
break;
/* An unknown test? */
- case FHEAP_TEST_FILL_N:
+ case FHEAP_TEST_NTESTS:
default:
goto error;
} /* end switch */
- /*
- * Test fractal heap managed object insertion
- */
+ /* Test fractal heap creation */
+ nerrors += test_create(fapl, &small_cparam, &tparam);
+ nerrors += test_reopen(fapl, &small_cparam, &tparam);
+ nerrors += test_open_twice(fapl, &small_cparam, &tparam);
+ nerrors += test_delete_open(fapl, &small_cparam, &tparam);
- /* "Weird" sized objects */
- nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam);
+ nerrors += test_id_limits(fapl, &small_cparam, tparam.my_fcpl);
+ nerrors += test_filtered_create(fapl, &small_cparam, tparam.my_fcpl);
+ nerrors += test_size(fapl, &small_cparam, tparam.my_fcpl);
+ nerrors += test_reopen_hdr(fapl, &small_cparam, tparam.my_fcpl);
-#ifdef ALL_INSERT_TESTS
- /* "Standard" sized objects, building from simple to complex heaps */
- nerrors += test_man_insert_first(fapl, &small_cparam, &tparam);
- nerrors += test_man_insert_second(fapl, &small_cparam, &tparam);
- nerrors += test_man_insert_root_mult(fapl, &small_cparam, &tparam);
- nerrors += test_man_insert_force_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_insert_fill_second(fapl, &small_cparam, &tparam);
- nerrors += test_man_insert_third_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_first_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_start_second_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_second_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_start_third_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_fourth_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_all_root_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_first_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_second_direct_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_first_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_second_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_second_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_recursive_indirect_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_start_2nd_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_recursive_indirect_two_deep(fapl, &small_cparam, &tparam);
- nerrors += test_man_start_3rd_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_first_3rd_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_3rd_recursive_indirect_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_all_3rd_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_start_4th_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_first_4th_recursive_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_4th_recursive_indirect_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_all_4th_recursive_indirect(fapl, &small_cparam, &tparam);
-#endif /* ALL_INSERT_TESTS */
- /* If this test fails, uncomment the tests above, which build up to this
- * level of complexity gradually. -QAK
- */
- if(ExpressMode > 1)
- printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n");
- else
- nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam);
+ {
+ fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */
- /*
- * Test fractal heap object deletion
- */
- /* Simple removal */
- nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_one(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_two(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam);
- tparam.del_dir = FHEAP_DEL_FORWARD;
- nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam);
- tparam.del_dir = FHEAP_DEL_REVERSE;
- nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam);
- tparam.del_dir = FHEAP_DEL_FORWARD;
- nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam);
- tparam.del_dir = FHEAP_DEL_REVERSE;
- nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam);
-
- /* Incremental insert & removal */
- tparam.del_dir = FHEAP_DEL_FORWARD;
- nerrors += test_man_incr_insert_remove(fapl, &small_cparam, &tparam);
+ /* Filling with different sized objects */
+ for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) {
+ tparam.fill = fill;
- {
- fheap_test_del_dir_t del_dir; /* Deletion direction */
- fheap_test_del_drain_t drain_half; /* Deletion draining */
+ /* Set appropriate testing parameters for each test */
+ switch(fill) {
+ /* "Bulk fill" heap blocks with 'large' objects */
+ case FHEAP_TEST_FILL_LARGE:
+ HDputs("Bulk-filling blocks w/large objects");
+ break;
- /* More complex removal patterns */
- for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
- tparam.del_dir = del_dir;
- for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) {
- tparam.drain_half = drain_half;
- /* Don't need to test deletion directions when deleting entire heap */
- if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL)
+ /* "Bulk fill" heap blocks with 'single' objects */
+ case FHEAP_TEST_FILL_SINGLE:
+ HDputs("Bulk-filling blocks w/single object");
break;
- /* Simple insertion patterns */
- nerrors += test_man_remove_root_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_two_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_first_row(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_first_two_rows(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_first_four_rows(fapl, &small_cparam, &tparam);
- if(ExpressMode > 1)
- printf("***Express test mode on. Some tests skipped\n");
- else {
- nerrors += test_man_remove_all_root_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam);
- nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam);
- } /* end else */
-
- /* Skip blocks insertion */
- /* (covers insertion & deletion of skipped blocks) */
- nerrors += test_man_skip_start_block(fapl, &small_cparam, &tparam);
- nerrors += test_man_skip_start_block_add_back(fapl, &small_cparam, &tparam);
- nerrors += test_man_skip_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_skip_2nd_block(fapl, &small_cparam, &tparam);
- nerrors += test_man_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_one_partial_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_row_skip_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_skip_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_direct_skip_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_2nd_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
- if(ExpressMode > 1)
- printf("***Express test mode on. Some tests skipped\n");
- else {
- nerrors += test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
- nerrors += test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
- } /* end else */
-
- /* Fragmented insertion patterns */
- /* (covers insertion & deletion of fragmented blocks) */
- nerrors += test_man_frag_simple(fapl, &small_cparam, &tparam);
- nerrors += test_man_frag_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_frag_2nd_direct(fapl, &small_cparam, &tparam);
- nerrors += test_man_frag_3rd_direct(fapl, &small_cparam, &tparam);
+ /* An unknown test? */
+ case FHEAP_TEST_FILL_N:
+ default:
+ goto error;
+ } /* end switch */
+
+ /*
+ * Test fractal heap managed object insertion
+ */
+
+ /* "Weird" sized objects */
+ nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam);
+
+#ifdef ALL_INSERT_TESTS
+ /* "Standard" sized objects, building from simple to complex heaps */
+ nerrors += test_man_insert_first(fapl, &small_cparam, &tparam);
+ nerrors += test_man_insert_second(fapl, &small_cparam, &tparam);
+ nerrors += test_man_insert_root_mult(fapl, &small_cparam, &tparam);
+ nerrors += test_man_insert_force_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_insert_fill_second(fapl, &small_cparam, &tparam);
+ nerrors += test_man_insert_third_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_first_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_start_second_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_second_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_start_third_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_fourth_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_all_root_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_first_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_second_direct_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_first_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_second_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_second_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_recursive_indirect_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_start_2nd_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_recursive_indirect_two_deep(fapl, &small_cparam, &tparam);
+ nerrors += test_man_start_3rd_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_first_3rd_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_3rd_recursive_indirect_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_all_3rd_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_start_4th_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_first_4th_recursive_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_4th_recursive_indirect_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_all_4th_recursive_indirect(fapl, &small_cparam, &tparam);
+#endif /* ALL_INSERT_TESTS */
+ /* If this test fails, uncomment the tests above, which build up to this
+ * level of complexity gradually. -QAK
+ */
+ if(ExpressMode > 1)
+ HDprintf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n");
+ else
+ nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam);
+
+ /*
+ * Test fractal heap object deletion
+ */
+ /* Simple removal */
+ nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_one(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_two(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam);
+ tparam.del_dir = FHEAP_DEL_FORWARD;
+ nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam);
+ tparam.del_dir = FHEAP_DEL_REVERSE;
+ nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam);
+ tparam.del_dir = FHEAP_DEL_FORWARD;
+ nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam);
+ tparam.del_dir = FHEAP_DEL_REVERSE;
+ nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam);
+
+ /* Incremental insert & removal */
+ tparam.del_dir = FHEAP_DEL_FORWARD;
+ nerrors += test_man_incr_insert_remove(fapl, &small_cparam, &tparam);
+
+ {
+ fheap_test_del_dir_t del_dir; /* Deletion direction */
+ fheap_test_del_drain_t drain_half; /* Deletion draining */
+
+ /* More complex removal patterns */
+ for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
+ tparam.del_dir = del_dir;
+ for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) {
+ tparam.drain_half = drain_half;
+ /* Don't need to test deletion directions when deleting entire heap */
+ if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL)
+ break;
+
+ /* Simple insertion patterns */
+ nerrors += test_man_remove_root_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_two_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_first_row(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_first_two_rows(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_first_four_rows(fapl, &small_cparam, &tparam);
+ if(ExpressMode > 1)
+ HDprintf("***Express test mode on. Some tests skipped\n");
+ else {
+ nerrors += test_man_remove_all_root_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam);
+ nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam);
+ } /* end else */
+
+ /* Skip blocks insertion */
+ /* (covers insertion & deletion of skipped blocks) */
+ nerrors += test_man_skip_start_block(fapl, &small_cparam, &tparam);
+ nerrors += test_man_skip_start_block_add_back(fapl, &small_cparam, &tparam);
+ nerrors += test_man_skip_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_skip_2nd_block(fapl, &small_cparam, &tparam);
+ nerrors += test_man_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_one_partial_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_row_skip_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_skip_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_direct_skip_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_2nd_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ if(ExpressMode > 1)
+ HDprintf("***Express test mode on. Some tests skipped\n");
+ else {
+ nerrors += test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ nerrors += test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam);
+ } /* end else */
+
+ /* Fragmented insertion patterns */
+ /* (covers insertion & deletion of fragmented blocks) */
+ nerrors += test_man_frag_simple(fapl, &small_cparam, &tparam);
+ nerrors += test_man_frag_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_frag_2nd_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_man_frag_3rd_direct(fapl, &small_cparam, &tparam);
+ } /* end for */
} /* end for */
- } /* end for */
- /* Reset deletion drain parameter */
- tparam.drain_half = FHEAP_DEL_DRAIN_ALL;
+ /* Reset deletion drain parameter */
+ tparam.drain_half = FHEAP_DEL_DRAIN_ALL;
- } /* end block */
+ } /* end block */
} /* end for */
- } /* end block */
+ } /* end block */
- /*
- * Test fractal heap 'huge' & 'tiny' object insertion & deletion
- */
- {
- fheap_test_del_dir_t del_dir; /* Deletion direction */
- unsigned id_len; /* Length of heap IDs */
-
- /* Test "normal" & "direct" storage of 'huge' & 'tiny' heap IDs */
- for(id_len = 0; id_len < 3; id_len++) {
- /* Set the ID length for this test */
- small_cparam.id_len = (uint16_t)id_len;
-
- /* Print information about each test */
- switch(id_len) {
- /* Use "normal" form for 'huge' object's heap IDs */
- case 0:
- puts("Using 'normal' heap ID format for 'huge' objects");
- break;
+ /*
+ * Test fractal heap 'huge' & 'tiny' object insertion & deletion
+ */
+ {
+ fheap_test_del_dir_t del_dir; /* Deletion direction */
+ unsigned id_len; /* Length of heap IDs */
+
+ /* Test "normal" & "direct" storage of 'huge' & 'tiny' heap IDs */
+ for(id_len = 0; id_len < 3; id_len++) {
+ /* Set the ID length for this test */
+ small_cparam.id_len = (uint16_t)id_len;
+
+ /* Print information about each test */
+ switch(id_len) {
+ /* Use "normal" form for 'huge' object's heap IDs */
+ case 0:
+ HDputs("Using 'normal' heap ID format for 'huge' objects");
+ break;
- /* Use "direct" form for 'huge' object's heap IDs */
- case 1:
- puts("Using 'direct' heap ID format for 'huge' objects");
+ /* Use "direct" form for 'huge' object's heap IDs */
+ case 1:
+ HDputs("Using 'direct' heap ID format for 'huge' objects");
- /* Adjust actual length of heap IDs for directly storing 'huge' object's file offset & length in heap ID */
- tparam.actual_id_len = 17; /* 1 + 8 (file address size) + 8 (file length size) */
- break;
+ /* Adjust actual length of heap IDs for directly storing 'huge' object's file offset & length in heap ID */
+ tparam.actual_id_len = 17; /* 1 + 8 (file address size) + 8 (file length size) */
+ break;
- /* Use "direct" storage for 'huge' objects and larger IDs for 'tiny' objects */
- case 2:
- small_cparam.id_len = 37;
- puts("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects");
- tparam.actual_id_len = 37;
- break;
+ /* Use "direct" storage for 'huge' objects and larger IDs for 'tiny' objects */
+ case 2:
+ small_cparam.id_len = 37;
+ HDputs("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects");
+ tparam.actual_id_len = 37;
+ break;
- /* An unknown test? */
- default:
- goto error;
- } /* end switch */
+ /* An unknown test? */
+ default:
+ goto error;
+ } /* end switch */
+
+ /* Try several different methods of deleting objects */
+ for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
+ tparam.del_dir = del_dir;
+
+ /* Test 'huge' object insert & delete */
+ nerrors += test_huge_insert_one(fapl, &small_cparam, &tparam);
+ nerrors += test_huge_insert_two(fapl, &small_cparam, &tparam);
+ nerrors += test_huge_insert_three(fapl, &small_cparam, &tparam);
+ nerrors += test_huge_insert_mix(fapl, &small_cparam, &tparam);
+ nerrors += test_filtered_huge(fapl, &small_cparam, &tparam);
+
+ /* Test 'tiny' object insert & delete */
+ nerrors += test_tiny_insert_one(fapl, &small_cparam, &tparam);
+ nerrors += test_tiny_insert_two(fapl, &small_cparam, &tparam);
+ nerrors += test_tiny_insert_mix(fapl, &small_cparam, &tparam);
+ } /* end for */
+ } /* end for */
+
+ /* Reset the "normal" heap ID lengths */
+ small_cparam.id_len = 0;
+ tparam.actual_id_len = HEAP_ID_LEN;
+ } /* end block */
+
+ /* Test I/O filter support */
/* Try several different methods of deleting objects */
+ {
+ fheap_test_del_dir_t del_dir; /* Deletion direction */
+
for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
tparam.del_dir = del_dir;
- /* Test 'huge' object insert & delete */
- nerrors += test_huge_insert_one(fapl, &small_cparam, &tparam);
- nerrors += test_huge_insert_two(fapl, &small_cparam, &tparam);
- nerrors += test_huge_insert_three(fapl, &small_cparam, &tparam);
- nerrors += test_huge_insert_mix(fapl, &small_cparam, &tparam);
- nerrors += test_filtered_huge(fapl, &small_cparam, &tparam);
-
- /* Test 'tiny' object insert & delete */
- nerrors += test_tiny_insert_one(fapl, &small_cparam, &tparam);
- nerrors += test_tiny_insert_two(fapl, &small_cparam, &tparam);
- nerrors += test_tiny_insert_mix(fapl, &small_cparam, &tparam);
+ /* Controlled tests */
+ /* XXX: Re-enable file size checks in these tests, after the file has persistent free space tracking working */
+ nerrors += test_filtered_man_root_direct(fapl, &small_cparam, &tparam);
+ nerrors += test_filtered_man_root_indirect(fapl, &small_cparam, &tparam);
+
+ /* Random tests, with compressed blocks */
+ tparam.comp = FHEAP_TEST_COMPRESS;
+ nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(25*1000*1000)), fapl, &small_cparam, &tparam);
+ nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(2*1000*1000)), fapl, &small_cparam, &tparam);
+
+ /* Reset block compression */
+ tparam.comp = FHEAP_TEST_NO_COMPRESS;
} /* end for */
- } /* end for */
+ } /* end block */
+
+ /* Random object insertion & deletion */
+ if(ExpressMode > 1)
+ HDprintf("***Express test mode on. Some tests skipped\n");
+ else {
+ /* Random tests using "small" heap creation parameters */
+ HDputs("Using 'small' heap creation parameters");
+
+ /* (reduce size of tests when re-opening each time) */
+ /* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */
+ tparam.del_dir = FHEAP_DEL_FORWARD;
+ nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam);
+ nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam);
+
+ tparam.del_dir = FHEAP_DEL_HEAP;
+ nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam);
+ nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam);
- /* Reset the "normal" heap ID lengths */
- small_cparam.id_len = 0;
- tparam.actual_id_len = HEAP_ID_LEN;
- } /* end block */
+ /* Random tests using "large" heap creation parameters */
+ HDputs("Using 'large' heap creation parameters");
+ tparam.actual_id_len = LARGE_HEAP_ID_LEN;
- /* Test I/O filter support */
+ /* (reduce size of tests when re-opening each time) */
+ /* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */
+ tparam.del_dir = FHEAP_DEL_FORWARD;
+ nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam);
+ nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam);
- /* Try several different methods of deleting objects */
- {
- fheap_test_del_dir_t del_dir; /* Deletion direction */
+ tparam.del_dir = FHEAP_DEL_HEAP;
+ nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam);
+ nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam);
- for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) {
- tparam.del_dir = del_dir;
+ /* Reset the "normal" heap ID length */
+ tparam.actual_id_len = SMALL_HEAP_ID_LEN;
+ } /* end else */
- /* Controlled tests */
-/* XXX: Re-enable file size checks in these tests, after the file has persistent free space tracking working */
- nerrors += test_filtered_man_root_direct(fapl, &small_cparam, &tparam);
- nerrors += test_filtered_man_root_indirect(fapl, &small_cparam, &tparam);
+ /* Test object writing support */
- /* Random tests, with compressed blocks */
+ /* Basic object writing */
+ nerrors += test_write(fapl, &small_cparam, &tparam);
+
+ /* Writing objects in heap with filters */
tparam.comp = FHEAP_TEST_COMPRESS;
- nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(25*1000*1000)), fapl, &small_cparam, &tparam);
- nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(2*1000*1000)), fapl, &small_cparam, &tparam);
+ nerrors += test_write(fapl, &small_cparam, &tparam);
/* Reset block compression */
tparam.comp = FHEAP_TEST_NO_COMPRESS;
} /* end for */
- } /* end block */
-
- /* Random object insertion & deletion */
- if(ExpressMode > 1)
- printf("***Express test mode on. Some tests skipped\n");
- else {
- /* Random tests using "small" heap creation parameters */
- puts("Using 'small' heap creation parameters");
-
- /* (reduce size of tests when re-opening each time) */
-/* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */
- tparam.del_dir = FHEAP_DEL_FORWARD;
- nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam);
- nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam);
-
- tparam.del_dir = FHEAP_DEL_HEAP;
- nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam);
- nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam);
-
- /* Random tests using "large" heap creation parameters */
- puts("Using 'large' heap creation parameters");
- tparam.actual_id_len = LARGE_HEAP_ID_LEN;
-
- /* (reduce size of tests when re-opening each time) */
-/* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */
- tparam.del_dir = FHEAP_DEL_FORWARD;
- nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam);
- nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam);
-
- tparam.del_dir = FHEAP_DEL_HEAP;
- nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam);
- nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam);
-
- /* Reset the "normal" heap ID length */
- tparam.actual_id_len = SMALL_HEAP_ID_LEN;
- } /* end else */
-
- /* Test object writing support */
- /* Basic object writing */
- nerrors += test_write(fapl, &small_cparam, &tparam);
-
- /* Writing objects in heap with filters */
- tparam.comp = FHEAP_TEST_COMPRESS;
- nerrors += test_write(fapl, &small_cparam, &tparam);
+ if(H5Pclose(fcpl) < 0)
+ TEST_ERROR
+ } /* end num_pb_fs */
- /* Reset block compression */
- tparam.comp = FHEAP_TEST_NO_COMPRESS;
- } /* end for */
+ /* Tests that address specific bugs */
+ tparam.my_fcpl = def_fcpl;
+ fapl = def_fapl;
/* Tests that address specific bugs */
nerrors += test_bug1(fapl, &small_cparam, &tparam);
@@ -16752,7 +16816,7 @@ main(void)
if(nerrors)
goto error;
- puts("All fractal heap tests passed.");
+ HDputs("All fractal heap tests passed.");
/* Release space for the shared objects */
H5MM_xfree(shared_wobj_g);
@@ -16761,12 +16825,12 @@ main(void)
H5MM_xfree(shared_lens_g);
H5MM_xfree(shared_offs_g);
- if(H5Pclose(fcpl) < 0) TEST_ERROR
- if(H5Pclose(fcpl2) < 0) TEST_ERROR
+ if(H5Pclose(def_fcpl) < 0) TEST_ERROR
+ if(H5Pclose(pb_fapl) < 0) TEST_ERROR
/* Clean up file used */
#ifndef QAK
- h5_cleanup(FILENAME, fapl);
+ h5_cleanup(FILENAME, def_fapl);
#else /* QAK */
HDfprintf(stderr, "Uncomment cleanup!\n");
#endif /* QAK */
@@ -16774,14 +16838,17 @@ HDfprintf(stderr, "Uncomment cleanup!\n");
return 0;
error:
- puts("*** TESTS FAILED ***");
+ HDputs("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5MM_xfree(shared_wobj_g);
H5MM_xfree(shared_robj_g);
H5MM_xfree(shared_ids_g);
H5MM_xfree(shared_lens_g);
H5MM_xfree(shared_offs_g);
- H5Pclose(fapl);
+ H5Pclose(def_fapl);
+ H5Pclose(pb_fapl);
+ H5Pclose(def_fcpl);
+ H5Pclose(fcpl);
} H5E_END_TRY;
return 1;
} /* end main() */
diff --git a/test/plugin.c b/test/plugin.c
index b28c225..ea22c68 100644
--- a/test/plugin.c
+++ b/test/plugin.c
@@ -10,24 +10,26 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
- * 13 February 2013
+ * Programmer: Raymond Lu
+ * 13 February 2013
*
- * Purpose: Tests the plugin module (H5PL)
+ * Purpose: Tests the plugin module (H5PL)
*/
#include "h5test.h"
#include "H5srcdir.h"
/*
- * This file needs to access private datatypes from the H5Z package.
+ * This file needs to access private datatypes from the H5Z and H5PL package.
*/
+#define H5PL_FRIEND
+#include "H5PLpkg.h"
#define H5Z_FRIEND
#include "H5Zpkg.h"
/* Filters for HDF5 internal test */
#define H5Z_FILTER_DYNLIB1 257
-#define H5Z_FILTER_DYNLIB2 258
+#define H5Z_FILTER_DYNLIB2 258
#define H5Z_FILTER_DYNLIB3 259
#define H5Z_FILTER_DYNLIB4 260
@@ -38,10 +40,10 @@ const char *FILENAME[] = {
#define FILENAME_BUF_SIZE 1024
/* Dataset names for testing filters */
-#define DSET_DEFLATE_NAME "deflate"
-#define DSET_DYNLIB1_NAME "dynlib1"
-#define DSET_DYNLIB2_NAME "dynlib2"
-#define DSET_DYNLIB4_NAME "dynlib4"
+#define DSET_DEFLATE_NAME "deflate"
+#define DSET_DYNLIB1_NAME "dynlib1"
+#define DSET_DYNLIB2_NAME "dynlib2"
+#define DSET_DYNLIB4_NAME "dynlib4"
/* Parameters for internal filter test */
#define FILTER_CHUNK_DIM1 2
@@ -60,65 +62,61 @@ const char *FILENAME[] = {
#define GROUP_ITERATION 1000
-int points_deflate[DSET_DIM1][DSET_DIM2],
- points_dynlib1[DSET_DIM1][DSET_DIM2],
- points_dynlib2[DSET_DIM1][DSET_DIM2],
- points_dynlib4[DSET_DIM1][DSET_DIM2],
- points_bzip2[DSET_DIM1][DSET_DIM2];
+int points_deflate[DSET_DIM1][DSET_DIM2],
+ points_dynlib1[DSET_DIM1][DSET_DIM2],
+ points_dynlib2[DSET_DIM1][DSET_DIM2],
+ points_dynlib4[DSET_DIM1][DSET_DIM2],
+ points_bzip2[DSET_DIM1][DSET_DIM2];
/*-------------------------------------------------------------------------
- * Function: test_filter_internal
+ * Function: test_filter_internal
*
- * Purpose: Tests writing entire data and partial data with filters
- *
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * 27 February 2013
+ * Purpose: Tests writing entire data and partial data with filters
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
{
- hid_t dataset; /* Dataset ID */
- hid_t dxpl; /* Dataset xfer property list ID */
- hid_t write_dxpl; /* Dataset xfer property list ID for writing */
- hid_t sid; /* Dataspace ID */
- const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
- const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
- const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */
- void *tconv_buf = NULL; /* Temporary conversion buffer */
- int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2];
- size_t i, j; /* Local index variables */
- int n = 0;
+ herr_t ret_value = -1;
+ hid_t dataset = -1; /* Dataset ID */
+ hid_t dxpl = -1; /* Dataset xfer property list ID */
+ hid_t write_dxpl = -1; /* Dataset xfer property list ID for writing */
+ hid_t sid = -1; /* Dataspace ID */
+ const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
+ const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
+ const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */
+ void *tconv_buf = NULL; /* Temporary conversion buffer */
+ int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2];
+ size_t i, j; /* Local index variables */
+ int n = 0;
/* Create the data space */
- if((sid = H5Screate_simple(2, size, NULL)) < 0) goto error;
+ if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR
/*
* Create a small conversion buffer to test strip mining. We
* might as well test all we can!
*/
- if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) goto error;
+ if((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0) TEST_ERROR
tconv_buf = HDmalloc((size_t)1000);
- if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) goto error;
+ if(H5Pset_buffer(dxpl, (size_t)1000, tconv_buf, NULL) < 0) TEST_ERROR
if((write_dxpl = H5Pcopy(dxpl)) < 0) TEST_ERROR;
TESTING(" filters (setup)");
/* Check if all the filters are available */
- if(H5Pall_filters_avail(dcpl)!=TRUE) {
+ if(H5Pall_filters_avail(dcpl) != TRUE) {
H5_FAILED();
- printf(" Line %d: Incorrect filter availability\n",__LINE__);
- goto error;
+ HDprintf(" Line %d: Incorrect filter availability\n", __LINE__);
+ TEST_ERROR
} /* end if */
/* Create the dataset */
- if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT,
- dcpl, H5P_DEFAULT)) < 0) goto error;
+ if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR
PASSED();
@@ -128,20 +126,16 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
*/
TESTING(" filters (uninitialized read)");
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
-
- for(i=0; i<(size_t)size[0]; i++) {
- for(j=0; j<(size_t)size[1]; j++) {
- if(0!=check[i][j]) {
- H5_FAILED();
- printf(" Read a non-zero value.\n");
- printf(" At index %lu,%lu\n",
- (unsigned long)i, (unsigned long)j);
- goto error;
- }
- }
- }
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
+
+ for(i=0; i<(size_t)size[0]; i++)
+ for(j=0; j<(size_t)size[1]; j++)
+ if(0 != check[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read a non-zero value.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ TEST_ERROR
+ } /* end if */
PASSED();
/*----------------------------------------------------------------------
@@ -152,14 +146,11 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
TESTING(" filters (write)");
n = 0;
- for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- points[i][j] = (int)(n++);
- }
- }
+ for(i=0; i<size[0]; i++)
+ for(j=0; j<size[1]; j++)
+ points[i][j] = (int)(n++);
- if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
- TEST_ERROR;
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR;
PASSED();
@@ -170,22 +161,19 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
TESTING(" filters (read)");
/* Read the dataset back */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- fprintf(stderr," At original: %d\n", (int)points[i][j]);
- fprintf(stderr," At returned: %d\n", (int)check[i][j]);
- goto error;
- }
- }
- }
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ for(i=0; i<size[0]; i++)
+ for(j=0; j<size[1]; j++)
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDfprintf(stderr," At original: %d\n", (int)points[i][j]);
+ HDfprintf(stderr," At returned: %d\n", (int)check[i][j]);
+ TEST_ERROR
+ } /* end if */
PASSED();
@@ -198,30 +186,24 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
*/
TESTING(" filters (modify)");
- for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]/2; j++) {
- points[i][j] = (int)HDrandom () % RANDOM_LIMIT;
- }
- }
- if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0)
- TEST_ERROR;
-
- /* Read the dataset back and check it */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
- (unsigned long)i, (unsigned long)j);
- goto error;
- }
- }
- }
+ for(i=0; i<size[0]; i++)
+ for(j=0; j<size[1]/2; j++)
+ points[i][j] = (int)HDrandom () % RANDOM_LIMIT;
+
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, points) < 0) TEST_ERROR;
+
+ /* Read the dataset back and check it */
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ for(i=0; i<size[0]; i++)
+ for(j=0; j<size[1]; j++)
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ TEST_ERROR
+ } /* end if */
PASSED();
@@ -236,19 +218,17 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
if(H5Dclose(dataset) < 0) TEST_ERROR;
if((dataset = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) TEST_ERROR;
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0)
- TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR;
- /* Check that the values read are the same as the values written */
- for(i = 0; i < size[0]; i++)
- for(j = 0; j < size[1]; j++)
- if(points[i][j] != check[i][j]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %lu,%lu\n",
- (unsigned long)i, (unsigned long)j);
- goto error;
- } /* end if */
+ /* Check that the values read are the same as the values written */
+ for(i = 0; i < size[0]; i++)
+ for(j = 0; j < size[1]; j++)
+ if(points[i][j] != check[i][j]) {
+ H5_FAILED();
+ HDprintf(" Read different values than written.\n");
+ HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ TEST_ERROR
+ } /* end if */
PASSED();
@@ -260,249 +240,228 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl)
*/
TESTING(" filters (partial I/O)");
- for(i=0; i<(size_t)hs_size[0]; i++) {
- for(j=0; j<(size_t)hs_size[1]; j++) {
- points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom() % RANDOM_LIMIT;
- }
- }
- if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size,
- NULL) < 0) TEST_ERROR;
+ for(i=0; i<(size_t)hs_size[0]; i++)
+ for(j=0; j<(size_t)hs_size[1]; j++)
+ points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] = (int)HDrandom() % RANDOM_LIMIT;
+
+ if(H5Sselect_hyperslab(sid, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0) TEST_ERROR;
/* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */
- if(H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0)
- TEST_ERROR;
-
- if(H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0)
- TEST_ERROR;
-
- /* Check that the values read are the same as the values written */
- for(i=0; i<(size_t)hs_size[0]; i++) {
- for(j=0; j<(size_t)hs_size[1]; j++) {
- if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] !=
- check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
- H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n",
- (unsigned long)((size_t)hs_offset[0]+i),
- (unsigned long)((size_t)hs_offset[1]+j));
- fprintf(stderr," At original: %d\n",
- (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- fprintf(stderr," At returned: %d\n",
- (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
- goto error;
- }
- }
- }
+ if(H5Dwrite(dataset, H5T_NATIVE_INT, sid, sid, dxpl, points) < 0) TEST_ERROR;
+
+ if(H5Dread(dataset, H5T_NATIVE_INT, sid, sid, dxpl, check) < 0) TEST_ERROR;
+
+ /* Check that the values read are the same as the values written */
+ for(i=0; i<(size_t)hs_size[0]; i++)
+ for(j=0; j<(size_t)hs_size[1]; j++)
+ if(points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j] != check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]) {
+ H5_FAILED();
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)((size_t)hs_offset[0]+i), (unsigned long)((size_t)hs_offset[1]+j));
+ HDfprintf(stderr," At original: %d\n", (int)points[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
+ HDfprintf(stderr," At returned: %d\n", (int)check[(size_t)hs_offset[0]+i][(size_t)hs_offset[1]+j]);
+ TEST_ERROR
+ } /* end if */
PASSED();
- /* Save the data written to the file for later comparison when the file
+ /* Save the data written to the file for later comparison when the file
* is reopened for read test */
- for(i=0; i<size[0]; i++) {
- for(j=0; j<size[1]; j++) {
- if(!HDstrcmp(name, DSET_DEFLATE_NAME)) {
- points_deflate[i][j] = points[i][j];
- } else if(!HDstrcmp(name, DSET_DYNLIB1_NAME)) {
- points_dynlib1[i][j] = points[i][j];
- } else if(!HDstrcmp(name, DSET_DYNLIB2_NAME)) {
- points_dynlib2[i][j] = points[i][j];
- } else if(!HDstrcmp(name, DSET_DYNLIB4_NAME)) {
- points_dynlib4[i][j] = points[i][j];
- }
- }
- }
+ for(i=0; i<size[0]; i++)
+ for(j=0; j<size[1]; j++)
+ if(!HDstrcmp(name, DSET_DEFLATE_NAME))
+ points_deflate[i][j] = points[i][j];
+ else if(!HDstrcmp(name, DSET_DYNLIB1_NAME))
+ points_dynlib1[i][j] = points[i][j];
+ else if(!HDstrcmp(name, DSET_DYNLIB2_NAME))
+ points_dynlib2[i][j] = points[i][j];
+ else if(!HDstrcmp(name, DSET_DYNLIB4_NAME))
+ points_dynlib4[i][j] = points[i][j];
+
+ ret_value = 0;
+error:
/* Clean up objects used for this test */
- if(H5Dclose (dataset) < 0) goto error;
- if(H5Sclose (sid) < 0) goto error;
- if(H5Pclose (dxpl) < 0) goto error;
- free (tconv_buf);
-
- return(0);
+ H5E_BEGIN_TRY {
+ H5Dclose(dataset);
+ H5Sclose(sid);
+ H5Pclose(dxpl);
+ } H5E_END_TRY
-error:
if(tconv_buf)
- free (tconv_buf);
- return -1;
+ HDfree(tconv_buf);
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_filters_for_datasets
- *
- * Purpose: Tests creating datasets and writing data with dynamically
- * loaded filters
+ * Function: test_filters_for_datasets
*
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * 14 March 2013
+ * Purpose: Tests creating datasets and writing data with dynamically loaded filters
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_filters_for_datasets(hid_t file)
{
- hid_t dc; /* Dataset creation property list ID */
- const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
- unsigned int compress_level = 9;
- unsigned int dynlib4_values[4];
+ herr_t ret_value = -1;
+ hid_t dc = -1; /* Dataset creation property list ID */
+ const hsize_t chunk_size[2] = {FILTER_CHUNK_DIM1, FILTER_CHUNK_DIM2}; /* Chunk dimensions */
+ unsigned int compress_level = 9;
+ unsigned int dynlib4_values[4];
/*----------------------------------------------------------
* STEP 1: Test deflation by itself.
*----------------------------------------------------------
*/
+ HDputs("Testing deflate filter");
#ifdef H5_HAVE_FILTER_DEFLATE
- puts("Testing deflate filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if(H5Pset_deflate (dc, 6) < 0) goto error;
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
+ if(H5Pset_deflate(dc, 6) < 0) TEST_ERROR
- if(test_filter_internal(file,DSET_DEFLATE_NAME,dc) < 0) goto error;
+ if(test_filter_internal(file, DSET_DEFLATE_NAME, dc) < 0) TEST_ERROR
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
+ if(H5Pclose(dc) < 0) TEST_ERROR
#else /* H5_HAVE_FILTER_DEFLATE */
- TESTING("deflate filter");
SKIPPED();
- puts(" Deflate filter not enabled");
+ HDputs(" Deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
/*----------------------------------------------------------
* STEP 2: Test DYNLIB1 by itself.
*----------------------------------------------------------
*/
- puts("Testing DYNLIB1 filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) goto error;
+ HDputs(" DYNLIB1 filter");
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
+ if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB1, H5Z_FLAG_MANDATORY, (size_t)1, &compress_level) < 0) TEST_ERROR
- if(test_filter_internal(file,DSET_DYNLIB1_NAME,dc) < 0) goto error;
+ if(test_filter_internal(file, DSET_DYNLIB1_NAME, dc) < 0) TEST_ERROR
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
+ if(H5Pclose(dc) < 0) TEST_ERROR
- /* Unregister the dynamic filter DYNLIB1 for testing purpose. The next time when this test is run for
+ /* Unregister the dynamic filter DYNLIB1 for testing purpose. The next time when this test is run for
* the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
* for this filter. */
- if(H5Zunregister(H5Z_FILTER_DYNLIB1) < 0) goto error;
+ if(H5Zunregister(H5Z_FILTER_DYNLIB1) < 0) TEST_ERROR
/*----------------------------------------------------------
* STEP 3: Test DYNLIB2 by itself.
*----------------------------------------------------------
*/
- puts("Testing DYNLIB2 filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
- if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL) < 0) goto error;
+ HDputs(" DYNLIB2 filter");
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
+ if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB2, H5Z_FLAG_MANDATORY, 0, NULL) < 0) TEST_ERROR
- if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) goto error;
+ if(test_filter_internal(file,DSET_DYNLIB2_NAME,dc) < 0) TEST_ERROR
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
+ if(H5Pclose(dc) < 0) TEST_ERROR
- /* Unregister the dynamic filter DYNLIB2 for testing purpose. The next time when this test is run for
+ /* Unregister the dynamic filter DYNLIB2 for testing purpose. The next time when this test is run for
* the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
* for this filter. */
- if(H5Zunregister(H5Z_FILTER_DYNLIB2) < 0) goto error;
+ if(H5Zunregister(H5Z_FILTER_DYNLIB2) < 0) TEST_ERROR
/*----------------------------------------------------------
* STEP 4: Test DYNLIB4 by itself.
*----------------------------------------------------------
*/
- puts("Testing DYNLIB4 filter");
- if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error;
- if(H5Pset_chunk (dc, 2, chunk_size) < 0) goto error;
+ HDputs(" DYNLIB4 filter");
+ if((dc = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_chunk(dc, 2, chunk_size) < 0) TEST_ERROR
dynlib4_values[0] = 9;
- if(H5get_libversion(&dynlib4_values[1], &dynlib4_values[2], &dynlib4_values[3]) < 0) goto error;
- if(H5Pset_filter (dc, H5Z_FILTER_DYNLIB4, H5Z_FLAG_MANDATORY, (size_t)4, dynlib4_values) < 0) goto error;
+ if(H5get_libversion(&dynlib4_values[1], &dynlib4_values[2], &dynlib4_values[3]) < 0) TEST_ERROR
+ if(H5Pset_filter(dc, H5Z_FILTER_DYNLIB4, H5Z_FLAG_MANDATORY, (size_t)4, dynlib4_values) < 0) TEST_ERROR
- if(test_filter_internal(file,DSET_DYNLIB4_NAME,dc) < 0) goto error;
+ if(test_filter_internal(file, DSET_DYNLIB4_NAME, dc) < 0) TEST_ERROR
/* Clean up objects used for this test */
- if(H5Pclose (dc) < 0) goto error;
+ if(H5Pclose(dc) < 0) TEST_ERROR
/* Unregister the dynamic filter DYNLIB4 for testing purpose. The next time when this test is run for
* the new file format, the library's H5PL code has to search in the table of loaded plugin libraries
* for this filter. */
- if(H5Zunregister(H5Z_FILTER_DYNLIB4) < 0) goto error;
+ if(H5Zunregister(H5Z_FILTER_DYNLIB4) < 0) TEST_ERROR
- return 0;
+ ret_value = 0;
error:
- return -1;
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Pclose(dc);
+ } H5E_END_TRY
+
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_read_data
- *
- * Purpose: Tests reading data and compares values
- *
- * Return: Success: 0
- * Failure: -1
+ * Function: test_read_data
*
- * Programmer: Raymond Lu
- * 14 March 2013
+ * Purpose: Tests reading data and compares values
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_read_data(hid_t dataset, int *origin_data)
{
- int check[DSET_DIM1][DSET_DIM2];
- const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
- int *data_p = origin_data;
- size_t i, j; /* Local index variables */
+ herr_t ret_value = -1;
+ int check[DSET_DIM1][DSET_DIM2];
+ const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
+ int *data_p = origin_data;
+ size_t i, j; /* Local index variables */
/* Read the dataset back */
- if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0)
- TEST_ERROR;
+ if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, check) < 0) TEST_ERROR;
/* Check that the values read are the same as the values written */
- for(i=0; i<size[0]; i++) {
+ for(i=0; i<size[0]; i++)
for(j=0; j<size[1]; j++) {
- if(*data_p != check[i][j]) {
- H5_FAILED();
- fprintf(stderr," Read different values than written.\n");
- fprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
- fprintf(stderr," At original: %d\n", *data_p);
- fprintf(stderr," At returned: %d\n", (int)check[i][j]);
- goto error;
- }
+ if(*data_p != check[i][j]) {
+ H5_FAILED();
+ HDfprintf(stderr," Read different values than written.\n");
+ HDfprintf(stderr," At index %lu,%lu\n", (unsigned long)i, (unsigned long)j);
+ HDfprintf(stderr," At original: %d\n", *data_p);
+ HDfprintf(stderr," At returned: %d\n", (int)check[i][j]);
+ TEST_ERROR
+ } /* end if */
data_p++;
- }
- }
+ }
PASSED();
- return 0;
+ ret_value = 0;
error:
- return -1;
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_read_with_filters
+ * Function: test_read_with_filters
*
- * Purpose: Tests reading dataset created with dynamically loaded filters
- *
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * 14 March 2013
+ * Purpose: Tests reading dataset created with dynamically loaded filters
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_read_with_filters(hid_t file)
{
- hid_t dset; /* Dataset ID */
+ herr_t ret_value = -1;
+ hid_t dset = -1; /* Dataset ID */
/*----------------------------------------------------------
* STEP 1: Test deflation by itself.
*----------------------------------------------------------
*/
-#ifdef H5_HAVE_FILTER_DEFLATE
- TESTING("Testing deflate filter");
+ TESTING("deflate filter");
+#ifdef H5_HAVE_FILTER_DEFLATE
if(H5Zfilter_avail(H5Z_FILTER_DEFLATE) != TRUE) TEST_ERROR
if((dset = H5Dopen2(file,DSET_DEFLATE_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
@@ -513,18 +472,17 @@ test_read_with_filters(hid_t file)
/* Clean up objects used for this test */
#else /* H5_HAVE_FILTER_DEFLATE */
- TESTING("deflate filter");
SKIPPED();
- puts(" Deflate filter not enabled");
+ HDputs(" Deflate filter not enabled");
#endif /* H5_HAVE_FILTER_DEFLATE */
/*----------------------------------------------------------
* STEP 2: Test DYNLIB1 by itself.
*----------------------------------------------------------
*/
- TESTING("Testing DYNLIB1 filter");
+ TESTING(" DYNLIB1 filter");
- if((dset = H5Dopen2(file,DSET_DYNLIB1_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
if(test_read_data(dset, (int *)points_dynlib1) < 0) TEST_ERROR
@@ -534,9 +492,9 @@ test_read_with_filters(hid_t file)
* STEP 3: Test Bogus2 by itself.
*----------------------------------------------------------
*/
- TESTING("Testing DYNLIB2 filter");
+ TESTING(" DYNLIB2 filter");
- if((dset = H5Dopen2(file,DSET_DYNLIB2_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset = H5Dopen2(file, DSET_DYNLIB2_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
if(test_read_data(dset, (int *)points_dynlib2) < 0) TEST_ERROR
@@ -546,7 +504,7 @@ test_read_with_filters(hid_t file)
* STEP 4: Test DYNLIB4 by itself.
*----------------------------------------------------------
*/
- TESTING("Testing DYNLIB4 filter");
+ TESTING(" DYNLIB4 filter");
if((dset = H5Dopen2(file,DSET_DYNLIB4_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
@@ -554,27 +512,33 @@ test_read_with_filters(hid_t file)
if(H5Dclose(dset) < 0) TEST_ERROR
- return 0;
+ ret_value = 0;
error:
- return -1;
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ } H5E_END_TRY
+
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_noread_data
+ * Function: test_noread_data
*
- * Purpose: Tests not reading data
+ * Purpose: Tests not reading data
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
*-------------------------------------------------------------------------
*/
static herr_t
test_noread_data(hid_t dataset)
{
+ herr_t ret_value = -1;
int check[DSET_DIM1][DSET_DIM2];
- herr_t ret;
+ herr_t ret = -1;
/* Read the dataset back */
H5E_BEGIN_TRY {
@@ -584,113 +548,122 @@ test_noread_data(hid_t dataset)
TEST_ERROR
PASSED();
- return 0;
+ ret_value = 0;
error:
- return -1;
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_noread_with_filters
- *
- * Purpose: Tests reading dataset created with dynamically loaded filters disabled
+ * Function: test_noread_with_filters
*
- * Return: Success: 0
- * Failure: -1
+ * Purpose: Tests reading dataset created with dynamically loaded filters disabled
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_noread_with_filters(hid_t file)
{
- hid_t dset; /* Dataset ID */
- unsigned plugin_state; /* status of plugins */
- TESTING("Testing DYNLIB1 filter with plugins disabled");
+ herr_t ret_value = -1;
+ hid_t dset = -1; /* Dataset ID */
+ unsigned plugin_state; /* status of plugins */
+
+ TESTING("DYNLIB1 filter with plugins disabled");
/* disable filter plugin */
if(H5PLget_loading_state(&plugin_state) < 0) TEST_ERROR
plugin_state = plugin_state & ~H5PL_FILTER_PLUGIN;
if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR
- if((dset = H5Dopen2(file,DSET_DYNLIB1_NAME,H5P_DEFAULT)) < 0) TEST_ERROR
+ if((dset = H5Dopen2(file, DSET_DYNLIB1_NAME, H5P_DEFAULT)) < 0) TEST_ERROR
if(test_noread_data(dset) < 0) TEST_ERROR
if(H5Dclose(dset) < 0) TEST_ERROR
- /* re-enable filter plugin */
- plugin_state = plugin_state | H5PL_FILTER_PLUGIN;
- if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR
-
- return 0;
+ ret_value = 0;
error:
/* re-enable filter plugin */
plugin_state = plugin_state | H5PL_FILTER_PLUGIN;
- if(H5PLset_loading_state(plugin_state) < 0) TEST_ERROR
- return -1;
+ H5PLset_loading_state(plugin_state);
+
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Dclose(dset);
+ } H5E_END_TRY
+
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_filters_for_groups
- *
- * Purpose: Tests creating group with dynamically loaded filters
+ * Function: test_filters_for_groups
*
- * Return: Success: 0
- * Failure: -1
- *
- * Programmer: Raymond Lu
- * 1 April 2013
+ * Purpose: Tests creating group with dynamically loaded filters
*
+ * Return: Success: 0
+ * Failure: -1
*-------------------------------------------------------------------------
*/
static herr_t
test_filters_for_groups(hid_t file)
{
- hid_t gcpl, gid, group;
- int i;
- char gname[256];
+ herr_t ret_value = -1;
+ hid_t gcpl = -1;
+ hid_t gid = -1;
+ hid_t group = -1;
+ int i;
+ char gname[256];
+
+ TESTING("DYNLIB3 filter for group");
- TESTING("Testing DYNLIB3 filter for group");
+ if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR
- if((gcpl = H5Pcreate(H5P_GROUP_CREATE)) < 0) goto error;
-
- /* Use DYNLIB3 for creating groups */
- if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) goto error;
+ /* Use DYNLIB3 for creating groups */
+ if(H5Pset_filter (gcpl, H5Z_FILTER_DYNLIB3, H5Z_FLAG_MANDATORY, (size_t)0, NULL) < 0) TEST_ERROR
/* Create a group using this filter */
- if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) goto error;
+ if((gid = H5Gcreate2(file, "group1", H5P_DEFAULT, gcpl, H5P_DEFAULT)) < 0) TEST_ERROR
/* Create multiple groups under "group1" */
- for (i=0; i < GROUP_ITERATION; i++) {
- sprintf(gname, "group_%d", i);
- if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(group) < 0) goto error;
+ for(i=0; i < GROUP_ITERATION; i++) {
+ HDsprintf(gname, "group_%d", i);
+ if((group = H5Gcreate2(gid, gname, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group) < 0) TEST_ERROR
}
/* Close the group */
- if(H5Gclose(gid) < 0) goto error;
+ if(H5Gclose(gid) < 0) TEST_ERROR
/* Clean up objects used for this test */
- if(H5Pclose (gcpl) < 0) goto error;
+ if(H5Pclose(gcpl) < 0) TEST_ERROR
PASSED();
- return 0;
+ ret_value = 0;
error:
- return -1;
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Gclose(group);
+ H5Gclose(gid);
+ H5Pclose(gcpl);
+ } H5E_END_TRY
+
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: test_groups_with_filters
+ * Function: test_groups_with_filters
*
- * Purpose: Tests opening group with dynamically loaded filters
+ * Purpose: Tests opening group with dynamically loaded filters
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Raymond Lu
+ * Programmer: Raymond Lu
* 1 April 2013
*
*-------------------------------------------------------------------------
@@ -698,70 +671,316 @@ error:
static herr_t
test_groups_with_filters(hid_t file)
{
- hid_t gid, group;
+ herr_t ret_value = -1;
+ hid_t gid;
+ hid_t group;
int i;
char gname[256];
- TESTING("Testing opening groups with DYNLIB3 filter");
+ TESTING("opening groups with DYNLIB3 filter");
/* Open the top group */
- if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) goto error;
+ if((gid = H5Gopen2(file, "group1", H5P_DEFAULT)) < 0) TEST_ERROR
/* Create multiple groups under "group1" */
- for (i=0; i < GROUP_ITERATION; i++) {
- sprintf(gname, "group_%d", i);
- if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) goto error;
- if(H5Gclose(group) < 0) goto error;
+ for(i=0; i < GROUP_ITERATION; i++) {
+ HDsprintf(gname, "group_%d", i);
+ if((group = H5Gopen2(gid, gname, H5P_DEFAULT)) < 0) TEST_ERROR
+ if(H5Gclose(group) < 0) TEST_ERROR
}
/* Close the group */
- if(H5Gclose(gid) < 0) goto error;
+ if(H5Gclose(gid) < 0) TEST_ERROR
PASSED();
- return 0;
+ ret_value = 0;
+
+error:
+ /* Clean up objects used for this test */
+ H5E_BEGIN_TRY {
+ H5Gclose(group);
+ H5Gclose(gid);
+ } H5E_END_TRY
+
+ return ret_value;
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: test_filter_path_apis
+ *
+ * Purpose: Tests accessing the path table for dynamically loaded filters
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_filter_path_apis(void)
+{
+ herr_t ret_value = -1;
+ unsigned int i;
+ unsigned int ndx;
+ herr_t ret;
+ ssize_t pathlen = -1;
+ char pathname[256];
+ char tempname[256];
+
+ HDputs("Testing access to the filter path table");
+
+ if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR
+
+ ndx = H5PLsize();
+
+ TESTING(" remove");
+ /* Remove all existing paths*/
+ for(i=ndx; i > 0; i--)
+ if(H5PLremove(i-1) < 0) {
+ HDfprintf(stderr," at %d: %s\n", i, pathname);
+ TEST_ERROR
+ } /* end if */
+ /* Verify the table is empty */
+ if(H5PLsize() > 0) TEST_ERROR
+ PASSED();
+
+ TESTING(" remove (exceed min)");
+ /* Exceed the min path removal */
+ H5E_BEGIN_TRY {
+ ret = H5PLremove(0);
+ } H5E_END_TRY
+ if(ret >= 0) TEST_ERROR
+ PASSED();
+
+ TESTING(" append");
+ /* Create multiple paths to fill table */
+ for(i=0; i < H5PL_MAX_PATH_NUM; i++) {
+ HDsprintf(pathname, "a_path_%d", i);
+ if(H5PLappend(pathname) < 0) {
+ HDfprintf(stderr," at %d: %s\n", i, pathname);
+ TEST_ERROR
+ }
+ }
+ /* Verify the table is full */
+ if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+ PASSED();
+
+ TESTING(" append (exceed)");
+ /* Exceed the max path append */
+ H5E_BEGIN_TRY {
+ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM);
+ ret = H5PLappend(pathname);
+ } H5E_END_TRY
+ if(ret >= 0) TEST_ERROR
+ PASSED();
+
+ TESTING(" remove (exceed max)");
+ /* Exceed the max path removal */
+ H5E_BEGIN_TRY {
+ ret = H5PLremove(H5PL_MAX_PATH_NUM);
+ } H5E_END_TRY
+ if(ret >= 0) TEST_ERROR
+ PASSED();
+
+ TESTING(" get (path name)");
+ if((pathlen = H5PLget(0, NULL, 0)) <= 0) {
+ HDfprintf(stderr," get path 0 length failed\n");
+ TEST_ERROR
+ }
+ if(pathlen != 8) TEST_ERROR
+
+ if((pathlen = H5PLget(0, pathname, 256)) <= 0) {
+ HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname);
+ TEST_ERROR
+ }
+ if(HDstrcmp(pathname, "a_path_0") != 0) {
+ HDfprintf(stderr," get 0: %s\n", pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ TESTING(" get (bounds)");
+ if((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR
+ if(HDstrcmp(pathname, "a_path_1") != 0) {
+ HDfprintf(stderr," get 1: %s\n", pathname);
+ TEST_ERROR
+ }
+ if((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR
+ HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1);
+ if(HDstrcmp(pathname, tempname) != 0) {
+ HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ TESTING(" get (bounds exceed)");
+ H5E_BEGIN_TRY {
+ pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0);
+ } H5E_END_TRY
+ if(pathlen > 0) TEST_ERROR
+ PASSED();
+
+ TESTING(" remove (verify for prepend)");
+ /* Remove one path*/
+ if(H5PLremove(8) < 0) TEST_ERROR
+
+ /* Verify that the entries were moved */
+ if((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR
+ if(HDstrcmp(pathname, "a_path_9") != 0) {
+ HDfprintf(stderr," get 8: %s\n", pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ /* Verify the table is not full */
+ if (H5PLsize() != H5PL_MAX_PATH_NUM - 1) TEST_ERROR
+
+ TESTING(" prepend");
+ /* Prepend one path*/
+ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1);
+ if(H5PLprepend(pathname) < 0) {
+ HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname);
+ TEST_ERROR
+ }
+
+ /* Verify the table is full */
+ if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+
+ /* Verify that the entries were moved */
+ if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR
+ if(HDstrcmp(pathname, "a_path_7") != 0) {
+ HDfprintf(stderr," get 8: %s\n", pathname);
+ TEST_ERROR
+ }
+ if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR
+ HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1);
+ if(HDstrcmp(pathname, tempname) != 0) {
+ HDfprintf(stderr," get 0: %s\n", pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ TESTING(" prepend (exceed)");
+ /* Exceed the max path prepend */
+ H5E_BEGIN_TRY {
+ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2);
+ ret = H5PLprepend(pathname);
+ } H5E_END_TRY
+ if(ret >= 0) TEST_ERROR
+ PASSED();
+
+ TESTING(" replace");
+ /* Replace one path*/
+ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4);
+ if(H5PLreplace(pathname, 1) < 0) {
+ HDfprintf(stderr," replace 1: %s\n", pathname);
+ TEST_ERROR
+ }
+
+ /* Verify the table is full */
+ if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+
+ /* Verify that the entries were not moved */
+ if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR
+ HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1);
+ if(HDstrcmp(pathname, tempname) != 0) {
+ HDfprintf(stderr," get 0: %s\n", pathname);
+ TEST_ERROR
+ }
+ if(H5PLget(2, pathname, 256) <= 0) TEST_ERROR
+ if(HDstrcmp(pathname, "a_path_1") != 0) {
+ HDfprintf(stderr," get 2: %s\n", pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ TESTING(" remove (verify for insert)");
+ /* Remove one path*/
+ if(H5PLremove(4) < 0) TEST_ERROR
+
+ /* Verify that the entries were moved */
+ if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR
+ if(HDstrcmp(pathname, "a_path_4") != 0) {
+ HDfprintf(stderr," get 4: %s\n", pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ /* Verify the table is not full */
+ if(H5PLsize() != 15) TEST_ERROR
+
+ TESTING(" insert");
+ /* Insert one path*/
+ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5);
+ if(H5PLinsert(pathname, 3) < 0) {
+ HDfprintf(stderr," insert 3: %s\n", pathname);
+ TEST_ERROR
+ }
+
+ /* Verify that the entries were moved */
+ if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR
+ if(HDstrcmp(pathname, "a_path_2") != 0) {
+ HDfprintf(stderr," get 4: %s\n", pathname);
+ TEST_ERROR
+ }
+ PASSED();
+
+ /* Verify the table is full */
+ if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR
+
+ TESTING(" insert (exceed)");
+ /* Exceed the max path insert */
+ H5E_BEGIN_TRY {
+ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6);
+ ret = H5PLinsert(pathname, 12);
+ } H5E_END_TRY
+ if(ret >= 0) TEST_ERROR
+
+ PASSED();
+
+ ret_value = 0;
error:
- return -1;
+ return ret_value;
}
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Tests the plugin module (H5PL)
+ * Purpose: Tests the plugin module (H5PL)
*
- * Return: Success: exit(EXIT_SUCCESS)
+ * Return: Success: exit(EXIT_SUCCESS)
*
- * Failure: exit(EXIT_FAILURE)
+ * Failure: exit(EXIT_FAILURE)
*
- * Programmer: Raymond Lu
- * 14 March 2013
+ * Programmer: Raymond Lu
+ * 14 March 2013
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- char filename[FILENAME_BUF_SIZE];
- hid_t file, fapl, fapl2;
- unsigned new_format;
- int mdc_nelmts;
- size_t rdcc_nelmts;
- size_t rdcc_nbytes;
- double rdcc_w0;
- int nerrors = 0;
+ char filename[FILENAME_BUF_SIZE];
+ hid_t file = -1;
+ hid_t fapl = -1;
+ hid_t fapl2 = -1;
+ unsigned new_format;
+ int mdc_nelmts;
+ size_t rdcc_nelmts;
+ size_t rdcc_nbytes;
+ double rdcc_w0;
+ int nerrors = 0;
/* Testing setup */
h5_reset();
fapl = h5_fileaccess();
/* Turn off the chunk cache, so all the chunks are immediately written to disk */
- if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0)
- TEST_ERROR
+ if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) TEST_ERROR
rdcc_nbytes = 0;
- if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0)
- TEST_ERROR
+ if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR
/* Copy the file access property list */
if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR
@@ -777,50 +996,47 @@ main(void)
/* Set the FAPL for the type of format */
if(new_format) {
- puts("\nTesting with new file format:");
+ HDputs("\nTesting with new file format:");
my_fapl = fapl2;
} /* end if */
else {
- puts("Testing with old file format:");
+ HDputs("Testing with old file format:");
my_fapl = fapl;
} /* end else */
/* Create the file for this test */
- if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0)
- TEST_ERROR
+ if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR
/* Test dynamically loaded filters for chunked dataset */
- nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0);
+ nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0);
/* Test dynamically loaded filters for groups */
nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0);
- if(H5Fclose(file) < 0)
- TEST_ERROR
+ if(H5Fclose(file) < 0) TEST_ERROR
} /* end for */
/* Close FAPL */
if(H5Pclose(fapl2) < 0) TEST_ERROR
if(H5Pclose(fapl) < 0) TEST_ERROR
-
+
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
- puts("\nTesting reading data with with dynamic plugin filters:");
+ HDputs("\nTesting reading data with with dynamic plugin filters:");
/* Close the library so that all loaded plugin libraries are unloaded */
h5_reset();
fapl = h5_fileaccess();
/* Reopen the file for testing data reading */
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
- TEST_ERROR
+ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
/* Read the data with filters */
- nerrors += (test_read_with_filters(file) < 0 ? 1 : 0);
+ nerrors += (test_read_with_filters(file) < 0 ? 1 : 0);
/* Open the groups with filters */
- nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0);
+ nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0);
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();
@@ -830,26 +1046,26 @@ main(void)
fapl = h5_fileaccess();
/* Reopen the file for testing data reading */
- if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0)
- TEST_ERROR
+ if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR
/* Read the data with disabled filters */
nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0);
- if(H5Fclose(file) < 0)
- TEST_ERROR
+ if(H5Fclose(file) < 0) TEST_ERROR
+
+ /* Test the APIs for access to the filter plugin path table */
+ nerrors += (test_filter_path_apis() < 0 ? 1 : 0);
+
+ if(nerrors) TEST_ERROR
- if(nerrors)
- TEST_ERROR
- printf("All plugin tests passed.\n");
+ HDprintf("All plugin tests passed.\n");
h5_cleanup(FILENAME, fapl);
return 0;
error:
nerrors = MAX(1, nerrors);
- printf("***** %d PLUGIN TEST%s FAILED! *****\n",
- nerrors, 1 == nerrors ? "" : "S");
+ HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S");
return 1;
}
diff --git a/test/set_extent.c b/test/set_extent.c
index 8384a39..b9536e5 100644
--- a/test/set_extent.c
+++ b/test/set_extent.c
@@ -2601,13 +2601,6 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue,
volatile unsigned i, j, k, l, m; /* Local indices */
char filename[NAME_BUF_SIZE];
- /*!FIXME Skip the test if a fixed array index is requested, as resizing
- * fixed arrays is broken now. Extensible arrays are also broken. Remove
- * these lines as appropriate when these problems are fixed. */
- /* Fixed Array index type is now fixed */
- if(index_type == RANK4_INDEX_EARRAY)
- return 0;
-
/* create a new file */
h5_fixname(FILENAME[4], fapl, filename, sizeof filename);
if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
@@ -2812,12 +2805,6 @@ static int test_random_rank4_vl( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue,
volatile unsigned i, j, k, l, m; /* Local indices */
char filename[NAME_BUF_SIZE];
- /*!FIXME Skip the test if a fixed array index is requested, as resizing
- * fixed arrays is broken now. Extensible arrays are also broken. Remove
- * these lines as appropriate when these problems are fixed. */
- if(index_type == RANK4_INDEX_FARRAY || index_type == RANK4_INDEX_EARRAY)
- return 0;
-
/* Initialize fill value buffers so they aren't freed in case of an error */
fill_value.len = 0;
fill_value.p = NULL;