From 6a4d711b9907ff191065fd70048892a341479b88 Mon Sep 17 00:00:00 2001
From: Achim Gsell <achim.gsell@psi.ch>
Date: Mon, 19 Nov 2018 17:08:48 +0100
Subject: [PATCH] test: use independent IO in h5u_test_{read,write}3() for hdf5
 > 1.8.12

Since MPI-POSIX VFD has been removed from hdf5 > 1.8.12, but a test
with stride data should be performed, we use independent IO instead for
hdf5 > 1.8.12
---
 test/h5u_read.c  | 15 +++++++++++++--
 test/h5u_write.c | 16 +++++++++++++---
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/test/h5u_read.c b/test/h5u_read.c
index 62a1143c..aa4cd926 100644
--- a/test/h5u_read.c
+++ b/test/h5u_read.c
@@ -471,19 +471,31 @@ void h5u_test_read2(void)
 	RETURN(status, H5_SUCCESS, "H5CloseFile");
 }
 
-#if H5_VERSION_LE(1,8,12)
 void h5u_test_read3(void)
 {
 	h5_file_t file1;
 	h5_int64_t status;
 
+#if H5_VERSION_LE(1,8,12)
 	TEST("Opening file once, read-only, MPI-POSIX VFD");
+#else
+	TEST("Opening file once, read-only, MPI-IO Independent VFD");
+#endif
+
 	h5_prop_t props = H5CreateFileProp ();
+
 #if defined(H5_HAVE_PARALLEL)
         MPI_Comm comm = MPI_COMM_WORLD;
+
+#if H5_VERSION_LE(1,8,12)
         status = H5SetPropFileMPIOPosix (props, &comm);
 	RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOPosix");
+#else
+        status = H5SetPropFileMPIOIndependent (props, &comm);
+	RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOIndependent");
 #endif
+
+#endif // H5_HAVE_PARALLEL
 	file1 = H5OpenFile(FILENAME, H5_O_RDONLY, props);
 	status = H5CheckFile(file1);
 	RETURN(status, H5_SUCCESS, "H5CheckFile");
@@ -498,7 +510,6 @@ void h5u_test_read3(void)
 	status = H5CloseFile(file1);
 	RETURN(status, H5_SUCCESS, "H5CloseFile");
 }
-#endif
 
 void h5u_test_read4(void)
 {
diff --git a/test/h5u_write.c b/test/h5u_write.c
index 191a5706..1edcb773 100644
--- a/test/h5u_write.c
+++ b/test/h5u_write.c
@@ -411,21 +411,32 @@ void h5u_test_write2(void)
 	RETURN(status, H5_SUCCESS, "H5CloseFile");
 }
 
-#if H5_VERSION_LE(1,8,12)
 void h5u_test_write3(void)
 {
 	h5_file_t file1;
 	h5_err_t status;
 
+#if H5_VERSION_LE(1,8,12)
 	TEST("Opening file once, write-truncate, MPI-POSIX VFD");
-
+#else
+	TEST("Opening file once, write-truncate, MPI-IO Independent VFD");
+#endif
+	
         h5_prop_t props = H5CreateFileProp ();
 
 #if defined(H5_HAVE_PARALLEL)
         MPI_Comm comm = MPI_COMM_WORLD;
+
+#if H5_VERSION_LE(1,8,12)
         status = H5SetPropFileMPIOPosix (props, &comm);
 	RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOPosix");
+#else
+        status = H5SetPropFileMPIOIndependent (props, &comm);
+	RETURN(status, H5_SUCCESS, "H5SetPropFileMPIOIndependent");
 #endif
+
+#endif // H5_HAVE_PARALLEL
+
 	file1 = H5OpenFile(FILENAME, H5_O_WRONLY, props);
 
 	status = H5CheckFile(file1);
@@ -444,7 +455,6 @@ void h5u_test_write3(void)
 	status = H5CloseFile(file1);
 	RETURN(status, H5_SUCCESS, "H5CloseFile");
 }
-#endif
 
 void h5u_test_write4(void)
 {
-- 
GitLab