summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-08-02 19:54:40 (GMT)
committerGitHub <noreply@github.com>2022-08-02 19:54:40 (GMT)
commitfcf41b3cd60df51af9be529e379a9dd6c488d088 (patch)
treee486d5f8254a33b978c34069b9810ce171ba7c2c /tools/lib
parentea13de1bb0aba8a97c75f10343dc4c792193b215 (diff)
downloadhdf5-fcf41b3cd60df51af9be529e379a9dd6c488d088.zip
hdf5-fcf41b3cd60df51af9be529e379a9dd6c488d088.tar.gz
hdf5-fcf41b3cd60df51af9be529e379a9dd6c488d088.tar.bz2
Onion VFD (#1953)
* Onion VFD feature * Fixes onion VFD errors with non-sec2 backing store VFDs * Disables the onion VFD tests w/ ph5diff * Disables non-sec2 VFDs as onion VFD backing stores * Committing clang-format changes * Formatted source * Typo * Adds onion VFD tools tests to CMake * Fixes for v16 API compatibility * Memset structs to avoid bad frees on errors * H5Dwrite() calls now use H5T_NATIVE_INT as the memory type vs LE * Properly decodes checksums on BE machines * Be more careful about uint64_t to haddr_t/hsize_t conversions * Another fix for BE data comparison * Removed double underscores from onion constants * Replace hard-coded onion header string w/ constant * Fixes cleanup paths in H5FD__onion_ingest_history() * Fixed use of size_t revision numbers * Fix h5dump revision count format string Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff.c17
-rw-r--r--tools/lib/h5tools.c8
-rw-r--r--tools/lib/h5tools.h1
3 files changed, 24 insertions, 2 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 7eb17ba..0bad3fe 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -648,8 +648,15 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
*-------------------------------------------------------------------------
*/
/* open file 1 */
+ if (opts->vfd_info[0].u.name) {
+ if ((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &(opts->vfd_info[0]))) < 0) {
+ parallel_print("h5diff: unable to create fapl for input file\n");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n");
+ }
+ }
+
if (opts->custom_vol[0] || opts->custom_vfd[0]) {
- if ((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, opts->custom_vol[0] ? &(opts->vol_info[0]) : NULL,
+ if ((fapl1_id = h5tools_get_fapl(fapl1_id, opts->custom_vol[0] ? &(opts->vol_info[0]) : NULL,
opts->custom_vfd[0] ? &(opts->vfd_info[0]) : NULL)) < 0) {
parallel_print("h5diff: unable to create fapl for input file\n");
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n");
@@ -664,9 +671,15 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char
H5TOOLS_DEBUG("file1_id = %s", fname1);
/* open file 2 */
+ if (opts->vfd_info[1].u.name) {
+ if ((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, NULL, &(opts->vfd_info[1]))) < 0) {
+ parallel_print("h5diff: unable to create fapl for output file\n");
+ H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n");
+ }
+ }
if (opts->custom_vol[1] || opts->custom_vfd[1]) {
- if ((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, opts->custom_vol[1] ? &(opts->vol_info[1]) : NULL,
+ if ((fapl2_id = h5tools_get_fapl(fapl2_id, opts->custom_vol[1] ? &(opts->vol_info[1]) : NULL,
opts->custom_vfd[1] ? &(opts->vfd_info[1]) : NULL)) < 0) {
parallel_print("h5diff: unable to create fapl for output file\n");
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n");
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 93886d2..9c4f746 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -85,6 +85,7 @@ const char *drivernames[] = {
[WINDOWS_VFD_IDX] = "windows", [STDIO_VFD_IDX] = "stdio", [CORE_VFD_IDX] = "core",
[FAMILY_VFD_IDX] = "family", [SPLIT_VFD_IDX] = "split", [MULTI_VFD_IDX] = "multi",
[MPIO_VFD_IDX] = "mpio", [ROS3_VFD_IDX] = "ros3", [HDFS_VFD_IDX] = "hdfs",
+ [ONION_VFD_IDX] = "onion",
};
#define NUM_VOLS (sizeof(volnames) / sizeof(volnames[0]))
@@ -573,6 +574,13 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info)
H5TOOLS_GOTO_ERROR(FAIL, "The HDFS VFD is not enabled");
#endif
}
+ else if (!HDstrcmp(vfd_info->u.name, drivernames[ONION_VFD_IDX])) {
+ /* Onion driver */
+ if (!vfd_info->info)
+ H5TOOLS_GOTO_ERROR(FAIL, "Onion VFD info is invalid");
+ if (H5Pset_fapl_onion(fapl_id, (const H5FD_onion_fapl_info_t *)vfd_info->info) < 0)
+ H5TOOLS_GOTO_ERROR(FAIL, "H5Pset_fapl_onion() failed");
+ }
else {
/*
* Try to load VFD plugin.
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index 0620791..6561b68 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -600,6 +600,7 @@ typedef enum {
MPIO_VFD_IDX,
ROS3_VFD_IDX,
HDFS_VFD_IDX,
+ ONION_VFD_IDX,
} driver_idx;
/* The following include, h5tools_str.h, must be after the