summaryrefslogtreecommitdiffstats
path: root/tools/h5repack
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5repack')
-rw-r--r--tools/h5repack/h5repack.c4
-rw-r--r--tools/h5repack/h5repack.h14
-rw-r--r--tools/h5repack/h5repack_copy.c20
-rw-r--r--tools/h5repack/h5repack_filters.c2
-rw-r--r--tools/h5repack/h5repack_main.c42
-rw-r--r--tools/h5repack/testh5repack_main.c23
6 files changed, 58 insertions, 47 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index a6a6989..37ef3d1 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -73,8 +73,8 @@ int h5repack(const char* infile,
if (check_objects(infile,options)<0)
return -1;
- /* copy the file */
- if (copy_file(infile,outfile,options)<0)
+ /* copy the objects */
+ if (copy_objects(infile,outfile,options)<0)
return -1;
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h
index 0b82aea..2d4ad5d 100644
--- a/tools/h5repack/h5repack.h
+++ b/tools/h5repack/h5repack.h
@@ -139,18 +139,18 @@ int h5repack_cmpdcpl (const char *fname1,
int check_objects(const char* fname,
pack_opt_t *options);
-int copy_file(const char* fnamein,
- const char* fnameout,
- pack_opt_t *options);
+int copy_objects(const char* fnamein,
+ const char* fnameout,
+ pack_opt_t *options);
void print_objlist(const char *filename,
int nobjects,
trav_info_t *travi );
-int do_copy_file(hid_t fidin,
- hid_t fidout,
- trav_table_t *travt,
- pack_opt_t *options);
+int do_copy_objects(hid_t fidin,
+ hid_t fidout,
+ trav_table_t *travt,
+ pack_opt_t *options);
int copy_attr(hid_t loc_in,
hid_t loc_out,
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 6b5a393..be263ae 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -20,7 +20,7 @@
#include "h5repack.h"
/*-------------------------------------------------------------------------
- * Function: copy_file
+ * Function: copy_objects
*
* Purpose: duplicate all HDF5 objects in the file
*
@@ -33,9 +33,9 @@
*-------------------------------------------------------------------------
*/
-int copy_file(const char* fnamein,
- const char* fnameout,
- pack_opt_t *options)
+int copy_objects(const char* fnamein,
+ const char* fnameout,
+ pack_opt_t *options)
{
hid_t fidin;
hid_t fidout;
@@ -81,7 +81,7 @@ int copy_file(const char* fnamein,
* do the copy
*-------------------------------------------------------------------------
*/
- if(do_copy_file(fidin,fidout,travt,options)<0) {
+ if(do_copy_objects(fidin,fidout,travt,options)<0) {
printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein, fnameout);
goto out;
}
@@ -127,7 +127,7 @@ out:
/*-------------------------------------------------------------------------
- * Function: do_copy_file
+ * Function: do_copy_objects
*
* Purpose: duplicate all HDF5 objects in the file
*
@@ -140,10 +140,10 @@ out:
*-------------------------------------------------------------------------
*/
-int do_copy_file(hid_t fidin,
- hid_t fidout,
- trav_table_t *travt,
- pack_opt_t *options) /* repack options */
+int do_copy_objects(hid_t fidin,
+ hid_t fidout,
+ trav_table_t *travt,
+ pack_opt_t *options) /* repack options */
{
hid_t grp_in; /* group ID */
hid_t grp_out; /* group ID */
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index ebb65e1..e3edb8a 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -182,7 +182,7 @@ int apply_filters(hid_t dcpl_id,
unsigned szip_options_mask=H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block;
- /* get information about filters */
+ /* get information about input filters */
if ((nfilters = H5Pget_nfilters(dcpl_id))<0)
return -1;
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 0c02894..8ae0f91 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -22,7 +22,7 @@ static void usage(void);
/*
Examples of use:
--v -i file1.h5 -o file2.h5 -f "dataset:GZIP 6" -l "dataset:2x2"
+-v -i file1.h5 -o file2.h5 -f "dataset:GZIP 6" -l "dataset:CHUNK 2x2"
-v -i file1.h5 -o file2.h5 -f "GZIP 6"
*/
@@ -89,7 +89,7 @@ int main(int argc, char **argv)
/* pack it */
h5repack(infile,outfile,&options);
-
+
/* free tables */
h5repack_end(&options);
@@ -110,10 +110,44 @@ int main(int argc, char **argv)
static
void usage(void)
{
-
+ printf("h5repack -i input -o output [-h] [-v] [-t 'comp_info'] [-c 'chunk_info'][-m number] \n");
+ printf("\n");
+ printf("-i input Input HDF5 File\n");
+ printf("-o output Output HDF5 File\n");
+ printf("[-h] Print usage message\n");
+ printf("[-f 'filter'] Filter type: 'filter' is a string with the format\n");
+ printf(" <list of objects> : <name of filter> <filter parameters>\n");
+ printf(" <list of objects> is a comma separated list of object names\n");
+ printf(" meaning apply compression only to those objects.\n");
+ printf(" if no object names are specified, the filter is applied to all objects\n");
+ printf(" <name of filter> can be:\n");
+ printf(" GZIP, to apply the HDF5 GZIP filter (GZIP compression)\n");
+ printf(" SZIP, to apply the HDF5 SZIP filter (SZIP compression)\n");
+ printf(" SHUF, to apply the HDF5 shuffle filter\n");
+ printf(" FLET, to apply the HDF5 checksum filter\n");
+ printf(" NONE, to remove the filter\n");
+ printf(" <filter parameters> is optional compression info\n");
+ printf(" GZIP, the deflation level\n");
+ printf(" SZIP, the pixels per block parameter\n");
+ printf("[-l 'layout'] Layout type. 'layout' is a string with the format\n");
+ printf(" <list of objects> : <layout type>\n");
+ printf(" <list of objects> is a comma separated list of object names,\n");
+ printf(" meaning that layout information is supplied for those objects.\n");
+ printf(" if no object names are specified, the layout is applied to all objects\n");
+ printf(" <layout type> can be:\n");
+ printf(" CHUNK, to apply chunking layout\n");
+ printf(" COMPA, to apply compact layout\n");
+ printf(" CONTI, to apply continuous layout\n");
+ printf(" <layout parameters> is present for the chunk case only\n");
+ printf(" it is the chunk size of each dimension:\n");
+ printf(" <dim_1 x dim_2 x ... dim_n>\n");
+ printf("\n");
+ printf("-e file File with the above informatuion info in it (instead of the two above options)\n");
+ printf("-m number Do not apply the filter to objects which size in bytes is smaller than number.\n");
+ printf(" If no size is specified a minimum of 1024 bytes is assumed.\n");
+ printf("\n");
exit(1);
}
-
diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c
index d2ca603..814b5c4 100644
--- a/tools/h5repack/testh5repack_main.c
+++ b/tools/h5repack/testh5repack_main.c
@@ -241,29 +241,6 @@ test_filter_szip(void)
TEST_ERROR;
if (h5repack_end (&pack_options)<0)
TEST_ERROR;
-
-/*-------------------------------------------------------------------------
- * test all objects option
- *-------------------------------------------------------------------------
- */
-
-
-#if 0
- if (h5repack_init (&pack_options, 0)<0)
- TEST_ERROR;
- if (h5repack_addfilter("SZIP 8",&pack_options)<0)
- TEST_ERROR;
- if (h5repack_addlayout("CHUNK 20x10",&pack_options)<0)
- TEST_ERROR;
- if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0)
- TEST_ERROR;
- if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1)
- TEST_ERROR;
- if (h5repack_verify(FNAME4OUT,&pack_options)<=0)
- TEST_ERROR;
- if (h5repack_end (&pack_options)<0)
- TEST_ERROR;
-#endif
PASSED();