summaryrefslogtreecommitdiffstats
path: root/tools/src
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-10-02 20:38:39 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-10-02 20:38:39 (GMT)
commit574cc772d5a838cb346548cb61f2b747f4d58579 (patch)
tree35aec89caded2ddadffd9a407175139d6522a75e /tools/src
parentdb86b6d397866e971769ed5cacb3bdd75edb6e4e (diff)
parentbc6115931877c6f6d63977f2c03c5e2dbffe3e56 (diff)
downloadhdf5-574cc772d5a838cb346548cb61f2b747f4d58579.zip
hdf5-574cc772d5a838cb346548cb61f2b747f4d58579.tar.gz
hdf5-574cc772d5a838cb346548cb61f2b747f4d58579.tar.bz2
Merge pull request #1973 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'bc6115931877c6f6d63977f2c03c5e2dbffe3e56': HDFFV-10919 merge synching HDFFV-10408,10918 Add note
Diffstat (limited to 'tools/src')
-rw-r--r--tools/src/h5dump/h5dump.c3
-rw-r--r--tools/src/h5repack/h5repack.c89
-rw-r--r--tools/src/h5repack/h5repack_copy.c138
-rw-r--r--tools/src/h5repack/h5repack_main.c10
-rw-r--r--tools/src/misc/h5debug.c116
5 files changed, 122 insertions, 234 deletions
diff --git a/tools/src/h5dump/h5dump.c b/tools/src/h5dump/h5dump.c
index b1e736a..0579f63 100644
--- a/tools/src/h5dump/h5dump.c
+++ b/tools/src/h5dump/h5dump.c
@@ -1641,8 +1641,7 @@ main(int argc, const char *argv[])
fid = H5Fopen(fname, H5F_ACC_RDONLY, fapl_id);
}
else {
- fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT,
- driver, NULL, 0);
+ fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, driver, NULL, 0);
}
if (fid < 0) {
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c
index 24f4e6c..0183cbf 100644
--- a/tools/src/h5repack/h5repack.c
+++ b/tools/src/h5repack/h5repack.c
@@ -220,11 +220,7 @@ h5repack_addlayout(const char *str, pack_opt_t *options)
*-------------------------------------------------------------------------
*/
hid_t
-copy_named_datatype(hid_t type_in,
- hid_t fidout,
- named_dt_t **named_dt_head_p,
- trav_table_t *travt,
- pack_opt_t *options)
+copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options)
{
named_dt_t *dt = *named_dt_head_p; /* Stack pointer */
named_dt_t *dt_ret = NULL; /* Datatype to return */
@@ -248,8 +244,7 @@ copy_named_datatype(hid_t type_in,
if (travt->objs[i].type == H5TRAV_TYPE_NAMED_DATATYPE) {
/* Push onto the stack */
if (NULL == (dt = (named_dt_t *)HDmalloc(sizeof(named_dt_t))))
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "buffer allocation failed failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "buffer allocation failed failed");
dt->next = *named_dt_head_p;
*named_dt_head_p = dt;
@@ -289,8 +284,7 @@ copy_named_datatype(hid_t type_in,
else
dt_ret->id_out = H5Tcopy(type_in);
if (dt_ret->id_out < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Tget_native_type-H5Tcopy failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type-H5Tcopy failed");
if (H5Tcommit_anon(fidout, dt_ret->id_out, H5P_DEFAULT, H5P_DEFAULT) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tcommit_anon failed");
} /* end if named datatype not yet in output file */
@@ -347,12 +341,7 @@ done:
*-------------------------------------------------------------------------
*/
int
-copy_attr(
- hid_t loc_in,
- hid_t loc_out,
- named_dt_t **named_dt_head_p,
- trav_table_t *travt,
- pack_opt_t *options)
+copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, trav_table_t *travt, pack_opt_t *options)
{
int ret_value = 0;
hid_t attr_id = -1; /* attr ID */
@@ -382,13 +371,13 @@ copy_attr(
*/
for (u = 0; u < (unsigned) oinfo.num_attrs; u++) {
/* open attribute */
- attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t) u, H5P_DEFAULT, H5P_DEFAULT);
- if (attr_id < 0)
+ if ((attr_id = H5Aopen_by_idx(loc_in, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, (hsize_t) u, H5P_DEFAULT, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aopen_by_idx failed");
if (H5Aget_name(attr_id, (size_t) 255, name) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
+ /* get the file datatype */
if ((ftype_id = H5Aget_type(attr_id)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aget_type failed");
@@ -405,8 +394,7 @@ copy_attr(
/* Copy named dt */
if ((wtype_id = copy_named_datatype(ftype_id, fidout, named_dt_head_p, travt, options)) < 0) {
H5Fclose(fidout);
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "copy_named_datatype failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_named_datatype failed");
}
if (H5Fclose(fidout) < 0)
@@ -425,8 +413,7 @@ copy_attr(
/* get dimensions */
if ((rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Sget_simple_extent_dims failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
nelmts = 1;
for (j = 0; j < rank; j++)
@@ -622,8 +609,7 @@ check_options(pack_opt_t *options)
} /* end for each object in options */
if (options->all_layout == 1 && has_ck)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "invalid chunking input: 'all' option is present with other objects");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid chunking input: 'all' option is present with other objects");
/*-------------------------------------------------------------------------
* Objects to filter
@@ -669,14 +655,10 @@ check_options(pack_opt_t *options)
if (options->verbose) {
if (pack.filter[j].filtn >= 0) {
if (pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) {
- HDprintf(" <%s> with %s filter %d\n", name,
- get_sfilter(pack.filter[j].filtn),
- pack.filter[j].filtn);
+ HDprintf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), pack.filter[j].filtn);
}
else {
- HDprintf(" <%s> with %s filter\n",
- name,
- get_sfilter(pack.filter[j].filtn));
+ HDprintf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn));
}
}
}
@@ -685,9 +667,7 @@ check_options(pack_opt_t *options)
} /* end for each object in options table */
if (options->all_filter == 1 && has_cp)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "invalid compression input: 'all' option is present with " \
- "other objects");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid compression input: 'all' option is present with other objects");
/*-------------------------------------------------------------------------
* Check options for the latest format
@@ -695,18 +675,14 @@ check_options(pack_opt_t *options)
*/
if (options->grp_compact < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "invalid maximum number of links to store as header messages");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid maximum number of links to store as header messages");
if (options->grp_indexed < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "invalid minimum number of links to store in indexed format");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid minimum number of links to store in the indexed format");
if (options->grp_indexed > options->grp_compact)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "minimum indexed size is greater than maximum compact size");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "minimum indexed size is greater than the maximum compact size");
for (i = 0; i < 8; i++)
if (options->msg_size[i] < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "invalid shared message size");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid shared message size");
/*------------------------------------------------------------------------
* Verify new user userblock options; file name must be present
@@ -720,8 +696,7 @@ check_options(pack_opt_t *options)
}
if (options->ublock_filename == NULL && options->ublock_size != 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "file name missing for user block", options->ublock_filename);
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file name missing for user block", options->ublock_filename);
/*------------------------------------------------------------------------
* Verify alignment options; threshold is zero default but alignment not
@@ -729,8 +704,7 @@ check_options(pack_opt_t *options)
*/
if (options->alignment == 0 && options->threshold != 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "alignment for H5Pset_alignment missing");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "alignment for H5Pset_alignment missing");
done:
return ret_value;
@@ -765,8 +739,7 @@ check_objects(const char* fname, pack_opt_t *options)
*-------------------------------------------------------------------------
*/
if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR);
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR);
/*-------------------------------------------------------------------------
* get the list of objects in the file
@@ -775,6 +748,7 @@ check_objects(const char* fname, pack_opt_t *options)
/* Initialize indexing options */
h5trav_set_index(sort_by, sort_order);
+ /* init table */
trav_table_init(&travt);
/* get the list of objects in the file */
@@ -798,8 +772,7 @@ check_objects(const char* fname, pack_opt_t *options)
/* the input object names are present in the file and are valid */
if (h5trav_getindext(name, travt) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "%s Could not find <%s> in file <%s>. Exiting...\n",
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%s Could not find <%s> in file <%s>. Exiting...\n",
(options->verbose ? "\n" : ""), name, fname);
if (options->verbose)
HDprintf("...Found\n");
@@ -825,27 +798,21 @@ check_objects(const char* fname, pack_opt_t *options)
}
else {
if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Dopen2 failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
if ((sid = H5Dget_space(did)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Dget_space failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Sget_simple_extent_ndims failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
HDmemset(dims, 0, sizeof dims);
if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Sget_simple_extent_dims failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
for (j = 0; j < rank; j++)
csize *= dims[j];
if (H5Sclose(sid) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Sclose failed");
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
if (H5Dclose(did) < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g,
- "H5Dclose failed");
- } /* end else (chunk rank is 0) */
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
+ }
if (csize < ppb) {
HDprintf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n");
diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c
index 398d632..f6409e3 100644
--- a/tools/src/h5repack/h5repack_copy.c
+++ b/tools/src/h5repack/h5repack_copy.c
@@ -37,7 +37,7 @@
* local functions
*-------------------------------------------------------------------------
*/
-static int Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
+static int get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p);
static void print_dataset_info(hid_t dcpl_id, char *objname, double per, int pr);
static int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
@@ -145,8 +145,7 @@ copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
/* Adjust group creation parameters for root group */
/* (So that it is created in "dense storage" form) */
- if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact,
- (unsigned) options->grp_indexed) < 0)
+ if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact, (unsigned) options->grp_indexed) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed to adjust group creation parameters for root group");
for (i = 0; i < 5; i++) {
@@ -368,7 +367,7 @@ done:
} /* end copy_objects() */
/*-------------------------------------------------------------------------
- * Function: Get_hyperslab
+ * Function: get_hyperslab
*
* Purpose: Calulate a hyperslab from a dataset for higher performance.
* The size of hyperslab is limitted by H5TOOLS_BUFSIZE.
@@ -400,7 +399,7 @@ done:
*-----------------------------------------*/
int
-Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
+get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
size_t size_datum, hsize_t dims_hslab[], hsize_t * hslab_nbytes_p)
{
int ret_value = 0;
@@ -521,7 +520,7 @@ Get_hyperslab(hid_t dcpl_id, int rank_dset, hsize_t dims_dset[],
done:
return ret_value;
-} /* end Get_hyperslab() */
+} /* end get_hyperslab() */
/*-------------------------------------------------------------------------
* Function: do_copy_objects
@@ -569,7 +568,7 @@ done:
* in (2) is that, when using the strip mine size, it assures that the "remaining" part
* of the dataset that does not fill an entire strip mine is processed.
*
- * 1. figure out a hyperslab (dimentions) and size (refer to Get_hyperslab()).
+ * 1. figure out a hyperslab (dimentions) and size (refer to get_hyperslab()).
* 2. Calculate the hyperslab selections as the selection is moving forward.
* Selection would be same as the hyperslab except for the remaining edge portion
* of the dataset. The code take care of the remaining portion if exist.
@@ -678,11 +677,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
}
else {
if (options->grp_compact > 0 || options->grp_indexed > 0)
- if (H5Pset_link_phase_change(
- gcpl_out,
- (unsigned) options->grp_compact,
- (unsigned) options->grp_indexed)
- < 0)
+ if (H5Pset_link_phase_change(gcpl_out, (unsigned) options->grp_compact, (unsigned) options->grp_indexed) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed");
if ((grp_out = H5Gcreate2(fidout, travt->objs[i].name, H5P_DEFAULT, gcpl_out, H5P_DEFAULT)) < 0)
@@ -799,8 +794,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
if ((dcpl_out = H5Pcreate(H5P_DATASET_CREATE)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed");
}
- else
- if ((dcpl_out = H5Pcopy(dcpl_in)) < 0) {
+ else if ((dcpl_out = H5Pcopy(dcpl_in)) < 0) {
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed");
}
@@ -847,25 +841,14 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
* changing to COMPACT. For the reference, COMPACT is limited
* by size 64K by library.
*/
- if (options->layout_g != H5D_COMPACT) {
- if (size_dset < options->min_comp) {
+ if (options->layout_g != H5D_COMPACT)
+ if (size_dset < options->min_comp)
apply_s = 0;
- }
- }
/* apply the filter */
- if (apply_s) {
- if (apply_filters(
- travt->objs[i].name,
- rank,
- dims,
- msize,
- dcpl_out,
- options,
- &has_filter)
- < 0)
+ if (apply_s)
+ if (apply_filters(travt->objs[i].name, rank, dims, msize, dcpl_out, options, &has_filter) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "apply_filters failed");
- }
/* only if layout change requested for entire file or
* individual obj */
@@ -904,36 +887,13 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
* modified dcpl; in that case use the original instead
*-------------------------------------------------------------------------
*/
- dset_out = H5Dcreate2(fidout,
- travt->objs[i].name,
- wtype_id,
- f_space_id,
- H5P_DEFAULT,
- dcpl_out,
- H5P_DEFAULT);
- /* if unable to create, retry with original DCPL */
- if (dset_out < 0) {
- H5Epush2(H5tools_ERR_STACK_g,
- __FILE__,
- FUNC,
- __LINE__,
- H5tools_ERR_CLS_g,
- H5E_tools_g,
- H5E_tools_min_id_g,
- "H5Dcreate2 failed");
- if (options->verbose) {
- HDprintf(" warning: could not create dataset <%s>. Applying original settings\n",
- travt->objs[i].name);
- }
- dset_out = H5Dcreate2(
- fidout,
- travt->objs[i].name,
- wtype_id,
- f_space_id,
- H5P_DEFAULT,
- dcpl_in,
- H5P_DEFAULT);
- if (dset_out < 0)
+ dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_out, H5P_DEFAULT);
+ if (dset_out == FAIL) {
+ H5Epush2(H5tools_ERR_STACK_g, __FILE__, FUNC, __LINE__, H5tools_ERR_CLS_g, H5E_tools_g, H5E_tools_min_id_g, "H5Dcreate2 failed");
+ if (options->verbose)
+ HDprintf(" warning: could not create dataset <%s>. Applying original settings\n", travt->objs[i].name);
+
+ if ((dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_in, H5P_DEFAULT)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed");
apply_f = 0;
} /* end if retry dataset create */
@@ -1003,15 +963,9 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
dcpl_tmp = dcpl_in; /* reading dataset */
}
- if (Get_hyperslab(
- dcpl_tmp,
- rank,
- dims,
- p_type_nbytes,
- hslab_dims,
- &hslab_nbytes)
- < 0)
- HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Get_hyperslab failed");
+ /* get hyperslab dims and size in byte */
+ if (get_hyperslab(dcpl_tmp, rank, dims, p_type_nbytes, hslab_dims, &hslab_nbytes) < 0)
+ HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "get_hyperslab failed");
hslab_buf = HDmalloc((size_t)hslab_nbytes);
if (hslab_buf == NULL)
@@ -1033,30 +987,14 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
*/
for (k = 0, hs_select_nelmts = 1; k < rank; k++) {
/* MIN() is used to get the remaining edge portion if exist.
- * "dims[k] - hs_sel_offset[k]" is remaining edge portion that is
- * smaller then the hyperslab.
- */
+ * "dims[k] - hs_sel_offset[k]" is remaining edge portion that is smaller then the hyperslab.*/
hs_sel_count[k] = MIN(dims[k] - hs_sel_offset[k], hslab_dims[k]);
hs_select_nelmts *= hs_sel_count[k];
}
- if (H5Sselect_hyperslab(
- f_space_id,
- H5S_SELECT_SET,
- hs_sel_offset,
- NULL,
- hs_sel_count,
- NULL)
- < 0)
+ if (H5Sselect_hyperslab(f_space_id, H5S_SELECT_SET, hs_sel_offset, NULL, hs_sel_count, NULL) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
- if (H5Sselect_hyperslab(
- hslab_space,
- H5S_SELECT_SET,
- zero,
- NULL,
- &hs_select_nelmts,
- NULL)
- < 0)
+ if (H5Sselect_hyperslab(hslab_space, H5S_SELECT_SET, zero, NULL, &hs_select_nelmts, NULL) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
} /* end if rank > 0 */
else {
@@ -1065,25 +1003,12 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
hs_select_nelmts = 1;
} /* end (else) rank == 0 */
- if (H5Dread(
- dset_in,
- wtype_id,
- hslab_space,
- f_space_id,
- H5P_DEFAULT,
- hslab_buf)
- < 0)
+ if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
- if (H5Dwrite(
- dset_out,
- wtype_id,
- hslab_space,
- f_space_id,
- H5P_DEFAULT,
- hslab_buf)
- < 0)
+ if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dwrite failed");
+ /* reclaim any VL memory, if necessary */
if (vl_data)
H5Dvlen_reclaim(wtype_id, hslab_space, H5P_DEFAULT, hslab_buf);
@@ -1129,11 +1054,8 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
/* print a message that the filter was not applied
* (in case there was a filter)
*/
- if (has_filter && apply_s == 0) {
- HDprintf(" <warning: filter not applied to %s. dataset smaller than %d bytes>\n",
- travt->objs[i].name,
- (int) options->min_comp);
- }
+ if (has_filter && apply_s == 0)
+ HDprintf(" <warning: filter not applied to %s. dataset smaller than %d bytes>\n", travt->objs[i].name, (int) options->min_comp);
if (has_filter && apply_f == 0)
HDprintf(" <warning: could not apply the filter to %s>\n", travt->objs[i].name);
diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c
index db821ef..c628beb 100644
--- a/tools/src/h5repack/h5repack_main.c
+++ b/tools/src/h5repack/h5repack_main.c
@@ -237,11 +237,6 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, " Using latest file format with maximum compact group size of 10 and\n");
PRINTVALSTREAM(rawoutstream, " minimum shared datatype size of 20\n");
PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, "5) h5repack --low=0 --high=1 file1 file2\n");
- PRINTVALSTREAM(rawoutstream, "\n");
- PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via\n");
- PRINTVALSTREAM(rawoutstream, " H5Pset_libver_bounds() when creating the repacked file, file2\n");
- PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, "5) h5repack -f SHUF -f GZIP=1 file1 file2\n");
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Add both filters SHUF and GZIP in this order to all datasets\n");
@@ -250,6 +245,11 @@ static void usage(const char *prog) {
PRINTVALSTREAM(rawoutstream, "\n");
PRINTVALSTREAM(rawoutstream, " Add bzip2 filter to all datasets\n");
PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "7) h5repack --low=0 --high=1 file1 file2\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via\n");
+ PRINTVALSTREAM(rawoutstream, " H5Pset_libver_bounds() when creating the repacked file, file2\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
}
/*-------------------------------------------------------------------------
diff --git a/tools/src/misc/h5debug.c b/tools/src/misc/h5debug.c
index 96d6b9f..b28457e 100644
--- a/tools/src/misc/h5debug.c
+++ b/tools/src/misc/h5debug.c
@@ -254,7 +254,7 @@ main(int argc, char *argv[])
uint8_t sig[H5F_SIGNATURE_LEN];
size_t u;
H5E_auto2_t func;
- void *edata;
+ void *edata;
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
herr_t status = SUCCEED;
@@ -274,8 +274,8 @@ main(int argc, char *argv[])
H5Eset_auto2(H5E_DEFAULT, NULL, NULL);
/*
- * Open the file and get the file descriptor.
- */
+ * Open the file and get the file descriptor.
+ */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
HDfprintf(stderr, "cannot create file access property list\n");
HDexit(1);
@@ -309,8 +309,8 @@ main(int argc, char *argv[])
}
/*
- * Parse command arguments.
- */
+ * Parse command arguments.
+ */
if(argc > 2)
addr = (haddr_t)HDstrtoll(argv[2], NULL, 0);
if(argc > 3)
@@ -323,8 +323,8 @@ main(int argc, char *argv[])
extra4 = (haddr_t)HDstrtoll(argv[6], NULL, 0);
/*
- * Read the signature at the specified file position.
- */
+ * Read the signature at the specified file position.
+ */
HDfprintf(stdout, "Reading signature at address %a (rel)\n", addr);
if(H5F_block_read(f, H5FD_MEM_SUPER, addr, sizeof(sig), sig) < 0) {
HDfprintf(stderr, "cannot read signature\n");
@@ -332,28 +332,28 @@ main(int argc, char *argv[])
}
if(!HDmemcmp(sig, H5F_SIGNATURE, (size_t)H5F_SIGNATURE_LEN)) {
/*
- * Debug the file's super block.
- */
+ * Debug the file's super block.
+ */
status = H5F_debug(f, stdout, 0, VCOL);
} else if(!HDmemcmp(sig, H5HL_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a local heap.
- */
+ * Debug a local heap.
+ */
status = H5HL_debug(f, addr, stdout, 0, VCOL);
}
else if(!HDmemcmp (sig, H5HG_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a global heap collection.
- */
+ * Debug a global heap collection.
+ */
status = H5HG_debug(f, addr, stdout, 0, VCOL);
}
else if(!HDmemcmp(sig, H5G_NODE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a symbol table node.
- */
+ * Debug a symbol table node.
+ */
/* Check for extra parameters */
if(extra == 0) {
@@ -367,10 +367,10 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5B_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a B-tree. B-trees are debugged through the B-tree
- * subclass. The subclass identifier is the byte immediately
- * after the B-tree signature.
- */
+ * Debug a B-tree. B-trees are debugged through the B-tree
+ * subclass. The subclass identifier is the byte immediately
+ * after the B-tree signature.
+ */
H5B_subid_t subtype = (H5B_subid_t)sig[H5_SIZEOF_MAGIC];
unsigned ndims;
uint32_t dim[H5O_LAYOUT_NDIMS];
@@ -435,8 +435,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5B2_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a v2 B-tree header.
- */
+ * Debug a v2 B-tree header.
+ */
const H5B2_class_t *cls = get_H5B2_class(sig);
HDassert(cls);
@@ -452,8 +452,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5B2_INT_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a v2 B-tree internal node.
- */
+ * Debug a v2 B-tree internal node.
+ */
const H5B2_class_t *cls = get_H5B2_class(sig);
HDassert(cls);
@@ -479,8 +479,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5B2_LEAF_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a v2 B-tree leaf node.
- */
+ * Debug a v2 B-tree leaf node.
+ */
const H5B2_class_t *cls = get_H5B2_class(sig);
HDassert(cls);
@@ -505,15 +505,15 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5HF_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a fractal heap header.
- */
+ * Debug a fractal heap header.
+ */
status = H5HF_hdr_debug(f, addr, stdout, 0, VCOL);
}
else if(!HDmemcmp(sig, H5HF_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a fractal heap direct block.
- */
+ * Debug a fractal heap direct block.
+ */
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
@@ -528,8 +528,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5HF_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a fractal heap indirect block.
- */
+ * Debug a fractal heap indirect block.
+ */
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
@@ -544,16 +544,16 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5FS_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a free space header.
- */
+ * Debug a free space header.
+ */
status = H5FS_debug(f, addr, stdout, 0, VCOL);
}
else if(!HDmemcmp(sig, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug free space serialized sections.
- */
+ * Debug free space serialized sections.
+ */
/* Check for enough valid parameters */
if(extra == 0 || extra2 == 0) {
@@ -568,16 +568,16 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5SM_TABLE_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug shared message master table.
- */
+ * Debug shared message master table.
+ */
status = H5SM_table_debug(f, addr, stdout, 0, VCOL, (unsigned) UFAIL, (unsigned) UFAIL);
}
else if(!HDmemcmp(sig, H5SM_LIST_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug shared message list index.
- */
+ * Debug shared message list index.
+ */
/* Check for enough valid parameters */
if(extra == 0) {
@@ -592,8 +592,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5EA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray header.
- */
+ * Debug an extensible aray header.
+ */
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -610,8 +610,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5EA_IBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray index block.
- */
+ * Debug an extensible aray index block.
+ */
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -628,8 +628,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5EA_SBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray super block.
- */
+ * Debug an extensible aray super block.
+ */
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -646,8 +646,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5EA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug an extensible aray data block.
- */
+ * Debug an extensible aray data block.
+ */
const H5EA_class_t *cls = get_H5EA_class(sig);
HDassert(cls);
@@ -664,8 +664,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5FA_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a fixed array header.
- */
+ * Debug a fixed array header.
+ */
const H5FA_class_t *cls = get_H5FA_class(sig);
HDassert(cls);
@@ -682,8 +682,8 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5FA_DBLOCK_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug a fixed array data block.
- */
+ * Debug a fixed array data block.
+ */
const H5FA_class_t *cls = get_H5FA_class(sig);
HDassert(cls);
@@ -700,24 +700,24 @@ main(int argc, char *argv[])
}
else if(!HDmemcmp(sig, H5O_HDR_MAGIC, (size_t)H5_SIZEOF_MAGIC)) {
/*
- * Debug v2 object header (which have signatures).
- */
+ * Debug v2 object header (which have signatures).
+ */
status = H5O_debug(f, addr, stdout, 0, VCOL);
}
else if(sig[0] == H5O_VERSION_1) {
/*
- * This could be a v1 object header. Since they don't have a signature
- * it's a somewhat "ify" detection.
- */
+ * This could be a v1 object header. Since they don't have a signature
+ * it's a somewhat "ify" detection.
+ */
status = H5O_debug(f, addr, stdout, 0, VCOL);
}
else {
/*
- * Got some other unrecognized signature.
- */
+ * Got some other unrecognized signature.
+ */
HDprintf("%-*s ", VCOL, "Signature:");
for (u = 0; u < sizeof(sig); u++) {
if (sig[u] > ' ' && sig[u] <= '~' && '\\' != sig[u])