From 5140343f45312d4d2e486e6cc7645c7bc42b1267 Mon Sep 17 00:00:00 2001 From: Peter Cao Date: Thu, 31 Jan 2013 17:15:15 -0500 Subject: [svn-r23217] add scalr vlen string datasets --- tools/misc/h5perf_gentest.c | 111 +++++++++++++++++++++++++------------------- 1 file changed, 63 insertions(+), 48 deletions(-) diff --git a/tools/misc/h5perf_gentest.c b/tools/misc/h5perf_gentest.c index 6442a10..6a080d0 100755 --- a/tools/misc/h5perf_gentest.c +++ b/tools/misc/h5perf_gentest.c @@ -92,14 +92,6 @@ int main (int argc, char *argv[]) } } - if (ngrpsdim0) chunk=dim0/4; - if (chunk<1) chunk = 1; - if (vlen<1) vlen = MAXVLEN; - if (strlen(fname)<=0) sprintf(fname, FNAME); @@ -132,10 +124,10 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, int compressed, int latest) { int i, j, k; - hid_t fid, sid_null, sid_1d, sid_2d, did, aid, sid_2, sid_large, + hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large, fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s; - char name[32]; + char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32]; hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN}, dim1[1]={2}; char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"}; @@ -148,7 +140,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, char **buf_vlen_s=NULL; hobj_ref_t buf_ref[2]; hdset_reg_ref_t buf_reg_ref[2]; - size_t offset; + size_t offset, len; herr_t status; char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string", "enum", "fixed float array", "vlen int array", "vlen strings"}; @@ -156,8 +148,14 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s}; hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; - /* the large compound dataset will be at least as large as regular datasets. */ - if (nrows < dim0) nrows = dim0; + if (nrows < NROWS) nrows = NROWS; + if (ngrpsdim0) chunk=dim0/4; + if (chunk<1) chunk = 1; + if (vlen<1) vlen = MAXVLEN; /* create fixed string datatype */ types[4] = tid_str = H5Tcopy (H5T_C_S1); @@ -198,6 +196,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, sid_2 = H5Screate_simple (1, dim1, NULL); sid_large = H5Screate_simple (1, &nrows, NULL); sid_null = H5Screate (H5S_NULL); + sid_scalar = H5Screate (H5S_SCALAR); /* create fid access property */ fapl = H5Pcreate (H5P_FILE_ACCESS); @@ -238,6 +237,7 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, for (i=1; i