diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2013-06-14 21:55:01 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2013-06-14 21:55:01 (GMT) |
commit | b3526d3b90565e7224d84ada66d55a3d27c76866 (patch) | |
tree | 35dc00d67e0615ed893ddacff4752ff95fe574ae /test/use.h | |
parent | 6e46183e3580866e77bccc2021707ac40d95fa52 (diff) | |
download | hdf5-b3526d3b90565e7224d84ada66d55a3d27c76866.zip hdf5-b3526d3b90565e7224d84ada66d55a3d27c76866.tar.gz hdf5-b3526d3b90565e7224d84ada66d55a3d27c76866.tar.bz2 |
[svn-r23775] Implement SWMR-5:
Implemented use case 1.9: Appending n-1 dimensional planes
Adding the option "-y" which allows chunks to be thicker
(more than 1 plane). This supports use case 1.9 which have chunks
of multiple planes but writing is still appending one plane at a time.
Using -y with "use_append_chunk", would provide the use case
of writing a plane to a partial chunk.
Using -y with "use_append_mchunks", would provide the use case
of writing a plane to multiple partial chunks.
Also added the option -n which specifies how many planes to write
instead of the defaults of chunksize number of planes. This allows
the final dataset to be other than a cube.
test/use_append_mchunks.c:
test/use_common.c:
test/use.h:
test/use_append_chunk.c:
I also overhauled code in use_append_mchunks and use_append_chunk:
1. creating a set_parameter() to customize individual use case;
2. combine the create_uc_file(), read_uc_file() and write_uc_file()
of both use cases appending one plane per chunks and one plane per
multiple chunks. Moved these combined create/read/write functions
into use_common.c to make future modification and maintence easier.
test/test_usecases.sh.in:
Added a simple test to demonstarte how to use -y to run use case 1.9.
Tested: h5committest, except cmake, passed. Hand tested in Koala for various options.
Diffstat (limited to 'test/use.h')
-rw-r--r-- | test/use.h | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -32,6 +32,7 @@ /* these two definitions must match each other */ #define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */ #define UC_CTYPE short /* use case C data type */ +#define UC_RANK 3 /* use case dataset rank */ /* type declarations */ typedef enum part_t { @@ -40,13 +41,16 @@ typedef enum part_t { UC_READER /* reader only */ } part_t; typedef struct options_t { - int use_swmr; /* use swmr open (1) or not */ - int compress; /* 0: no compress */ - int h5_use_chunks; /* 0/1: Not use/use chunked dataset */ int chunksize; /* chunks are chunksize^2 planes */ - int nplanes; /* number of planes, default chunksize */ + int chunkplanes; /* number of planes per chunk, default 1*/ + hsize_t chunkdims[UC_RANK]; /* chunk dims is (chunkplan, chunksize, chunksize) */ + hsize_t dims[UC_RANK]; /* dataset initial dims */ + hsize_t max_dims[UC_RANK]; /* dataset max dims */ + int nplanes; /* number of planes to write, default proportional to chunksize */ char *filename; /* use case data filename */ part_t launch; /* launch writer, reader or both */ + int use_swmr; /* use swmr open (1) or not */ + int iterations; /* iterations, default 1 */ } options_t; /* global variables declarations */ @@ -55,6 +59,8 @@ extern const char *progname_g; /* Program name */ /* prototype declarations */ int parse_option(int argc, char * const argv[]); +int setup_parameters(int argc, char * const argv[]); +void show_parameters(void); void usage(const char *prog); int create_uc_file(void); int write_uc_file(void); |