summaryrefslogtreecommitdiffstats
path: root/examples/h5_vds.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/h5_vds.c')
-rw-r--r--examples/h5_vds.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/examples/h5_vds.c b/examples/h5_vds.c
index 6bef06f..e036204 100644
--- a/examples/h5_vds.c
+++ b/examples/h5_vds.c
@@ -60,7 +60,7 @@ main(void)
hsize_t start_out[2], stride_out[2], count_out[2], block_out[2];
int wdata[DIM0], /* Write buffer for source dataset */
rdata[VDSDIM0][VDSDIM1], /* Read buffer for virtual dataset */
- i, j, k, l;
+ i, j, k, l, block_inc;
int fill_value = -1; /* Fill value for VDS */
H5D_layout_t layout; /* Storage layout */
size_t num_map; /* Number of mappings */
@@ -178,13 +178,14 @@ main(void)
buf = (hsize_t *)malloc(sizeof(hsize_t) * 2 * RANK2 * nblocks);
status = H5Sget_select_hyper_blocklist(vspace, (hsize_t)0, nblocks, buf);
for (l = 0; l < nblocks; l++) {
+ block_inc = 2 * RANK2 * l;
printf("(");
for (k = 0; k < RANK2 - 1; k++)
- printf("%d,", (int)buf[k]);
- printf("%d ) - (", (int)buf[k]);
+ printf("%d,", (int)buf[block_inc + k]);
+ printf("%d) - (", (int)buf[block_inc + k]);
for (k = 0; k < RANK2 - 1; k++)
- printf("%d,", (int)buf[RANK2 + k]);
- printf("%d)\n", (int)buf[RANK2 + k]);
+ printf("%d,", (int)buf[block_inc + RANK2 + k]);
+ printf("%d)\n", (int)buf[block_inc + RANK2 + k]);
}
/* We also can use new APIs to get start, stride, count and block */
if (H5Sis_regular_hyperslab(vspace)) {