diff options
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/h5dump.c | 33 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 32 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 1 |
3 files changed, 56 insertions, 10 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 43b2813..a437619 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -3067,22 +3067,22 @@ dump_fcpl(hid_t fid) hsize_t userblock; /* userblock size retrieved from FCPL */ size_t off_size; /* size of offsets in the file */ size_t len_size; /* size of lengths in the file */ - unsigned super; /* superblock version # */ - unsigned freelist; /* free list version # */ - unsigned stab; /* symbol table entry version # */ - unsigned shhdr; /* shared object header version # */ hid_t fdriver; /* file driver */ char dname[32]; /* buffer to store driver name */ unsigned sym_lk; /* symbol table B-tree leaf 'K' value */ unsigned sym_ik; /* symbol table B-tree internal 'K' value */ unsigned istore_ik; /* indexed storage B-tree internal 'K' value */ + H5F_file_space_type_t fs_strategy; /* file space strategy */ + hsize_t fs_threshold; /* free-space section threshold */ + H5F_info2_t finfo; /* file information */ fcpl=H5Fget_create_plist(fid); - H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr); + H5Fget_info2(fid, &finfo); H5Pget_userblock(fcpl,&userblock); H5Pget_sizes(fcpl,&off_size,&len_size); H5Pget_sym_k(fcpl,&sym_ik,&sym_lk); H5Pget_istore_k(fcpl,&istore_ik); + H5Pget_file_space(fcpl, &fs_strategy, &fs_threshold); H5Pclose(fcpl); fapl=h5_fileaccess(); fdriver=H5Pget_driver(fapl); @@ -3094,13 +3094,13 @@ dump_fcpl(hid_t fid) */ printf("%s %s\n",SUPER_BLOCK, BEGIN); indentation(indent + COL); - printf("%s %u\n","SUPERBLOCK_VERSION", super); + printf("%s %u\n","SUPERBLOCK_VERSION", finfo.super.version); indentation(indent + COL); - printf("%s %u\n","FREELIST_VERSION", freelist); + printf("%s %u\n","FREELIST_VERSION", finfo.free.version); indentation(indent + COL); - printf("%s %u\n","SYMBOLTABLE_VERSION", stab); + printf("%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */ indentation(indent + COL); - printf("%s %u\n","OBJECTHEADER_VERSION", shhdr); + printf("%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version); indentation(indent + COL); HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); indentation(indent + COL); @@ -3141,6 +3141,21 @@ dump_fcpl(hid_t fid) printf("%s %s\n","FILE_DRIVER", dname);*/ indentation(indent + COL); printf("%s %u\n","ISTORE_K", istore_ik); + + indentation(indent + COL); + if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST) + printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST"); + else if(fs_strategy == H5F_FILE_SPACE_ALL) + printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL"); + else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD) + printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD"); + else if(fs_strategy == H5F_FILE_SPACE_VFD) + printf("%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD"); + else + printf("%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy"); + indentation(indent + COL); + HDfprintf(stdout, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold); + printf("%s\n",END); /*------------------------------------------------------------------------- diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index b8ed41d..2ddc0bf 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -93,6 +93,7 @@ #define FILE63 "textlinkfar.h5" #define FILE64 "tarray8.h5" #define FILE65 "tattrreg.h5" +#define FILE66 "file_space.h5" @@ -244,6 +245,10 @@ typedef struct s1_t { #define F64_ARRAY_BUF_LEN (4*1024) #define F64_DIM1 (F64_ARRAY_BUF_LEN / sizeof(int) + 1) +/* File 65 macros */ +#define STRATEGY H5F_FILE_SPACE_AGGR_VFD /* File space handling strategy */ +#define THRESHOLD10 10 /* Free space section threshold */ + static void gent_group(void) { @@ -6443,7 +6448,32 @@ gent_extlinks(void) H5Fclose(far_fid); } +/*------------------------------------------------------------------------- + * Function: gent_fs_strategy_threshold + * + * Purpose: Generate a file with non-default file space strategy and + * non-default free-space section threshold. + *------------------------------------------------------------------------- + */ +static void +gent_fs_strategy_threshold(void) +{ + hid_t fid; /* File id */ + hid_t fcpl; /* File creation property */ + + /* Create file-creation template */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + + /* Set file space information */ + H5Pset_file_space(fcpl, STRATEGY, THRESHOLD10); + /* Create the file with the specified strategy and threshold */ + fid = H5Fcreate(FILE66, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT); + + /* close */ + H5Fclose(fid); + H5Pclose(fcpl); +} /*------------------------------------------------------------------------- * Function: main @@ -6516,7 +6546,7 @@ int main(void) gent_attr_creation_order(); gent_fpformat(); gent_extlinks(); - + gent_fs_strategy_threshold(); return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 3ffff50..9dcb562 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -340,6 +340,7 @@ TOOLTEST tnofilename.ddl # tests for super block TOOLTEST tboot1.ddl -H -B -d dset tfcontents1.h5 TOOLTEST tboot2.ddl -B tfcontents2.h5 +TOOLTEST file_space.ddl -B file_space.h5 # test -p with a non existing dataset TOOLTEST tperror.ddl -p -d bogus tfcontents1.h5 |