summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2019-02-22 18:53:07 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2019-02-22 19:03:08 (GMT)
commit0e402e436d0c58acc72e45ab6153d5662b3148e0 (patch)
tree94798cf8cb723798fc7fda00a281b712ccdfb427
parent9e5651ec4f0073ed84a5459dc109ca0d6b602862 (diff)
downloadhdf5-0e402e436d0c58acc72e45ab6153d5662b3148e0.zip
hdf5-0e402e436d0c58acc72e45ab6153d5662b3148e0.tar.gz
hdf5-0e402e436d0c58acc72e45ab6153d5662b3148e0.tar.bz2
Updated the tests to use mobject.
-rw-r--r--BRANCH.txt37
-rw-r--r--examples/Makefile.am2
-rw-r--r--examples/h5rados_dset_create.c2
-rw-r--r--examples/h5rados_dset_open.c2
-rw-r--r--examples/h5rados_dset_read.c2
-rw-r--r--examples/h5rados_dset_rpartial.c2
-rw-r--r--examples/h5rados_dset_wpartial.c2
-rw-r--r--examples/h5rados_dset_write.c2
-rw-r--r--examples/h5rados_example.h8
-rw-r--r--examples/h5rados_file_create.c2
-rw-r--r--examples/h5rados_file_open.c2
-rw-r--r--examples/h5rados_group_create.c2
-rw-r--r--examples/h5rados_group_open.c2
-rw-r--r--examples/run_mobject_examples.sh48
14 files changed, 103 insertions, 12 deletions
diff --git a/BRANCH.txt b/BRANCH.txt
index 57aa2da..a0605bf 100644
--- a/BRANCH.txt
+++ b/BRANCH.txt
@@ -16,6 +16,8 @@ made to keep the MANIFEST sane, etc.
* BUILDING *
************
+RADOS:
+
The code for the RADOS VOL connector lies entirely in
the H5VLrados* files in the src directory. The connector
is built as a static part of the library.
@@ -30,6 +32,21 @@ LDFLAGS="-L/path/to/librados -lrados"
YMMV, but the autotools do no librados hunting so you may
need to specify things it can't figure out on its own.
+MOBJECT:
+
+You'll need to be able to find the headers and libs for
+mobject-store. You do not need the RADOS libraries.
+
+On jelly (THG), this will work:
+
+export SPACK_ROOT=/mnt/hdf/jsoumagne/spack
+source $SPACK_ROOT/share/spack/setup-env.sh
+module load GCC
+source <(spack module tcl loads --dependencies mobject)
+
+You will also need to define HDF5_USE_MOBJECT in CPPFLAGS.
+This switches between the RADOS and mobject headers.
+
***********
* TESTING *
@@ -39,6 +56,8 @@ There are no tests for the RADOS VOL connector in the main
library, so running 'make check' won't provide much
information.
+RADOS:
+
Once the library has been built, you can run some smoke
checks by running 'make install' and going to the
share/hdf5_examples/c/ directory and running the
@@ -48,3 +67,21 @@ and run all the example scripts in a sane order.
*** YOU WILL NEED TO COPY YOUR ceph.conf FILE
*** INTO THIS DIRECTORY FIRST!!!
+
+In case it's not obvious, you'll need an active Ceph
+cluster to run the tests :)
+
+MOBJECT:
+
+Same as above, only the script's name is run_mobject_examples.sh.
+
+You can probably ignore any sdskv_put warnings as long as the
+examples pass.
+
+The tests are hard-coded to use /tmp/mobject-clust-test.gid and
+this can be changed in h5rados_example.h.
+
+So to start mobject-server:
+
+mobject-server-daemon na+sm /tmp/mobject-cluster-test.gid
+
diff --git a/examples/Makefile.am b/examples/Makefile.am
index ae0ac65..7e56f86 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -64,7 +64,7 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \
h5rados_group_open.c h5rados_dset_create.c \
h5rados_dset_open.c h5rados_dset_write.c h5rados_dset_read.c \
h5rados_dset_wpartial.c h5rados_dset_rpartial.c \
- h5rados_example.h run_rados_examples.sh
+ h5rados_example.h run_rados_examples.sh run_mobject_examples.sh
diff --git a/examples/h5rados_dset_create.c b/examples/h5rados_dset_create.c
index 0e14a7f..2ec6bfa 100644
--- a/examples/h5rados_dset_create.c
+++ b/examples/h5rados_dset_create.c
@@ -14,7 +14,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_dset_open.c b/examples/h5rados_dset_open.c
index 19e29ed..a0d4fa7 100644
--- a/examples/h5rados_dset_open.c
+++ b/examples/h5rados_dset_open.c
@@ -15,7 +15,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_dset_read.c b/examples/h5rados_dset_read.c
index fc7292c..5dbb91d 100644
--- a/examples/h5rados_dset_read.c
+++ b/examples/h5rados_dset_read.c
@@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_dset_rpartial.c b/examples/h5rados_dset_rpartial.c
index 622b961..f6faad7 100644
--- a/examples/h5rados_dset_rpartial.c
+++ b/examples/h5rados_dset_rpartial.c
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_dset_wpartial.c b/examples/h5rados_dset_wpartial.c
index bb53982..048625e 100644
--- a/examples/h5rados_dset_wpartial.c
+++ b/examples/h5rados_dset_wpartial.c
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_dset_write.c b/examples/h5rados_dset_write.c
index dad96fa..17e6898 100644
--- a/examples/h5rados_dset_write.c
+++ b/examples/h5rados_dset_write.c
@@ -18,7 +18,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_example.h b/examples/h5rados_example.h
index 4516b15..8da9487 100644
--- a/examples/h5rados_example.h
+++ b/examples/h5rados_example.h
@@ -3,7 +3,6 @@
#include <stdlib.h>
#include <mpi.h>
#include <hdf5.h>
-#include <rados/librados.h>
#include <H5VLrados_public.h>
/* Macros for printing standard messages and issuing errors */
@@ -12,3 +11,10 @@
#define ERROR do {FAILED(); AT(); goto error;} while(0)
#define PRINTF_ERROR(...) do {FAILED(); AT(); printf(" " __VA_ARGS__); printf("\n"); goto error;} while(0)
+/* Config file */
+#ifdef HDF5_USE_MOBJECT
+#define CEPH_CONFIG_FILE "/tmp/mobject-cluster-test.gid"
+#else
+#define CEPH_CONFIG_FILE "ceph.conf"
+#endif
+
diff --git a/examples/h5rados_file_create.c b/examples/h5rados_file_create.c
index 493be18..04101b3 100644
--- a/examples/h5rados_file_create.c
+++ b/examples/h5rados_file_create.c
@@ -12,7 +12,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_file_open.c b/examples/h5rados_file_open.c
index 176d26e..881ab10 100644
--- a/examples/h5rados_file_open.c
+++ b/examples/h5rados_file_open.c
@@ -12,7 +12,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_group_create.c b/examples/h5rados_group_create.c
index fcfbbc0..68c6a6d 100644
--- a/examples/h5rados_group_create.c
+++ b/examples/h5rados_group_create.c
@@ -12,7 +12,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/h5rados_group_open.c b/examples/h5rados_group_open.c
index 3339480..4fde06c 100644
--- a/examples/h5rados_group_open.c
+++ b/examples/h5rados_group_open.c
@@ -12,7 +12,7 @@ int main(int argc, char *argv[]) {
if(rados_create(&cluster, NULL) < 0)
ERROR;
- if(rados_conf_read_file(cluster, "ceph.conf") < 0)
+ if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
ERROR;
/* Initialize VOL */
diff --git a/examples/run_mobject_examples.sh b/examples/run_mobject_examples.sh
new file mode 100644
index 0000000..767387d
--- /dev/null
+++ b/examples/run_mobject_examples.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+
+# Build mobject examples.
+# Assumes mobject stuff can be found
+echo "Building mobject examples"
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_file_create h5rados_file_create.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_file_open h5rados_file_open.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_dset_create h5rados_dset_create.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_dset_open h5rados_dset_open.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_group_create h5rados_group_create.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_group_open h5rados_group_open.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_dset_write h5rados_dset_write.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_dset_read h5rados_dset_read.c
+
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_dset_rpartial h5rados_dset_rpartial.c
+../../../bin/h5pcc -DHDF5_USE_MOBJECT -o h5rados_dset_wpartial h5rados_dset_wpartial.c
+echo "DONE"
+echo
+
+# Run the mobject examples
+echo "Running mobject examples"
+# File create/open
+echo "./h5rados_file_create testfile"
+mpiexec -n 2 ./h5rados_file_create testfile
+echo "./h5rados_file_open testfile"
+mpiexec -n 2 ./h5rados_file_open testfile
+# Dataset create/open
+echo "./h5rados_dset_create testfile testdset"
+mpiexec -n 2 ./h5rados_dset_create testfile testdset
+echo "./h5rados_dset_open testfile testdset"
+mpiexec -n 2 ./h5rados_dset_open testfile testdset
+# Group create/open
+echo "./h5rados_group_create testfile testgroup"
+mpiexec -n 2 ./h5rados_group_create testfile testgroup
+echo "./h5rados_group_open testfile testgroup"
+mpiexec -n 2 ./h5rados_group_open testfile testgroup
+# Dataset read/write
+echo "./h5rados_dset_write testfile testdset"
+mpiexec -n 2 ./h5rados_dset_write testfile testdset
+echo "./h5rados_dset_read testfile testdset"
+mpiexec -n 2 ./h5rados_dset_read testfile testdset
+# Dataset read/write (partial)
+echo "./h5rados_dset_wpartial testfile testdset"
+mpiexec -n 2 ./h5rados_dset_wpartial testfile testdset
+echo "./h5rados_dset_rpartial testfile testdset"
+mpiexec -n 2 ./h5rados_dset_rpartial testfile testdset
+echo
+