Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix example of hyperslab block coordinate printing #437

Merged
merged 1 commit into from
Mar 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions examples/h5_vds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)) {
Expand Down