diff options
Diffstat (limited to 'examples/h5_vds-exc.c')
-rw-r--r-- | examples/h5_vds-exc.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/examples/h5_vds-exc.c b/examples/h5_vds-exc.c index 124d22b..ceafe68 100644 --- a/examples/h5_vds-exc.c +++ b/examples/h5_vds-exc.c @@ -10,14 +10,17 @@ #include <stdio.h> #include <stdlib.h> -#define FILE "vds-excalibur.h5" -#define DATASET "VDS-excalibur" -#define VDSDIM1 6 -#define VDSDIM0 15 -#define KDIM0 2 -#define KDIM1 6 -#define NDIM0 3 -#define NDIM1 6 +#define FILE "vds-exc.h5" +#define DATASET "VDS-Excalibur" +#define VDSDIM0 0 +#define VDSDIM1 15 +#define VDSDIM2 6 +#define KDIM0 0 +#define KDIM1 2 +#define KDIM2 6 +#define NDIM0 0 +#define NDIM1 3 +#define NDIM2 6 #define RANK 3 const char *SRC_FILE[] = { @@ -46,12 +49,12 @@ main (void) dset; /* Handles */ hid_t dcpl; herr_t status; - hsize_t vdsdims[3] = {0,VDSDIM0, VDSDIM1}, - vdsdims_max[3] = {H5S_UNLIMITED,VDSDIM0, VDSDIM1}, - kdims[3] = {0, KDIM0, KDIM1}, - kdims_max[3] = {H5S_UNLIMITED, KDIM0, KDIM1}, - ndims[3] = {0, NDIM0, NDIM1}, - ndims_max[3] = {H5S_UNLIMITED, NDIM0, NDIM1}, + hsize_t vdsdims[3] = {VDSDIM0, VDSDIM1, VDSDIM2}, + vdsdims_max[3] = {H5S_UNLIMITED,VDSDIM1, VDSDIM2}, + kdims[3] = {KDIM0, KDIM1, KDIM2}, + kdims_max[3] = {H5S_UNLIMITED, KDIM1, KDIM2}, + ndims[3] = {NDIM0, NDIM1, NDIM2}, + ndims_max[3] = {H5S_UNLIMITED, NDIM1, NDIM2}, start[3], /* Hyperslab parameters */ stride[3], count[3], @@ -68,8 +71,6 @@ main (void) ssize_t len; /* Length of the string; also a return value */ char *filename; char *dsetname; - hsize_t nblocks; - hsize_t *buf; /* Buffer to hold hyperslab coordinates */ file = H5Fcreate (FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -94,14 +95,14 @@ main (void) count[2] = 1; block[0] = 1; block[1] = k; - block[2] = VDSDIM1; + block[2] = VDSDIM2; /* * Build the mappings for A, C and E source datasets. * */ for (i = 0; i < 3; i++) { - start[0] = (hsize_t)((k+n)*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); } @@ -113,7 +114,7 @@ main (void) * */ for (i = 0; i < 3; i++) { - start[0] = (hsize_t)(k+(k+n)*i); + start[1] = (hsize_t)(k+(k+n)*i); status = H5Sselect_hyperslab (space, H5S_SELECT_SET, start, NULL, count, block); status = H5Pset_virtual (dcpl, space, SRC_FILE[2*i+1], SRC_DATASET[2*i+1], nsrc_space); } @@ -157,13 +158,13 @@ main (void) * Find number of mappings. */ status = H5Pget_virtual_count (dcpl, &num_map); - printf("Number of mappings is %d\n", num_map); + printf(" Number of mappings is %d\n", num_map); /* * Get mapping parameters for each mapping. */ for (i = 0; i < (int)num_map; i++) { - printf("Mapping %d \n", i); + printf(" Mapping %d \n", i); printf(" Selection in the virtual dataset \n"); /* Get selection in the virttual dataset */ vspace = H5Pget_virtual_vspace (dcpl, (size_t)i); |