summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-29 20:35:51 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-08-29 20:35:51 (GMT)
commit13f357a94693c720bf101119103902c63b027706 (patch)
treea450afdd25662e4d22a952ccf5e4daed0234f2be /tools/h5repack/h5repack_copy.c
parentca4379362b95dc8cc81152b8d994b72e7ca65eea (diff)
downloadhdf5-13f357a94693c720bf101119103902c63b027706.zip
hdf5-13f357a94693c720bf101119103902c63b027706.tar.gz
hdf5-13f357a94693c720bf101119103902c63b027706.tar.bz2
[svn-r15558] 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.c50
1 files changed, 45 insertions, 5 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 35bf1c9..7f43ad0 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -31,9 +31,7 @@ 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 */
+#define USERBLOCK_XFER_SIZE 512 /* size of buffer/# of bytes to xfer at a time when copying userblock */
/*-------------------------------------------------------------------------
* local functions
@@ -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",