diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-08-28 19:47:26 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-08-28 19:47:26 (GMT) |
commit | f384b17625179b29475b2ec836c949fe3b9d5e44 (patch) | |
tree | 2adc53784220241216b8ef41697c9e984889575d /tools/h5repack/h5repack_copy.c | |
parent | a4c82ed0491ce7e28079cdde9745b8ddfa9d60bc (diff) | |
download | hdf5-f384b17625179b29475b2ec836c949fe3b9d5e44.zip hdf5-f384b17625179b29475b2ec836c949fe3b9d5e44.tar.gz hdf5-f384b17625179b29475b2ec836c949fe3b9d5e44.tar.bz2 |
[svn-r15551] 1) There are 2 new command line parameters for h5repack. Together they allow a call to H5Pset_alignment to be made
-t T, --threshold=T Threshold value for H5Pset_alignment
-a A, --alignment=A Alignment value for H5Pset_alignment
2) bug fix
the printing of the dataset name was not done for references (verbose mode)
tested: windows, linux
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 48 |
1 files changed, 44 insertions, 4 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index e9ddbe0..7f43ad0 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -31,8 +31,6 @@ extern char *progname; * macros *------------------------------------------------------------------------- */ -#define FORMAT_OBJ " %-27s %s\n" /* obj type, name */ -#define FORMAT_OBJ_ATTR " %-27s %s\n" /* obj type, name */ #define USERBLOCK_XFER_SIZE 512 /* size of buffer/# of bytes to xfer at a time when copying userblock */ /*------------------------------------------------------------------------- @@ -240,6 +238,48 @@ int copy_objects(const char* fnamein, } + + /*------------------------------------------------------------------------- + * set alignment options + *------------------------------------------------------------------------- + */ + + + if ( options->alignment > 0 ) + { + /* either use the FCPL already created or create a new one */ + if (fapl != H5P_DEFAULT) + { + + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) + { + error_msg(progname, "failed to set alignment\n"); + goto out; + } + + } + + else + { + + /* create a file access property list */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + { + error_msg(progname, "Could not create file access property list\n"); + goto out; + } + + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) + { + error_msg(progname, "failed to set alignment\n"); + goto out; + } + + } + + } + + /*------------------------------------------------------------------------- * create the output file *------------------------------------------------------------------------- @@ -588,7 +628,7 @@ int do_copy_objects(hid_t fidin, dsize_in=H5Dget_storage_size(dset_in); /* check for datasets too small */ - if (nelmts*msize < options->threshold ) + if (nelmts*msize < options->min_comp ) apply_s=0; /* apply the filter */ @@ -768,7 +808,7 @@ int do_copy_objects(hid_t fidin, 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->threshold); + (int)options->min_comp); if ( has_filter && apply_f == 0 ) printf(" <warning: could not apply the filter to %s>\n", |