summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorRichard Warren <Richard.Warren@hdfgroup.org>2020-06-22 18:46:24 (GMT)
committerRichard Warren <Richard.Warren@hdfgroup.org>2020-06-22 18:46:24 (GMT)
commit5e02da94f11742aa246eb284c964709d97404d3d (patch)
treef7c15b98588051287ceaad887ec122917af2d92e /testpar
parentd20000ec51d50b66fc1226eeb656b8dc1358f826 (diff)
downloadhdf5-5e02da94f11742aa246eb284c964709d97404d3d.zip
hdf5-5e02da94f11742aa246eb284c964709d97404d3d.tar.gz
hdf5-5e02da94f11742aa246eb284c964709d97404d3d.tar.bz2
Initial subfiling branch
Diffstat (limited to 'testpar')
-rw-r--r--testpar/CMakeLists.txt1
-rw-r--r--testpar/t_subfile_openclose.c42
2 files changed, 43 insertions, 0 deletions
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index a9f45d5..3d0fe7e 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -75,6 +75,7 @@ set (H5P_TESTS
t_shapesame
t_filters_parallel
t_2Gio
+ t_subfile_openclose
)
foreach (h5_testp ${H5P_TESTS})
diff --git a/testpar/t_subfile_openclose.c b/testpar/t_subfile_openclose.c
new file mode 100644
index 0000000..9f31b6e
--- /dev/null
+++ b/testpar/t_subfile_openclose.c
@@ -0,0 +1,42 @@
+#include <stdio.h>
+#include "hdf5.h"
+#include "H5FDsubfile_public.h"
+
+#include "mpi.h"
+
+int
+main(int argc, char **argv)
+{
+
+ int i, mpi_size, mpi_rank;
+ int mpi_provides, require = MPI_THREAD_MULTIPLE;
+ hid_t subfile_id;
+
+ MPI_Init_thread(&argc, &argv, require, &mpi_provides);
+ MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
+ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
+ H5open();
+
+ if (H5FDsubfiling_init() == SUCCEED) {
+ subfile_id = get_subfiling_context();
+ printf("[%d] subfile_id = %lx\n", mpi_rank, subfile_id);
+ }
+ else if (mpi_rank == 0) {
+ puts("Error: Unable to initialize subfiling!");
+ }
+
+ for(i=0; i < 10; i++) {
+ sf_open_subfiles(subfile_id, NULL, O_CREAT|O_TRUNC|O_RDWR);
+ sf_close_subfiles(subfile_id);
+ }
+
+ MPI_Barrier(MPI_COMM_WORLD);
+
+ H5FDsubfiling_finalize();
+
+ H5close();
+
+ MPI_Finalize();
+ return 0;
+}