diff options
Diffstat (limited to 'tools/src/h5repack')
-rw-r--r-- | tools/src/h5repack/h5repack.c | 52 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_copy.c | 38 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_refs.c | 28 |
3 files changed, 59 insertions, 59 deletions
diff --git a/tools/src/h5repack/h5repack.c b/tools/src/h5repack/h5repack.c index e96dea5..c18df6c 100644 --- a/tools/src/h5repack/h5repack.c +++ b/tools/src/h5repack/h5repack.c @@ -483,7 +483,7 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p, } /*H5T_REFERENCE*/ if (options->verbose) - printf(FORMAT_OBJ_ATTR, "attr", name); + HDprintf(FORMAT_OBJ_ATTR, "attr", name); /*------------------------------------------------------------------------- * close @@ -545,7 +545,7 @@ static int check_options(pack_opt_t *options) { */ if (options->verbose && have_request(options) /* only print if requested */) { if (options->all_layout == 1) { - printf("All objects to modify layout are...\n"); + HDprintf("All objects to modify layout are...\n"); switch (options->layout_g) { case H5D_COMPACT: strcpy(slayout, "compact"); @@ -566,17 +566,17 @@ static int check_options(pack_opt_t *options) { strcpy(slayout, "invalid layout\n"); HGOTO_DONE(FAIL); } - printf(" Apply %s layout to all", slayout); + HDprintf(" Apply %s layout to all", slayout); if (H5D_CHUNKED == options->layout_g) { - printf("with dimension [ "); + HDprintf("with dimension [ "); for (j = 0; j < options->chunk_g.rank; j++) - printf("%d ", (int) options->chunk_g.chunk_lengths[j]); - printf("]"); + HDprintf("%d ", (int) options->chunk_g.chunk_lengths[j]); + HDprintf("]"); } - printf("\n"); + HDprintf("\n"); } else - printf("No all objects to modify layout\n"); + HDprintf("No all objects to modify layout\n"); }/* verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -584,16 +584,16 @@ static int check_options(pack_opt_t *options) { if (options->op_tbl->objs[i].chunk.rank > 0) { if (options->verbose) { - printf(" <%s> with chunk size ", name); + HDprintf(" <%s> with chunk size ", name); for (k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) - printf("%d ", (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); - printf("\n"); + HDprintf("%d ", (int) options->op_tbl->objs[i].chunk.chunk_lengths[k]); + HDprintf("\n"); } has_ck = 1; } else if (options->op_tbl->objs[i].chunk.rank == -2) { if (options->verbose) - printf(" <%s> %s\n", name, "NONE (contiguous)"); + HDprintf(" <%s> %s\n", name, "NONE (contiguous)"); has_ck = 1; } } @@ -608,33 +608,33 @@ static int check_options(pack_opt_t *options) { if (options->verbose && have_request(options) /* only print if requested */) { if (options->all_filter == 1) { - printf("All objects to apply filter are...\n"); + HDprintf("All objects to apply filter are...\n"); for (k = 0; k < options->n_filter_g; k++) { H5Z_filter_t filtn = options->filter_g[k].filtn; if (filtn < 0) { - printf(" Unknown\n"); + HDprintf(" Unknown\n"); continue; } switch (filtn) { case H5Z_FILTER_NONE: - printf(" Uncompress all\n"); + HDprintf(" Uncompress all\n"); break; case H5Z_FILTER_SHUFFLE: case H5Z_FILTER_FLETCHER32: - printf(" All with %s\n", get_sfilter(filtn)); + HDprintf(" All with %s\n", get_sfilter(filtn)); break; case H5Z_FILTER_SZIP: case H5Z_FILTER_DEFLATE: - printf(" All with %s, parameter %d\n", get_sfilter(filtn), options->filter_g[k].cd_values[0]); + HDprintf(" All with %s, parameter %d\n", get_sfilter(filtn), options->filter_g[k].cd_values[0]); break; default: - printf(" User Defined %d\n", filtn); + HDprintf(" User Defined %d\n", filtn); break; } /* k */ }; } else - printf("No all objects to apply filter\n"); + HDprintf("No all objects to apply filter\n"); } /* verbose */ for (i = 0; i < options->op_tbl->nelems; i++) { @@ -645,9 +645,9 @@ static int check_options(pack_opt_t *options) { if (options->verbose) { if(pack.filter[j].filtn >= 0) { if(pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET) - printf(" <%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 - printf(" <%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)); } } has_cp = 1; @@ -678,7 +678,7 @@ static int check_options(pack_opt_t *options) { */ if (options->ublock_filename != NULL && options->ublock_size == 0) { if (options->verbose) { - printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename); + HDprintf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename); options->ublock_size = 1024; } } @@ -747,19 +747,19 @@ static int check_objects(const char* fname, pack_opt_t *options) { */ if (options->verbose) - printf("Opening file. Searching %zu objects to modify ...\n", travt->nobjs); + HDprintf("Opening file. Searching %zu objects to modify ...\n", travt->nobjs); for (i = 0; i < options->op_tbl->nelems; i++) { char* name = options->op_tbl->objs[i].path; if (options->verbose) - printf(" <%s>", name); + HDprintf(" <%s>", name); /* 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", (options->verbose ? "\n" : ""), name, fname); if (options->verbose) - printf("...Found\n"); + HDprintf("...Found\n"); for (ifil = 0; ifil < options->op_tbl->objs[i].nfilters; ifil++) { if (options->op_tbl->objs[i].filter[ifil].filtn < 0) @@ -799,7 +799,7 @@ static int check_objects(const char* fname, pack_opt_t *options) { } if (csize < ppb) { - printf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); + HDprintf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n"); HGOTO_DONE(0); } } diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 8122d6d..13adb7c 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -296,7 +296,7 @@ print_user_block(fnamein, fidin); *------------------------------------------------------------------------- */ if (options->verbose) - printf("Making new file ...\n"); + HDprintf("Making new file ...\n"); if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fcreate could not create file <%s>:", fnameout); @@ -624,9 +624,9 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, */ if (options->verbose) { - printf("-----------------------------------------\n"); - printf(" Type Filter (Compression) Name\n"); - printf("-----------------------------------------\n"); + HDprintf("-----------------------------------------\n"); + HDprintf(" Type Filter (Compression) Name\n"); + HDprintf("-----------------------------------------\n"); } if (travt->objs) { @@ -645,7 +645,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, */ case H5TRAV_TYPE_GROUP: if (options->verbose) - printf(FORMAT_OBJ, "group", travt->objs[i].name); + HDprintf(FORMAT_OBJ, "group", travt->objs[i].name); /* open input group */ if ((grp_in = H5Gopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) @@ -880,7 +880,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, 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) - printf(" warning: could not create dataset <%s>. Applying original settings\n", travt->objs[i].name); + 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"); @@ -1043,10 +1043,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, (in case there was a filter) */ if (has_filter && apply_s == 0) - printf(" <warning: filter not applied to %s. dataset smaller than %d bytes>\n", travt->objs[i].name, (int) options->min_comp); + 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) - printf(" <warning: could not apply the filter to %s>\n", travt->objs[i].name); + HDprintf(" <warning: could not apply the filter to %s>\n", travt->objs[i].name); } /* verbose */ /*------------------------------------------------------------------------- @@ -1127,7 +1127,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed"); if (options->verbose) - printf(FORMAT_OBJ, "dset", travt->objs[i].name); + HDprintf(FORMAT_OBJ, "dset", travt->objs[i].name); } /* end do we have request for filter/chunking */ break; @@ -1138,7 +1138,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, */ case H5TRAV_TYPE_NAMED_DATATYPE: if (options->verbose) - printf(FORMAT_OBJ, "type", travt->objs[i].name); + HDprintf(FORMAT_OBJ, "type", travt->objs[i].name); if ((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed"); @@ -1177,13 +1177,13 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, case H5TRAV_TYPE_LINK: case H5TRAV_TYPE_UDLINK: if (options->verbose) - printf(FORMAT_OBJ, "link", travt->objs[i].name); + HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); if (H5Lcopy(fidin, travt->objs[i].name, fidout, travt->objs[i].name, H5P_DEFAULT, H5P_DEFAULT) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Lcopy failed"); if (options->verbose) - printf(FORMAT_OBJ, "link", travt->objs[i].name); + HDprintf(FORMAT_OBJ, "link", travt->objs[i].name); break; default: @@ -1278,7 +1278,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) { unsigned level = cd_values[0]; - sprintf(temp,"(%d)", level); + HDsprintf(temp,"(%d)", level); HDstrcat(strfilter, temp); } #endif @@ -1292,7 +1292,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) unsigned options_mask = cd_values[0]; /* from dcpl, not filt*/ unsigned ppb = cd_values[1]; - sprintf(temp,"(%d,", ppb); + HDsprintf(temp,"(%d,", ppb); HDstrcat(strfilter, temp); if (options_mask & H5_SZIP_EC_OPTION_MASK) HDstrcpy(temp, "EC) "); @@ -1326,15 +1326,15 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr) }/*i*/ if (!pr) - printf(FORMAT_OBJ, "dset", objname); + HDprintf(FORMAT_OBJ, "dset", objname); else { char str[512], temp[512]; HDstrcpy(str, "dset "); HDstrcat(str, strfilter); - sprintf(temp, " (%.3f:1)", ratio); + HDsprintf(temp, " (%.3f:1)", ratio); HDstrcat(str, temp); - printf(FORMAT_OBJ, str, objname); + HDprintf(FORMAT_OBJ, str, objname); } } @@ -1461,10 +1461,10 @@ print_user_block(const char *filename, hid_t fid) for (i = 0; i < nread; i++) { - printf("%c ", rbuf[i]); + HDprintf("%c ", rbuf[i]); } - printf("\n"); + HDprintf("\n"); if (nread < 0) { HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "nread < 0"); diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index f5846ba..7e8951f 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -158,7 +158,7 @@ int do_copy_refobjs(hid_t fidin, if(nelmts) { buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf==NULL) { - printf("cannot read into memory\n" ); + HDprintf("cannot read into memory\n" ); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) @@ -166,7 +166,7 @@ int do_copy_refobjs(hid_t fidin, refbuf = (hobj_ref_t*) HDcalloc((unsigned)nelmts, msize); if(refbuf == NULL){ - printf("cannot allocate memory\n" ); + HDprintf("cannot allocate memory\n" ); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ for(u = 0; u < nelmts; u++) { @@ -183,8 +183,8 @@ int do_copy_refobjs(hid_t fidin, if(H5Rcreate(&refbuf[u], fidout, refname, H5R_OBJECT, (hid_t)-1) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Rcreate failed"); if(options->verbose) { - printf(FORMAT_OBJ,"dset",travt->objs[i].name ); - printf("object <%s> object reference created to <%s>\n", + HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name ); + HDprintf("object <%s> object reference created to <%s>\n", travt->objs[i].name, refname); } @@ -234,7 +234,7 @@ int do_copy_refobjs(hid_t fidin, if(nelmts) { buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { - printf("cannot read into memory\n"); + HDprintf("cannot read into memory\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Dread(dset_in, mtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) @@ -246,7 +246,7 @@ int do_copy_refobjs(hid_t fidin, */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { - printf("cannot allocate memory\n"); + HDprintf("cannot allocate memory\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ @@ -271,8 +271,8 @@ int do_copy_refobjs(hid_t fidin, if(H5Sclose(region_id) < 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed"); if(options->verbose) { - printf(FORMAT_OBJ,"dset",travt->objs[i].name ); - printf("object <%s> region reference created to <%s>\n", + HDprintf(FORMAT_OBJ,"dset",travt->objs[i].name ); + HDprintf("object <%s> region reference created to <%s>\n", travt->objs[i].name, refname); } @@ -590,7 +590,7 @@ static int copy_refs_attr(hid_t loc_in, if((is_ref || is_ref_array) && (H5R_OBJ_REF_BUF_SIZE==msize)) { buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { - printf("cannot read into memory\n"); + HDprintf("cannot read into memory\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) @@ -598,7 +598,7 @@ static int copy_refs_attr(hid_t loc_in, refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); if(refbuf == NULL) { - printf("cannot allocate memory\n"); + HDprintf("cannot allocate memory\n"); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ @@ -611,7 +611,7 @@ static int copy_refs_attr(hid_t loc_in, buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); if(buf == NULL) { - printf( "cannot read into memory\n" ); + HDprintf( "cannot read into memory\n" ); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ if(H5Aread(attr_id, mtype_id, buf) < 0) @@ -623,7 +623,7 @@ static int copy_refs_attr(hid_t loc_in, */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ if(refbuf == NULL) { - printf( "cannot allocate memory\n" ); + HDprintf( "cannot allocate memory\n" ); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDcalloc failed"); } /* end if */ @@ -638,7 +638,7 @@ static int copy_refs_attr(hid_t loc_in, refbuf = buf; /* reuse the read buffer for write */ if(buf == NULL) { - printf( "cannot read into memory\n" ); + HDprintf( "cannot read into memory\n" ); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ @@ -679,7 +679,7 @@ static int copy_refs_attr(hid_t loc_in, refbuf = buf; /* reuse the read buffer for write */ if(buf == NULL) { - printf( "cannot read into memory\n" ); + HDprintf( "cannot read into memory\n" ); HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed"); } /* end if */ |