diff options
Diffstat (limited to 'tools/h5repack')
-rw-r--r-- | tools/h5repack/Makefile.am | 2 | ||||
-rw-r--r-- | tools/h5repack/Makefile.in | 23 | ||||
-rw-r--r-- | tools/h5repack/h5repack.c | 11 | ||||
-rw-r--r-- | tools/h5repack/h5repack.h | 18 | ||||
-rwxr-xr-x | tools/h5repack/h5repack.sh.in | 57 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 46 | ||||
-rw-r--r-- | tools/h5repack/h5repack_main.c | 142 | ||||
-rw-r--r-- | tools/h5repack/h5repack_opttable.c | 2 | ||||
-rw-r--r-- | tools/h5repack/h5repack_parse.c | 46 | ||||
-rw-r--r-- | tools/h5repack/h5repack_verify.c | 113 | ||||
-rw-r--r-- | tools/h5repack/h5repacktst.c | 240 |
11 files changed, 431 insertions, 269 deletions
diff --git a/tools/h5repack/Makefile.am b/tools/h5repack/Makefile.am index 1f811f0..96f0082 100644 --- a/tools/h5repack/Makefile.am +++ b/tools/h5repack/Makefile.am @@ -37,7 +37,7 @@ SCRIPT_DEPEND=h5repack$(EXEEXT) bin_PROGRAMS=h5repack # Add h5repack specific linker flags here -h5repack_LDFLAGS = $(LT_STATIC_EXEC) +h5repack_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Depend on the hdf5 library, the tools library, the test library LDADD=$(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index 656cfa6..dd33879 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -117,6 +117,16 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@ AMTAR = @AMTAR@ + +# H5_CFLAGS holds flags that should be used when building hdf5, +# but which should not be exported to h5cc for building other programs. +# AM_CFLAGS is an automake construct which should be used by Makefiles +# instead of CFLAGS, as CFLAGS is reserved solely for the user to define. +AM_CFLAGS = @AM_CFLAGS@ @H5_CFLAGS@ +AM_CPPFLAGS = @AM_CPPFLAGS@ @H5_CPPFLAGS@ +AM_CXXFLAGS = @AM_CXXFLAGS@ @H5_CXXFLAGS@ +AM_FCFLAGS = @AM_FCFLAGS@ @H5_FCFLAGS@ +AM_LDFLAGS = @AM_LDFLAGS@ AM_MAKEFLAGS = @AM_MAKEFLAGS@ AR = @AR@ @@ -130,21 +140,18 @@ BYTESEX = @BYTESEX@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_VERSION = @CC_VERSION@ - -# H5_CFLAGS holds flags that should be used as CFLAGS when building hdf5, -# but which shouldn't be exported to h5cc for building other programs. -CFLAGS = @CFLAGS@ @H5_CFLAGS@ +CFLAGS = @CFLAGS@ CLEARFILEBUF = @CLEARFILEBUF@ CODESTACK = @CODESTACK@ CONFIG_DATE = @CONFIG_DATE@ CONFIG_MODE = @CONFIG_MODE@ CONFIG_USER = @CONFIG_USER@ CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ @H5_CPPFLAGS@ +CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ @H5_CXXFLAGS@ +CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEBUG_PKG = @DEBUG_PKG@ DEFAULT_API_VERSION = @DEFAULT_API_VERSION@ @@ -167,7 +174,7 @@ F9XMODEXT = @F9XMODEXT@ F9XMODFLAG = @F9XMODFLAG@ F9XSUFFIXFLAG = @F9XSUFFIXFLAG@ FC = @FC@ -FCFLAGS = @FCFLAGS@ @H5_FCFLAGS@ +FCFLAGS = @FCFLAGS@ FCFLAGS_f90 = @FCFLAGS_f90@ FCLIBS = @FCLIBS@ FGREP = @FGREP@ @@ -378,7 +385,7 @@ check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5repack$(EXEEXT) # Add h5repack specific linker flags here -h5repack_LDFLAGS = $(LT_STATIC_EXEC) +h5repack_LDFLAGS = $(LT_STATIC_EXEC) $(AM_LDFLAGS) # Depend on the hdf5 library, the tools library, the test library LDADD = $(LIBH5TOOLS) $(LIBH5TEST) $(LIBHDF5) diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index d0a7a7d..c8a3abe 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -90,13 +90,15 @@ int h5repack(const char* infile, *------------------------------------------------------------------------- */ -int h5repack_init (pack_opt_t *options, int verbose, int latest) +int +h5repack_init(pack_opt_t *options, int verbose, int latest, + H5F_file_space_type_t strategy, hsize_t threshold) { int k, n; memset(options,0,sizeof(pack_opt_t)); options->min_comp = 1024; options->verbose = verbose; - options->latest = latest ; + options->latest = latest; for ( n = 0; n < H5_REPACK_MAX_NFILTERS; n++) { @@ -106,6 +108,9 @@ int h5repack_init (pack_opt_t *options, int verbose, int latest) options->filter_g[n].cd_values[k] = 0; } + options->fs_strategy = strategy; + options->fs_threshold = threshold; + return (options_table_init(&(options->op_tbl))); } @@ -649,7 +654,7 @@ static const char* get_sfilter(H5Z_filter_t filtn) return "SOFF"; else { error_msg(progname, "input error in filter type\n"); - exit(1); + exit(EXIT_FAILURE); } } diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index feabeaa..38ce9e4 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -112,6 +112,8 @@ typedef struct { hsize_t ublock_size; /* user block size */ hsize_t threshold; /* alignment threshold for H5Pset_alignment */ hsize_t alignment ; /* alignment for H5Pset_alignment */ + H5F_file_space_type_t fs_strategy; /* File space handling strategy */ + hsize_t fs_threshold; /* Free space section threshold */ } pack_opt_t; @@ -125,14 +127,14 @@ typedef struct { extern "C" { #endif -int h5repack (const char* infile, const char* outfile, pack_opt_t *options); -int h5repack_addfilter (const char* str, pack_opt_t *options); -int h5repack_addlayout (const char* str, pack_opt_t *options); -int h5repack_init (pack_opt_t *options, int verbose, int latest); -int h5repack_end (pack_opt_t *options); -int h5repack_verify (const char *fname,pack_opt_t *options); -int h5repack_cmp_pl (const char *fname1, - const char *fname2); +int h5repack(const char* infile, const char* outfile, pack_opt_t *options); +int h5repack_addfilter(const char* str, pack_opt_t *options); +int h5repack_addlayout(const char* str, pack_opt_t *options); +int h5repack_init(pack_opt_t *options, int verbose, int latest, + H5F_file_space_type_t strategy, hsize_t threshold); +int h5repack_end(pack_opt_t *options); +int h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options); +int h5repack_cmp_pl(const char *fname1, const char *fname2); #ifdef __cplusplus diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 01c33ef..e9aae81 100755 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -96,11 +96,7 @@ SKIP() { DIFFTEST() { VERIFY $@ - if [ "`uname -s`" = "TFLOPS O/S" ]; then - $RUNSERIAL $H5DIFF_BIN -q $@ - else - $RUNSERIAL $H5DIFF_BIN -q "$@" - fi + $RUNSERIAL $H5DIFF_BIN -q "$@" RET=$? if [ $RET != 0 ] ; then echo "*FAILED*" @@ -116,27 +112,20 @@ DIFFTEST() TOOLTEST() { # Run test. - # Tflops interprets "$@" as "" when no parameter is given (e.g., the - # case of missing file name). Changed it to use $@ till Tflops fixes it. TESTING $H5REPACK $@ infile=$srcdir/testfiles/$1 path=`pwd` outfile=$path/out.$1 shift - if [ "`uname -s`" = "TFLOPS O/S" ]; then - $RUNSERIAL $H5REPACK_BIN $@ $infile $outfile - else - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile - fi - + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi rm -f $outfile } @@ -146,27 +135,20 @@ TOOLTEST() TOOLTEST0() { # Run test. - # Tflops interprets "$@" as "" when no parameter is given (e.g., the - # case of missing file name). Changed it to use $@ till Tflops fixes it. TESTING $H5REPACK $@ infile=$srcdir/testfiles/$1 path=`pwd` outfile=$path/out.$1 shift - if [ "`uname -s`" = "TFLOPS O/S" ]; then - $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile $@ - else - $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" - fi - + $RUNSERIAL $H5REPACK_BIN -i $infile -o $outfile "$@" RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi rm -f $outfile } @@ -178,27 +160,20 @@ TOOLTEST0() TOOLTEST1() { # Run test. - # Tflops interprets "$@" as "" when no parameter is given (e.g., the - # case of missing file name). Changed it to use $@ till Tflops fixes it. TESTING $H5REPACK $@ infile=$srcdir/../testfiles/$1 path=`pwd` outfile=$path/out.$1 shift - if [ "`uname -s`" = "TFLOPS O/S" ]; then - $RUNSERIAL $H5REPACK_BIN $@ $infile $outfile - else - $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile - fi - + $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile RET=$? if [ $RET != 0 ] ; then - echo "*FAILED*" - nerrors="`expr $nerrors + 1`" + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" else - echo " PASSED" - DIFFTEST $infile $outfile + echo " PASSED" + DIFFTEST $infile $outfile fi rm -f $outfile } diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 0fb8fc8..77c03d2 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -104,7 +104,7 @@ int copy_objects(const char* fnamein, goto out; } - /* get user block size */ + /* get user block size and file space strategy/threshold */ { hid_t fcpl_in; /* file creation property list ID for input file */ @@ -120,6 +120,24 @@ int copy_objects(const char* fnamein, goto out; } + if(!options->fs_strategy) + { + if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0) + { + error_msg(progname, "failed to retrieve file space strategy\n"); + goto out; + } + } + + if(!options->fs_threshold) + { + if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0) + { + error_msg(progname, "failed to retrieve file space threshold\n"); + goto out; + } + } + if(H5Pclose(fcpl_in) < 0) { error_msg(progname, "failed to close property list\n"); @@ -316,6 +334,32 @@ int copy_objects(const char* fnamein, } + /* either use the FCPL already created or create a new one */ + if(fcpl != H5P_DEFAULT) + { + /* set file space strategy and free space threshold */ + if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) + { + error_msg(progname, "failed to set file space strategy & threshold\n"); + goto out; + } + } + else + { + /* create a file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + { + error_msg(progname, "fail to create a file creation property list\n"); + goto out; + } + + /* set file space strategy and free space threshold */ + if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) + { + error_msg(progname, "failed to set file space strategy & threshold \n"); + goto out; + } + } /*------------------------------------------------------------------------- * create the output file diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index d2aed2b..acbd8ee 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -38,7 +38,7 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:t:a:i:o:"; +static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:t:a:i:o:S:T:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -58,6 +58,8 @@ static struct long_options l_opts[] = { { "alignment", require_arg, 'a' }, { "infile", require_arg, 'i' }, /* -i for backward compability */ { "outfile", require_arg, 'o' }, /* -o for backward compability */ + { "fs_strategy", require_arg, 'S' }, + { "fs_threshold", require_arg, 'T' }, { NULL, 0, '\0' } }; @@ -69,7 +71,9 @@ static struct long_options l_opts[] = { * * Purpose: h5repack main program * - * Return: 1, error, 0, no error + * Return: Success: EXIT_SUCCESS(0) + * + * Failure: EXIT_FAILURE(1) * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -104,7 +108,7 @@ int main(int argc, const char **argv) int ret=-1; /* initialize options */ - h5repack_init (&options,0, 0); + h5repack_init (&options, 0, 0, 0, (hsize_t)0); parse_command_line(argc, argv, &options); @@ -180,63 +184,77 @@ static void usage(const char *prog) printf(" -a A, --alignment=A Alignment value for H5Pset_alignment\n"); printf(" -f FILT, --filter=FILT Filter type\n"); printf(" -l LAYT, --layout=LAYT Layout type\n"); + printf(" -S FS_STRGY, --fs_strategy=FS_STRGY File space management strategy\n"); + printf(" -T FS_THRD, --fs_threshold=FS_THRD Free-space section threshold\n"); printf("\n"); - printf(" M - is an integer greater than 1, size of dataset in bytes (default is 1024) \n"); - printf(" E - is a filename.\n"); - printf(" S - is an integer\n"); - printf(" U - is a filename.\n"); - printf(" T - is an integer\n"); - printf(" A - is an integer greater than zero\n"); - printf(" B - is the user block size, any value that is 512 or greater and is\n"); + printf(" M - is an integer greater than 1, size of dataset in bytes (default is 1024) \n"); + printf(" E - is a filename.\n"); + printf(" S - is an integer\n"); + printf(" U - is a filename.\n"); + printf(" T - is an integer\n"); + printf(" A - is an integer greater than zero\n"); + printf(" B - is the user block size, any value that is 512 or greater and is\n"); printf(" a power of 2 (1024 default)\n"); - printf(" F - is the shared object header message type, any of <dspace|dtype|fill|\n"); + printf(" F - is the shared object header message type, any of <dspace|dtype|fill|\n"); printf(" pline|attr>. If F is not specified, S applies to all messages\n"); - + printf("\n"); + printf(" FS_STRGY is the file space management strategy to use for the output file.\n"); + printf(" It is a string as listed below:\n"); + printf(" ALL_PERSIST - Use persistent free-space managers, aggregators and virtual file driver\n"); + printf(" for file space allocation\n"); + printf(" ALL - Use non-persistent free-space managers, aggregators and virtual file driver\n"); + printf(" for file space allocation\n"); + printf(" AGGR_VFD - Use aggregators and virtual file driver for file space allocation\n"); + printf(" VFD - Use virtual file driver for file space allocation\n"); + printf("\n"); + printf(" FS_THRD is the free-space section threshold to use for the output file.\n"); + printf(" It is the minimum size (in bytes) of free-space sections to be tracked\n"); + printf(" by the the library's free-space managers.\n"); printf("\n"); - printf(" FILT - is a string with the format:\n"); + printf(" FILT - is a string with the format:\n"); printf("\n"); - printf(" <list of objects>:<name of filter>=<filter parameters>\n"); + printf(" <list of objects>:<name of filter>=<filter parameters>\n"); printf("\n"); - printf(" <list of objects> is a comma separated list of object names, meaning apply\n"); - printf(" compression only to those objects. If no names are specified, the filter\n"); - printf(" 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(" NBIT, to apply the HDF5 NBIT filter (NBIT compression)\n"); - printf(" SOFF, to apply the HDF5 Scale/Offset filter\n"); - printf(" NONE, to remove all filters\n"); - printf(" <filter parameters> is optional filter parameter information\n"); - printf(" GZIP=<deflation level> from 1-9\n"); - printf(" SZIP=<pixels per block,coding> pixels per block is a even number in\n"); + printf(" <list of objects> is a comma separated list of object names, meaning apply\n"); + printf(" compression only to those objects. If no names are specified, the filter\n"); + printf(" 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(" NBIT, to apply the HDF5 NBIT filter (NBIT compression)\n"); + printf(" SOFF, to apply the HDF5 Scale/Offset filter\n"); + printf(" NONE, to remove all filters\n"); + printf(" <filter parameters> is optional filter parameter information\n"); + printf(" GZIP=<deflation level> from 1-9\n"); + printf(" SZIP=<pixels per block,coding> pixels per block is a even number in\n"); printf(" 2-32 and coding method is either EC or NN\n"); - printf(" SHUF (no parameter)\n"); - printf(" FLET (no parameter)\n"); - printf(" NBIT (no parameter)\n"); - printf(" SOFF=<scale_factor,scale_type> scale_factor is an integer and scale_type\n"); + printf(" SHUF (no parameter)\n"); + printf(" FLET (no parameter)\n"); + printf(" NBIT (no parameter)\n"); + printf(" SOFF=<scale_factor,scale_type> scale_factor is an integer and scale_type\n"); printf(" is either IN or DS\n"); - printf(" NONE (no parameter)\n"); + printf(" NONE (no parameter)\n"); printf("\n"); - printf(" LAYT - is a string with the format:\n"); + printf(" LAYT - is a string with the format:\n"); printf("\n"); - printf(" <list of objects>:<layout type>=<layout parameters>\n"); + printf(" <list of objects>:<layout type>=<layout parameters>\n"); printf("\n"); - printf(" <list of objects> is a comma separated list of object names, meaning that\n"); - printf(" layout information is supplied for those objects. If no names are\n"); - printf(" specified, the layout type 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 optional layout information\n"); - printf(" CHUNK=DIM[xDIM...xDIM], the chunk size of each dimension\n"); - printf(" COMPA (no parameter)\n"); - printf(" CONTI (no parameter)\n"); + printf(" <list of objects> is a comma separated list of object names, meaning that\n"); + printf(" layout information is supplied for those objects. If no names are\n"); + printf(" specified, the layout type 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 optional layout information\n"); + printf(" CHUNK=DIM[xDIM...xDIM], the chunk size of each dimension\n"); + printf(" COMPA (no parameter)\n"); + printf(" CONTI (no parameter)\n"); printf("\n"); printf("Examples of use:\n"); printf("\n"); @@ -429,6 +447,30 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) } break; + case 'S': + { + char strategy[MAX_NC_NAME]; + + strcpy(strategy, opt_arg); + if(!strcmp(strategy, "ALL_PERSIST")) + options->fs_strategy = H5F_FILE_SPACE_ALL_PERSIST; + else if(!strcmp(strategy, "ALL")) + options->fs_strategy = H5F_FILE_SPACE_ALL; + else if(!strcmp(strategy, "AGGR_VFD")) + options->fs_strategy = H5F_FILE_SPACE_AGGR_VFD; + else if(!strcmp(strategy, "VFD")) + options->fs_strategy = H5F_FILE_SPACE_VFD; + else { + error_msg(progname, "invalid file space management strategy\n", opt_arg ); + exit(EXIT_FAILURE); + } + break; + } + + case 'T': + + options->fs_threshold = (hsize_t)atol( opt_arg ); + break; } /* switch */ @@ -484,7 +526,7 @@ void read_info(const char *filename, if ((fp = fopen(data_file, "r")) == (FILE *)NULL) { error_msg(progname, "cannot open options file %s\n", filename); - exit(1); + exit(EXIT_FAILURE); } /* cycle until end of file reached */ @@ -521,7 +563,7 @@ void read_info(const char *filename, if (h5repack_addfilter(comp_info,options)==-1){ error_msg(progname, "could not add compression option\n"); - exit(1); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -551,7 +593,7 @@ void read_info(const char *filename, if (h5repack_addlayout(comp_info,options)==-1){ error_msg(progname, "could not add chunck option\n"); - exit(1); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -560,7 +602,7 @@ void read_info(const char *filename, */ else { error_msg(progname, "bad file format for %s", filename); - exit(1); + exit(EXIT_FAILURE); } } diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index 8572837..5b6d5d0 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -231,7 +231,7 @@ int options_add_layout( obj_list_t *obj_list, if (table->objs[i].chunk.rank>0) { error_msg(progname, "chunk information already inserted for <%s>\n",obj_list[j].obj); - exit(1); + exit(EXIT_FAILURE); } /* insert the layout info */ else diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 154d6e5..15dc812 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -122,7 +122,7 @@ obj_list_t* parse_filter(const char *str, { if (obj_list) free(obj_list); error_msg(progname, "input Error: Invalid compression type in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } @@ -160,7 +160,7 @@ obj_list_t* parse_filter(const char *str, if (!isdigit(c) && l==-1){ if (obj_list) free(obj_list); error_msg(progname, "compression parameter not digit in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } if (l==-1) stype[m]=c; @@ -180,7 +180,7 @@ obj_list_t* parse_filter(const char *str, else { error_msg(progname, "szip mask must be 'NN' or 'EC' \n"); - exit(1); + exit(EXIT_FAILURE); } @@ -220,7 +220,7 @@ obj_list_t* parse_filter(const char *str, if (!isdigit(c) && l==-1){ if (obj_list) free(obj_list); error_msg(progname, "compression parameter is not a digit in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } if (l==-1) stype[m]=c; @@ -240,7 +240,7 @@ obj_list_t* parse_filter(const char *str, else { error_msg(progname, "scale type must be 'IN' or 'DS' \n"); - exit(1); + exit(EXIT_FAILURE); } } @@ -264,7 +264,7 @@ obj_list_t* parse_filter(const char *str, if (!isdigit(c)){ if (obj_list) free(obj_list); error_msg(progname, "compression parameter is not a digit in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } stype[m]=c; } /* u */ @@ -310,7 +310,7 @@ obj_list_t* parse_filter(const char *str, { /*no more parameters, GZIP must have parameter */ if (obj_list) free(obj_list); error_msg(progname, "missing compression parameter in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } @@ -326,7 +326,7 @@ obj_list_t* parse_filter(const char *str, { /*no more parameters, SZIP must have parameter */ if (obj_list) free(obj_list); error_msg(progname, "missing compression parameter in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } @@ -342,7 +342,7 @@ obj_list_t* parse_filter(const char *str, { /*shuffle does not have parameter */ if (obj_list) free(obj_list); error_msg(progname, "extra parameter in SHUF <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -357,7 +357,7 @@ obj_list_t* parse_filter(const char *str, { /*shuffle does not have parameter */ if (obj_list) free(obj_list); error_msg(progname, "extra parameter in FLET <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -372,7 +372,7 @@ obj_list_t* parse_filter(const char *str, { /*nbit does not have parameter */ if (obj_list) free(obj_list); error_msg(progname, "extra parameter in NBIT <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } /*------------------------------------------------------------------------- @@ -387,13 +387,13 @@ obj_list_t* parse_filter(const char *str, { /*no more parameters, SOFF must have parameter */ if (obj_list) free(obj_list); error_msg(progname, "missing compression parameter in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } else { if (obj_list) free(obj_list); error_msg(progname, "invalid filter type in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } } /*i*/ @@ -416,7 +416,7 @@ obj_list_t* parse_filter(const char *str, { if (obj_list) free(obj_list); error_msg(progname, "invalid compression parameter in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } break; @@ -431,19 +431,19 @@ obj_list_t* parse_filter(const char *str, { if (obj_list) free(obj_list); error_msg(progname, "pixels_per_block is not even in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) { if (obj_list) free(obj_list); error_msg(progname, "pixels_per_block is too large in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } if ( (strcmp(smask,"NN")!=0) && (strcmp(smask,"EC")!=0) ) { if (obj_list) free(obj_list); error_msg(progname, "szip mask must be 'NN' or 'EC' \n"); - exit(1); + exit(EXIT_FAILURE); } break; default: @@ -544,7 +544,7 @@ obj_list_t* parse_layout(const char *str, { if (obj_list) free(obj_list); error_msg(progname, "in parse layout, no characters after : in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } /* get layout info */ @@ -561,7 +561,7 @@ obj_list_t* parse_layout(const char *str, pack->layout=H5D_CHUNKED; else { error_msg(progname, "in parse layout, not a valid layout in <%s>\n",str); - exit(1); + exit(EXIT_FAILURE); } } else @@ -585,7 +585,7 @@ obj_list_t* parse_layout(const char *str, { if (obj_list) free(obj_list); error_msg(progname, "in parse layout, <%s> Chunk dimensions missing\n",str); - exit(1); + exit(EXIT_FAILURE); } for ( i=j, c_index=0; i<len; i++) @@ -600,7 +600,7 @@ obj_list_t* parse_layout(const char *str, if (obj_list) free(obj_list); error_msg(progname, "in parse layout, <%s> Not a valid character in <%s>\n", sdim,str); - exit(1); + exit(EXIT_FAILURE); } if ( c=='x' || i==len-1) @@ -613,7 +613,7 @@ obj_list_t* parse_layout(const char *str, if (obj_list) free(obj_list); error_msg(progname, "in parse layout, <%s> conversion to number in <%s>\n", sdim,str); - exit(1); + exit(EXIT_FAILURE); } c_index++; } @@ -631,7 +631,7 @@ obj_list_t* parse_layout(const char *str, if (obj_list) free(obj_list); error_msg(progname, "in parse layout, <%s> conversion to number in <%s>\n", sdim,str); - exit(1); + exit(EXIT_FAILURE); } pack->chunk.rank=c_index+1; } diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 69df02c..fe94148 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -44,20 +44,25 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil *------------------------------------------------------------------------- */ -int h5repack_verify(const char *fname, - pack_opt_t *options) +int +h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options) { - hid_t fid; /* file ID */ - hid_t did; /* dataset ID */ - hid_t pid; /* dataset creation property list ID */ - hid_t sid; /* space ID */ - hid_t tid; /* type ID */ + hid_t fidin; /* file ID for input file*/ + hid_t fidout; /* file ID for output file*/ + hid_t did; /* dataset ID */ + hid_t pid; /* dataset creation property list ID */ + hid_t sid; /* space ID */ + hid_t tid; /* type ID */ unsigned int i; trav_table_t *travt = NULL; int ok = 1; + hid_t fcpl_in; /* file creation property for input file */ + hid_t fcpl_out; /* file creation property for output file */ + H5F_file_space_type_t in_strat, out_strat; /* file space handling strategy for in/output file */ + hsize_t in_thresh, out_thresh; /* free space section threshold for in/output file */ - /* open the file */ - if((fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) + /* open the output file */ + if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) return -1; for(i = 0; i < options->op_tbl->nelems; i++) @@ -69,7 +74,7 @@ int h5repack_verify(const char *fname, * open *------------------------------------------------------------------------- */ - if((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0) goto error; if((sid = H5Dget_space(did)) < 0) goto error; @@ -121,7 +126,7 @@ int h5repack_verify(const char *fname, trav_table_init(&travt); /* get the list of objects in the file */ - if(h5trav_gettable(fid, travt) < 0) + if(h5trav_gettable(fidout, travt) < 0) goto error; for(i = 0; i < travt->nobjs; i++) @@ -135,7 +140,7 @@ int h5repack_verify(const char *fname, * open *------------------------------------------------------------------------- */ - if((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0) + if((did = H5Dopen2(fidout, name, H5P_DEFAULT)) < 0) goto error; if((sid = H5Dget_space(did)) < 0) goto error; @@ -191,26 +196,100 @@ int h5repack_verify(const char *fname, } /*------------------------------------------------------------------------- - * close + * Verify that file space strategy and free space threshold + * are set as expected *------------------------------------------------------------------------- */ - if (H5Fclose(fid) < 0) - return -1; + /* open the input file */ + if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 ) + goto error; + + /* Get file creation property list for input file */ + if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { + error_msg(progname, "failed to retrieve file creation property list\n"); + goto error; + } + + /* Get file space management info for input file */ + if(H5Pget_file_space(fcpl_in, &in_strat, &in_thresh) < 0) { + error_msg(progname, "failed to retrieve file space strategy & threshold\n"); + goto error; + } + + /* Output file is already opened */ + /* Get file creation property list for output file */ + if((fcpl_out = H5Fget_create_plist(fidout)) < 0) { + error_msg(progname, "failed to retrieve file creation property list\n"); + goto error; + } + + /* Get file space management info for output file */ + if(H5Pget_file_space(fcpl_out, &out_strat, &out_thresh) < 0) { + error_msg(progname, "failed to retrieve file space strategy & threshold\n"); + goto error; + } + + /* + * If the strategy option is not set, + * file space handling strategy should be the same for both + * input & output files. + * If the strategy option is set, + * the output file's file space handling strategy should be the same + * as what is set via the strategy option + */ + if(!options->fs_strategy && out_strat != in_strat) { + error_msg(progname, "file space strategy not set as unexpected\n"); + goto error; + + } else if(options->fs_strategy && out_strat!= options->fs_strategy) { + error_msg(progname, "file space strategy not set as unexpectec\n"); + goto error; + } + + /* + * If the threshold option is not set, + * the free space section threshold should be the same for both + * input & output files. + * If the threshold option is set, + * the output file's free space section threshold should be the same + * as what is set via the threshold option. + */ + if(!options->fs_threshold && out_thresh != in_thresh) { + error_msg(progname, "free space threshold not set as unexpected\n"); + goto error; + + } else if(options->fs_threshold && out_thresh != options->fs_threshold) { + error_msg(progname, "free space threshold not set as unexpectec\n"); + goto error; + } + + /* Closing */ + if (H5Pclose(fcpl_in) < 0) + goto error; + if (H5Pclose(fcpl_out) < 0) + goto error; + if (H5Fclose(fidin) < 0) + goto error; + if (H5Fclose(fidout) < 0) + goto error; return ok; error: H5E_BEGIN_TRY { + H5Pclose(fcpl_in); + H5Pclose(fcpl_out); H5Pclose(pid); H5Sclose(sid); H5Dclose(did); - H5Fclose(fid); + H5Fclose(fidin); + H5Fclose(fidout); if (travt) trav_table_free(travt); } H5E_END_TRY; return -1; -} +} /* h5repack_verify() */ diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 59652e0..adaef43 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -79,7 +79,6 @@ #define FNAME_UB "ublock.bin" - const char *H5REPACK_FILENAMES[] = { "h5repack_big_out", NULL @@ -153,6 +152,8 @@ int main (void) { pack_opt_t pack_options; diff_opt_t diff_options; + hsize_t fs_size = 0; /* free space section threshold */ + H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */ #if defined (H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif @@ -178,19 +179,22 @@ int main (void) *------------------------------------------------------------------------- */ + /*------------------------------------------------------------------------- * file with fill values *------------------------------------------------------------------------- */ TESTING(" copy of datasets (fill values)"); - if (h5repack_init (&pack_options, 0, 0) < 0) + + /* fs_type = 0; fs_size = 0 */ + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME0,FNAME0OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME0,FNAME0OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME0OUT,&pack_options)<=0) + if (h5repack_verify(FNAME0, FNAME0OUT,&pack_options)<=0) GOERROR; if (h5repack_cmp_pl(FNAME0,FNAME0OUT)<=0) GOERROR; @@ -204,13 +208,13 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of datasets (all datatypes)"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME1,FNAME1OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME1,FNAME1OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME1OUT,&pack_options)<=0) + if (h5repack_verify(FNAME1, FNAME1OUT,&pack_options)<=0) GOERROR; if (h5repack_cmp_pl(FNAME1,FNAME1OUT)<=0) GOERROR; @@ -224,13 +228,13 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of datasets (attributes)"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME2,FNAME2OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME2,FNAME2OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME2OUT,&pack_options)<=0) + if (h5repack_verify(FNAME2, FNAME2OUT,&pack_options)<=0) GOERROR; if (h5repack_cmp_pl(FNAME2,FNAME2OUT)<=0) GOERROR; @@ -243,13 +247,13 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of datasets (hardlinks)"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME3,FNAME3OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME3,FNAME3OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME3OUT,&pack_options)<=0) + if (h5repack_verify(FNAME3, FNAME3OUT,&pack_options)<=0) GOERROR; if (h5repack_cmp_pl(FNAME3,FNAME3OUT)<=0) GOERROR; @@ -263,13 +267,13 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" copy of allocation early file"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME5,FNAME5OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME5,FNAME5OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME5OUT,&pack_options)<=0) + if (h5repack_verify(FNAME5, FNAME5OUT, &pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -293,7 +297,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) GOERROR; @@ -303,7 +307,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -320,7 +324,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 1) < 0) + if (h5repack_init (&pack_options, 0, 1, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:GZIP=9",&pack_options) < 0) GOERROR; @@ -330,7 +334,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -348,7 +352,7 @@ int main (void) #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("GZIP=1",&pack_options) < 0) GOERROR; @@ -358,7 +362,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -386,7 +390,7 @@ int main (void) */ if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options) < 0) GOERROR; @@ -396,7 +400,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -418,7 +422,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("SZIP=8,NN",&pack_options) < 0) GOERROR; @@ -426,7 +430,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -449,7 +453,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:SHUF",&pack_options) < 0) GOERROR; @@ -459,7 +463,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -478,7 +482,8 @@ int main (void) #ifdef H5_HAVE_FILTER_SHUFFLE - if (h5repack_init (&pack_options, 0, 0) < 0) + /* fs_type = H5F_FILE_SPACE_ALL_PERSIST; fs_size = 1 */ + if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addfilter("SHUF",&pack_options) < 0) GOERROR; @@ -488,7 +493,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -507,7 +512,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset1:FLET",&pack_options) < 0) GOERROR; @@ -517,7 +522,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -537,7 +542,7 @@ int main (void) #ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("FLET",&pack_options) < 0) GOERROR; @@ -547,7 +552,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -565,7 +570,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK 20x10",&pack_options) < 0) GOERROR; @@ -596,7 +601,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -611,7 +616,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) GOERROR; @@ -619,7 +624,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -633,7 +638,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 1) < 0) + if (h5repack_init (&pack_options, 0, 1, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CHUNK=20x10",&pack_options) < 0) GOERROR; @@ -641,7 +646,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT, &pack_options )<= 0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -653,7 +658,7 @@ int main (void) */ TESTING(" adding layout chunked to all"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("CHUNK=20x10",&pack_options) < 0) GOERROR; @@ -661,7 +666,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -674,7 +679,7 @@ int main (void) * test an individual object option *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:CONTI",&pack_options) < 0) GOERROR; @@ -682,7 +687,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -695,7 +700,7 @@ int main (void) * test all objects option *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("CONTI",&pack_options) < 0) GOERROR; @@ -703,7 +708,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -712,7 +717,7 @@ int main (void) * do the same test for a file with filters (chunked) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("CONTI",&pack_options) < 0) GOERROR; @@ -720,7 +725,7 @@ int main (void) GOERROR; if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -734,7 +739,7 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset1:COMPA",&pack_options) < 0) GOERROR; @@ -742,7 +747,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -755,7 +760,8 @@ int main (void) *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + /* fs_type = H5F_FILE_SPACE_ALL; fs_size = 2 */ + if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addlayout("COMPA",&pack_options) < 0) GOERROR; @@ -763,7 +769,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -777,7 +783,7 @@ int main (void) * layout compact to contiguous conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_compact:CONTI",&pack_options) < 0) GOERROR; @@ -785,7 +791,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -797,7 +803,7 @@ int main (void) * layout compact to chunk conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_compact:CHUNK=2x5",&pack_options) < 0) GOERROR; @@ -805,7 +811,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -817,7 +823,7 @@ int main (void) * layout compact to compact conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_compact:COMPA",&pack_options) < 0) GOERROR; @@ -825,7 +831,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -836,7 +842,7 @@ int main (void) * layout contiguous to compact conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_contiguous:COMPA",&pack_options) < 0) GOERROR; @@ -844,7 +850,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -855,7 +861,7 @@ int main (void) * layout contiguous to chunk conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_contiguous:CHUNK=3x6",&pack_options) < 0) GOERROR; @@ -863,7 +869,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -875,7 +881,7 @@ int main (void) * layout contiguous to contiguous conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_contiguous:CONTI",&pack_options) < 0) GOERROR; @@ -883,7 +889,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -894,7 +900,7 @@ int main (void) * layout chunked to compact conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_chunk:COMPA",&pack_options) < 0) GOERROR; @@ -902,7 +908,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -914,7 +920,7 @@ int main (void) * layout chunked to contiguous conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_chunk:CONTI",&pack_options) < 0) GOERROR; @@ -922,7 +928,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -933,7 +939,7 @@ int main (void) * layout chunked to chunked conversion *------------------------------------------------------------------------- */ - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addlayout("dset_chunk:CHUNK=18x13",&pack_options) < 0) GOERROR; @@ -941,7 +947,7 @@ int main (void) GOERROR; if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + if (h5repack_verify(FNAME4, FNAME4OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -963,13 +969,14 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0) < 0) + /* fs_type = H5F_FILE_SPACE_AGGR_VFD; fs_size = 3 */ + if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack(FNAME7,FNAME7OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME7, FNAME7OUT,&pack_options)<=0) GOERROR; if (h5repack_cmp_pl(FNAME7,FNAME7OUT)<=0) GOERROR; @@ -988,7 +995,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_szip:NONE",&pack_options) < 0) GOERROR; @@ -996,7 +1003,7 @@ int main (void) GOERROR; if (h5diff(FNAME7,FNAME7OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME7OUT,&pack_options)<=0) + if (h5repack_verify(FNAME7, FNAME7OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1013,13 +1020,13 @@ int main (void) TESTING(" copy of deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME8,FNAME8OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1033,7 +1040,7 @@ int main (void) TESTING(" removing deflate filter"); #ifdef H5_HAVE_FILTER_DEFLATE - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, ++fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_deflate:NONE",&pack_options) < 0) GOERROR; @@ -1041,7 +1048,7 @@ int main (void) GOERROR; if (h5diff(FNAME8,FNAME8OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME8OUT,&pack_options)<=0) + if (h5repack_verify(FNAME8, FNAME8OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1056,13 +1063,13 @@ int main (void) TESTING(" copy of shuffle filter"); #ifdef H5_HAVE_FILTER_SHUFFLE - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME9,FNAME9OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME9,FNAME9OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME9OUT,&pack_options)<=0) + if (h5repack_verify(FNAME9, FNAME9OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1075,7 +1082,7 @@ int main (void) TESTING(" removing shuffle filter"); #ifdef H5_HAVE_FILTER_SHUFFLE - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_shuffle:NONE",&pack_options) < 0) GOERROR; @@ -1083,7 +1090,7 @@ int main (void) GOERROR; if (h5diff(FNAME9,FNAME9OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME9OUT,&pack_options)<=0) + if (h5repack_verify(FNAME9, FNAME9OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1096,13 +1103,13 @@ int main (void) TESTING(" copy of fletcher filter"); #ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME10,FNAME10OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME10,FNAME10OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME10OUT,&pack_options)<=0) + if (h5repack_verify(FNAME10, FNAME10OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1115,7 +1122,7 @@ int main (void) TESTING(" removing fletcher filter"); #ifdef H5_HAVE_FILTER_FLETCHER32 - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_fletcher32:NONE",&pack_options) < 0) GOERROR; @@ -1123,7 +1130,7 @@ int main (void) GOERROR; if (h5diff(FNAME10,FNAME10OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME10OUT,&pack_options)<=0) + if (h5repack_verify(FNAME10, FNAME10OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1137,13 +1144,13 @@ int main (void) TESTING(" copy of nbit filter"); #ifdef H5_HAVE_FILTER_NBIT - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME12,FNAME12OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1156,7 +1163,7 @@ int main (void) TESTING(" removing nbit filter"); #ifdef H5_HAVE_FILTER_NBIT - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_nbit:NONE",&pack_options) < 0) GOERROR; @@ -1164,7 +1171,7 @@ int main (void) GOERROR; if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1178,7 +1185,7 @@ int main (void) TESTING(" adding nbit filter"); #ifdef H5_HAVE_FILTER_NBIT - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_int31:NBIT",&pack_options) < 0) GOERROR; @@ -1186,7 +1193,7 @@ int main (void) GOERROR; if (h5diff(FNAME12,FNAME12OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME12OUT,&pack_options)<=0) + if (h5repack_verify(FNAME12, FNAME12OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1200,13 +1207,13 @@ int main (void) TESTING(" copy of scaleoffset filter"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME13,FNAME13OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1219,7 +1226,7 @@ int main (void) TESTING(" removing scaleoffset filter"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_scaleoffset:NONE",&pack_options) < 0) GOERROR; @@ -1227,7 +1234,7 @@ int main (void) GOERROR; if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1241,7 +1248,7 @@ int main (void) TESTING(" adding scaleoffset filter"); #ifdef H5_HAVE_FILTER_SCALEOFFSET - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_none:SOFF=31,IN",&pack_options) < 0) GOERROR; @@ -1249,7 +1256,7 @@ int main (void) GOERROR; if (h5diff(FNAME13,FNAME13OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME13OUT,&pack_options)<=0) + if (h5repack_verify(FNAME13, FNAME13OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1279,7 +1286,8 @@ int main (void) && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0) < 0) + /* fs_type = H5F_FILE_SPACE_VFD; fs_size = 4 */ + if (h5repack_init (&pack_options, 0, 0, H5_INC_ENUM(H5F_file_space_type_t, fs_type), ++fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options) < 0) GOERROR; @@ -1287,7 +1295,7 @@ int main (void) GOERROR; if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1307,7 +1315,7 @@ int main (void) && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) if (szip_can_encode) { - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options) < 0) GOERROR; @@ -1315,7 +1323,7 @@ int main (void) GOERROR; if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1339,7 +1347,7 @@ int main (void) #if defined (H5_HAVE_FILTER_SZIP) && defined (H5_HAVE_FILTER_DEFLATE) \ && defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE) - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("NONE",&pack_options) < 0) GOERROR; @@ -1347,7 +1355,7 @@ int main (void) GOERROR; if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1362,13 +1370,14 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" big file"); - if (h5repack_init (&pack_options, 0, 0) < 0) + + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME14,FNAME14OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME14,FNAME14OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME14OUT,&pack_options)<=0) + if (h5repack_verify(FNAME14, FNAME14OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1379,13 +1388,13 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" external datasets"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack(FNAME15,FNAME15OUT,&pack_options) < 0) GOERROR; if (h5diff(FNAME15,FNAME15OUT,NULL,NULL,&diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME15OUT,&pack_options)<=0) + if (h5repack_verify(FNAME15, FNAME15OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1396,13 +1405,13 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" file with userblock"); - if(h5repack_init(&pack_options, 0, 0) < 0) + if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if(h5repack(FNAME16, FNAME16OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME16, FNAME16OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME16OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME16, FNAME16OUT, &pack_options) <= 0) GOERROR; if(verify_userblock(FNAME16OUT) < 0) GOERROR; @@ -1415,7 +1424,7 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" latest file format options"); - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; pack_options.latest=1; pack_options.grp_compact=10; @@ -1429,7 +1438,7 @@ int main (void) GOERROR; if (h5diff(FNAME1,FNAME1OUT,NULL,NULL,&diff_options) > 0) GOERROR; - if (h5repack_verify(FNAME1OUT,&pack_options)<=0) + if (h5repack_verify(FNAME1, FNAME1OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1445,7 +1454,7 @@ int main (void) #if defined (H5_HAVE_FILTER_DEFLATE) && defined (H5_HAVE_FILTER_SHUFFLE) - if (h5repack_init (&pack_options, 0, 0) < 0) + if (h5repack_init (&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if (h5repack_addfilter("GZIP=1",&pack_options) < 0) GOERROR; @@ -1455,7 +1464,7 @@ int main (void) GOERROR; if (h5diff(FNAME11,FNAME11OUT,NULL,NULL,&diff_options) >0) GOERROR; - if (h5repack_verify(FNAME11OUT,&pack_options)<=0) + if (h5repack_verify(FNAME11, FNAME11OUT,&pack_options)<=0) GOERROR; if (h5repack_end (&pack_options) < 0) GOERROR; @@ -1474,7 +1483,7 @@ int main (void) #ifdef H5_HAVE_FILTER_DEFLATE - if(h5repack_init(&pack_options, 0, 0) < 0) + if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; /* add the options for a user block size and user block filename */ @@ -1485,7 +1494,7 @@ int main (void) GOERROR; if(h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME8OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; if(verify_userblock(FNAME8OUT) < 0) GOERROR; @@ -1507,7 +1516,7 @@ int main (void) #ifdef H5_HAVE_FILTER_DEFLATE - if(h5repack_init(&pack_options, 0, 0) < 0) + if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; /* add the options for aligment */ @@ -1518,10 +1527,9 @@ int main (void) GOERROR; if(h5diff(FNAME8, FNAME8OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME8OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME8, FNAME8OUT, &pack_options) <= 0) GOERROR; - /* verify aligment */ { hsize_t threshold; @@ -1562,14 +1570,14 @@ int main (void) */ TESTING(" file with committed datatypes"); - if(h5repack_init(&pack_options, 0, 0) < 0) + if(h5repack_init(&pack_options, 0, 0, fs_type, fs_size) < 0) GOERROR; if(h5repack(FNAME17, FNAME17OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME17, FNAME17OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME17OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME17, FNAME17OUT, &pack_options) <= 0) GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; |