diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-07-20 19:21:03 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-07-20 19:21:03 (GMT) |
commit | 4cb6c01d7f59be968649e36a61346be044f76345 (patch) | |
tree | e0a0b81e542768b75d5bbb2de8afc1abfb8c4370 /tools/h5repack/h5repack_main.c | |
parent | 00909f278d64017c21c8348537231daba97be9dd (diff) | |
download | hdf5-4cb6c01d7f59be968649e36a61346be044f76345.zip hdf5-4cb6c01d7f59be968649e36a61346be044f76345.tar.gz hdf5-4cb6c01d7f59be968649e36a61346be044f76345.tar.bz2 |
[svn-r8904] Purpose:
h5diff and h5repack changes
Description:
h5diff
introduced the following four modes of output:
Normal mode: print the number of differences found and where they occured
Report mode: print the above plus the differences
Verbose mode: print the above plus a list of objects and warnings
Quiet mode: do not print output (h5diff always returns an exit code of 1 when differences are found)
h5repack
added an extra parameter for SZIP filter (coding method)
the new syntax is
-f SZIP=<pixels per block,coding>
(pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN')
Example of use:
./h5repack -i file1 -o file2 -f SZIP=8,NN -v
updated usage messages, test scripts and files accordingly
Solution:
Platforms tested:
linux
AIX
solaris
Misc. update:
Diffstat (limited to 'tools/h5repack/h5repack_main.c')
-rw-r--r-- | tools/h5repack/h5repack_main.c | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 810d30f..442af99 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -17,9 +17,25 @@ static void usage(void); -/* -h5repack main program -*/ +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: h5repack main program + * + * Return: 1, error, 0, no error + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: May 9, 2003 + * + * Comments: + * + * Modifications: July 2004 + * Introduced the extra EC or NN option for SZIP + * + *------------------------------------------------------------------------- + */ + int main(int argc, char **argv) { @@ -33,6 +49,10 @@ int main(int argc, char **argv) for ( i = 1; i < argc; i++) { + if (strcmp(argv[i], "-h") == 0) { + usage(); + exit(0); + } if (strcmp(argv[i], "-i") == 0) { infile = argv[++i]; } @@ -76,11 +96,15 @@ int main(int argc, char **argv) else if (argv[i][0] == '-') { usage(); + exit(1); } } if (infile == NULL || outfile == NULL) + { usage(); + exit(1); + } /* pack it */ ret=h5repack(infile,outfile,&options); @@ -112,8 +136,9 @@ void usage(void) printf("-i input Input HDF5 File\n"); printf("-o output Output HDF5 File\n"); printf("[-h] Print usage message\n"); + printf("[-v] Verbose mode. Print output (list of objects, filters, warnings)\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> : <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"); @@ -124,8 +149,10 @@ void usage(void) 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(" SHUF (no parameter)\n"); + printf(" FLET (no parameter)\n"); + printf(" GZIP=<deflation level> from 1-9\n"); + printf(" SZIP=<pixels per block,coding> (pixels per block is a even number in 2-32 and coding method is 'EC' or 'NN')\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"); @@ -143,8 +170,20 @@ void usage(void) 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); + printf("Examples of use:\n"); + printf("\n"); + printf("1) h5repack -i file1 -o file2 -f GZIP=1 -v\n"); + printf("\n"); + printf(" Applies GZIP compression to all objects in file1 and saves the output in file2\n"); + printf("\n"); + printf("2) h5repack -i file1 -o file2 -f dset1:SZIP=8,NN -v\n"); + printf("\n"); + printf(" Applies SZIP compression only to object 'dset1'\n"); + printf("\n"); + printf("3) h5repack -i file1 -o file2 -l dset1,dset2:CHUNK=20x10 -v\n"); + printf("\n"); + printf(" Applies chunked layout to objects 'dset1' and 'dset2'\n"); + printf("\n"); } |