Compare commits
37 Commits
hdf5-1_13_
...
inactive/r
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8c92019eb0 | ||
|
|
3099afddc7 | ||
|
|
2ac68d421f | ||
|
|
66ca98ad23 | ||
|
|
eed720d3e4 | ||
|
|
7c38ca9cf5 | ||
|
|
537bde63d2 | ||
|
|
070aae61cd | ||
|
|
b974164e8c | ||
|
|
c844a0497f | ||
|
|
ae78522092 | ||
|
|
d1f47a53de | ||
|
|
05a07f595c | ||
|
|
079edfc7bb | ||
|
|
ca40a2026c | ||
|
|
01d0586ce5 | ||
|
|
e24bd8f117 | ||
|
|
23a23d7858 | ||
|
|
35c4b78dac | ||
|
|
134f9c37be | ||
|
|
1ec2de8c72 | ||
|
|
be1fc58875 | ||
|
|
bb19438495 | ||
|
|
6d7835fced | ||
|
|
25c17219d4 | ||
|
|
4535dd7d58 | ||
|
|
f33d4d03ef | ||
|
|
43ebf4637a | ||
|
|
d490f933cf | ||
|
|
2d46ee0622 | ||
|
|
588f6b69ec | ||
|
|
82b1809e3c | ||
|
|
5497b72ae0 | ||
|
|
cd7403bb99 | ||
|
|
8af2e3cff6 | ||
|
|
633c9db2ce | ||
|
|
934ef8bec0 |
55
BRANCH.txt
Normal file
55
BRANCH.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
This branch is a merge of Neil's original RADOS VOL connector
|
||||
branch and develop and is kept in sync with the changes
|
||||
in develop.
|
||||
|
||||
************
|
||||
* BUILDING *
|
||||
************
|
||||
|
||||
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.
|
||||
|
||||
YOU MUST BUILD THE PARALLEL LIBRARY (--enable-parallel
|
||||
in the autotools).
|
||||
|
||||
The autotools configuration files have been updated with
|
||||
a --with-rados= option. CMake has not yet been updated
|
||||
so you'll have to add the -I, -l, and -L flags yourself,
|
||||
if necessary.
|
||||
|
||||
I build this branch on Ubuntu, with the system default
|
||||
librados-dev package and its dependencies installed. On
|
||||
Ubuntu, the librados libraries are installed in an odd
|
||||
location, so I simplify the configure line by creating
|
||||
an opt/librados directory in my home directory and
|
||||
creating symlinks to the include and lib directories in
|
||||
that.
|
||||
|
||||
|
||||
***********
|
||||
* TESTING *
|
||||
***********
|
||||
|
||||
There are no tests for the RADOS VOL connector in the main
|
||||
library, so running 'make check' won't provide much
|
||||
information.
|
||||
|
||||
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
|
||||
run_rados_examples.sh script found there. That will
|
||||
create a small pool (or clear it out if it exists)
|
||||
and run all the example scripts in a sane order.
|
||||
|
||||
*** YOU WILL NEED TO COPY YOUR ceph.conf FILE
|
||||
*** INTO THIS DIRECTORY FIRST!!!
|
||||
|
||||
This script is not as sophisticated as our usual test
|
||||
scripts, so don't be surprised if it fails and you have
|
||||
to run the tests manually.
|
||||
|
||||
Also note that CMake installs HDF5 to the system by
|
||||
default, even in development branches. The autotools
|
||||
will install HDF5 to an hdf5 subdirectory of the
|
||||
build directory by default in development branches.
|
||||
23
HOW_TO_BUILD.txt
Normal file
23
HOW_TO_BUILD.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
How to build this branch:
|
||||
|
||||
1) Install RADOS
|
||||
|
||||
Debian/Ubuntu
|
||||
sudo apt-get install librados-dev
|
||||
|
||||
RHEL/CentOS
|
||||
sudo yum install librados2-devel
|
||||
|
||||
|
||||
2) Configure (autotools only)
|
||||
|
||||
You will need to use --with-rados and set the include and library paths. You'll also need to build the parallel library.
|
||||
|
||||
Using the default locations on Ubuntu:
|
||||
|
||||
../develop/configure --enable-parallel --with-rados=/usr/include/rados,/usr/lib 2>&1 | tee configure.out
|
||||
|
||||
|
||||
3) Build and run tests
|
||||
|
||||
The 'tests' are the RADOS examples which are run via 'make check-install'
|
||||
21
MANIFEST
21
MANIFEST
@@ -23,9 +23,12 @@
|
||||
./.autom4te.cfg _DO_NOT_DISTRIBUTE_
|
||||
./.h5chkright.ini _DO_NOT_DISTRIBUTE_
|
||||
./ACKNOWLEDGMENTS
|
||||
./BRANCH.txt
|
||||
./COPYING
|
||||
./COPYING_LBNL_HDF5
|
||||
./HOW_TO_BUILD.txt
|
||||
./MANIFEST
|
||||
./MOBJECT_ON_JELLY.txt _DO_NOT_DISTRIBUTE_
|
||||
./Makefile.dist
|
||||
./Makefile.am
|
||||
./README.txt
|
||||
@@ -166,6 +169,19 @@
|
||||
./examples/h5_select.c
|
||||
./examples/h5_attribute.c
|
||||
./examples/h5_mount.c
|
||||
./examples/h5rados_dset_create.c
|
||||
./examples/h5rados_dset_open.c
|
||||
./examples/h5rados_dset_read.c
|
||||
./examples/h5rados_dset_rpartial.c
|
||||
./examples/h5rados_dset_rss.c
|
||||
./examples/h5rados_dset_wpartial.c
|
||||
./examples/h5rados_dset_write.c
|
||||
./examples/h5rados_dset_wss.c
|
||||
./examples/h5rados_example.h
|
||||
./examples/h5rados_file_create.c
|
||||
./examples/h5rados_file_open.c
|
||||
./examples/h5rados_group_create.c
|
||||
./examples/h5rados_group_open.c
|
||||
./examples/h5_reference.c
|
||||
./examples/h5_ref2reg.c
|
||||
./examples/h5_shared_mesg.c
|
||||
@@ -178,6 +194,8 @@
|
||||
./examples/h5_vds-percival.c
|
||||
./examples/h5_vds-percival-unlim.c
|
||||
./examples/h5_vds-percival-unlim-maxmin.c
|
||||
./examples/run_mobject_examples.sh
|
||||
./examples/run_rados_examples.sh
|
||||
./examples/testh5cc.sh.in
|
||||
./examples/README
|
||||
|
||||
@@ -918,6 +936,9 @@
|
||||
./src/H5VLpkg.h
|
||||
./src/H5VLprivate.h
|
||||
./src/H5VLpublic.h
|
||||
./src/H5VLrados.c
|
||||
./src/H5VLrados.h
|
||||
./src/H5VLrados_public.h
|
||||
./src/H5VM.c
|
||||
./src/H5VMprivate.h
|
||||
./src/H5WB.c
|
||||
|
||||
39
MOBJECT_ON_JELLY.txt
Normal file
39
MOBJECT_ON_JELLY.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
How to do an out-of-source build of the hdf5_rados branch on jelly.
|
||||
Assumes you are in a separate build directory and that the source is in
|
||||
a directory named hdf5_rados.
|
||||
|
||||
First run autogen in the source directory.
|
||||
|
||||
./autogen.sh
|
||||
|
||||
|
||||
Now set up the environment. We're using Jerome's spack packages.
|
||||
|
||||
module load GCC
|
||||
|
||||
export SPACK_ROOT=/mnt/hdf/jsoumagne/spack
|
||||
source $SPACK_ROOT/share/spack/setup-env.sh
|
||||
source <(spack module tcl loads --dependencies mobject)
|
||||
|
||||
export CFLAGS=`pkg-config --cflags mobject-store`
|
||||
export LDFLAGS=`pkg-config --libs mobject-store`
|
||||
export CPPFLAGS=-DHDF5_USE_MOBJECT
|
||||
|
||||
|
||||
Now change to your build directory and configure/build.
|
||||
|
||||
../hdf5_rados/configure --enable-parallel
|
||||
make -j5
|
||||
make install
|
||||
|
||||
|
||||
Now switch to the examples directory and test mobject. You
|
||||
will have to fire up mobject-store. I do this in the same
|
||||
shell and set it to be a background test with CTRL-Z and bg.
|
||||
|
||||
cd hdf5/share/hdf5_examples/c
|
||||
export MOBJECT_CLUSTER_FILE=/tmp/mobject-cluster-test.gid
|
||||
mobject-server-daemon na+sm /tmp/mobject-cluster-test.gid
|
||||
CTRL-Z
|
||||
bg
|
||||
sh run_mobject_examples.sh
|
||||
@@ -173,6 +173,7 @@ $Source = "";
|
||||
"H5VL_request_notify_t" => "x",
|
||||
"H5Z_func_t" => "x",
|
||||
"H5Z_filter_func_t" => "x",
|
||||
"rados_t" => "x",
|
||||
"va_list" => "x",
|
||||
"size_t" => "z",
|
||||
"H5Z_SO_scale_type_t" => "Za",
|
||||
|
||||
79
configure.ac
79
configure.ac
@@ -1329,6 +1329,85 @@ case "X-$withval" in
|
||||
;;
|
||||
esac
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Is RADOS present? It has a header file 'librados.h' and a library
|
||||
## '-lrados' and their locations might be specified with the '--with-rados'
|
||||
## command-line switch. The value is an include path and/or a library path.
|
||||
## If the library path is specified then it must be preceded by a comma.
|
||||
##
|
||||
AC_SUBST([HAVE_RADOS])
|
||||
|
||||
## Default is not present
|
||||
HAVE_RADOS=no
|
||||
|
||||
AC_ARG_WITH([rados],
|
||||
[AS_HELP_STRING([--with-rados=DIR],
|
||||
[Use RADOS [default=no]])],,
|
||||
[withval=no])
|
||||
|
||||
case $withval in
|
||||
yes)
|
||||
HAVE_RADOS="yes"
|
||||
AC_CHECK_HEADERS([librados.h],, [unset HAVE_RADOS])
|
||||
if test "x$HAVE_RADOS" = "xyes"; then
|
||||
AC_CHECK_LIB([rados], [rados_read],, [unset HAVE_RADOS])
|
||||
fi
|
||||
if test -z "$HAVE_RADOS" -a -n "$HDF5_CONFIG_ABORT"; then
|
||||
AC_MSG_ERROR([couldn't find RADOS library])
|
||||
fi
|
||||
;;
|
||||
no)
|
||||
HAVE_RADOS="no"
|
||||
AC_MSG_CHECKING([for RADOS library])
|
||||
AC_MSG_RESULT([suppressed])
|
||||
;;
|
||||
*)
|
||||
HAVE_RADOS="yes"
|
||||
case "$withval" in
|
||||
*,*)
|
||||
rados_inc="`echo $withval |cut -f1 -d,`"
|
||||
rados_lib="`echo $withval |cut -f2 -d, -s`"
|
||||
;;
|
||||
*)
|
||||
if test -n "$withval"; then
|
||||
rados_inc="$withval/include"
|
||||
rados_lib="$withval/lib"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
saved_AM_CPPFLAGS="$AM_CPPFLAGS"
|
||||
saved_LDFLAGS="$LDFLAGS"
|
||||
saved_AM_LDFLAGS="$AM_LDFLAGS"
|
||||
|
||||
if test -n "$rados_inc"; then
|
||||
CPPFLAGS="$CPPFLAGS -I$rados_inc"
|
||||
AM_CPPFLAGS="$AM_CPPFLAGS -I$rados_inc"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADERS([librados.h],,[CPPFLAGS="$saved_CPPFLAGS"; AM_CPPFLAGS="$saved_AM_CPPFLAGS"] [unset HAVE_RADOS])
|
||||
|
||||
if test -n "$rados_lib"; then
|
||||
LDFLAGS="$LDFLAGS -L$rados_lib"
|
||||
AM_LDFLAGS="$AM_LDFLAGS -L$rados_lib"
|
||||
fi
|
||||
|
||||
if test "x$HAVE_RADOS" = "xyes"; then
|
||||
AC_CHECK_LIB([rados], [rados_read],, [LDFLAGS="$saved_LDFLAGS"; AM_LDFLAGS="$saved_AM_LDFLAGS"; unset HAVE_RADOS])
|
||||
fi
|
||||
|
||||
if test -z "$HAVE_RADOS" -a -n "$HDF5_CONFIG_ABORT"; then
|
||||
AC_MSG_ERROR([couldn't find RADOS library])
|
||||
fi
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "x$HAVE_RADOS" = "xyes" ; then
|
||||
AC_DEFINE([HAVE_RADOS], [1], [Define if RADOS is enabled])
|
||||
fi
|
||||
|
||||
## ----------------------------------------------------------------------
|
||||
## Make the external filters list available to *.in files
|
||||
## At this point it's unset (no external filters by default) but it
|
||||
|
||||
@@ -20,7 +20,10 @@
|
||||
include $(top_srcdir)/config/commence.am
|
||||
|
||||
if BUILD_PARALLEL_CONDITIONAL
|
||||
EXAMPLE_PROG_PARA = ph5example
|
||||
EXAMPLE_PROG_PARA = ph5example h5rados_file_create h5rados_file_open \
|
||||
h5rados_group_create h5rados_group_open h5rados_dset_create \
|
||||
h5rados_dset_open h5rados_dset_write h5rados_dset_read \
|
||||
h5rados_dset_wpartial h5rados_dset_rpartial
|
||||
endif
|
||||
|
||||
INSTALL_SCRIPT_FILES = run-c-ex.sh
|
||||
@@ -38,6 +41,7 @@ EXAMPLE_PROG = h5_write h5_read h5_extend_write h5_chunk_read h5_compound \
|
||||
h5_ref2reg h5_extlink h5_elink_unix2win h5_shared_mesg h5_vds h5_vds-exc \
|
||||
h5_vds-exclim h5_vds-eiger h5_vds-simpleIO h5_vds-percival \
|
||||
h5_vds-percival-unlim h5_vds-percival-unlim-maxmin
|
||||
|
||||
TEST_SCRIPT=testh5cc.sh
|
||||
TEST_EXAMPLES_SCRIPT=$(INSTALL_SCRIPT_FILES)
|
||||
|
||||
@@ -50,8 +54,12 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \
|
||||
h5_reference.c h5_drivers.c h5_extlink.c h5_elink_unix2win.c \
|
||||
h5_ref2reg.c h5_shared_mesg.c ph5example.c h5_vds.c h5_vds-exc.c \
|
||||
h5_vds-exclim.c h5_vds-eiger.c h5_vds-simpleIO.c h5_vds-percival.c \
|
||||
h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c
|
||||
|
||||
h5_vds-percival-unlim.c h5_vds-percival-unlim-maxmin.c \
|
||||
h5rados_example.h h5rados_file_create.c h5rados_file_open.c \
|
||||
h5rados_dset_create.c h5rados_dset_open.c h5rados_dset_read.c h5rados_dset_rpartial.c \
|
||||
h5rados_dset_rss.c h5rados_dset_wpartial.c h5rados_dset_write.c h5rados_dset_wss.c \
|
||||
h5rados_group_create.c h5rados_group_open.c \
|
||||
h5rados_example.h run_rados_examples.sh run_mobject_examples.sh
|
||||
|
||||
|
||||
# How to build examples, using installed version of h5cc
|
||||
@@ -127,6 +135,16 @@ h5_vds-simpleIO: $(srcdir)/h5_vds-simpleIO.c
|
||||
h5_vds-percival: $(srcdir)/h5_vds-percival.c
|
||||
h5_vds-percival-unlim: $(srcdir)/h5_vds-percival-unlim.c
|
||||
h5_vds-percival-unlim-maxmin: $(srcdir)/h5_vds-percival-unlim-maxmin.c
|
||||
h5rados_file_create: $(srcdir)/h5rados_file_create.c
|
||||
h5rados_file_open: $(srcdir)/h5rados_file_open.c
|
||||
h5rados_group_create: $(srcdir)/h5rados_group_create.c
|
||||
h5rados_group_open: $(srcdir)/h5rados_group_open.c
|
||||
h5rados_dset_create: $(srcdir)/h5rados_dset_create.c
|
||||
h5rados_dset_open: $(srcdir)/h5rados_dset_open.c
|
||||
h5rados_dset_write: $(srcdir)/h5rados_dset_write.c
|
||||
h5rados_dset_read: $(srcdir)/h5rados_dset_read.c
|
||||
h5rados_dset_wpartial: $(srcdir)/h5rados_dset_wpartial.c
|
||||
h5rados_dset_rpartial: $(srcdir)/h5rados_dset_rpartial.c
|
||||
|
||||
if BUILD_SHARED_SZIP_CONDITIONAL
|
||||
LD_LIBRARY_PATH=$(LL_PATH)
|
||||
|
||||
102
examples/h5rados_dset_create.c
Normal file
102
examples/h5rados_dset_create.c
Normal file
@@ -0,0 +1,102 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, space = -1, fapl = -1, dcpl = H5P_DEFAULT;
|
||||
hsize_t dims[2] = {4, 6};
|
||||
hsize_t cdims[2];
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
if((argc != 3) && (argc != 5))
|
||||
PRINTF_ERROR("argc is not 3 or 5\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up DCPL */
|
||||
if(argc == 5) {
|
||||
cdims[0] = (hsize_t)atoi(argv[3]);
|
||||
cdims[1] = (hsize_t)atoi(argv[4]);
|
||||
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_chunk(dcpl, 2, cdims) < 0)
|
||||
ERROR;
|
||||
} /* end if */
|
||||
|
||||
/* Set up dataspace */
|
||||
if((space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Creating dataset\n");
|
||||
|
||||
/* Create dataset */
|
||||
if((dset = H5Dcreate2(file, argv[2], H5T_NATIVE_INT, space, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(space) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
if((dcpl != H5P_DEFAULT) && (H5Pclose(dcpl) < 0))
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Sclose(space);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
144
examples/h5rados_dset_open.c
Normal file
144
examples/h5rados_dset_open.c
Normal file
@@ -0,0 +1,144 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, fapl = -1, space = -1, type = -1, dcpl = -1, dapl = -1, def_dcpl = -1, def_dapl = -1;
|
||||
int ndims;
|
||||
hsize_t dims[2];
|
||||
htri_t tri_ret;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Opening dataset\n");
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Check dataset dataspace */
|
||||
if((space = H5Dget_space(dset)) < 0)
|
||||
ERROR;
|
||||
if((ndims = H5Sget_simple_extent_ndims(space)) < 0)
|
||||
ERROR;
|
||||
if(ndims != 2)
|
||||
PRINTF_ERROR("ndims == %d, expected 2\n", ndims);
|
||||
if(H5Sget_simple_extent_dims(space, dims, NULL) < 0)
|
||||
ERROR;
|
||||
if(dims[0] != 4)
|
||||
PRINTF_ERROR("dims[0] == %d, expected 4\n", (int)dims[0]);
|
||||
if(dims[1] != 6)
|
||||
PRINTF_ERROR("dims[1] == %d, expected 6\n", (int)dims[1]);
|
||||
|
||||
/* Check dataset datatype */
|
||||
if((type = H5Dget_type(dset)) < 0)
|
||||
ERROR;
|
||||
if((tri_ret = H5Tequal(type, H5T_NATIVE_INT)) < 0)
|
||||
ERROR;
|
||||
if(!tri_ret)
|
||||
PRINTF_ERROR("datatype does not equal H5T_NATIVE_INT\n");
|
||||
|
||||
/* Check DCPL */
|
||||
if((dcpl = H5Dget_create_plist(dset)) < 0)
|
||||
ERROR;
|
||||
if((def_dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
|
||||
ERROR;
|
||||
if((tri_ret = H5Pequal(dcpl, def_dcpl)) < 0)
|
||||
ERROR;
|
||||
if(!tri_ret)
|
||||
PRINTF_ERROR("DCPL does not equal default\n");
|
||||
|
||||
/* Check DAPL */
|
||||
if((dapl = H5Dget_access_plist(dset)) < 0)
|
||||
ERROR;
|
||||
if((def_dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if((tri_ret = H5Pequal(dapl, def_dapl)) < 0)
|
||||
ERROR;
|
||||
if(!tri_ret)
|
||||
PRINTF_ERROR("DAPL does not equal default\n");
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(space) < 0)
|
||||
ERROR;
|
||||
if(H5Tclose(type) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(dcpl) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(dapl) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(def_dcpl) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(def_dapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
H5Sclose(space);
|
||||
H5Tclose(type);
|
||||
H5Pclose(dcpl);
|
||||
H5Pclose(dapl);
|
||||
H5Pclose(def_dcpl);
|
||||
H5Pclose(def_dapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
104
examples/h5rados_dset_read.c
Normal file
104
examples/h5rados_dset_read.c
Normal file
@@ -0,0 +1,104 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, fapl = -1;
|
||||
int buf[4][6];
|
||||
int i, j;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
/* Seed random number generator */
|
||||
srand(time(NULL));
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Reading dataset\n");
|
||||
|
||||
/* Initialize buffer */
|
||||
for(i = 0; i < 4; i++)
|
||||
for(j = 0; j < 6; j++)
|
||||
buf[i][j] = -1;
|
||||
|
||||
/* Read data */
|
||||
if(H5Dread(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Print buffer */
|
||||
printf("Successfully read data. Buffer is:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(j = 0; j < 6; j++)
|
||||
printf("%d ", buf[i][j]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
160
examples/h5rados_dset_rpartial.c
Normal file
160
examples/h5rados_dset_rpartial.c
Normal file
@@ -0,0 +1,160 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, file_space = -1, mem_space = -1, fapl = -1;
|
||||
hsize_t dims[2] = {4, 6};
|
||||
hsize_t start[2], count[2];
|
||||
int buf[4][6];
|
||||
int rank, mpi_size;
|
||||
char *file_sel_str[2] = {"XXX...", "...XXX"};
|
||||
int i, j;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
|
||||
|
||||
if(mpi_size > 2)
|
||||
PRINTF_ERROR("mpi_size > 2\n");
|
||||
|
||||
/* Seed random number generator */
|
||||
srand(time(NULL));
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
if(rank == 1)
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
printf("---------------Rank %d---------------\n", rank);
|
||||
printf("Selecting elements denoted with X\n");
|
||||
printf("Memory File\n");
|
||||
printf("...... %s\n", file_sel_str[rank]);
|
||||
for(i = 1; i < 4; i++)
|
||||
printf(".XXXX. %s\n", file_sel_str[rank]);
|
||||
|
||||
if(rank == 0)
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
else
|
||||
printf("Reading dataset\n");
|
||||
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
/* Set up dataspaces */
|
||||
if((file_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
if((mem_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
start[0] = 0;
|
||||
start[1] = 3 * rank;
|
||||
count[0] = 4;
|
||||
count[1] = 3;
|
||||
if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
start[0] = 1;
|
||||
start[1] = 1;
|
||||
count[0] = 3;
|
||||
count[1] = 4;
|
||||
if(H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize buffer */
|
||||
for(i = 0; i < 4; i++)
|
||||
for(j = 0; j < 6; j++)
|
||||
buf[i][j] = -1;
|
||||
|
||||
/* Read data */
|
||||
if(H5Dread(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf) < 0)
|
||||
ERROR;
|
||||
|
||||
if(rank == 1)
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
/* Fill and print buffer */
|
||||
printf("---------------Rank %d---------------\n", rank);
|
||||
printf("Successfully read data. Buffer is:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(j = 0; j < 6; j++)
|
||||
printf("%d ", buf[i][j]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if(rank == 0)
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(file_space) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(mem_space) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Sclose(file_space);
|
||||
H5Sclose(mem_space);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
152
examples/h5rados_dset_rss.c
Normal file
152
examples/h5rados_dset_rss.c
Normal file
@@ -0,0 +1,152 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, file_space = -1, mem_space = -1, fapl = -1;
|
||||
hsize_t dims[2] = {4, 6};
|
||||
hsize_t fstart[2], count[2], mstart[2];
|
||||
int buf[4][6];
|
||||
int i, j;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
|
||||
if(argc != 9)
|
||||
PRINTF_ERROR("argc != 9\n");
|
||||
|
||||
fstart[0] = (hsize_t)atoi(argv[3]);
|
||||
fstart[1] = (hsize_t)atoi(argv[4]);
|
||||
count[0] = (hsize_t)atoi(argv[5]);
|
||||
count[1] = (hsize_t)atoi(argv[6]);
|
||||
mstart[0] = (hsize_t)atoi(argv[7]);
|
||||
mstart[1] = (hsize_t)atoi(argv[8]);
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, "ceph.conf") < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Selecting elements denoted with X\n");
|
||||
printf("File:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
if((i >= fstart[0]) && (i < fstart[0] + count[0])) {
|
||||
for(j = 0; j < 6; j++)
|
||||
if((j >= fstart[1]) && (j < fstart[1] + count[1]))
|
||||
printf("X");
|
||||
else
|
||||
printf(".");
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
printf("......\n");
|
||||
}
|
||||
printf("\nMemory:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
if((i >= mstart[0]) && (i < mstart[0] + count[0])) {
|
||||
for(j = 0; j < 6; j++)
|
||||
if((j >= mstart[1]) && (j < mstart[1] + count[1]))
|
||||
printf("X");
|
||||
else
|
||||
printf(".");
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
printf("......\n");
|
||||
}
|
||||
|
||||
/* Set up dataspaces */
|
||||
if((file_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
if((mem_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, fstart, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, mstart, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize buffer */
|
||||
for(i = 0; i < 4; i++)
|
||||
for(j = 0; j < 6; j++)
|
||||
buf[i][j] = -1;
|
||||
|
||||
/* Read data */
|
||||
if(H5Dread(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Fill and print buffer */
|
||||
printf("Successfully read data. Buffer is:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(j = 0; j < 6; j++)
|
||||
printf("%d ", buf[i][j]);
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(file_space) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(mem_space) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Sclose(file_space);
|
||||
H5Sclose(mem_space);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
147
examples/h5rados_dset_wpartial.c
Normal file
147
examples/h5rados_dset_wpartial.c
Normal file
@@ -0,0 +1,147 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, file_space = -1, mem_space = -1, fapl = -1;
|
||||
hsize_t dims[2] = {4, 6};
|
||||
hsize_t start[2], count[2];
|
||||
int buf[4][6];
|
||||
int rank, mpi_size;
|
||||
char *file_sel_str[2] = {"XXX...", "...XXX"};
|
||||
int i, j;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
|
||||
|
||||
if(mpi_size != 2)
|
||||
PRINTF_ERROR("mpi_size != 2\n");
|
||||
|
||||
/* Seed random number generator */
|
||||
srand(time(NULL));
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
if(rank == 1)
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
printf("---------------Rank %d---------------\n", rank);
|
||||
printf("Selecting elements denoted with X\n");
|
||||
printf("Memory File\n");
|
||||
printf("...... %s\n", file_sel_str[rank]);
|
||||
for(i = 1; i < 4; i++)
|
||||
printf(".XXXX. %s\n", file_sel_str[rank]);
|
||||
|
||||
/* Fill and print buffer */
|
||||
printf("Writing data. Buffer is:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(j = 0; j < 6; j++) {
|
||||
buf[i][j] = rand() % 10;
|
||||
printf("%d ", buf[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
if(rank == 0)
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
|
||||
|
||||
/* Set up dataspaces */
|
||||
if((file_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
if((mem_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
start[0] = 0;
|
||||
start[1] = 3 * rank;
|
||||
count[0] = 4;
|
||||
count[1] = 3;
|
||||
if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
start[0] = 1;
|
||||
start[1] = 1;
|
||||
count[0] = 3;
|
||||
count[1] = 4;
|
||||
if(H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, start, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Write data */
|
||||
if(H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(file_space) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(mem_space) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Sclose(file_space);
|
||||
H5Sclose(mem_space);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
99
examples/h5rados_dset_write.c
Normal file
99
examples/h5rados_dset_write.c
Normal file
@@ -0,0 +1,99 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, fapl = -1;
|
||||
int buf[4][6];
|
||||
int i, j;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
/* Seed random number generator */
|
||||
srand(time(NULL));
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Fill and print buffer */
|
||||
printf("Writing data. Buffer is:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(j = 0; j < 6; j++) {
|
||||
buf[i][j] = rand() % 10;
|
||||
printf("%d ", buf[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* Write data */
|
||||
if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
153
examples/h5rados_dset_wss.c
Normal file
153
examples/h5rados_dset_wss.c
Normal file
@@ -0,0 +1,153 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
#include <time.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, dset = -1, file_space = -1, mem_space = -1, fapl = -1;
|
||||
hsize_t dims[2] = {4, 6};
|
||||
hsize_t mstart[2], count[2], fstart[2];
|
||||
int buf[4][6];
|
||||
int i, j;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
/* Seed random number generator */
|
||||
srand(time(NULL));
|
||||
|
||||
if(argc != 9)
|
||||
PRINTF_ERROR("argc != 9\n");
|
||||
|
||||
mstart[0] = (hsize_t)atoi(argv[3]);
|
||||
mstart[1] = (hsize_t)atoi(argv[4]);
|
||||
count[0] = (hsize_t)atoi(argv[5]);
|
||||
count[1] = (hsize_t)atoi(argv[6]);
|
||||
fstart[0] = (hsize_t)atoi(argv[7]);
|
||||
fstart[1] = (hsize_t)atoi(argv[8]);
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, "ceph.conf") < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open dataset */
|
||||
if((dset = H5Dopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Selecting elements denoted with X\n");
|
||||
printf("Memory:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
if((i >= mstart[0]) && (i < mstart[0] + count[0])) {
|
||||
for(j = 0; j < 6; j++)
|
||||
if((j >= mstart[1]) && (j < mstart[1] + count[1]))
|
||||
printf("X");
|
||||
else
|
||||
printf(".");
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
printf("......\n");
|
||||
}
|
||||
printf("\nFile:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
if((i >= fstart[0]) && (i < fstart[0] + count[0])) {
|
||||
for(j = 0; j < 6; j++)
|
||||
if((j >= fstart[1]) && (j < fstart[1] + count[1]))
|
||||
printf("X");
|
||||
else
|
||||
printf(".");
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
printf("......\n");
|
||||
}
|
||||
|
||||
/* Fill and print buffer */
|
||||
printf("Writing data. Buffer is:\n");
|
||||
for(i = 0; i < 4; i++) {
|
||||
for(j = 0; j < 6; j++) {
|
||||
buf[i][j] = rand() % 10;
|
||||
printf("%d ", buf[i][j]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
/* Set up dataspaces */
|
||||
if((file_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
if((mem_space = H5Screate_simple(2, dims, NULL)) < 0)
|
||||
ERROR;
|
||||
if(H5Sselect_hyperslab(file_space, H5S_SELECT_SET, fstart, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Sselect_hyperslab(mem_space, H5S_SELECT_SET, mstart, NULL, count, NULL) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Write data */
|
||||
if(H5Dwrite(dset, H5T_NATIVE_INT, mem_space, file_space, H5P_DEFAULT, buf) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Dclose(dset) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(file_space) < 0)
|
||||
ERROR;
|
||||
if(H5Sclose(mem_space) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Dclose(dset);
|
||||
H5Fclose(file);
|
||||
H5Sclose(file_space);
|
||||
H5Sclose(mem_space);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
37
examples/h5rados_example.h
Normal file
37
examples/h5rados_example.h
Normal file
@@ -0,0 +1,37 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <mpi.h>
|
||||
#include <hdf5.h>
|
||||
#include <H5VLrados_public.h>
|
||||
|
||||
/* Macros for printing standard messages and issuing errors */
|
||||
#define AT() printf (" at %s:%d in %s()...\n", __FILE__, __LINE__, __FUNCTION__)
|
||||
#define FAILED() do {puts("*FAILED*");fflush(stdout);} while(0)
|
||||
#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
|
||||
|
||||
72
examples/h5rados_file_create.c
Normal file
72
examples/h5rados_file_create.c
Normal file
@@ -0,0 +1,72 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, fapl = -1;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
if(argc != 2)
|
||||
PRINTF_ERROR("argc != 2\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Create file */
|
||||
if((file = H5Fcreate(argv[1], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
72
examples/h5rados_file_open.c
Normal file
72
examples/h5rados_file_open.c
Normal file
@@ -0,0 +1,72 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, fapl = -1;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
if(argc != 2)
|
||||
PRINTF_ERROR("argc != 2\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Create file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
81
examples/h5rados_group_create.c
Normal file
81
examples/h5rados_group_create.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, fapl = -1, grp = -1;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* OPEN file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDWR, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Creating group\n");
|
||||
|
||||
/* Create group */
|
||||
if((grp = H5Gcreate2(file, argv[2], H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Gclose(grp) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Gclose(grp);
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
81
examples/h5rados_group_open.c
Normal file
81
examples/h5rados_group_open.c
Normal file
@@ -0,0 +1,81 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
#include "h5rados_example.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
rados_t cluster;
|
||||
char *pool = "mypool";
|
||||
hid_t file = -1, fapl = -1, grp = -1;
|
||||
|
||||
(void)MPI_Init(&argc, &argv);
|
||||
|
||||
if(argc != 3)
|
||||
PRINTF_ERROR("argc != 3\n");
|
||||
|
||||
if(rados_create(&cluster, NULL) < 0)
|
||||
ERROR;
|
||||
if(rados_conf_read_file(cluster, CEPH_CONFIG_FILE) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Initialize VOL */
|
||||
if(H5VLrados_init(cluster, pool) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Set up FAPL */
|
||||
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_fapl_rados(fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
|
||||
ERROR;
|
||||
if(H5Pset_all_coll_metadata_ops(fapl, true) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Open file */
|
||||
if((file = H5Fopen(argv[1], H5F_ACC_RDONLY, fapl)) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Opening group\n");
|
||||
|
||||
/* Open group */
|
||||
if((grp = H5Gopen2(file, argv[2], H5P_DEFAULT)) < 0)
|
||||
ERROR;
|
||||
|
||||
/* Close */
|
||||
if(H5Gclose(grp) < 0)
|
||||
ERROR;
|
||||
if(H5Fclose(file) < 0)
|
||||
ERROR;
|
||||
if(H5Pclose(fapl) < 0)
|
||||
ERROR;
|
||||
|
||||
printf("Success\n");
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 0;
|
||||
|
||||
error:
|
||||
H5E_BEGIN_TRY {
|
||||
H5Gclose(grp);
|
||||
H5Fclose(file);
|
||||
H5Pclose(fapl);
|
||||
} H5E_END_TRY;
|
||||
|
||||
(void)MPI_Finalize();
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ then
|
||||
rm h5_vds-percival &&\
|
||||
RunTest h5_vds-percival-unlim &&\
|
||||
rm h5_vds-percival-unlim &&\
|
||||
RunTest h5_vds-percival-unlim-maxmin&&\
|
||||
RunTest h5_vds-percival-unlim-maxmin &&\
|
||||
rm h5_vds-percival-unlim-maxmin &&\
|
||||
RunTest h5_vds &&\
|
||||
rm h5_vds); then
|
||||
|
||||
61
examples/run_mobject_examples.sh
Normal file
61
examples/run_mobject_examples.sh
Normal file
@@ -0,0 +1,61 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# 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 COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
# This source code was developed under the Mochi project
|
||||
# (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
# Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
|
||||
# Build mobject examples.
|
||||
# Assumes mobject stuff can be found
|
||||
echo "Building mobject examples"
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_file_create h5rados_file_create.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_file_open h5rados_file_open.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_dset_create h5rados_dset_create.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_dset_open h5rados_dset_open.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_group_create h5rados_group_create.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_group_open h5rados_group_open.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_dset_write h5rados_dset_write.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_dset_read h5rados_dset_read.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -o h5rados_dset_rpartial h5rados_dset_rpartial.c
|
||||
../../../bin/h5pcc -DHDF5_USE_MOBJECT -g -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
|
||||
|
||||
84
examples/run_rados_examples.sh
Executable file
84
examples/run_rados_examples.sh
Executable file
@@ -0,0 +1,84 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# 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 COPYING file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
#
|
||||
# This source code was developed under the Mochi project
|
||||
# (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
# Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
|
||||
# Build RADOS examples.
|
||||
# Assumes RADOS can be found in the usual location.
|
||||
echo "Building RADOS examples"
|
||||
../../../bin/h5pcc -g -o h5rados_file_create h5rados_file_create.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_file_open h5rados_file_open.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_dset_create h5rados_dset_create.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_dset_open h5rados_dset_open.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_group_create h5rados_group_create.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_group_open h5rados_group_open.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_dset_write h5rados_dset_write.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_dset_read h5rados_dset_read.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_dset_rpartial h5rados_dset_rpartial.c -lrados
|
||||
../../../bin/h5pcc -g -o h5rados_dset_wpartial h5rados_dset_wpartial.c -lrados
|
||||
echo "DONE"
|
||||
echo
|
||||
|
||||
# Create the pool
|
||||
echo "Creating the test pool"
|
||||
echo "(Ceph makes it hard to delete pools, so we never do that"
|
||||
echo "and you may see a message that the pool already exists.)"
|
||||
ceph osd pool create mypool 128
|
||||
echo
|
||||
|
||||
# Dump some Ceph info
|
||||
echo "Pool status at start of tests:"
|
||||
rados -p mypool ls
|
||||
echo
|
||||
|
||||
# Clean out the test pool
|
||||
echo "Cleaning out the test pool"
|
||||
for i in $(rados -p mypool ls); do echo $i; rados -p mypool rm $i; done
|
||||
echo
|
||||
|
||||
# Run the RADOS examples
|
||||
echo "Running RADOS 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
|
||||
|
||||
|
||||
# Dump the Ceph info again
|
||||
echo "Pool status at end of tests:"
|
||||
rados -p mypool ls
|
||||
echo
|
||||
|
||||
@@ -5049,6 +5049,34 @@ H5Pget_vol_info(hid_t plist_id, void **vol_info)
|
||||
if(NULL == (plist = (H5P_genplist_t *)H5I_object_verify(plist_id, H5I_GENPROP_LST)))
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
|
||||
|
||||
/* Call the internal function */
|
||||
if(H5P_get_vol_info(plist, vol_info) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get VOL connector info")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Pget_vol_info() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P_get_vol_info
|
||||
*
|
||||
* Purpose: Private version of H5Pget_vol_info().
|
||||
*
|
||||
* Return: SUCCEED/FAIL
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
herr_t
|
||||
H5P_get_vol_info(H5P_genplist_t *plist, void **vol_info)
|
||||
{
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
/* Sanity checks */
|
||||
HDassert(plist);
|
||||
|
||||
/* Get the current VOL info */
|
||||
if(TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS)) {
|
||||
void *new_connector_info = NULL; /* Copy of connector info */
|
||||
@@ -5078,8 +5106,8 @@ H5Pget_vol_info(hid_t plist_id, void **vol_info)
|
||||
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_API(ret_value)
|
||||
} /* end H5Pget_vol_info() */
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* end H5P_get_vol_info() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
|
||||
@@ -170,6 +170,7 @@ H5_DLL herr_t H5P_remove(H5P_genplist_t *plist, const char *name);
|
||||
H5_DLL htri_t H5P_exist_plist(const H5P_genplist_t *plist, const char *name);
|
||||
H5_DLL htri_t H5P_class_isa(const H5P_genclass_t *pclass1, const H5P_genclass_t *pclass2);
|
||||
H5_DLL char *H5P_get_class_name(H5P_genclass_t *pclass);
|
||||
H5_DLL herr_t H5P_get_vol_info(H5P_genplist_t *plist, void **vol_info);
|
||||
|
||||
/* Internal helper routines */
|
||||
H5_DLL herr_t H5P_get_nprops_pclass(const H5P_genclass_t *pclass, size_t *nprops,
|
||||
|
||||
4360
src/H5VLrados.c
Normal file
4360
src/H5VLrados.c
Normal file
File diff suppressed because it is too large
Load Diff
125
src/H5VLrados.h
Normal file
125
src/H5VLrados.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Programmer: Neil Fortner <nfortne2@hdfgroup.org>
|
||||
* December, 2017
|
||||
*
|
||||
* Purpose: The private header file for the RADOS VOL plugin.
|
||||
*/
|
||||
#ifndef H5VLrados_H
|
||||
#define H5VLrados_H
|
||||
|
||||
/* Include package's public header */
|
||||
#include "H5VLrados_public.h"
|
||||
|
||||
#define HDF5_VOL_RADOS_VERSION_1 1 /* Version number of RADOS VOL plugin */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* FAPL property to tell the VOL plugin to open a saved snapshot when opening a
|
||||
* file */
|
||||
#define H5VL_RADOS_SNAP_OPEN_ID "rados_snap_open"
|
||||
|
||||
/* Common object and attribute information */
|
||||
typedef struct H5VL_rados_item_t {
|
||||
H5I_type_t type;
|
||||
struct H5VL_rados_file_t *file;
|
||||
int rc;
|
||||
} H5VL_rados_item_t;
|
||||
|
||||
/* Common object information */
|
||||
typedef struct H5VL_rados_obj_t {
|
||||
H5VL_rados_item_t item; /* Must be first */
|
||||
uint64_t bin_oid;
|
||||
char *oid;
|
||||
} H5VL_rados_obj_t;
|
||||
|
||||
/* The file struct */
|
||||
typedef struct H5VL_rados_file_t {
|
||||
H5VL_rados_item_t item; /* Must be first */
|
||||
char *file_name;
|
||||
size_t file_name_len;
|
||||
unsigned flags;
|
||||
char *glob_md_oid;
|
||||
struct H5VL_rados_group_t *root_grp;
|
||||
uint64_t max_oid;
|
||||
hbool_t max_oid_dirty;
|
||||
hid_t fcpl_id;
|
||||
hid_t fapl_id;
|
||||
MPI_Comm comm;
|
||||
MPI_Info info;
|
||||
int my_rank;
|
||||
int num_procs;
|
||||
hbool_t collective;
|
||||
} H5VL_rados_file_t;
|
||||
|
||||
/* The group struct */
|
||||
typedef struct H5VL_rados_group_t {
|
||||
H5VL_rados_obj_t obj; /* Must be first */
|
||||
hid_t gcpl_id;
|
||||
hid_t gapl_id;
|
||||
} H5VL_rados_group_t;
|
||||
|
||||
/* The dataset struct */
|
||||
typedef struct H5VL_rados_dset_t {
|
||||
H5VL_rados_obj_t obj; /* Must be first */
|
||||
hid_t type_id;
|
||||
hid_t space_id;
|
||||
hid_t dcpl_id;
|
||||
hid_t dapl_id;
|
||||
} H5VL_rados_dset_t;
|
||||
|
||||
/* The datatype struct */
|
||||
/* Note we could speed things up a bit by caching the serialized datatype. We
|
||||
* may also not need to keep the type_id around. -NAF */
|
||||
typedef struct H5VL_rados_dtype_t {
|
||||
H5VL_rados_obj_t obj; /* Must be first */
|
||||
hid_t type_id;
|
||||
hid_t tcpl_id;
|
||||
hid_t tapl_id;
|
||||
} H5VL_rados_dtype_t;
|
||||
|
||||
/* The attribute struct */
|
||||
typedef struct H5VL_rados_attr_t {
|
||||
H5VL_rados_item_t item; /* Must be first */
|
||||
H5VL_rados_obj_t *parent;
|
||||
char *name;
|
||||
hid_t type_id;
|
||||
hid_t space_id;
|
||||
} H5VL_rados_attr_t;
|
||||
|
||||
/* The link value struct */
|
||||
typedef struct H5VL_rados_link_val_t {
|
||||
H5L_type_t type;
|
||||
union {
|
||||
uint64_t hard;
|
||||
char *soft;
|
||||
} target;
|
||||
} H5VL_rados_link_val_t;
|
||||
|
||||
extern hid_t H5VL_RADOS_g;
|
||||
|
||||
H5_DLL herr_t H5VL_rados_init(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* H5VLrados_H */
|
||||
54
src/H5VLrados_public.h
Normal file
54
src/H5VLrados_public.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* 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 COPYING file, which can be found at the root of the source code *
|
||||
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
||||
* If you do not have access to either file, you may request a copy from *
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* This source code was developed under the Mochi project
|
||||
* (https://www.mcs.anl.gov/research/projects/mochi), supported by the U.S.
|
||||
* Department of Energy, Office of Science, under contract DE-AC02-06CH11357.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Programmer: Neil Fortner <nfortne2@hdfgroup.gov>
|
||||
* December, 2016
|
||||
*
|
||||
* Purpose: The public header file for the RADOS VOL plugin.
|
||||
*/
|
||||
#ifndef H5VLrados_public_H
|
||||
#define H5VLrados_public_H
|
||||
|
||||
/* External headers needed by this file */
|
||||
#ifdef HDF5_USE_MOBJECT
|
||||
#include <librados-mobject-store.h>
|
||||
#else
|
||||
#include <rados/librados.h>
|
||||
#endif
|
||||
|
||||
/* Public headers needed by this file */
|
||||
#include "H5public.h"
|
||||
#include "H5Ipublic.h"
|
||||
|
||||
#define H5VL_RADOS_VERSION 1
|
||||
#define H5VL_RADOS_VALUE 268
|
||||
#define H5VL_RADOS_NAME "rados_vol_connector"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
H5_DLL herr_t H5VLrados_init(rados_t rados_cluster, const char *rados_pool);
|
||||
H5_DLL herr_t H5VLrados_term(void);
|
||||
H5_DLL herr_t H5Pset_fapl_rados(hid_t fapl_id, MPI_Comm comm, MPI_Info info);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* H5VLrados_public_H */
|
||||
@@ -118,6 +118,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
|
||||
H5VLnative_attr.c H5VLnative_dataset.c H5VLnative_datatype.c \
|
||||
H5VLnative_file.c H5VLnative_group.c H5VLnative_link.c H5VLnative_object.c \
|
||||
H5VLpassthru.c \
|
||||
H5VLrados.c \
|
||||
H5VM.c H5WB.c H5Z.c \
|
||||
H5Zdeflate.c H5Zfletcher32.c H5Znbit.c H5Zshuffle.c \
|
||||
H5Zscaleoffset.c H5Zszip.c H5Ztrans.c
|
||||
@@ -144,7 +145,9 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers
|
||||
H5MMpublic.h H5Opublic.h H5Ppublic.h \
|
||||
H5PLextern.h H5PLpublic.h \
|
||||
H5Rpublic.h H5Spublic.h H5Tpublic.h \
|
||||
H5VLnative.h H5VLpassthru.h H5VLpublic.h H5Zpublic.h
|
||||
H5VLnative.h H5VLpassthru.h H5VLpublic.h \
|
||||
H5VLrados_public.h \
|
||||
H5Zpublic.h
|
||||
|
||||
# install libhdf5.settings in lib directory
|
||||
settingsdir=$(libdir)
|
||||
|
||||
Reference in New Issue
Block a user