diff options
author | Neil Fortner <nfortne2@hdfgroup.org> | 2015-06-12 22:04:35 (GMT) |
---|---|---|
committer | Neil Fortner <nfortne2@hdfgroup.org> | 2015-06-12 22:04:35 (GMT) |
commit | 4117cfe2b9e19a79e00c5176f354f906235f1b80 (patch) | |
tree | f059fde101de2ba0463c8a63c305ee8d240fc48b /test | |
parent | 78e128c544064ba4861a3eb7a72908e7ae7916eb (diff) | |
download | hdf5-4117cfe2b9e19a79e00c5176f354f906235f1b80.zip hdf5-4117cfe2b9e19a79e00c5176f354f906235f1b80.tar.gz hdf5-4117cfe2b9e19a79e00c5176f354f906235f1b80.tar.bz2 |
[svn-r27197] Improve performance of "printf" VDS with selections in the file space - the
library no longer iterates over all source datasets in the printf mapping, it
now only looks at the ones that could be involved in I/O (the ones whose bounds
overlap with the selection in the unlimited dimension).
Tested: ummon
Diffstat (limited to 'test')
-rw-r--r-- | test/vds.c | 41 |
1 files changed, 37 insertions, 4 deletions
@@ -5515,10 +5515,6 @@ test_printf(unsigned config, hid_t fapl) if(mdims[1] != 20) TEST_ERROR - /* Close filespace */ - if(H5Sclose(filespace) < 0) - TEST_ERROR - /* Read data through virtual dataset */ /* Reset rbuf */ HDmemset(rbuf[0], 0, sizeof(rbuf)); @@ -5543,6 +5539,43 @@ test_printf(unsigned config, hid_t fapl) TEST_ERROR } /* end for */ + /* Now try with different selections */ + count[0] = 10; + for(start[1] = (hsize_t)0; start[1] < (hsize_t)5; start[1]++) + for(count[1] = (hsize_t)1; count[1] < (hsize_t)11; count[1]++) { + /* Reset rbuf */ + HDmemset(rbuf[0], 0, sizeof(rbuf)); + + /* Select hyperslab in memory space */ + if(H5Sselect_hyperslab(memspace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + TEST_ERROR + + /* Select hyperslab in file space */ + if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) + TEST_ERROR + + /* Read data */ + if(H5Dread(vdset, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, rbuf[0]) < 0) + TEST_ERROR + + /* Verify read data */ + for(i = 0; i < (int)mdims[0]; i++) + for(j = 0; j < (int)mdims[1]; j++) { + if((j < (int)start[1]) || (j >= (int)(start[1] + count[1]))) { + if(rbuf[i][j] != 0) + TEST_ERROR + } /* end if */ + else + if(rbuf[i][j] != erbuf[i][j]) + TEST_ERROR + } /* end for */ + } /* end for */ + start[1] = 0; + + /* Close filespace */ + if(H5Sclose(filespace) < 0) + TEST_ERROR + /* Close */ if(!(config & TEST_IO_CLOSE_SRC)) { if(H5Dclose(srcdset[0]) < 0) |