diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-04-21 18:36:10 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-04-21 18:36:10 (GMT) |
commit | 8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23 (patch) | |
tree | 5c5dce61c112c4f31ec0bfb5b65b00f2157269a7 /tools/lib | |
parent | c6097935d5be4c3750b9bf9167783ad28158905b (diff) | |
download | hdf5-8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23.zip hdf5-8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23.tar.gz hdf5-8cd9d8349e5984d8a6f78c9c0c1bb566a9960b23.tar.bz2 |
Added VOL command-line options to (p)h5diff, h5ls, h5dump, and h5mkgrp.
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5diff.c | 29 | ||||
-rw-r--r-- | tools/lib/h5diff.h | 5 |
2 files changed, 30 insertions, 4 deletions
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index fff0b9a..d11d28f 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -519,6 +519,8 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char { hid_t file1_id = H5I_INVALID_HID; hid_t file2_id = H5I_INVALID_HID; + hid_t fapl1_id = H5P_DEFAULT; + hid_t fapl2_id = H5P_DEFAULT; char filenames[2][MAX_FILENAME]; hsize_t nfound = 0; int l_ret1 = -1; @@ -570,17 +572,32 @@ h5diff(const char *fname1, const char *fname2, const char *objname1, const char *------------------------------------------------------------------------- */ /* open file 1 */ - if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { + if (opts->custom_in_vol) { + if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->in_vol_info), NULL)) < 0 ) { + parallel_print("h5diff: unable to create fapl for input file\n"); + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create input fapl\n"); + } + } + + if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, fapl1_id, FALSE, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname1); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname1); - } /* end if */ + } H5TOOLS_DEBUG("file1_id = %s", fname1); /* open file 2 */ - if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, FALSE, NULL, (size_t)0)) < 0) { + + if (opts->custom_out_vol) { + if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->out_vol_info), NULL)) < 0 ) { + parallel_print("h5diff: unable to create fapl for output file\n"); + H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "unable to create output fapl\n"); + } + } + + if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, fapl2_id, FALSE, NULL, (size_t)0)) < 0) { parallel_print("h5diff: <%s>: unable to open file\n", fname2); H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "<%s>: unable to open file\n", fname2); - } /* end if */ + } H5TOOLS_DEBUG("file2_id = %s", fname2); /*------------------------------------------------------------------------- @@ -967,6 +984,10 @@ done: { H5Fclose(file1_id); H5Fclose(file2_id); + if (fapl1_id != H5P_DEFAULT) + H5Pclose(fapl1_id); + if (fapl2_id != H5P_DEFAULT) + H5Pclose(fapl2_id); } H5E_END_TRY; H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat); diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index b04ec23..1ac1dd7 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -15,6 +15,7 @@ #define H5DIFF_H__ #include "hdf5.h" +#include "h5tools.h" #include "h5trav.h" /* @@ -86,6 +87,10 @@ typedef struct { int m_list_not_cmp; /* list not comparable messages */ int exclude_path; /* exclude path to an object */ struct exclude_path_list * exclude; /* keep exclude path list */ + h5tools_vol_info_t in_vol_info; /* VOL information for input file */ + h5tools_vol_info_t out_vol_info; /* VOL information for output file */ + hbool_t custom_in_vol; /* Using a custom input VOL? */ + hbool_t custom_out_vol; /* Using a custom output VOL? */ } diff_opt_t; |