summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5dump/h5dump_ddl.c16
-rw-r--r--tools/src/h5perf/pio_engine.c8
-rw-r--r--tools/src/h5perf/sio_engine.c8
-rw-r--r--tools/src/h5repack/h5repack_copy.c13
4 files changed, 30 insertions, 15 deletions
diff --git a/tools/src/h5dump/h5dump_ddl.c b/tools/src/h5dump/h5dump_ddl.c
index da9093c..8a02a49 100644
--- a/tools/src/h5dump/h5dump_ddl.c
+++ b/tools/src/h5dump/h5dump_ddl.c
@@ -920,7 +920,7 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
h5tool_format_t *outputformat = &h5tools_dataformat;
h5tool_format_t string_dataformat;
hid_t type, space;
- unsigned attr_crt_order_flags;
+ unsigned attr_crt_order_flags = 0;
hid_t dcpl_id; /* dataset creation property list ID */
h5tools_str_t buffer; /* string into which to render */
hsize_t curr_pos = 0; /* total data element position */
@@ -947,14 +947,16 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
outputformat = &string_dataformat;
if ((dcpl_id = H5Dget_create_plist(did)) < 0) {
- error_msg("error in getting creation property list ID\n");
+ error_msg("error in getting creation property list ID for dataset '%s'\n", name);
h5tools_setstatus(EXIT_FAILURE);
}
/* query the creation properties for attributes */
- if (H5Pget_attr_creation_order(dcpl_id, &attr_crt_order_flags) < 0) {
- error_msg("error in getting creation properties\n");
- h5tools_setstatus(EXIT_FAILURE);
+ if (dcpl_id >= 0) {
+ if (H5Pget_attr_creation_order(dcpl_id, &attr_crt_order_flags) < 0) {
+ error_msg("error in getting creation properties for dataset '%s'\n", name);
+ h5tools_setstatus(EXIT_FAILURE);
+ }
}
/* setup */
@@ -993,7 +995,9 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset)
h5tools_dump_dcpl(rawoutstream, outputformat, &ctx, dcpl_id, type, did);
h5dump_type_table = NULL;
}
- H5Pclose(dcpl_id);
+
+ if (dcpl_id >= 0)
+ H5Pclose(dcpl_id);
ctx.sset = sset;
ctx.display_index = dump_opts.display_ai;
diff --git a/tools/src/h5perf/pio_engine.c b/tools/src/h5perf/pio_engine.c
index 9b2c1c2..8830c82 100644
--- a/tools/src/h5perf/pio_engine.c
+++ b/tools/src/h5perf/pio_engine.c
@@ -52,15 +52,15 @@
#define ELMT_H5_TYPE H5T_NATIVE_UCHAR
#define GOTOERROR(errcode) \
- { \
+ do { \
ret_code = errcode; \
goto done; \
- }
+ } while (0)
#define ERRMSG(mesg) \
- { \
+ do { \
fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", mesg, (int)__LINE__, __FILE__); \
- }
+ } while (0)
/* verify: if val is false (0), print mesg. */
#define VRFY(val, mesg) \
diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c
index 849238f..1f73a62 100644
--- a/tools/src/h5perf/sio_engine.c
+++ b/tools/src/h5perf/sio_engine.c
@@ -34,14 +34,14 @@
#define ELMT_H5_TYPE H5T_NATIVE_UCHAR
#define GOTOERROR(errcode) \
- { \
+ do { \
ret_code = errcode; \
goto done; \
- }
+ } while (0)
#define ERRMSG(mesg) \
- { \
+ do { \
fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", mesg, (int)__LINE__, __FILE__); \
- }
+ } while (0)
/* verify: if val is false (0), print mesg. */
#define VRFY(val, mesg) \
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 0f270c5..81b33c3 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -653,6 +653,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
int ifil;
int is_ref = 0;
htri_t is_named;
+ htri_t is_vlen = 0;
hbool_t limit_maxdims;
hsize_t size_dset;
int ret_value = 0;
@@ -806,6 +807,10 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
if (H5T_REFERENCE == H5Tget_class(ftype_id))
is_ref = 1;
+ /* early detection of variable-length types */
+ if ((is_vlen = H5Tdetect_class(ftype_id, H5T_VLEN)) < 0)
+ H5TOOLS_GOTO_ERROR((-1), "H5Tdetect_class failed");
+
/* Check if the datatype is committed */
if ((is_named = H5Tcommitted(ftype_id)) < 0)
H5TOOLS_GOTO_ERROR((-1), "H5Tcommitted failed");
@@ -823,10 +828,16 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti
* check if we should use H5Ocopy or not
* if there is a request for filters/layout, we read/write the object
* otherwise we do a copy using H5Ocopy
+ *
+ * Note that H5Ocopy is currently unsafe to use for objects that reside in
+ * or interact with global heaps, such as variable-length datatypes. This
+ * appears to be due to H5Ocopy not correctly translating in the case where
+ * these objects move to different global heap addresses in the repacked
+ * file.
*-------------------------------------------------------------------------
*/
use_h5ocopy = !(options->op_tbl->nelems || options->all_filter == 1 ||
- options->all_layout == 1 || is_ref || is_named);
+ options->all_layout == 1 || is_ref || is_vlen || is_named);
/*
* Check if we are using different source and destination VOL connectors.