/**************************************************************************** * NCSA HDF * * Software Development Group * * National Center for Supercomputing Applications * * University of Illinois at Urbana-Champaign * * 605 E. Springfield, Champaign IL 61820 * * * * For conditions of distribution and use, see the accompanying * * hdf/COPYING file. * * * ****************************************************************************/ /* $Id$ */ /*********************************************************** * * Test program: tselect * * Test the Dataspace selection functionality * *************************************************************/ #include "testhdf5.h" #include "hdf5.h" #define FILENAME "tselect.h5" /* 3-D dataset with fixed dimensions */ #define SPACE1_NAME "Space1" #define SPACE1_RANK 3 #define SPACE1_DIM1 3 #define SPACE1_DIM2 15 #define SPACE1_DIM3 13 /* 2-D dataset with fixed dimensions */ #define SPACE2_NAME "Space2" #define SPACE2_RANK 2 #define SPACE2_DIM1 30 #define SPACE2_DIM2 26 #define SPACE2A_RANK 1 #define SPACE2A_DIM1 (SPACE2_DIM1*SPACE2_DIM2) /* 2-D dataset with fixed dimensions */ #define SPACE3_NAME "Space3" #define SPACE3_RANK 2 #define SPACE3_DIM1 15 #define SPACE3_DIM2 26 /* 3-D dataset with fixed dimensions */ #define SPACE4_NAME "Space4" #define SPACE4_RANK 3 #define SPACE4_DIM1 11 #define SPACE4_DIM2 13 #define SPACE4_DIM3 17 /* Number of random hyperslabs to test */ #define NHYPERSLABS 10 /* Number of random hyperslab tests performed */ #define NRAND_HYPER 100 /* 5-D dataset with fixed dimensions */ #define SPACE5_NAME "Space5" #define SPACE5_RANK 5 #define SPACE5_DIM1 10 #define SPACE5_DIM2 10 #define SPACE5_DIM3 10 #define SPACE5_DIM4 10 #define SPACE5_DIM5 10 /* 1-D dataset with same size as 5-D dataset */ #define SPACE6_NAME "Space6" #define SPACE6_RANK 1 #define SPACE6_DIM1 (SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5) /* 2-D dataset with easy dimension sizes */ #define SPACE7_NAME "Space7" #define SPACE7_RANK 2 #define SPACE7_DIM1 10 #define SPACE7_DIM2 10 /* 4-D dataset with fixed dimensions */ #define SPACE8_NAME "Space8" #define SPACE8_RANK 4 #define SPACE8_DIM1 11 #define SPACE8_DIM2 13 #define SPACE8_DIM3 17 #define SPACE8_DIM4 19 /* Element selection information */ #define POINT1_NPOINTS 10 /* Chunked dataset information */ #define DATASETNAME "ChunkArray" #define NX_SUB 87 /* hyperslab dimensions */ #define NY_SUB 61 #define NZ_SUB 181 #define NX 87 /* output buffer dimensions */ #define NY 61 #define NZ 181 #define RANK_F 3 /* File dataspace rank */ #define RANK_M 3 /* Memory dataspace rank */ #define X 87 /* dataset dimensions */ #define Y 61 #define Z 181 #define CHUNK_X 87 /* chunk dimensions */ #define CHUNK_Y 61 #define CHUNK_Z 181 /* Location comparison function */ int compare_size_t(const void *s1, const void *s2); herr_t test_select_hyper_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); herr_t test_select_point_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); herr_t test_select_all_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); herr_t test_select_none_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data); herr_t test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, hsize_t ndim, hssize_t *point, void *_operator_data); /**************************************************************** ** ** test_select_hyper_iter1(): Iterator for checking hyperslab iteration ** ****************************************************************/ herr_t test_select_hyper_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ **tbuf2=(uint8_t **)_operator_data; /* temporary buffer handle */ if(*tbuf!=**tbuf2) return(-1); else { (*tbuf2)++; return(0); } } /* end test_select_hyper_iter1() */ /**************************************************************** ** ** test_select_hyper(): Test basic H5S (dataspace) selection code. ** Tests hyperslabs of various sizes and dimensionalities. ** ****************************************************************/ static void test_select_hyper(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ herr_t ret; /* Generic return value */ H5S_class_t ext_type; /* Extent type */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); rbuf=calloc(sizeof(uint8_t),SPACE3_DIM1*SPACE3_DIM2); /* Initialize write buffer */ for(i=0, tbuf=wbuf; ibuf+(pnt_info->coord[pnt_info->offset][0]*SPACE2_DIM2)+pnt_info->coord[pnt_info->offset][1]; if(*elem!=*tmp) return(-1); else { pnt_info->offset++; return(0); } } /* end test_select_hyper_iter1() */ /**************************************************************** ** ** test_select_point(): Test basic H5S (dataspace) selection code. ** Tests element selections between dataspaces of various sizes ** and dimensionalities. ** ****************************************************************/ static void test_select_point(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; hssize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ hssize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */ hssize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ hssize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */ hssize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ hssize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j; /* Counters */ struct pnt_iter pi; /* Custom Pointer iterator struct */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Element Selection Functions\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); rbuf=calloc(sizeof(uint8_t),SPACE3_DIM1*SPACE3_DIM2); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i*(const size_t *)s2) return(1); else return(0); } /**************************************************************** ** ** test_select_hyper_stride(): Test H5S (dataspace) selection code. ** Tests strided hyperslabs of various sizes and dimensionalities. ** ****************************************************************/ static void test_select_hyper_stride(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2}; hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */ uint16_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ size_t loc1[72]={ /* Gruesomely ugly way to make certain hyperslab locations are checked correctly */ 27, 28, 29, 53, 54, 55, 79, 80, 81, /* Block #1 */ 32, 33, 34, 58, 59, 60, 84, 85, 86, /* Block #2 */ 157,158,159,183,184,185,209,210,211, /* Block #3 */ 162,163,164,188,189,190,214,215,216, /* Block #4 */ 287,288,289,313,314,315,339,340,341, /* Block #5 */ 292,293,294,318,319,320,344,345,346, /* Block #6 */ 417,418,419,443,444,445,469,470,471, /* Block #7 */ 422,423,424,448,449,450,474,475,476, /* Block #8 */ }; size_t loc2[72]={ 0, 1, 2, 26, 27, 28, /* Block #1 */ 4, 5, 6, 30, 31, 32, /* Block #2 */ 8, 9, 10, 34, 35, 36, /* Block #3 */ 12, 13, 14, 38, 39, 40, /* Block #4 */ 104,105,106,130,131,132, /* Block #5 */ 108,109,110,134,135,136, /* Block #6 */ 112,113,114,138,139,140, /* Block #7 */ 116,117,118,142,143,144, /* Block #8 */ 208,209,210,234,235,236, /* Block #9 */ 212,213,214,238,239,240, /* Block #10 */ 216,217,218,242,243,244, /* Block #11 */ 220,221,222,246,247,248, /* Block #12 */ }; int i,j; /* Counters */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslabs with Strides Functionality\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(uint16_t)*SPACE2_DIM1*SPACE2_DIM2); rbuf=calloc(sizeof(uint16_t),SPACE3_DIM1*SPACE3_DIM2); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i=5 && i<=9) && (j>=5 && j<=9)) { if(*tbuf!=*tbuf2) printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ free(wbuf); free(rbuf); } /* test_select_hyper_and_2d() */ /**************************************************************** ** ** test_select_hyper_xor_2d(): Test basic H5S (dataspace) selection code. ** Tests 'xor' of hyperslabs in 2-D ** ****************************************************************/ static void test_select_hyper_xor_2d(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t dims2[] = {SPACE2A_DIM1}; hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ herr_t ret; /* Generic return value */ hsize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with XOR of 2-D hyperslabs\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); rbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i=0 && i<=4) && (j>=0 && j<=9)) || ((i>=5 && i<=9) && ((j>=0 && j<=4) || (j>=10 && j<=14))) || ((i>=10 && i<=14) && (j>=5 && j<=14))) { if(*tbuf!=*tbuf2) printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ free(wbuf); free(rbuf); } /* test_select_hyper_xor_2d() */ /**************************************************************** ** ** test_select_hyper_notb_2d(): Test basic H5S (dataspace) selection code. ** Tests 'notb' of hyperslabs in 2-D ** ****************************************************************/ static void test_select_hyper_notb_2d(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t dims2[] = {SPACE2A_DIM1}; hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ herr_t ret; /* Generic return value */ hsize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTB of 2-D hyperslabs\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); rbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i=0 && i<=4) && (j>=0 && j<=9)) || ((i>=5 && i<=9) && (j>=0 && j<=4))) { if(*tbuf!=*tbuf2) printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ free(wbuf); free(rbuf); } /* test_select_hyper_notb_2d() */ /**************************************************************** ** ** test_select_hyper_nota_2d(): Test basic H5S (dataspace) selection code. ** Tests 'nota' of hyperslabs in 2-D ** ****************************************************************/ static void test_select_hyper_nota_2d(void) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2}; hsize_t dims2[] = {SPACE2A_DIM1}; hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */ uint8_t *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf, /* temporary buffer pointer */ *tbuf2; /* temporary buffer pointer */ int i,j; /* Counters */ herr_t ret; /* Generic return value */ hsize_t npoints; /* Number of elements in selection */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with NOTA of 2-D hyperslabs\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(uint8_t)*SPACE2_DIM1*SPACE2_DIM2); rbuf=calloc(sizeof(uint8_t),SPACE2_DIM1*SPACE2_DIM2); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i=10 && i<=14) && (j>=5 && j<=14)) || ((i>=5 && i<=9) && (j>=10 && j<=14))) { if(*tbuf!=*tbuf2) printf("%d: hyperslab values don't match!, i=%d, j=%d, *tbuf=%d, *tbuf2=%d\n",__LINE__,i,j,(int)*tbuf,(int)*tbuf2); tbuf2++; } /* end if */ else { if(*tbuf!=0) printf("%d: hyperslab element has wrong value!, i=%d, j=%d, *tbuf=%d\n",__LINE__,i,j,(int)*tbuf); } /* end else */ } /* end for */ /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); /* Free memory buffers */ free(wbuf); free(rbuf); } /* test_select_hyper_nota_2d() */ /**************************************************************** ** ** test_select_hyper_iter2(): Iterator for checking hyperslab iteration ** ****************************************************************/ herr_t test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, hsize_t ndim, hssize_t *point, void *_operator_data) { int *tbuf=(int *)_elem, /* temporary buffer pointer */ **tbuf2=(int **)_operator_data; /* temporary buffer handle */ unsigned u; /* Local counting variable */ if(*tbuf!=**tbuf2) { num_errs++; printf("Error in hyperslab iteration!\n"); printf("location: { "); for(u=0; u<(unsigned)ndim; u++) { printf("%2d",(int)point[u]); if(u<(unsigned)(ndim-1)) printf(", "); } /* end for */ printf("}\n"); printf("*tbuf=%d, **tbuf2=%d\n",*tbuf,**tbuf2); return(-1); } /* end if */ else { (*tbuf2)++; return(0); } } /* end test_select_hyper_iter1() */ /**************************************************************** ** ** test_select_hyper_union_random_5d(): Test basic H5S (dataspace) selection code. ** Tests random unions of 5-D hyperslabs ** ****************************************************************/ static void test_select_hyper_union_random_5d(hid_t read_plist) { hid_t fid1; /* HDF5 File IDs */ hid_t dataset; /* Dataset ID */ hid_t sid1,sid2; /* Dataspace ID */ hsize_t dims1[] = {SPACE5_DIM1, SPACE5_DIM2, SPACE5_DIM3, SPACE5_DIM4, SPACE5_DIM5}; hsize_t dims2[] = {SPACE6_DIM1}; hssize_t start[SPACE5_RANK]; /* Starting location of hyperslab */ hsize_t count[SPACE5_RANK]; /* Element count of hyperslab */ int *wbuf, /* buffer to write to disk */ *rbuf, /* buffer read from disk */ *tbuf; /* temporary buffer pointer */ int i,j,k,l,m; /* Counters */ herr_t ret; /* Generic return value */ hssize_t npoints, /* Number of elements in file selection */ npoints2; /* Number of elements in memory selection */ unsigned seed; /* Random number seed for each test */ unsigned test_num; /* Count of tests being executed */ /* Output message about test being performed */ MESSAGE(5, ("Testing Hyperslab Selection Functions with random unions of 5-D hyperslabs\n")); /* Allocate write & read buffers */ wbuf=malloc(sizeof(int)*SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5); rbuf=calloc(sizeof(int),SPACE5_DIM1*SPACE5_DIM2*SPACE5_DIM3*SPACE5_DIM4*SPACE5_DIM5); /* Initialize write buffer */ for(i=0, tbuf=wbuf; i=(int)(start[0]+real_offset[0]) && i<(int)(start[0]+count[0]+real_offset[0])) && (j>=(int)(start[1]+real_offset[1]) && j<(int)(start[1]+count[1]+real_offset[1]))) { if(*tbuf!=(unsigned short)fill_value) { num_errs++; printf("Error! j=%d, i=%d, *tbuf=%u, fill_value=%u\n",j,i,(unsigned)*tbuf,(unsigned)fill_value); } /* end if */ } /* end if */ else { if(*tbuf!=((unsigned short)(i*SPACE7_DIM2)+j)) { num_errs++; printf("Error! j=%d, i=%d, *tbuf=%u, should be: %u\n",j,i,(unsigned)*tbuf,(unsigned)((i*SPACE7_DIM2)+j)); } /* end if */ } /* end else */ } /* end for */ /* Free memory buffers */ free(wbuf); } /* test_select_fill_hyper_simple() */ /**************************************************************** ** ** test_select_fill_hyper_regular(): Test basic H5S (dataspace) selection code. ** Tests filling "regular" (i.e. strided block) hyperslab selections ** ****************************************************************/ static void test_select_fill_hyper_regular(hssize_t *offset) { hid_t sid1; /* Dataspace ID */ hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2}; hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */ hssize_t start[SPACE7_RANK]; /* Hyperslab start */ hsize_t stride[SPACE7_RANK]; /* Hyperslab stride size */ hsize_t count[SPACE7_RANK]; /* Hyperslab block count */ hsize_t block[SPACE7_RANK]; /* Hyperslab block size */ hssize_t points[16][SPACE7_RANK] = { {2,2}, {2,3}, {3,2}, {3,3}, {2,6}, {2,7}, {3,6}, {3,7}, {6,2}, {6,3}, {7,2}, {7,3}, {6,6}, {6,7}, {7,6}, {7,7}, }; size_t num_points=16; /* Number of points selected */ int fill_value; /* Fill value */ unsigned short *wbuf, /* buffer to write to disk */ *tbuf; /* temporary buffer pointer */ int i,j,k; /* Counters */ herr_t ret; /* Generic return value */ /* Output message about test being performed */ MESSAGE(5, ("Testing Filling Regular 'hyperslab' Selections\n")); /* Allocate memory buffer */ wbuf=malloc(sizeof(unsigned short)*SPACE7_DIM1*SPACE7_DIM2); /* Initialize memory buffer */ for(i=0, tbuf=wbuf; i