summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2015-09-14 15:03:58 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2015-09-14 15:03:58 (GMT)
commit68659dd411a8ca3b0b2ef86eaaa7d5ba5d5bc449 (patch)
tree9ffd3eae4d8eb0e6d1e3fd8c0b24fb3617c1cb75 /examples
parent122bf84bb3623df66306da08275c4cb65e15475e (diff)
downloadhdf5-68659dd411a8ca3b0b2ef86eaaa7d5ba5d5bc449.zip
hdf5-68659dd411a8ca3b0b2ef86eaaa7d5ba5d5bc449.tar.gz
hdf5-68659dd411a8ca3b0b2ef86eaaa7d5ba5d5bc449.tar.bz2
[svn-r27769] Maintenance: Fixed example that failed daily tests.
Tested on Mac Air, jam and ostrich.
Diffstat (limited to 'examples')
-rw-r--r--examples/h5_vds-exc.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c
index 88d8f61..039cdb8 100644
--- a/examples/h5_vds-exc.c
+++ b/examples/h5_vds-exc.c
@@ -100,20 +100,25 @@ main (void)
/*
* Build the mappings for A, C and E source datasets.
- *
+ * Unlimited hyperslab selection is the same in the source datasets.
+ * Unlimited hyperslab selections in the virtual dataset have different offsets.
*/
+ status = H5Sselect_hyperslab (ksrc_space, H5S_SELECT_SET, start, NULL, count, block);
for (i = 0; i < 3; i++) {
start[1] = (hsize_t)((k+n)*i);
status = H5Sselect_hyperslab (space, H5S_SELECT_SET, start, NULL, count, block);
status = H5Pset_virtual (dcpl, space, SRC_FILE[2*i], SRC_DATASET[2*i], ksrc_space);
}
- /* Reinitialize block[1] */
+ /* Reinitialize start[1] and block[1] to build the second set of mappings. */
+ start[1] = 0;
block[1] = n;
/*
* Build the mappings for B, D and F source datasets.
- *
+ * Unlimited hyperslab selection is the same in the source datasets.
+ * Unlimited hyperslab selections in the virtual dataset have different offsets.
*/
+ status = H5Sselect_hyperslab (nsrc_space, H5S_SELECT_SET, start, NULL, count, block);
for (i = 0; i < 3; i++) {
start[1] = (hsize_t)(k+(k+n)*i);
status = H5Sselect_hyperslab (space, H5S_SELECT_SET, start, NULL, count, block);
@@ -191,10 +196,16 @@ main (void)
printf(" Source dataset name %s\n", dsetname);
/* Get selection in the source dataset */
- printf(" Selection in the source dataset ");
+ printf(" Selection in the source dataset \n");
src_space = H5Pget_virtual_srcspace (dcpl, (size_t)i);
- if(H5Sget_select_type(src_space) == H5S_SEL_ALL) {
- printf("H5S_ALL \n");
+ if (H5Sget_select_type(src_space) == H5S_SEL_HYPERSLABS) {
+ if (H5Sis_regular_hyperslab(vspace)) {
+ status = H5Sget_regular_hyperslab (src_space, start_out, stride_out, count_out, block_out);
+ printf(" start = [%llu, %llu, %llu] \n", (unsigned long long)start_out[0], (unsigned long long)start_out[1], (unsigned long long)start_out[2]);
+ printf(" stride = [%llu, %llu, %llu] \n", (unsigned long long)stride_out[0], (unsigned long long)stride_out[1], (unsigned long long)stride_out[2]);
+ printf(" count = [%llu, %llu, %llu] \n", (unsigned long long)count_out[0], (unsigned long long)count_out[1], (unsigned long long)count_out[2]);
+ printf(" block = [%llu, %llu, %llu] \n", (unsigned long long)block_out[0], (unsigned long long)block_out[1], (unsigned long long)block_out[2]);
+ }
}
H5Sclose(vspace);
H5Sclose(src_space);