diff options
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..8b6ace9 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_vol_1) { + if((fapl1_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info_1), 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_vol_2) { + if((fapl2_id = h5tools_get_fapl(H5P_DEFAULT, &(opts->vol_info_2), 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..8fe9d86 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 vol_info_1; /* VOL information for input file */ + h5tools_vol_info_t vol_info_2; /* VOL information for output file */ + hbool_t custom_vol_1; /* Using a custom input VOL? */ + hbool_t custom_vol_2; /* Using a custom output VOL? */ } diff_opt_t; |