diff options
Diffstat (limited to 'testpar/t_bigio.c')
-rw-r--r-- | testpar/t_bigio.c | 528 |
1 files changed, 264 insertions, 264 deletions
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 1d882b8..9ca077c 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -1,7 +1,7 @@ #include "hdf5.h" #include "testphdf5.h" -#include "H5Dprivate.h" /* For Chunk tests */ +#include "H5Dprivate.h" /* For Chunk tests */ /* FILENAME and filenames must have the same number of names */ const char *FILENAME[2]={ "bigio_test.h5", @@ -17,7 +17,7 @@ const char *FILENAME[2]={ "bigio_test.h5", #define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ /* Constants definitions */ -#define RANK 2 +#define RANK 2 #define IN_ORDER 1 #define OUT_OF_ORDER 2 @@ -33,12 +33,12 @@ const char *FILENAME[2]={ "bigio_test.h5", #define HYPER 1 #define POINT 2 -#define ALL 3 +#define ALL 3 /* Dataset data type. Int's can be easily octo dumped. */ typedef hsize_t B_DATATYPE; -int facc_type = FACC_MPIO; /*Test file access type */ +int facc_type = FACC_MPIO; /*Test file access type */ int dxfer_coll_type = DXFER_COLLECTIVE_IO; size_t bigcount = DXFER_BIGCOUNT; int nerrors = 0; @@ -54,12 +54,12 @@ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type); /* * Setup the coordinates for point selection. */ -static void +static void set_coords(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], - size_t num_points, + size_t num_points, hsize_t coords[], int order) { @@ -99,10 +99,10 @@ fill_datasets(hsize_t start[], hsize_t block[], B_DATATYPE * dataset) /* put some trivial data in the data_array */ for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - *dataptr = (B_DATATYPE)((i+start[0])*100 + (j+start[1]+1)); - dataptr++; - } + for (j=0; j < block[1]; j++){ + *dataptr = (B_DATATYPE)((i+start[0])*100 + (j+start[1]+1)); + dataptr++; + } } } @@ -113,7 +113,7 @@ void point_set(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], - size_t num_points, + size_t num_points, hsize_t coords[], int order) { @@ -143,13 +143,13 @@ void point_set(hsize_t start[], } if(VERBOSE_MED) { - printf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n", + HDprintf("start[]=(%lu, %lu), count[]=(%lu, %lu), stride[]=(%lu, %lu), block[]=(%lu, %lu), total datapoints=%lu\n", (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], (unsigned long)(block[0] * block[1] * count[0] * count[1])); k = 0; for(i = 0; i < num_points ; i++) { - printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); + HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); k += 2; } } @@ -165,19 +165,19 @@ dataset_print(hsize_t start[], hsize_t block[], B_DATATYPE * dataset) hsize_t i, j; /* print the column heading */ - printf("%-8s", "Cols:"); + HDprintf("%-8s", "Cols:"); for (j=0; j < block[1]; j++){ - printf("%3lu ", (unsigned long)(start[1]+j)); + HDprintf("%3lu ", (unsigned long)(start[1]+j)); } - printf("\n"); + HDprintf("\n"); /* print the slab data */ for (i=0; i < block[0]; i++){ - printf("Row %2lu: ", (unsigned long)(i+start[0])); - for (j=0; j < block[1]; j++){ - printf("%llu ", *dataptr++); - } - printf("\n"); + HDprintf("Row %2lu: ", (unsigned long)(i+start[0])); + for (j=0; j < block[1]; j++){ + HDprintf("%llu ", *dataptr++); + } + HDprintf("\n"); } } @@ -193,90 +193,90 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], /* print it if VERBOSE_MED */ if(VERBOSE_MED) { - printf("verify_data dumping:::\n"); - printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", - (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], - (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); - printf("original values:\n"); - dataset_print(start, block, original); - printf("compared values:\n"); - dataset_print(start, block, dataset); + HDprintf("verify_data dumping:::\n"); + HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); + HDprintf("original values:\n"); + dataset_print(start, block, original); + HDprintf("compared values:\n"); + dataset_print(start, block, dataset); } vrfyerrs = 0; for (i=0; i < block[0]; i++){ - for (j=0; j < block[1]; j++){ - if(*dataset != *original){ - if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ - printf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n", + for (j=0; j < block[1]; j++){ + if(*dataset != *original){ + if(vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ + HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %llu, got %llu\n", (unsigned long)i, (unsigned long)j, (unsigned long)(i+start[0]), (unsigned long)(j+start[1]), *(original), *(dataset)); - } - dataset++; - original++; - } - } + } + dataset++; + original++; + } + } } if(vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) - printf("[more errors ...]\n"); + HDprintf("[more errors ...]\n"); if(vrfyerrs) - printf("%d errors found in verify_data\n", vrfyerrs); + HDprintf("%d errors found in verify_data\n", vrfyerrs); return(vrfyerrs); } /* Set up the selection */ static void ccslab_set(int mpi_rank, - int mpi_size, - hsize_t start[], - hsize_t count[], - hsize_t stride[], - hsize_t block[], - int mode) + int mpi_size, + hsize_t start[], + hsize_t count[], + hsize_t stride[], + hsize_t block[], + int mode) { switch (mode){ case BYROW_CONT: - /* Each process takes a slabs of rows. */ - block[0] = 1; - block[1] = 1; - stride[0] = 1; - stride[1] = 1; - count[0] = space_dim1; - count[1] = space_dim2; - start[0] = mpi_rank*count[0]; - start[1] = 0; - - break; + /* Each process takes a slabs of rows. */ + block[0] = 1; + block[1] = 1; + stride[0] = 1; + stride[1] = 1; + count[0] = space_dim1; + count[1] = space_dim2; + start[0] = mpi_rank*count[0]; + start[1] = 0; + + break; case BYROW_DISCONT: - /* Each process takes several disjoint blocks. */ - block[0] = 1; - block[1] = 1; + /* Each process takes several disjoint blocks. */ + block[0] = 1; + block[1] = 1; stride[0] = 3; stride[1] = 3; count[0] = space_dim1/(stride[0]*block[0]); count[1] = (space_dim2)/(stride[1]*block[1]); - start[0] = space_dim1*mpi_rank; - start[1] = 0; + start[0] = space_dim1*mpi_rank; + start[1] = 0; - break; + break; case BYROW_SELECTNONE: - /* Each process takes a slabs of rows, there are + /* Each process takes a slabs of rows, there are no selections for the last process. */ - block[0] = 1; - block[1] = 1; - stride[0] = 1; - stride[1] = 1; - count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:space_dim1); - count[1] = space_dim2; - start[0] = mpi_rank*count[0]; - start[1] = 0; + block[0] = 1; + block[1] = 1; + stride[0] = 1; + stride[1] = 1; + count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:space_dim1); + count[1] = space_dim2; + start[0] = mpi_rank*count[0]; + start[1] = 0; - break; + break; case BYROW_SELECTUNBALANCE: /* The first one-third of the number of processes only @@ -284,14 +284,14 @@ ccslab_set(int mpi_rank, half of the domain. */ block[0] = 1; - count[0] = 2; + count[0] = 2; stride[0] = space_dim1*mpi_size/4+1; block[1] = space_dim2; count[1] = 1; start[1] = 0; stride[1] = 1; - if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank; - else start[0] = 1 + space_dim1*mpi_size/2 + (mpi_rank-2*mpi_size/3); + if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank; + else start[0] = 1 + space_dim1*mpi_size/2 + (mpi_rank-2*mpi_size/3); break; case BYROW_SELECTINCHUNK: @@ -299,33 +299,33 @@ ccslab_set(int mpi_rank, block[0] = 1; count[0] = 1; - start[0] = mpi_rank*space_dim1; + start[0] = mpi_rank*space_dim1; stride[0]= 1; - block[1] = space_dim2; - count[1] = 1; - stride[1]= 1; - start[1] = 0; + block[1] = space_dim2; + count[1] = 1; + stride[1]= 1; + start[1] = 0; break; default: - /* Unknown mode. Set it to cover the whole dataset. */ - block[0] = space_dim1*mpi_size; - block[1] = space_dim2; - stride[0] = block[0]; - stride[1] = block[1]; - count[0] = 1; - count[1] = 1; - start[0] = 0; - start[1] = 0; - - break; + /* Unknown mode. Set it to cover the whole dataset. */ + block[0] = space_dim1*mpi_size; + block[1] = space_dim2; + stride[0] = block[0]; + stride[1] = block[1]; + count[0] = 1; + count[1] = 1; + start[0] = 0; + start[1] = 0; + + break; } if (VERBOSE_MED){ - printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n", - (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], - (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], - (unsigned long)(block[0]*block[1]*count[0]*count[1])); + HDprintf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1], + (unsigned long)(block[0]*block[1]*count[0]*count[1])); } } @@ -336,10 +336,10 @@ ccslab_set(int mpi_rank, */ static void ccdataset_fill(hsize_t start[], - hsize_t stride[], - hsize_t count[], - hsize_t block[], - DATATYPE * dataset, + hsize_t stride[], + hsize_t count[], + hsize_t block[], + DATATYPE * dataset, int mem_selection) { DATATYPE *dataptr = dataset; @@ -377,28 +377,28 @@ ccdataset_fill(hsize_t start[], */ static void ccdataset_print(hsize_t start[], - hsize_t block[], - DATATYPE * dataset) + hsize_t block[], + DATATYPE * dataset) { DATATYPE *dataptr = dataset; hsize_t i, j; /* print the column heading */ - printf("Print only the first block of the dataset\n"); - printf("%-8s", "Cols:"); + HDprintf("Print only the first block of the dataset\n"); + HDprintf("%-8s", "Cols:"); for (j=0; j < block[1]; j++){ - printf("%3lu ", (unsigned long)(start[1]+j)); + HDprintf("%3lu ", (unsigned long)(start[1]+j)); } - printf("\n"); + HDprintf("\n"); /* print the slab data */ for (i=0; i < block[0]; i++){ - printf("Row %2lu: ", (unsigned long)(i+start[0])); - for (j=0; j < block[1]; j++){ - printf("%03d ", *dataptr++); - } - printf("\n"); + HDprintf("Row %2lu: ", (unsigned long)(i+start[0])); + for (j=0; j < block[1]; j++){ + HDprintf("%03d ", *dataptr++); + } + HDprintf("\n"); } } @@ -407,11 +407,11 @@ ccdataset_print(hsize_t start[], */ static int ccdataset_vrfy(hsize_t start[], - hsize_t count[], - hsize_t stride[], - hsize_t block[], - DATATYPE *dataset, - DATATYPE *original, + hsize_t count[], + hsize_t stride[], + hsize_t block[], + DATATYPE *dataset, + DATATYPE *original, int mem_selection) { hsize_t i, j,k1,k2,k=0; @@ -420,14 +420,14 @@ ccdataset_vrfy(hsize_t start[], /* print it if VERBOSE_MED */ if (VERBOSE_MED) { - printf("dataset_vrfy dumping:::\n"); - printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", - (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], - (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); - printf("original values:\n"); - ccdataset_print(start, block, original); - printf("compared values:\n"); - ccdataset_print(start, block, dataset); + HDprintf("dataset_vrfy dumping:::\n"); + HDprintf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n", + (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1], + (unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]); + HDprintf("original values:\n"); + ccdataset_print(start, block, original); + HDprintf("compared values:\n"); + ccdataset_print(start, block, dataset); } vrfyerrs = 0; @@ -449,7 +449,7 @@ ccdataset_vrfy(hsize_t start[], } if (*dataptr != *oriptr){ if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){ - printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", + HDprintf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", (unsigned long)i, (unsigned long)j, *(oriptr), *(dataptr)); } @@ -459,9 +459,9 @@ ccdataset_vrfy(hsize_t start[], } } if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) - printf("[more errors ...]\n"); + HDprintf("[more errors ...]\n"); if (vrfyerrs) - printf("%d errors found in ccdataset_vrfy\n", vrfyerrs); + HDprintf("%d errors found in ccdataset_vrfy\n", vrfyerrs); return(vrfyerrs); } @@ -478,28 +478,28 @@ static void dataset_big_write(void) { - hid_t xfer_plist; /* Dataset transfer properties list */ - hid_t sid; /* Dataspace ID */ - hid_t file_dataspace; /* File dataspace ID */ - hid_t mem_dataspace; /* memory dataspace ID */ + hid_t xfer_plist; /* Dataset transfer properties list */ + hid_t sid; /* Dataspace ID */ + hid_t file_dataspace; /* File dataspace ID */ + hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset; - hid_t datatype; /* Datatype ID */ - hsize_t dims[RANK]; /* dataset dim sizes */ - hsize_t start[RANK]; /* for hyperslab setting */ - hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ - hsize_t block[RANK]; /* for hyperslab setting */ + hid_t datatype; /* Datatype ID */ + hsize_t dims[RANK]; /* dataset dim sizes */ + hsize_t start[RANK]; /* for hyperslab setting */ + hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ + hsize_t block[RANK]; /* for hyperslab setting */ hsize_t *coords = NULL; int i; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ hid_t fid; /* HDF5 file ID */ - hid_t acc_tpl; /* File access templates */ + hid_t acc_tpl; /* File access templates */ hsize_t h; size_t num_points; B_DATATYPE * wdata; /* allocate memory for data buffer */ - wdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); VRFY((wdata != NULL), "wdata malloc succeeded"); /* setup file access template */ @@ -552,8 +552,8 @@ dataset_big_write(void) fill_datasets(start, block, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); - dataset_print(start, block, wdata); + MESG("data_array created"); + dataset_print(start, block, wdata); } /* set up the collective transfer properties list */ @@ -580,7 +580,7 @@ dataset_big_write(void) /* Each process takes a slabs of cols. */ - if (mpi_rank == 0) + if (mpi_rank == 0) HDprintf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; @@ -615,8 +615,8 @@ dataset_big_write(void) fill_datasets(start, block, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); - dataset_print(start, block, wdata); + MESG("data_array created"); + dataset_print(start, block, wdata); } /* set up the collective transfer properties list */ @@ -690,7 +690,7 @@ dataset_big_write(void) fill_datasets(start, dims, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); + MESG("data_array created"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, @@ -729,7 +729,7 @@ dataset_big_write(void) num_points = bigcount; - coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); set_coords (start, count, stride, block, num_points, coords, IN_ORDER); @@ -744,8 +744,8 @@ dataset_big_write(void) fill_datasets(start, block, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); - dataset_print(start, block, wdata); + MESG("data_array created"); + dataset_print(start, block, wdata); } /* create a memory dataspace */ @@ -778,7 +778,7 @@ dataset_big_write(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - free(wdata); + HDfree(wdata); H5Fclose(fid); } @@ -795,30 +795,30 @@ static void dataset_big_read(void) { hid_t fid; /* HDF5 file ID */ - hid_t acc_tpl; /* File access templates */ - hid_t xfer_plist; /* Dataset transfer properties list */ - hid_t file_dataspace; /* File dataspace ID */ - hid_t mem_dataspace; /* memory dataspace ID */ + hid_t acc_tpl; /* File access templates */ + hid_t xfer_plist; /* Dataset transfer properties list */ + hid_t file_dataspace; /* File dataspace ID */ + hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset; - B_DATATYPE *rdata = NULL; /* data buffer */ - B_DATATYPE *wdata = NULL; /* expected data buffer */ - hsize_t dims[RANK]; /* dataset dim sizes */ - hsize_t start[RANK]; /* for hyperslab setting */ - hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ - hsize_t block[RANK]; /* for hyperslab setting */ + B_DATATYPE *rdata = NULL; /* data buffer */ + B_DATATYPE *wdata = NULL; /* expected data buffer */ + hsize_t dims[RANK]; /* dataset dim sizes */ + hsize_t start[RANK]; /* for hyperslab setting */ + hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */ + hsize_t block[RANK]; /* for hyperslab setting */ int i,j,k; hsize_t h; size_t num_points; hsize_t *coords = NULL; - herr_t ret; /* Generic return value */ + herr_t ret; /* Generic return value */ /* allocate memory for data buffer */ - rdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE)); + rdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); VRFY((rdata != NULL), "rdata malloc succeeded"); - wdata = (B_DATATYPE *)malloc(bigcount*sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); VRFY((wdata != NULL), "wdata malloc succeeded"); - memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); + HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); @@ -865,7 +865,7 @@ dataset_big_read(void) fill_datasets(start, block, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); + MESG("data_array created"); } /* set up the collective transfer properties list */ @@ -885,7 +885,7 @@ dataset_big_read(void) /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); - if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -897,7 +897,7 @@ dataset_big_read(void) if (mpi_rank == 0) HDprintf("\nRead Testing Dataset2 by ROW\n"); - memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); + HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -927,7 +927,7 @@ dataset_big_read(void) fill_datasets(start, block, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); + MESG("data_array created"); } /* set up the collective transfer properties list */ @@ -947,7 +947,7 @@ dataset_big_read(void) /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); - if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -958,7 +958,7 @@ dataset_big_read(void) if (mpi_rank == 0) HDprintf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); - memset(rdata, 0, bigcount*sizeof(B_DATATYPE)); + HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT); VRFY((dataset >= 0), "H5Dopen2 succeeded"); @@ -989,7 +989,7 @@ dataset_big_read(void) fill_datasets(start, dims, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); + MESG("data_array created"); } /* set up the collective transfer properties list */ @@ -1010,7 +1010,7 @@ dataset_big_read(void) if(mpi_rank == 0) { /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); - if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} } /* release all temporary handles. */ @@ -1040,13 +1040,13 @@ dataset_big_read(void) fill_datasets(start, block, wdata); MESG("data_array initialized"); if(VERBOSE_MED){ - MESG("data_array created"); - dataset_print(start, block, wdata); + MESG("data_array created"); + dataset_print(start, block, wdata); } num_points = bigcount; - coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); set_coords (start, count, stride, block, num_points, coords, IN_ORDER); @@ -1056,7 +1056,7 @@ dataset_big_read(void) ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); VRFY((ret >= 0), "H5Sselect_elements succeeded"); - if(coords) free(coords); + if(coords) HDfree(coords); /* create a memory dataspace */ /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1082,7 +1082,7 @@ dataset_big_read(void) VRFY((ret >= 0), "H5Dread dataset1 succeeded"); ret = verify_data(start, count, stride, block, rdata, wdata); - if(ret) {fprintf(stderr, "verify failed\n"); exit(1);} + if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -1091,8 +1091,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose1 succeeded"); - free(wdata); - free(rdata); + HDfree(wdata); + HDfree(rdata); wdata = NULL; rdata = NULL; @@ -1115,8 +1115,8 @@ dataset_big_read(void) H5Fclose(fid); /* release data buffers */ - if(rdata) free(rdata); - if(wdata) free(wdata); + if(rdata) HDfree(rdata); + if(wdata) HDfree(wdata); } /* dataset_large_readAll */ @@ -1129,7 +1129,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) { hid_t ret_pl = -1; herr_t ret; /* generic return value */ - int mpi_rank; /* mpi variables */ + int mpi_rank; /* mpi variables */ /* need the rank for error checking macros */ MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); @@ -1138,36 +1138,36 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); if (l_facc_type == FACC_DEFAULT) - return (ret_pl); + return (ret_pl); if (l_facc_type == FACC_MPIO){ - /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(ret_pl, comm, info); - VRFY((ret >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_mpio(ret_pl, comm, info); + VRFY((ret >= 0), ""); ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE); - VRFY((ret >= 0), ""); + VRFY((ret >= 0), ""); ret = H5Pset_coll_metadata_write(ret_pl, TRUE); - VRFY((ret >= 0), ""); - return(ret_pl); + VRFY((ret >= 0), ""); + return(ret_pl); } if (l_facc_type == (FACC_MPIO | FACC_SPLIT)){ - hid_t mpio_pl; - - mpio_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((mpio_pl >= 0), ""); - /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(mpio_pl, comm, info); - VRFY((ret >= 0), ""); - - /* setup file access template */ - ret_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((ret_pl >= 0), ""); - /* set Parallel access with communicator */ - ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); - VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); - H5Pclose(mpio_pl); - return(ret_pl); + hid_t mpio_pl; + + mpio_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((mpio_pl >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_mpio(mpio_pl, comm, info); + VRFY((ret >= 0), ""); + + /* setup file access template */ + ret_pl = H5Pcreate (H5P_FILE_ACCESS); + VRFY((ret_pl >= 0), ""); + /* set Parallel access with communicator */ + ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); + VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); + H5Pclose(mpio_pl); + return(ret_pl); } /* unknown file access types */ @@ -1176,17 +1176,17 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) /*------------------------------------------------------------------------- - * Function: coll_chunk1 + * Function: coll_chunk1 * - * Purpose: Wrapper to test the collective chunk IO for regular JOINT + * Purpose: Wrapper to test the collective chunk IO for regular JOINT selection with a single chunk * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * July 12th, 2004 + * Programmer: Unknown + * July 12th, 2004 * * Modifications: * @@ -1215,7 +1215,7 @@ coll_chunk1(void) { const char *filename = FILENAME[0]; if (mpi_rank == 0) - printf("coll_chunk1\n"); + HDprintf("coll_chunk1\n"); coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); @@ -1230,17 +1230,17 @@ coll_chunk1(void) /*------------------------------------------------------------------------- - * Function: coll_chunk2 + * Function: coll_chunk2 * - * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT + * Purpose: Wrapper to test the collective chunk IO for regular DISJOINT selection with a single chunk * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * July 12th, 2004 + * Programmer: Unknown + * July 12th, 2004 * * Modifications: * @@ -1269,7 +1269,7 @@ coll_chunk2(void) { const char *filename = FILENAME[0]; if (mpi_rank == 0) - printf("coll_chunk2\n"); + HDprintf("coll_chunk2\n"); coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); @@ -1284,17 +1284,17 @@ coll_chunk2(void) /*------------------------------------------------------------------------- - * Function: coll_chunk3 + * Function: coll_chunk3 * - * Purpose: Wrapper to test the collective chunk IO for regular JOINT + * Purpose: Wrapper to test the collective chunk IO for regular JOINT selection with at least number of 2*mpi_size chunks * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * - * Programmer: Unknown - * July 12th, 2004 + * Programmer: Unknown + * July 12th, 2004 * * Modifications: * @@ -1324,7 +1324,7 @@ coll_chunk3(void) { const char *filename = FILENAME[0]; if (mpi_rank == 0) - printf("coll_chunk3\n"); + HDprintf("coll_chunk3\n"); coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); @@ -1341,17 +1341,17 @@ coll_chunk3(void) //------------------------------------------------------------------------- // Borrowed/Modified (slightly) from t_coll_chunk.c /*------------------------------------------------------------------------- - * Function: coll_chunktest + * Function: coll_chunktest * * Purpose: The real testing routine for regular selection of collective chunking storage testing both write and read, - If anything fails, it may be read or write. There is no - separation test between read and write. + If anything fails, it may be read or write. There is no + separation test between read and write. * - * Return: Success: 0 + * Return: Success: 0 * - * Failure: -1 + * Failure: -1 * * Modifications: * Remove invalid temporary property checkings for API_LINK_HARD and @@ -1359,8 +1359,8 @@ coll_chunk3(void) * Programmer: Jonathan Kim * Date: 2012-10-10 * - * Programmer: Unknown - * July 12th, 2004 + * Programmer: Unknown + * July 12th, 2004 * * Modifications: * @@ -1369,14 +1369,14 @@ coll_chunk3(void) static void coll_chunktest(const char* filename, - int chunk_factor, - int select_factor, + int chunk_factor, + int select_factor, int api_option, int file_selection, int mem_selection, int mode) { - hid_t file, dataset, file_dataspace, mem_dataspace; + hid_t file, dataset, file_dataspace, mem_dataspace; hid_t acc_plist,xfer_plist,crp_plist; hsize_t dims[RANK], chunk_dims[RANK]; @@ -1524,41 +1524,41 @@ coll_chunktest(const char* filename, } switch(api_option){ - case API_LINK_HARD: - status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); + case API_LINK_HARD: + status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); VRFY((status>= 0),"collective chunk optimization succeeded"); break; - case API_MULTI_HARD: - status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); - VRFY((status>= 0),"collective chunk optimization succeeded "); + case API_MULTI_HARD: + status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); + VRFY((status>= 0),"collective chunk optimization succeeded "); break; - case API_LINK_TRUE: + case API_LINK_TRUE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2); - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); break; - case API_LINK_FALSE: + case API_LINK_FALSE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6); VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); break; - case API_MULTI_COLL: + case API_MULTI_COLL: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); - status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); + status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); break; - case API_MULTI_IND: + case API_MULTI_IND: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); - status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); + status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); break; - default: + default: ; } @@ -1615,7 +1615,7 @@ coll_chunktest(const char* filename, /* write data collectively */ status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); VRFY((status >= 0),"dataset write succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY @@ -1820,22 +1820,22 @@ coll_chunktest(const char* filename, /***************************************************************************** * - * Function: do_express_test() + * Function: do_express_test() * - * Purpose: Do an MPI_Allreduce to obtain the maximum value returned - * by GetTestExpress() across all processes. Return this - * value. + * Purpose: Do an MPI_Allreduce to obtain the maximum value returned + * by GetTestExpress() across all processes. Return this + * value. * - * Envirmoment variables can be different across different - * processes. This function ensures that all processes agree - * on whether to do an express test. + * Envirmoment variables can be different across different + * processes. This function ensures that all processes agree + * on whether to do an express test. * - * Return: Success: Maximum of the values returned by - * GetTestExpress() across all processes. + * Return: Success: Maximum of the values returned by + * GetTestExpress() across all processes. * - * Failure: -1 + * Failure: -1 * - * Programmer: JRM -- 4/25/06 + * Programmer: JRM -- 4/25/06 * *****************************************************************************/ static int @@ -1868,7 +1868,7 @@ do_express_test(int world_mpi_rank) } /* do_express_test() */ -int main(int argc, char **argv) +int main(int argc, char **argv) { int ExpressMode = 0; hsize_t newsize = 1048576; @@ -1894,12 +1894,12 @@ int main(int argc, char **argv) * calls. By then, MPI calls may not work. */ if (H5dont_atexit() < 0){ - HDprintf("Failed to turn off atexit processing. Continue.\n"); + HDprintf("Failed to turn off atexit processing. Continue.\n"); }; /* set alarm. */ ALARM_ON; - + ExpressMode = do_express_test(mpi_rank); dataset_big_write(); @@ -1923,7 +1923,7 @@ int main(int argc, char **argv) /* turn off alarm */ ALARM_OFF; - if (mpi_rank == 0) + if (mpi_rank == 0) HDremove(FILENAME[0]); /* close HDF5 library */ |