diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2016-02-05 19:17:02 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2016-02-05 19:17:02 (GMT) |
commit | 56a8a212ebcd67912e79d612dae36285bea9e286 (patch) | |
tree | 08fa925be0d08038d7f50a5a339368ba9ca602ad /tools | |
parent | a6bfa0a0aeccc101c03501956be6eef41ae723f2 (diff) | |
download | hdf5-56a8a212ebcd67912e79d612dae36285bea9e286.zip hdf5-56a8a212ebcd67912e79d612dae36285bea9e286.tar.gz hdf5-56a8a212ebcd67912e79d612dae36285bea9e286.tar.bz2 |
[svn-r29048] Fix to h5format_convert tool:
(1) Downgrade layout version to 3 for contiguous and compact dataset
(2) Add new test files for testing with/without messages in superblock extension.
Tested on jam, osx1010test, platypus, quail, ostrich, kite, moohan, kituo, mayll, emu.
Diffstat (limited to 'tools')
45 files changed, 1470 insertions, 453 deletions
diff --git a/tools/h5format_convert/h5fc_gentest.c b/tools/h5format_convert/h5fc_gentest.c index 888aa27..54ef3df 100644 --- a/tools/h5format_convert/h5fc_gentest.c +++ b/tools/h5format_convert/h5fc_gentest.c @@ -23,15 +23,30 @@ * of the expected output and update the corresponding *.ddl files. */ #include "hdf5.h" +#include "H5private.h" + +#define NON_V3_FILE "h5fc_non_v3.h5" +#define EDGE_V3_FILE "h5fc_edge_v3.h5" + +const char *FILENAME[] = { + "h5fc_ext1_i.h5", /* 0 */ + "h5fc_ext1_s.h5", /* 1 */ + "h5fc_ext1_f.h5", /* 2 */ + "h5fc_ext2_is.h5", /* 3 */ + "h5fc_ext2_if.h5", /* 4 */ + "h5fc_ext2_sf.h5", /* 5 */ + "h5fc_ext3_isf.h5", /* 6 */ + "h5fc_ext_none.h5", /* 7 */ + NULL +}; #define GROUP "GROUP" -#define OLD_V1_FILE "h5fc_v1.h5" -#define DSET_NON_CHUNKED "DSET_NON_CHUNKED" #define DSET_BT1 "DSET_BT1" #define DSET_NDATA_BT1 "DSET_NDATA_BT1" +#define DSET_COMPACT "DSET_COMPACT" +#define DSET_CONTIGUOUS "DSET_CONTIGUOUS" -#define LATEST_V3_FILE "h5fc_latest_v3.h5" #define DSET_EA "DSET_EA" #define DSET_NDATA_EA "DSET_NDATA_EA" #define DSET_BT2 "DSET_BT2" @@ -41,58 +56,84 @@ #define DSET_NONE "DSET_NONE" #define DSET_NDATA_NONE "DSET_NDATA_NONE" -#define NON_V3_FILE "h5fc_non_v3.h5" - -#define EDGE_V3_FILE "h5fc_edge_v3.h5" #define DSET_EDGE "DSET_EDGE" +#define ISTORE_IK 64 + /* - * Function: gen_old() + * Function: gen_latest() * - * Create an old format file with: - * 1) 1 non-chunked dataset - * 2) 2 chunked datasets with version 1 B-tree chunk indexing type: with/without data + * Create a file with write+latest-format--this will result in v3 superblock+latest version support: + * 1) 2 chunked datasets with extensible array chunk indexing type (with/without data) + * 2) 2 chunked datasets with version 2 B-tree chunk indexing type (with/without data) + * 3) 2 chunked datasets with fixed array chunk indexing type (with/without data) + * 4) 2 chunked datasets with implicit array chunk indexing type (with/without data) + */ + +/* + * Function: gen_non() + * + * Create a file with SWMR write+non-latest-format--this will result in v3 superbock+latest version support: + * 1) 1 chunked dataset with extensible array chunk indexing type (without data) + * 2) 1 chunked dataset with version 2 B-tree chunk indexing type (with data) + * Re-open the file with write+non-latest-format and create: + * 3) 1 chunked dataset with version 2 B-tree chunk indexing type (without data) + * 4) 1 chunked dataset with extensible array indexing type (with data) + * 5) 1 compact and 1 contiguous datasets */ static void -gen_old(const char *fname) +gen_non(const char *fname) { - hid_t fid = -1; /* file id */ - hid_t fcpl = -1; - hid_t gid = -1; /* group id */ - hid_t sid = -1; /* space id */ - hid_t dcpl = -1; /* dataset creation property id */ + hid_t fid = -1; /* file id */ + hid_t fcpl = -1; /* file creation property list */ + hid_t gid = -1; /* group id */ + hid_t sid = -1; /* space id */ + hid_t dcpl = -1; /* dataset creation property id */ hid_t did1 = -1, did2 = -1; /* dataset id */ hsize_t dims1[1] = {10}; /* dataset dimension */ hsize_t dims2[2] = {4, 6}; /* dataset dimension */ + hsize_t max_dims[2]; /* maximum dataset dimension */ hsize_t c_dims[2] = {2, 3}; /* chunk dimension */ int i; /* local index variable */ int buf[24]; /* data buffer */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; - + if(H5Pset_shared_mesg_nindexes(fcpl, 4) < 0) + goto error; if(H5Pset_istore_k(fcpl, 64) < 0) goto error; - /* Create file */ - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) + /* Create a new file with SWMR_WRITE + non-latest-format */ + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, fcpl, H5P_DEFAULT)) < 0) goto error; /* Create a group */ if((gid = H5Gcreate2(fid, GROUP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; + /* Create data */ + for(i = 0; i < 24; i++) + buf[i] = i; + + /* Set chunk */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + goto error; + if(H5Pset_chunk(dcpl, 2, c_dims) < 0) + goto error; /* - * Create a non-chunked dataset + * Create a chunked dataset with extensible array chunk indexing type (without data) */ /* Create dataspace */ - if((sid = H5Screate_simple(1, dims1, NULL)) < 0) + max_dims[0] = 10; + max_dims[1] = H5S_UNLIMITED; + if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; /* Create the dataset */ - if((did1 = H5Dcreate2(fid, DSET_NON_CHUNKED, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + if((did1 = H5Dcreate2(fid, DSET_NDATA_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Closing */ @@ -102,114 +143,70 @@ gen_old(const char *fname) goto error; /* - * Create two chunked datasets with version 1 B-tree chunk indexing type - * (one with data, one without data) + * Create a chunked dataset with version 2 B-tree chunk indexing type (with data) */ - /* Create data */ - for(i = 0; i < 24; i++) - buf[i] = i; - - /* Set chunk */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if(H5Pset_chunk(dcpl, 2, c_dims) < 0) - goto error; - /* Create dataspace */ - if((sid = H5Screate_simple(2, dims2, NULL)) < 0) + max_dims[0] = 10; + max_dims[0] = H5S_UNLIMITED; + max_dims[1] = H5S_UNLIMITED; + if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; - /* Create the 2 datasets */ - if((did1 = H5Dcreate2(fid, DSET_NDATA_BT1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + /* Create the dataset */ + if((did1 = H5Dcreate2(gid, DSET_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if((did2 = H5Dcreate2(gid, DSET_BT1, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - - /* Write to one dataset */ - if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + /* Write to the dataset */ + if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; /* Closing */ - if(H5Pclose(dcpl) < 0) - goto error; if(H5Sclose(sid) < 0) goto error; if(H5Dclose(did1) < 0) goto error; - if(H5Dclose(did2) < 0) + if(H5Pclose(dcpl) < 0) goto error; - if(H5Gclose(gid) < 0) goto error; if(H5Fclose(fid) < 0) goto error; -error: - H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Sclose(sid); - H5Dclose(did1); - H5Dclose(did2); - H5Gclose(gid); - H5Fclose(fid); - } H5E_END_TRY; + /* Re-open the file with old format */ + if((fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + goto error; -} /* gen_old() */ + /* Open the group */ + if((gid = H5Gopen2(fid, GROUP, H5P_DEFAULT)) < 0) + goto error; -/* - * Function: gen_latest() - * - * Create a file with write+latest-format--this will result in v3 superblock+latest version support: - * 1) 2 chunked datasets with extensible array chunk indexing type (with/without data) - * 2) 2 chunked datasets with version 2 B-tree chunk indexing type (with/without data) - * 3) 2 chunked datasets with fixed array chunk indexing type (with/without data) - * 4) 2 chunked datasets with implicit array chunk indexing type (with/without data) - */ -static void -gen_latest(const char *fname) -{ - hid_t fid = -1; /* file id */ - hid_t fapl = -1; /* file access property list */ - hid_t fcpl = -1; /* file creation property list */ - hid_t gid = -1; /* group id */ - hid_t sid = -1; /* space id */ - hid_t dcpl = -1; /* dataset creation property id */ - hid_t did1 = -1, did2 = -1; /* dataset id */ - hsize_t dims2[2] = {4, 6}; /* dataset dimension */ - hsize_t max_dims[2]; /* maximum dataset dimension */ - hsize_t c_dims[2] = {2, 3}; /* chunk dimension */ - int i; /* local index variable */ - int buf[24]; /* data buffer */ + /* + * Create a dataset with version 2 B-btree chunk indexing type (without data) + */ - /* Create a new format file */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + /* Set chunk */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + if(H5Pset_chunk(dcpl, 2, c_dims) < 0) goto error; - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; - if(H5Pset_shared_mesg_nindexes(fcpl, 4) < 0) - goto error; - - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, fapl)) < 0) + /* Create dataspace */ + max_dims[0] = H5S_UNLIMITED; + max_dims[1] = H5S_UNLIMITED; + if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; - /* Create a group */ - if((gid = H5Gcreate2(fid, GROUP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Create the dataset */ + if((did1 = H5Dcreate2(fid, DSET_NDATA_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - /* Set chunk */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if(H5Pset_chunk(dcpl, 2, c_dims) < 0) + /* Close the dataspace */ + if(H5Sclose(sid) < 0) goto error; - /* - * Create 2 chunked datasets with extensible array chunk indexing type - * (one with data; one without data) + /* + * Create a dataset with extensible array chunk indexing type (with data) in the group */ /* Create dataspace */ @@ -218,127 +215,155 @@ gen_latest(const char *fname) if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; - /* Create the 2 datasets */ - if((did1 = H5Dcreate2(gid, DSET_NDATA_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - - if((did2 = H5Dcreate2(fid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + /* Create the dataset */ + if((did2 = H5Dcreate2(gid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - /* Create data */ - for(i = 0; i < 24; i++) - buf[i] = i; - - /* Write to one dataset */ + /* Write to the dataset */ if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; /* Closing */ if(H5Sclose(sid) < 0) goto error; + if(H5Pclose(dcpl) < 0) + goto error; if(H5Dclose(did1) < 0) goto error; if(H5Dclose(did2) < 0) goto error; - /* - * Create 2 chunked datasets with version 2 B-tree chunk indexing type - * (one with data; one without data) + * Create a compact dataset in the group */ /* Create dataspace */ - max_dims[0] = 10; - max_dims[0] = H5S_UNLIMITED; - max_dims[1] = H5S_UNLIMITED; - if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) + if((sid = H5Screate_simple(1, dims1, NULL)) < 0) goto error; - /* Create the 2 datasets */ - if((did1 = H5Dcreate2(fid, DSET_NDATA_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - - if((did2 = H5Dcreate2(gid, DSET_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if(H5Pset_layout(dcpl, H5D_COMPACT) < 0) goto error; - /* Write to one dataset */ - if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + /* Create the dataset */ + if((did1 = H5Dcreate2(gid, DSET_COMPACT, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Closing */ - if(H5Sclose(sid) < 0) - goto error; if(H5Dclose(did1) < 0) goto error; - if(H5Dclose(did2) < 0) + if(H5Pclose(dcpl) < 0) + goto error; + if(H5Sclose(sid) < 0) goto error; - /* - * Create 2 chunked datasets with fixed array chunk indexing type - * (one with data; one without data) + /* + * Create a contiguous dataset with (2d with data) in the file */ - - /* Create dataspace */ - max_dims[0] = 20; - max_dims[1] = 10; - if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; - - /* Create the datasets */ - if((did1 = H5Dcreate2(fid, DSET_FA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if(H5Pset_layout(dcpl, H5D_CONTIGUOUS) < 0) goto error; - if((did2 = H5Dcreate2(gid, DSET_NDATA_FA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((sid = H5Screate_simple(2, dims2, NULL)) < 0) goto error; + /* Create the dataset */ + if((did2 = H5Dcreate2(fid, DSET_CONTIGUOUS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; /* Write to the dataset */ - if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; /* Closing */ + if(H5Dclose(did2) < 0) + goto error; + if(H5Pclose(dcpl) < 0) + goto error; if(H5Sclose(sid) < 0) goto error; - if(H5Dclose(did1) < 0) + + if(H5Gclose(gid) < 0) goto error; - if(H5Dclose(did2) < 0) + if(H5Fclose(fid) < 0) goto error; +error: + H5E_BEGIN_TRY { + H5Pclose(dcpl); + H5Sclose(sid); + H5Dclose(did1); + H5Dclose(did2); + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; - /* - * Create 2 chunked datasets with implicit chunk indexing type - * (one with data; one without data) - */ +} /* gen_non() */ - /* Create dataspace */ - if((sid = H5Screate_simple(2, dims2, NULL)) < 0) - goto error; +/* + * Function: gen_edge() + * + * Create a file with write+latest-format--this will result in v3 superblock+latest version support: + * A dataset: chunked, filtered, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS enabled + * (i.e. the dataset does not filter partial edge chunks) + */ +static void +gen_edge(const char *fname) +{ + hid_t fid = -1; /* file id */ + hid_t fapl = -1; /* file access property list */ + hid_t sid = -1; /* dataspace id */ + hid_t dcpl = -1; /* dataset creation property id */ + hid_t did = -1; /* dataset id */ + hsize_t dims2[2] = {12, 6}; /* Dataset dimensions */ + hsize_t c_dims[2] = {5, 5}; /* Chunk dimensions */ + float buf[12][6]; /* Buffer for writing data */ + int i, j; /* local index variable */ - /* Set early allocation */ - if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) + /* Create a new format file */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto error; - - /* Create the 2 datasets */ - if((did1 = H5Dcreate2(fid, DSET_NONE, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto error; + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; - if((did2 = H5Dcreate2(gid, DSET_NDATA_NONE, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + /* Set chunk, filter, no-filter-edge-chunk */ + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; + if(H5Pset_chunk(dcpl, 2, c_dims) < 0) + goto error; + if(H5Pset_deflate(dcpl, 9) < 0) + goto error; + if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) + goto error; - /* Write to one dataset */ - if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + /* Create dataspace */ + if((sid = H5Screate_simple(2, dims2, NULL)) < 0) + goto error; + + /* Create the dataset */ + if((did = H5Dcreate2(fid, DSET_EDGE, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Create data */ + for (i = 0; i< 12; i++) + for (j = 0; j< 6; j++) + buf[i][j] = 100.0F; + + /* Write to the dataset */ + if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; /* Closing */ - if(H5Dclose(did1) < 0) - goto error; - if(H5Dclose(did2) < 0) + if(H5Pclose(dcpl) < 0) goto error; if(H5Sclose(sid) < 0) goto error; - - if(H5Pclose(dcpl) < 0) + if(H5Dclose(did) < 0) goto error; - if(H5Gclose(gid) < 0) + if(H5Pclose(fapl) < 0) goto error; if(H5Fclose(fid) < 0) goto error; @@ -347,34 +372,35 @@ error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); - H5Dclose(did1); - H5Dclose(did2); - H5Gclose(gid); + H5Dclose(did); H5Fclose(fid); H5Pclose(fapl); } H5E_END_TRY; -} /* gen_latest() */ +} /* gen_edge() */ + /* - * Function: gen_non() + * Function: gen_ext() * - * Create a file with SWMR write+non-latest-format--this will result in v3 superbock+latest version support: - * 1) 1 chunked dataset with extensible array chunk indexing type (without data) - * 2) 1 chunked dataset with version 2 B-tree chunk indexing type (with data) - * Re-open the file with write+non-latest-format and create: - * 3) 1 chunked dataset with version 2 B-tree chunk indexing type (without data) - * 4) 1 chunked dataset with extensible array indexing type (with data) - * 5) 1 non-chunked dataset + * Create a file with/without latest format with: + * 1) 1 contiguous dataset (without data) + * 2) 2 chunked datasets with extensible array chunk indexing type (with/without data) + * 3) 2 chunked datasets with version 2 B-tree chunk indexing type (with/without data) + * 4) 2 chunked datasets with fixed array chunk indexing type (with/without data) + * 5) 2 chunked datasets with implicit array chunk indexing type (with/without data) + * It will create the file with/without messages in the superblock extension depending + * on the parameter "what". */ static void -gen_non(const char *fname) +gen_ext(const char *fname, unsigned new, unsigned what) { - hid_t fid = -1; /* file id */ - hid_t fcpl = -1; /* file creation property list */ - hid_t gid = -1; /* group id */ + hid_t fid = -1; /* file id */ + hid_t fapl = -1; /* file access property list */ + hid_t fcpl = -1; /* file creation property list */ + hid_t gid = -1; /* group id */ hid_t sid = -1; /* space id */ - hid_t dcpl = -1; /* dataset creation property id */ + hid_t dcpl = -1; /* dataset creation property id */ hid_t did1 = -1, did2 = -1; /* dataset id */ hsize_t dims1[1] = {10}; /* dataset dimension */ hsize_t dims2[2] = {4, 6}; /* dataset dimension */ @@ -383,43 +409,75 @@ gen_non(const char *fname) int i; /* local index variable */ int buf[24]; /* data buffer */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; - if(H5Pset_shared_mesg_nindexes(fcpl, 4) < 0) - goto error; - if(H5Pset_istore_k(fcpl, 64) < 0) - goto error; + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; - /* Create a new file with SWMR_WRITE + non-latest-format */ - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC|H5F_ACC_SWMR_WRITE, fcpl, H5P_DEFAULT)) < 0) + if(new) { + /* Create a new format file */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto error; + } + + /* Create a file creation property list */ + fcpl = H5Pcreate(H5P_FILE_CREATE); + + /* Generate messages that might be placed in superblock extension */ + switch(what) { + case 0: + H5Pset_istore_k(fcpl, ISTORE_IK); + break; + case 1: + H5Pset_shared_mesg_nindexes(fcpl, 4); + break; + case 2: + H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); + break; + case 3: + H5Pset_istore_k(fcpl, ISTORE_IK); + H5Pset_shared_mesg_nindexes(fcpl, 4); + break; + case 4: + H5Pset_istore_k(fcpl, ISTORE_IK); + H5Pset_file_space(fcpl, 0, (hsize_t)2); + break; + case 5: + H5Pset_shared_mesg_nindexes(fcpl, 4); + H5Pset_file_space(fcpl, H5F_FILE_SPACE_VFD, (hsize_t)0); + break; + case 6: + H5Pset_istore_k(fcpl, ISTORE_IK); + H5Pset_shared_mesg_nindexes(fcpl, 4); + H5Pset_file_space(fcpl, H5F_FILE_SPACE_AGGR_VFD, (hsize_t)0); + break; + default: + break; + } + + /* Create the file */ + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, fapl)) < 0) goto error; /* Create a group */ if((gid = H5Gcreate2(fid, GROUP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; - /* Create data */ - for(i = 0; i < 24; i++) - buf[i] = i; - /* Set chunk */ if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) goto error; if(H5Pset_chunk(dcpl, 2, c_dims) < 0) goto error; + /* - * Create a chunked dataset with extensible array chunk indexing type (without data) + * Create a contiguous dataset */ /* Create dataspace */ - max_dims[0] = 10; - max_dims[1] = H5S_UNLIMITED; - if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) + if((sid = H5Screate_simple(1, dims1, NULL)) < 0) goto error; /* Create the dataset */ - if((did1 = H5Dcreate2(fid, DSET_NDATA_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + if((did1 = H5Dcreate2(fid, DSET_CONTIGUOUS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; /* Closing */ @@ -429,22 +487,29 @@ gen_non(const char *fname) goto error; /* - * Create a chunked dataset with version 2 B-tree chunk indexing type (with data) + * Create 2 chunked datasets with extensible array chunk indexing type + * (one with data; one without data) */ /* Create dataspace */ max_dims[0] = 10; - max_dims[0] = H5S_UNLIMITED; max_dims[1] = H5S_UNLIMITED; if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; - /* Create the dataset */ - if((did1 = H5Dcreate2(gid, DSET_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + /* Create the 2 datasets */ + if((did1 = H5Dcreate2(gid, DSET_NDATA_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - /* Write to the dataset */ - if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if((did2 = H5Dcreate2(fid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Create data */ + for(i = 0; i < 24; i++) + buf[i] = i; + + /* Write to one dataset */ + if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; /* Closing */ @@ -452,61 +517,61 @@ gen_non(const char *fname) goto error; if(H5Dclose(did1) < 0) goto error; - if(H5Pclose(dcpl) < 0) - goto error; - if(H5Gclose(gid) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; - - /* Re-open the file with old format */ - if((fid = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) + if(H5Dclose(did2) < 0) goto error; - /* Open the group */ - if((gid = H5Gopen2(fid, GROUP, H5P_DEFAULT)) < 0) - goto error; - /* - * Create a dataset with version 2 B-btree chunk indexing type (without data) + /* + * Create 2 chunked datasets with version 2 B-tree chunk indexing type + * (one with data; one without data) */ - /* Set chunk */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) - goto error; - if(H5Pset_chunk(dcpl, 2, c_dims) < 0) - goto error; - /* Create dataspace */ + max_dims[0] = 10; max_dims[0] = H5S_UNLIMITED; max_dims[1] = H5S_UNLIMITED; if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; - /* Create the dataset */ - if((did1 = H5Dcreate2(fid, DSET_NDATA_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + /* Create the 2 datasets */ + if((did1 = H5Dcreate2(fid, DSET_NDATA_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - /* Close the dataspace */ + if((did2 = H5Dcreate2(gid, DSET_BT2, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + + /* Write to one dataset */ + if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + goto error; + + /* Closing */ if(H5Sclose(sid) < 0) goto error; + if(H5Dclose(did1) < 0) + goto error; + if(H5Dclose(did2) < 0) + goto error; /* - * Create a dataset with version extensible array chunk indexing type (with data) in the group + * Create 2 chunked datasets with fixed array chunk indexing type + * (one with data; one without data) */ /* Create dataspace */ - max_dims[0] = 10; - max_dims[1] = H5S_UNLIMITED; + max_dims[0] = 20; + max_dims[1] = 10; if((sid = H5Screate_simple(2, dims2, max_dims)) < 0) goto error; - /* Create the dataset */ - if((did2 = H5Dcreate2(gid, DSET_EA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + /* Create the datasets */ + if((did1 = H5Dcreate2(fid, DSET_FA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) + goto error; + + if((did2 = H5Dcreate2(gid, DSET_NDATA_FA, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; /* Write to the dataset */ - if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; /* Closing */ @@ -517,106 +582,42 @@ gen_non(const char *fname) if(H5Dclose(did2) < 0) goto error; + /* - * Create a non-chunked dataset in the group + * Create 2 chunked datasets with implicit chunk indexing type + * (one with data; one without data) */ /* Create dataspace */ - if((sid = H5Screate_simple(1, dims1, NULL)) < 0) + if((sid = H5Screate_simple(2, dims2, NULL)) < 0) goto error; - /* Create the dataset */ - if((did1 = H5Dcreate2(gid, DSET_NON_CHUNKED, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Set early allocation */ + if(H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto error; - /* Closing */ - if(H5Sclose(sid) < 0) - goto error; - if(H5Dclose(did1) < 0) + /* Create the 2 datasets */ + if((did1 = H5Dcreate2(fid, DSET_NONE, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; - if(H5Gclose(gid) < 0) - goto error; - if(H5Fclose(fid) < 0) - goto error; - if(H5Pclose(dcpl) < 0) + if((did2 = H5Dcreate2(gid, DSET_NDATA_NONE, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error; -error: - H5E_BEGIN_TRY { - H5Pclose(dcpl); - H5Sclose(sid); - H5Dclose(did1); - H5Dclose(did2); - H5Gclose(gid); - H5Fclose(fid); - } H5E_END_TRY; - -} /* gen_non() */ - -/* - * Function: gen_edge() - * - * Create a file with write+latest-format--this will result in v3 superblock+latest version support: - * A dataset: chunked, filtered, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS enabled - * (i.e. the dataset does not filter partial edge chunks) - */ -static void -gen_edge(const char *fname) -{ - hid_t fid = -1; /* file id */ - hid_t fapl = -1; /* file access property list */ - hid_t sid = -1; /* dataspace id */ - hid_t dcpl = -1; /* dataset creation property id */ - hid_t did = -1; /* dataset id */ - hsize_t dims2[2] = {12, 6}; /* Dataset dimensions */ - hsize_t c_dims[2] = {5, 5}; /* Chunk dimensions */ - float buf[12][6]; /* Buffer for writing data */ - int i, j; /* local index variable */ - - /* Create a new format file */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto error; - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + /* Write to one dataset */ + if(H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) goto error; - /* Set chunk, filter, no-filter-edge-chunk */ - if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) + /* Closing */ + if(H5Dclose(did1) < 0) goto error; - if(H5Pset_chunk(dcpl, 2, c_dims) < 0) + if(H5Dclose(did2) < 0) goto error; - if(H5Pset_deflate(dcpl, 9) < 0) - goto error; - if(H5Pset_chunk_opts(dcpl, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS) < 0) - goto error; - - /* Create dataspace */ - if((sid = H5Screate_simple(2, dims2, NULL)) < 0) - goto error; - - /* Create the dataset */ - if((did = H5Dcreate2(fid, DSET_EDGE, H5T_NATIVE_FLOAT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) - goto error; - - /* Create data */ - for (i = 0; i< 12; i++) - for (j = 0; j< 6; j++) - buf[i][j] = 100.0F; - - /* Write to the dataset */ - if(H5Dwrite(did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) + if(H5Sclose(sid) < 0) goto error; - /* Closing */ if(H5Pclose(dcpl) < 0) goto error; - if(H5Sclose(sid) < 0) - goto error; - if(H5Dclose(did) < 0) - goto error; - if(H5Pclose(fapl) < 0) + if(H5Gclose(gid) < 0) goto error; if(H5Fclose(fid) < 0) goto error; @@ -625,25 +626,39 @@ error: H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); - H5Dclose(did); + H5Dclose(did1); + H5Dclose(did2); + H5Gclose(gid); H5Fclose(fid); H5Pclose(fapl); + H5Pclose(fcpl); } H5E_END_TRY; -} /* gen_edge() */ +} /* gen_ext() */ int main(void) { - /* Generate an old format file with v1 superbock */ - gen_old(OLD_V1_FILE); - - /* Generate a latest-format file with v3 superblock */ - gen_latest(LATEST_V3_FILE); + unsigned i, new; /* Generate a non-latest-format file with v3 superblock */ gen_non(NON_V3_FILE); - /* Generate a new format file with a no-filter-edge-chunk dataset for testing */ + /* Generate a new format file with a no-filter-edge-chunk dataset */ gen_edge(EDGE_V3_FILE); + + /* Generate old/new format file with/without messages in the superblock extension */ + for(new = FALSE; new <= TRUE; new++) { + for(i = 0; i < 8; i++) { + char filename[50]; + + HDmemset(filename, 0, sizeof(filename)); + if(!new) + HDstrcat(filename, "old_"); + HDstrcat(filename, FILENAME[i]); + + gen_ext(filename, new, i); + } + } /* end for new */ + return 0; } diff --git a/tools/h5format_convert/h5format_convert.c b/tools/h5format_convert/h5format_convert.c index 54c666d..105ac5d 100644 --- a/tools/h5format_convert/h5format_convert.c +++ b/tools/h5format_convert/h5format_convert.c @@ -88,16 +88,20 @@ static void usage(const char *prog) printf("Examples of use:\n"); printf("\n"); printf("h5format_convert -d /group/dataset file_name\n"); - printf(" Convert the chunk indexing type to version 1 B-tree\n"); - printf(" for the chunked dataset </group/dataset> in the HDF5 file <file_name>.\n"); + printf(" Convert the dataset </group/dataset> in the HDF5 file <file_name>:\n"); + printf(" a. chunked dataset: convert the chunk indexing type to version 1 B-tree\n"); + printf(" b. compact/contiguous dataset: downgrade the layout version to 3\n"); + printf(" c. virtual dataset: no action\n"); printf("\n"); printf("h5format_convert file_name\n"); - printf(" Convert the chunk indexing type to version 1 B-tree\n"); - printf(" for all the chunked datasets in the HDF5 file <file_name>.\n"); + printf(" Convert all datasets in the HDF5 file <file_name>:\n"); + printf(" a. chunked dataset: convert the chunk indexing type to version 1 B-tree\n"); + printf(" b. compact/contiguous dataset: downgrade the layout version to 3\n"); + printf(" c. virtual dataset: no action\n"); printf("\n"); printf("h5format_convert -n -d /group/dataset file_name\n"); printf(" Go through all the steps except the actual conversion when \n"); - printf(" converting the chunked dataset </group/dataset> in the HDF5 file <file_name>.\n"); + printf(" converting the dataset </group/dataset> in the HDF5 file <file_name>.\n"); } /* usage() */ /*------------------------------------------------------------------------- @@ -200,11 +204,15 @@ leave(int ret) /*------------------------------------------------------------------------- * Function: convert() * - * Purpose: To change the chunk indexing type for the dataset to version 1 B-tree. - * -- the dataset has to be chunked - * -- the dataset's chunk indexing type is not already version 1 B-tree. - * If the above conditions are not fulfilled, the tool will not perform - * the conversion but will exit with success. + * Purpose: To downgrade a dataset's indexing type or layout version: + * For chunked: + * Downgrade the chunk indexing type to version 1 B-tree + * If type is already version 1 B-tree, no further action + * For compact/contiguous: + * Downgrade the layout version from 4 to 3 + * If version is already <= 3, no further action + * For virtual: + * No further action * * Return: Success: 0 * Failure: 1 @@ -244,34 +252,49 @@ convert(hid_t fid, const char *dname) } else if(verbose_g) printf("Retrieve the dataset's layout\n"); - /* No further action if not a chunked dataset */ - if(layout_type != H5D_CHUNKED) { - if(verbose_g) - printf("Dataset is not chunked: no further action\n"); - h5tools_setstatus(EXIT_SUCCESS); - goto done; + switch(layout_type) { + case H5D_CHUNKED: + if(verbose_g) + printf("Dataset is a chunked dataset\n"); - } else if(verbose_g) - printf("Verify the dataset is a chunked dataset\n"); + /* Get the dataset's chunk indexing type */ + if(H5Dget_chunk_index_type(did, &idx_type) < 0) { + error_msg("unable to get the chunk indexing type for \"%s\"\n", dname); + h5tools_setstatus(EXIT_FAILURE); + goto error; + } else if(verbose_g) + printf("Retrieve the dataset's chunk indexing type\n"); - /* Get the dataset's chunk indexing type */ - if(H5Dget_chunk_index_type(did, &idx_type) < 0) { - error_msg("unable to get the chunk indexing type for \"%s\"\n", dname); - h5tools_setstatus(EXIT_FAILURE); - goto error; + if(idx_type == H5D_CHUNK_IDX_BTREE) { + if(verbose_g) + printf("Dataset's chunk indexing type is already version 1 B-tree: no further action\n"); + h5tools_setstatus(EXIT_SUCCESS); + goto done; + } else if (verbose_g) + printf("Dataset's chunk indexing type is not version 1 B-tree\n"); + break; - } else if(verbose_g) - printf("Retrieve the dataset's chunk indexing type\n"); + case H5D_CONTIGUOUS: + if(verbose_g) + printf("Dataset is a contiguous dataset: downgrade layout version as needed\n"); + break; - /* No further action if the chunk indexing type is already version 1 B-tree */ - if(idx_type == H5D_CHUNK_IDX_BTREE) { - if(verbose_g) - printf("Chunk indexing type is already version 1 B-tree: no further action\n"); - h5tools_setstatus(EXIT_SUCCESS); - goto done; + case H5D_COMPACT: + if(verbose_g) + printf("Dataset is a compact dataset: downgrade layout version as needed\n"); + break; - } else if (verbose_g) - printf("Verify the dataset's chunk indexing type is not version 1 B-tree\n"); + case H5D_VIRTUAL: + if(verbose_g) + printf("No further action for virtual dataset\n"); + goto done; + + default: + error_msg("unknown layout type for \"%s\"\n", dname); + h5tools_setstatus(EXIT_FAILURE); + goto error; + + } /* end switch */ /* No further action if it is a noop */ if(noop_g) { @@ -284,12 +307,11 @@ convert(hid_t fid, const char *dname) if(verbose_g) printf("Converting the dataset...\n"); - /* Convert the dataset's chunk indexing type to version 1 B-tree */ + /* Downgrade the dataset */ if(H5Dformat_convert(did) < 0) { - error_msg("unable to convert chunk indexing for \"%s\"\n", dname); + error_msg("unable to downgrade dataset for \"%s\"\n", dname); h5tools_setstatus(EXIT_FAILURE); goto error; - } else if(verbose_g) printf("Done\n"); @@ -377,9 +399,6 @@ main(int argc, const char *argv[]) H5E_auto2_t func; void *edata; hid_t fid = -1; - hid_t fcpl = -1; - H5F_file_space_type_t strategy; - hsize_t threshold; h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); @@ -429,6 +448,7 @@ main(int argc, const char *argv[]) printf("Processing the file's superblock...\n"); } + /* Process superblock */ if(H5Fformat_convert(fid) < 0) { error_msg("unable to convert file's superblock\"%s\"\n", fname_g); h5tools_setstatus(EXIT_FAILURE); diff --git a/tools/h5format_convert/testfiles/h5fc_d_file.ddl b/tools/h5format_convert/testfiles/h5fc_d_file.ddl index 3641a4f..ad7a2f4 100644 --- a/tools/h5format_convert/testfiles/h5fc_d_file.ddl +++ b/tools/h5format_convert/testfiles/h5fc_d_file.ddl @@ -9,14 +9,18 @@ usage: h5format_convert [OPTIONS] file_name Examples of use: h5format_convert -d /group/dataset file_name - Convert the chunk indexing type to version 1 B-tree - for the chunked dataset </group/dataset> in the HDF5 file <file_name>. + Convert the dataset </group/dataset> in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert file_name - Convert the chunk indexing type to version 1 B-tree - for all the chunked datasets in the HDF5 file <file_name>. + Convert all datasets in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert -n -d /group/dataset file_name Go through all the steps except the actual conversion when - converting the chunked dataset </group/dataset> in the HDF5 file <file_name>. + converting the dataset </group/dataset> in the HDF5 file <file_name>. h5format_convert error: missing file name diff --git a/tools/h5format_convert/testfiles/h5fc_dname.ddl b/tools/h5format_convert/testfiles/h5fc_dname.ddl index c391764..0de42cb 100644 --- a/tools/h5format_convert/testfiles/h5fc_dname.ddl +++ b/tools/h5format_convert/testfiles/h5fc_dname.ddl @@ -9,14 +9,18 @@ usage: h5format_convert [OPTIONS] file_name Examples of use: h5format_convert -d /group/dataset file_name - Convert the chunk indexing type to version 1 B-tree - for the chunked dataset </group/dataset> in the HDF5 file <file_name>. + Convert the dataset </group/dataset> in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert file_name - Convert the chunk indexing type to version 1 B-tree - for all the chunked datasets in the HDF5 file <file_name>. + Convert all datasets in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert -n -d /group/dataset file_name Go through all the steps except the actual conversion when - converting the chunked dataset </group/dataset> in the HDF5 file <file_name>. + converting the dataset </group/dataset> in the HDF5 file <file_name>. h5format_convert error: No dataset name diff --git a/tools/h5format_convert/testfiles/h5fc_ext1_f.ddl b/tools/h5format_convert/testfiles/h5fc_ext1_f.ddl new file mode 100644 index 0000000..fb5192d --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext1_f.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 32 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext1_f.h5 b/tools/h5format_convert/testfiles/h5fc_ext1_f.h5 Binary files differnew file mode 100644 index 0000000..b5c5867 --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext1_f.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_ext1_i.ddl b/tools/h5format_convert/testfiles/h5fc_ext1_i.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext1_i.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext1_i.h5 b/tools/h5format_convert/testfiles/h5fc_ext1_i.h5 Binary files differnew file mode 100644 index 0000000..960a8d5 --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext1_i.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_ext1_s.ddl b/tools/h5format_convert/testfiles/h5fc_ext1_s.ddl new file mode 100644 index 0000000..fb5192d --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext1_s.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 32 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext1_s.h5 b/tools/h5format_convert/testfiles/h5fc_ext1_s.h5 Binary files differnew file mode 100644 index 0000000..103bde6 --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext1_s.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_ext2_if.ddl b/tools/h5format_convert/testfiles/h5fc_ext2_if.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext2_if.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext2_if.h5 b/tools/h5format_convert/testfiles/h5fc_ext2_if.h5 Binary files differnew file mode 100644 index 0000000..88e42e7 --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext2_if.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_ext2_is.ddl b/tools/h5format_convert/testfiles/h5fc_ext2_is.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext2_is.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext2_is.h5 b/tools/h5format_convert/testfiles/h5fc_ext2_is.h5 Binary files differnew file mode 100644 index 0000000..4d76436 --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext2_is.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_ext2_sf.ddl b/tools/h5format_convert/testfiles/h5fc_ext2_sf.ddl new file mode 100644 index 0000000..fb5192d --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext2_sf.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 32 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext2_sf.h5 b/tools/h5format_convert/testfiles/h5fc_ext2_sf.h5 Binary files differnew file mode 100644 index 0000000..c59a3ca --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext2_sf.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_ext3_isf.ddl b/tools/h5format_convert/testfiles/h5fc_ext3_isf.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext3_isf.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/h5fc_ext3_isf.h5 b/tools/h5format_convert/testfiles/h5fc_ext3_isf.h5 Binary files differnew file mode 100644 index 0000000..d00fc55 --- /dev/null +++ b/tools/h5format_convert/testfiles/h5fc_ext3_isf.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_latest_v3.h5 b/tools/h5format_convert/testfiles/h5fc_ext_none.h5 Binary files differindex f7de743..b1b1553 100644 --- a/tools/h5format_convert/testfiles/h5fc_latest_v3.h5 +++ b/tools/h5format_convert/testfiles/h5fc_ext_none.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_help.ddl b/tools/h5format_convert/testfiles/h5fc_help.ddl index 9081ab8..aef8c63 100644 --- a/tools/h5format_convert/testfiles/h5fc_help.ddl +++ b/tools/h5format_convert/testfiles/h5fc_help.ddl @@ -9,13 +9,17 @@ usage: h5format_convert [OPTIONS] file_name Examples of use: h5format_convert -d /group/dataset file_name - Convert the chunk indexing type to version 1 B-tree - for the chunked dataset </group/dataset> in the HDF5 file <file_name>. + Convert the dataset </group/dataset> in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert file_name - Convert the chunk indexing type to version 1 B-tree - for all the chunked datasets in the HDF5 file <file_name>. + Convert all datasets in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert -n -d /group/dataset file_name Go through all the steps except the actual conversion when - converting the chunked dataset </group/dataset> in the HDF5 file <file_name>. + converting the dataset </group/dataset> in the HDF5 file <file_name>. diff --git a/tools/h5format_convert/testfiles/h5fc_non_v3.h5 b/tools/h5format_convert/testfiles/h5fc_non_v3.h5 Binary files differindex b1bffa8..af2e8c4 100644 --- a/tools/h5format_convert/testfiles/h5fc_non_v3.h5 +++ b/tools/h5format_convert/testfiles/h5fc_non_v3.h5 diff --git a/tools/h5format_convert/testfiles/h5fc_nooption.ddl b/tools/h5format_convert/testfiles/h5fc_nooption.ddl index 9081ab8..aef8c63 100644 --- a/tools/h5format_convert/testfiles/h5fc_nooption.ddl +++ b/tools/h5format_convert/testfiles/h5fc_nooption.ddl @@ -9,13 +9,17 @@ usage: h5format_convert [OPTIONS] file_name Examples of use: h5format_convert -d /group/dataset file_name - Convert the chunk indexing type to version 1 B-tree - for the chunked dataset </group/dataset> in the HDF5 file <file_name>. + Convert the dataset </group/dataset> in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert file_name - Convert the chunk indexing type to version 1 B-tree - for all the chunked datasets in the HDF5 file <file_name>. + Convert all datasets in the HDF5 file <file_name>: + a. chunked dataset: convert the chunk indexing type to version 1 B-tree + b. compact/contiguous dataset: downgrade the layout version to 3 + c. virtual dataset: no action h5format_convert -n -d /group/dataset file_name Go through all the steps except the actual conversion when - converting the chunked dataset </group/dataset> in the HDF5 file <file_name>. + converting the dataset </group/dataset> in the HDF5 file <file_name>. diff --git a/tools/h5format_convert/testfiles/h5fc_v1.h5 b/tools/h5format_convert/testfiles/h5fc_v1.h5 Binary files differdeleted file mode 100644 index d3d66f8..0000000 --- a/tools/h5format_convert/testfiles/h5fc_v1.h5 +++ /dev/null diff --git a/tools/h5format_convert/testfiles/h5fc_v_all.ddl b/tools/h5format_convert/testfiles/h5fc_v_all.ddl index 9898faa..5e7365d 100644 --- a/tools/h5format_convert/testfiles/h5fc_v_all.ddl +++ b/tools/h5format_convert/testfiles/h5fc_v_all.ddl @@ -1,26 +1,76 @@ Process command line options Open the file tmp.h5 Processing all datasets in the file... -Going to process dataset:/DSET_NDATA_BT1... +Going to process dataset:/DSET_CONTIGUOUS... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a contiguous dataset: downgrade layout version as needed +Converting the dataset... +Done +Close the dataset +Close the dataset creation property list +Going to process dataset:/DSET_EA... +Open the dataset +Retrieve the dataset's layout +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is already version 1 B-tree: no further action +Close the dataset +Close the dataset creation property list +Going to process dataset:/DSET_FA... +Open the dataset +Retrieve the dataset's layout +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is already version 1 B-tree: no further action +Close the dataset +Close the dataset creation property list +Going to process dataset:/DSET_NDATA_BT2... +Open the dataset +Retrieve the dataset's layout +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is already version 1 B-tree: no further action +Close the dataset +Close the dataset creation property list +Going to process dataset:/DSET_NONE... +Open the dataset +Retrieve the dataset's layout +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Chunk indexing type is already version 1 B-tree: no further action +Dataset's chunk indexing type is already version 1 B-tree: no further action Close the dataset Close the dataset creation property list -Going to process dataset:/DSET_NON_CHUNKED... +Going to process dataset:/GROUP/DSET_BT2... Open the dataset Retrieve the dataset's layout -Dataset is not chunked: no further action +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is already version 1 B-tree: no further action +Close the dataset +Close the dataset creation property list +Going to process dataset:/GROUP/DSET_NDATA_EA... +Open the dataset +Retrieve the dataset's layout +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is already version 1 B-tree: no further action +Close the dataset +Close the dataset creation property list +Going to process dataset:/GROUP/DSET_NDATA_FA... +Open the dataset +Retrieve the dataset's layout +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is already version 1 B-tree: no further action Close the dataset Close the dataset creation property list -Going to process dataset:/GROUP/DSET_BT1... +Going to process dataset:/GROUP/DSET_NDATA_NONE... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Chunk indexing type is already version 1 B-tree: no further action +Dataset's chunk indexing type is already version 1 B-tree: no further action Close the dataset Close the dataset creation property list Processing the file's superblock... diff --git a/tools/h5format_convert/testfiles/h5fc_v_bt1.ddl b/tools/h5format_convert/testfiles/h5fc_v_bt1.ddl index 3bafc78..c501eb0 100644 --- a/tools/h5format_convert/testfiles/h5fc_v_bt1.ddl +++ b/tools/h5format_convert/testfiles/h5fc_v_bt1.ddl @@ -1,11 +1,11 @@ Process command line options Open the file tmp.h5 -Going to process dataset: /GROUP/DSET_BT1... +Going to process dataset: /GROUP/DSET_BT2... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Chunk indexing type is already version 1 B-tree: no further action +Dataset's chunk indexing type is already version 1 B-tree: no further action Close the dataset Close the dataset creation property list Processing the file's superblock... diff --git a/tools/h5format_convert/testfiles/h5fc_v_n_1d.ddl b/tools/h5format_convert/testfiles/h5fc_v_n_1d.ddl index 242386d..ff5da4a 100644 --- a/tools/h5format_convert/testfiles/h5fc_v_n_1d.ddl +++ b/tools/h5format_convert/testfiles/h5fc_v_n_1d.ddl @@ -4,9 +4,9 @@ Open the file tmp.h5 Going to process dataset: /DSET_EA... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Verify the dataset's chunk indexing type is not version 1 B-tree +Dataset's chunk indexing type is not version 1 B-tree Not converting the dataset Close the dataset Close the dataset creation property list diff --git a/tools/h5format_convert/testfiles/h5fc_v_n_all.ddl b/tools/h5format_convert/testfiles/h5fc_v_n_all.ddl index 3dec4a6..d2ffbbf 100644 --- a/tools/h5format_convert/testfiles/h5fc_v_n_all.ddl +++ b/tools/h5format_convert/testfiles/h5fc_v_n_all.ddl @@ -2,46 +2,54 @@ Process command line options It is noop... Open the file tmp.h5 Processing all datasets in the file... +Going to process dataset:/DSET_CONTIGUOUS... +Open the dataset +Retrieve the dataset's layout +Dataset is a contiguous dataset: downgrade layout version as needed +Not converting the dataset +Close the dataset +Close the dataset creation property list Going to process dataset:/DSET_NDATA_BT2... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Verify the dataset's chunk indexing type is not version 1 B-tree +Dataset's chunk indexing type is not version 1 B-tree Not converting the dataset Close the dataset Close the dataset creation property list Going to process dataset:/DSET_NDATA_EA... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Verify the dataset's chunk indexing type is not version 1 B-tree +Dataset's chunk indexing type is not version 1 B-tree Not converting the dataset Close the dataset Close the dataset creation property list Going to process dataset:/GROUP/DSET_BT2... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Verify the dataset's chunk indexing type is not version 1 B-tree +Dataset's chunk indexing type is not version 1 B-tree Not converting the dataset Close the dataset Close the dataset creation property list -Going to process dataset:/GROUP/DSET_EA... +Going to process dataset:/GROUP/DSET_COMPACT... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset -Retrieve the dataset's chunk indexing type -Verify the dataset's chunk indexing type is not version 1 B-tree +Dataset is a contiguous dataset: downgrade layout version as needed Not converting the dataset Close the dataset Close the dataset creation property list -Going to process dataset:/GROUP/DSET_NON_CHUNKED... +Going to process dataset:/GROUP/DSET_EA... Open the dataset Retrieve the dataset's layout -Dataset is not chunked: no further action +Dataset is a chunked dataset +Retrieve the dataset's chunk indexing type +Dataset's chunk indexing type is not version 1 B-tree +Not converting the dataset Close the dataset Close the dataset creation property list Not processing the file's superblock... diff --git a/tools/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl b/tools/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl index a326dc5..ba794a7 100644 --- a/tools/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl +++ b/tools/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl @@ -1,12 +1,12 @@ Process command line options It is noop... Open the file tmp.h5 -Going to process dataset: /DSET_NDATA_BT1... +Going to process dataset: /DSET_NDATA_BT2... Open the dataset Retrieve the dataset's layout -Verify the dataset is a chunked dataset +Dataset is a chunked dataset Retrieve the dataset's chunk indexing type -Chunk indexing type is already version 1 B-tree: no further action +Dataset's chunk indexing type is already version 1 B-tree: no further action Close the dataset Close the dataset creation property list Not processing the file's superblock... diff --git a/tools/h5format_convert/testfiles/h5fc_v_non_chunked.ddl b/tools/h5format_convert/testfiles/h5fc_v_non_chunked.ddl index bbc7229..aba0740 100644 --- a/tools/h5format_convert/testfiles/h5fc_v_non_chunked.ddl +++ b/tools/h5format_convert/testfiles/h5fc_v_non_chunked.ddl @@ -1,9 +1,11 @@ Process command line options Open the file tmp.h5 -Going to process dataset: /DSET_NON_CHUNKED... +Going to process dataset: /DSET_CONTIGUOUS... Open the dataset Retrieve the dataset's layout -Dataset is not chunked: no further action +Dataset is a contiguous dataset: downgrade layout version as needed +Converting the dataset... +Done Close the dataset Close the dataset creation property list Processing the file's superblock... diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext1_f.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext1_f.ddl new file mode 100644 index 0000000..fb5192d --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext1_f.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 32 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext1_f.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext1_f.h5 Binary files differnew file mode 100644 index 0000000..3cbc7f4 --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext1_f.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext1_i.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext1_i.ddl new file mode 100644 index 0000000..c906082 --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext1_i.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 1 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext1_i.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext1_i.h5 Binary files differnew file mode 100644 index 0000000..a2c9187 --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext1_i.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext1_s.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext1_s.ddl new file mode 100644 index 0000000..fb5192d --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext1_s.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 32 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext1_s.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext1_s.h5 Binary files differnew file mode 100644 index 0000000..fdf4f33 --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext1_s.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext2_if.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext2_if.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext2_if.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext2_if.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext2_if.h5 Binary files differnew file mode 100644 index 0000000..6bf0a2f --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext2_if.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext2_is.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext2_is.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext2_is.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext2_is.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext2_is.h5 Binary files differnew file mode 100644 index 0000000..c0c7ecc --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext2_is.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl new file mode 100644 index 0000000..fb5192d --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 32 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext2_sf.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext2_sf.h5 Binary files differnew file mode 100644 index 0000000..055cabf --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext2_sf.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl b/tools/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl new file mode 100644 index 0000000..2fff4ac --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl @@ -0,0 +1,58 @@ +HDF5 "./testfiles/tmp.h5" { +SUPER_BLOCK { + SUPERBLOCK_VERSION 2 + FREELIST_VERSION 0 + SYMBOLTABLE_VERSION 0 + OBJECTHEADER_VERSION 0 + OFFSET_SIZE 8 + LENGTH_SIZE 8 + BTREE_RANK 16 + BTREE_LEAF 4 + ISTORE_K 64 + FILE_SPACE_STRATEGY H5F_FILE_SPACE_ALL + FREE_SPACE_THRESHOLD 1 + USER_BLOCK { + USERBLOCK_SIZE 0 + } +} +GROUP "/" { + DATASET "DSET_CONTIGUOUS" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + } + DATASET "DSET_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + GROUP "GROUP" { + DATASET "DSET_BT2" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( H5S_UNLIMITED, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_EA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 10, H5S_UNLIMITED ) } + } + DATASET "DSET_NDATA_FA" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 20, 10 ) } + } + DATASET "DSET_NDATA_NONE" { + DATATYPE H5T_STD_I32LE + DATASPACE SIMPLE { ( 4, 6 ) / ( 4, 6 ) } + } + } +} +} diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext3_isf.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext3_isf.h5 Binary files differnew file mode 100644 index 0000000..f4caaf4 --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext3_isf.h5 diff --git a/tools/h5format_convert/testfiles/old_h5fc_ext_none.h5 b/tools/h5format_convert/testfiles/old_h5fc_ext_none.h5 Binary files differnew file mode 100644 index 0000000..d0bf344 --- /dev/null +++ b/tools/h5format_convert/testfiles/old_h5fc_ext_none.h5 diff --git a/tools/h5format_convert/testh5fc.sh.in b/tools/h5format_convert/testh5fc.sh.in index dc5aa48..f712434 100644 --- a/tools/h5format_convert/testh5fc.sh.in +++ b/tools/h5format_convert/testh5fc.sh.in @@ -41,6 +41,8 @@ RM='rm -rf' CMP='cmp -s' DIFF='diff -c' CP='cp' +H5DUMP=../h5dump/h5dump # The h5dump tool name +H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary DIRNAME='dirname' LS='ls' AWK='awk' @@ -79,10 +81,24 @@ TMPFILE=tmp.h5 # Comment '#' without space can be used. # -------------------------------------------------------------------- LIST_HDF5_TEST_FILES=" -$SRC_H5FORMCONV_TESTFILES/h5fc_v1.h5 -$SRC_H5FORMCONV_TESTFILES/h5fc_latest_v3.h5 $SRC_H5FORMCONV_TESTFILES/h5fc_non_v3.h5 $SRC_H5FORMCONV_TESTFILES/h5fc_edge_v3.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext_none.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext_none.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext1_i.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext1_s.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext1_f.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext2_if.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext2_is.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext2_sf.h5 +$SRC_H5FORMCONV_TESTFILES/h5fc_ext3_isf.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext1_i.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext1_s.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext1_f.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_if.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_is.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_sf.h5 +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext3_isf.h5 " LIST_OTHER_TEST_FILES=" @@ -98,6 +114,20 @@ $SRC_H5FORMCONV_TESTFILES/h5fc_v_ndata_bt1.ddl $SRC_H5FORMCONV_TESTFILES/h5fc_v_all.ddl $SRC_H5FORMCONV_TESTFILES/h5fc_v_n_1d.ddl $SRC_H5FORMCONV_TESTFILES/h5fc_v_n_all.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext1_i.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext1_s.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext1_f.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext2_if.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext2_is.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext2_sf.ddl +$SRC_H5FORMCONV_TESTFILES/h5fc_ext3_isf.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext1_i.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext1_s.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext1_f.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_if.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_is.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext2_sf.ddl +$SRC_H5FORMCONV_TESTFILES/old_h5fc_ext3_isf.ddl " # @@ -199,14 +229,7 @@ TOOLTEST_OUT() { cat $actual_err >> $actual # Compare output - if $CMP $expect $actual; then - echo " PASSED" - else - echo "*FAILED*" - echo " Expected result (*.ddl) differs from actual result (*.out)" - nerrors="`expr $nerrors + 1`" - test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' - fi + COMPARE_OUT $expect $actual # Clean up output file if test -z "$HDF5_NOCLEANUP"; then @@ -243,8 +266,8 @@ CHECKING() { echo "Verifying $* $SPACES" | cut -c1-80 | tr -d '\012' } -# $1 dataset name # Assume $TESTDIR/$TMPFILE is the converted test file +# $1 dataset name IDX_CHECK() { CHECKING $1 $RUNSERIAL $CHK_IDX_BIN $TESTDIR/$TMPFILE $1 @@ -258,6 +281,39 @@ IDX_CHECK() { fi } +# $1 is the expected output +# $2 is the output from testing +COMPARE_OUT() { + if $CMP $1 $2; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi +} + +# Assume $TESTDIR/$TMPFILE is the converted test file +# $1 is the test file for verifying h5dump output +# $2 is the expected output from h5dump +H5DUMP_CHECK() { + CHECKING h5dump output for $1 + expect="$TESTDIR/$2" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" + $RUNSERIAL $H5DUMP_BIN -BH $TESTDIR/$TMPFILE > $actual 2>$actual_err + cat $actual_err >> $actual + + # Compare output + COMPARE_OUT $expect $actual + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + $RM $actual $actual_err + fi +} + # Print a "SKIP" message SKIP() { TESTING $STAT $@ @@ -284,31 +340,31 @@ TOOLTEST_OUT h5fc_nooption.ddl '' TOOLTEST_OUT h5fc_nonexistfile.ddl nonexist.h5 # # -# h5format_convert -d h5fc_v1.h5 (just -d option, file exists) -# h5format_convert --dname h5fc_v1.h5 (just --dname option, file exists) +# h5format_convert -d old_h5fc_ext_none.h5 (just -d option, file exists) +# h5format_convert --dname old_h5fc_ext_none.h5 (just --dname option, file exists) # h5format_convert --dname (just --dname option) -# h5format_convert --dname=nonexist h5fc_v1.h5 (dataset does not exist, file exists) -TOOLTEST_OUT h5fc_d_file.ddl h5fc_v1.h5 -d -TOOLTEST_OUT h5fc_d_file.ddl h5fc_v1.h5 --dname +# h5format_convert --dname=nonexist old_h5fc_ext_none.h5 (dataset does not exist, file exists) +TOOLTEST_OUT h5fc_d_file.ddl old_h5fc_ext_none.h5 -d +TOOLTEST_OUT h5fc_d_file.ddl old_h5fc_ext_none.h5 --dname TOOLTEST_OUT h5fc_dname.ddl '' --dname -TOOLTEST_OUT h5fc_nonexistdset_file.ddl h5fc_v1.h5 --dname=nonexist +TOOLTEST_OUT h5fc_nonexistdset_file.ddl old_h5fc_ext_none.h5 --dname=nonexist # # # -# h5format_convert -d /DSET_NON_CHUNKED -v h5fc_v1.h5 (verbose, non-chunked dataset) -# h5format_convert -d /GROUP/DSET_BT1 --verbose h5fc_v1.h5 (verbose, bt1 dataset) -# h5format_convert -d /DSET_NDATA_BT1 -v -n h5fc_v1.h5 (verbose, noop, bt1+nodata dataset) -# h5format_convert -v h5fc_v1.h5 (verbose, all datasets) -TOOLTEST_OUT h5fc_v_non_chunked.ddl h5fc_v1.h5 -d /DSET_NON_CHUNKED -v -TOOLTEST_OUT h5fc_v_bt1.ddl h5fc_v1.h5 -d /GROUP/DSET_BT1 --verbose -TOOLTEST_OUT h5fc_v_ndata_bt1.ddl h5fc_v1.h5 -d /DSET_NDATA_BT1 -v -n -TOOLTEST_OUT h5fc_v_all.ddl h5fc_v1.h5 -v +# h5format_convert -d /DSET_CONTIGUOUS -v old_h5fc_ext_none.h5 (verbose, contiguous dataset) +# h5format_convert -d /GROUP/DSET_BT2 --verbose old_h5fc_ext_none.h5 (verbose, bt1 dataset) +# h5format_convert -d /DSET_NDATA_BT2 -v -n old_h5fc_ext_none.h5 (verbose, noop, bt1+nodata dataset) +# h5format_convert -v old_h5fc_ext_none.h5 (verbose, all datasets) +TOOLTEST_OUT h5fc_v_non_chunked.ddl old_h5fc_ext_none.h5 -d /DSET_CONTIGUOUS -v +TOOLTEST_OUT h5fc_v_bt1.ddl old_h5fc_ext_none.h5 -d /GROUP/DSET_BT2 --verbose +TOOLTEST_OUT h5fc_v_ndata_bt1.ddl old_h5fc_ext_none.h5 -d /DSET_NDATA_BT2 -v -n +TOOLTEST_OUT h5fc_v_all.ddl old_h5fc_ext_none.h5 -v # # # -# h5format_convert -d /DSET_EA -v -n h5fc_latest_v3.h5 (verbose, noop, one ea dataset) +# h5format_convert -d /DSET_EA -v -n h5fc_ext_none.h5 (verbose, noop, one ea dataset) # h5format_convert -v -n h5fc_non_v3.h5 (verbose, noop, all datasets) -TOOLTEST_OUT h5fc_v_n_1d.ddl h5fc_latest_v3.h5 -d /DSET_EA -v -n +TOOLTEST_OUT h5fc_v_n_1d.ddl h5fc_ext_none.h5 -d /DSET_EA -v -n TOOLTEST_OUT h5fc_v_n_all.ddl h5fc_non_v3.h5 -v -n # # @@ -316,45 +372,45 @@ TOOLTEST_OUT h5fc_v_n_all.ddl h5fc_non_v3.h5 -v -n # No output from tests # 1) Use the tool to convert the dataset # 2) Verify the chunk indexing type is correct -# h5format_convert -d /DSET_EA h5fc_latest_v3.h5 -# h5format_convert -d /GROUP/DSET_NDATA_EA h5fc_latest_v3.h5 -# h5format_convert -d /GROUP/DSET_BT2 h5fc_latest_v3.h5 -# h5format_convert -d /DSET_NDATA_BT2 h5fc_latest_v3.h5 -# h5format_convert -d /DSET_FA h5fc_latest_v3.h5 -# h5format_convert -d /GROUP/DSET_FA h5fc_latest_v3.h5 -# h5format_convert -d /DSET_NONE h5fc_latest_v3.h5 -# h5format_convert -d /GROUP/DSET_NONE h5fc_latest_v3.h5 -TOOLTEST h5fc_latest_v3.h5 -d /DSET_EA +# h5format_convert -d /DSET_EA h5fc_ext_none.h5 +# h5format_convert -d /GROUP/DSET_NDATA_EA h5fc_ext_none.h5 +# h5format_convert -d /GROUP/DSET_BT2 h5fc_ext_none.h5 +# h5format_convert -d /DSET_NDATA_BT2 h5fc_ext_none.h5 +# h5format_convert -d /DSET_FA h5fc_ext_none.h5 +# h5format_convert -d /GROUP/DSET_FA h5fc_ext_none.h5 +# h5format_convert -d /DSET_NONE h5fc_ext_none.h5 +# h5format_convert -d /GROUP/DSET_NDATA_NONE h5fc_ext_none.h5 +TOOLTEST h5fc_ext_none.h5 -d /DSET_EA IDX_CHECK /DSET_EA # -TOOLTEST h5fc_latest_v3.h5 -d /GROUP/DSET_NDATA_EA +TOOLTEST h5fc_ext_none.h5 -d /GROUP/DSET_NDATA_EA IDX_CHECK /GROUP/DSET_NDATA_EA # -TOOLTEST h5fc_latest_v3.h5 -d /GROUP/DSET_BT2 +TOOLTEST h5fc_ext_none.h5 -d /GROUP/DSET_BT2 IDX_CHECK /GROUP/DSET_BT2 # -TOOLTEST h5fc_latest_v3.h5 -d /DSET_NDATA_BT2 +TOOLTEST h5fc_ext_none.h5 -d /DSET_NDATA_BT2 IDX_CHECK /DSET_NDATA_BT2 # -TOOLTEST h5fc_latest_v3.h5 -d /DSET_FA +TOOLTEST h5fc_ext_none.h5 -d /DSET_FA IDX_CHECK /DSET_FA # -TOOLTEST h5fc_latest_v3.h5 -d /GROUP/DSET_NDATA_FA +TOOLTEST h5fc_ext_none.h5 -d /GROUP/DSET_NDATA_FA IDX_CHECK /GROUP/DSET_NDATA_FA # -TOOLTEST h5fc_latest_v3.h5 -d /DSET_NONE +TOOLTEST h5fc_ext_none.h5 -d /DSET_NONE IDX_CHECK /DSET_NONE # -TOOLTEST h5fc_latest_v3.h5 -d /GROUP/DSET_NDATA_NONE +TOOLTEST h5fc_ext_none.h5 -d /GROUP/DSET_NDATA_NONE IDX_CHECK /GROUP/DSET_NDATA_NONE # # # # No output from tests: just check exit code -# h5format_convert -d /DSET_NDATA_BT1 h5fc_v1.h5 (v1-btree dataset) -# h5format_convert -d /GROUP/DSET_NON_CHUNKED h5fc_non_v3.h5 (non-chunked dataset) -TOOLTEST h5fc_v1.h5 -d /DSET_NDATA_BT1 -TOOLTEST h5fc_non_v3.h5 -d /GROUP/DSET_NON_CHUNKED +# h5format_convert -d /DSET_NDATA_BT2 old_h5fc_ext_none.h5 (v1-btree dataset) +# h5format_convert -d /DSET_CONTIGUOUS h5fc_non_v3.h5 (non-chunked dataset) +TOOLTEST old_h5fc_ext_none.h5 -d /DSET_NDATA_BT2 +TOOLTEST h5fc_non_v3.h5 -d /DSET_CONTIGUOUS # # # @@ -386,6 +442,44 @@ TOOLTEST h5fc_edge_v3.h5 IDX_CHECK /DSET_EDGE # # + +# The following test files have messages in the superblock extension. +# Verify h5dump output for correctness after conversion +TOOLTEST h5fc_ext1_i.h5 +H5DUMP_CHECK h5fc_ext1_i.h5 h5fc_ext1_i.ddl +TOOLTEST h5fc_ext1_s.h5 +H5DUMP_CHECK h5fc_ext1_s.h5 h5fc_ext1_s.ddl +TOOLTEST h5fc_ext1_f.h5 +H5DUMP_CHECK h5fc_ext1_f.h5 h5fc_ext1_f.ddl +# +TOOLTEST h5fc_ext2_if.h5 +H5DUMP_CHECK h5fc_ext2_if.h5 h5fc_ext2_if.ddl +TOOLTEST h5fc_ext2_is.h5 +H5DUMP_CHECK h5fc_ext2_is.h5 h5fc_ext2_is.ddl +TOOLTEST h5fc_ext2_sf.h5 +H5DUMP_CHECK h5fc_ext2_sf.h5 h5fc_ext2_sf.ddl +# +TOOLTEST h5fc_ext3_isf.h5 +H5DUMP_CHECK h5fc_ext3_isf.h5 h5fc_ext3_isf.ddl +# +# +# +TOOLTEST old_h5fc_ext1_i.h5 +H5DUMP_CHECK old_h5fc_ext1_i.h5 old_h5fc_ext1_i.ddl +TOOLTEST old_h5fc_ext1_s.h5 +H5DUMP_CHECK old_h5fc_ext1_s.h5 old_h5fc_ext1_s.ddl +TOOLTEST old_h5fc_ext1_f.h5 +H5DUMP_CHECK old_h5fc_ext1_f.h5 old_h5fc_ext1_f.ddl +# +TOOLTEST old_h5fc_ext2_if.h5 +H5DUMP_CHECK old_h5fc_ext2_if.h5 old_h5fc_ext2_if.ddl +TOOLTEST old_h5fc_ext2_is.h5 +H5DUMP_CHECK old_h5fc_ext2_is.h5 old_h5fc_ext2_is.ddl +TOOLTEST old_h5fc_ext2_sf.h5 +H5DUMP_CHECK old_h5fc_ext2_sf.h5 old_h5fc_ext2_sf.ddl +# +TOOLTEST old_h5fc_ext3_isf.h5 +H5DUMP_CHECK old_h5fc_ext3_isf.h5 old_h5fc_ext3_isf.ddl # # Clean up temporary files/directories CLEAN_TESTFILES_AND_TESTDIR |