diff options
Diffstat (limited to 'testpar/API/t_bigio.c')
-rw-r--r-- | testpar/API/t_bigio.c | 190 |
1 files changed, 95 insertions, 95 deletions
diff --git a/testpar/API/t_bigio.c b/testpar/API/t_bigio.c index 3e18c8f..febf0d5 100644 --- a/testpar/API/t_bigio.c +++ b/testpar/API/t_bigio.c @@ -133,16 +133,16 @@ point_set(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], s } if (VERBOSE_MED) { - HDprintf("start[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "count[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "stride[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "block[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "total datapoints=%" PRIuHSIZE "\n", - start[0], start[1], count[0], count[1], stride[0], stride[1], block[0], block[1], - block[0] * block[1] * count[0] * count[1]); + printf("start[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "count[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "stride[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "block[]=(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "total datapoints=%" PRIuHSIZE "\n", + start[0], start[1], count[0], count[1], stride[0], stride[1], block[0], block[1], + block[0] * block[1] * count[0] * count[1]); k = 0; for (i = 0; i < num_points; i++) { - HDprintf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); + printf("(%d, %d)\n", (int)coords[k], (int)coords[k + 1]); k += 2; } } @@ -158,19 +158,19 @@ dataset_print(hsize_t start[], hsize_t block[], B_DATATYPE *dataset) hsize_t i, j; /* print the column heading */ - HDprintf("%-8s", "Cols:"); + printf("%-8s", "Cols:"); for (j = 0; j < block[1]; j++) { - HDprintf("%3" PRIuHSIZE " ", start[1] + j); + printf("%3" PRIuHSIZE " ", start[1] + j); } - HDprintf("\n"); + printf("\n"); /* print the slab data */ for (i = 0; i < block[0]; i++) { - HDprintf("Row %2" PRIuHSIZE ": ", i + start[0]); + printf("Row %2" PRIuHSIZE ": ", i + start[0]); for (j = 0; j < block[1]; j++) { - HDprintf("%" PRIuHSIZE " ", *dataptr++); + printf("%" PRIuHSIZE " ", *dataptr++); } - HDprintf("\n"); + printf("\n"); } } @@ -186,15 +186,15 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], /* print it if VERBOSE_MED */ if (VERBOSE_MED) { - HDprintf("verify_data dumping:::\n"); - HDprintf("start(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "count(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "stride(%" PRIuHSIZE ", %" PRIuHSIZE "), " - "block(%" PRIuHSIZE ", %" PRIuHSIZE ")\n", - start[0], start[1], count[0], count[1], stride[0], stride[1], block[0], block[1]); - HDprintf("original values:\n"); + printf("verify_data dumping:::\n"); + printf("start(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "count(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "stride(%" PRIuHSIZE ", %" PRIuHSIZE "), " + "block(%" PRIuHSIZE ", %" PRIuHSIZE ")\n", + start[0], start[1], count[0], count[1], stride[0], stride[1], block[0], block[1]); + printf("original values:\n"); dataset_print(start, block, original); - HDprintf("compared values:\n"); + printf("compared values:\n"); dataset_print(start, block, dataset); } @@ -203,10 +203,10 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], for (j = 0; j < block[1]; j++) { if (*dataset != *original) { if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED) { - HDprintf("Dataset Verify failed at [%" PRIuHSIZE "][%" PRIuHSIZE "]" - "(row %" PRIuHSIZE ", col %" PRIuHSIZE "): " - "expect %" PRIuHSIZE ", got %" PRIuHSIZE "\n", - i, j, i + start[0], j + start[1], *(original), *(dataset)); + printf("Dataset Verify failed at [%" PRIuHSIZE "][%" PRIuHSIZE "]" + "(row %" PRIuHSIZE ", col %" PRIuHSIZE "): " + "expect %" PRIuHSIZE ", got %" PRIuHSIZE "\n", + i, j, i + start[0], j + start[1], *(original), *(dataset)); } dataset++; original++; @@ -214,9 +214,9 @@ verify_data(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], } } if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) - HDprintf("[more errors ...]\n"); + printf("[more errors ...]\n"); if (vrfyerrs) - HDprintf("%d errors found in verify_data\n", vrfyerrs); + printf("%d errors found in verify_data\n", vrfyerrs); return (vrfyerrs); } @@ -314,12 +314,12 @@ ccslab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], hsize_t break; } if (VERBOSE_MED) { - 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])); + 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])); } } @@ -372,20 +372,20 @@ ccdataset_print(hsize_t start[], hsize_t block[], DATATYPE *dataset) hsize_t i, j; /* print the column heading */ - HDprintf("Print only the first block of the dataset\n"); - HDprintf("%-8s", "Cols:"); + printf("Print only the first block of the dataset\n"); + printf("%-8s", "Cols:"); for (j = 0; j < block[1]; j++) { - HDprintf("%3lu ", (unsigned long)(start[1] + j)); + printf("%3lu ", (unsigned long)(start[1] + j)); } - HDprintf("\n"); + printf("\n"); /* print the slab data */ for (i = 0; i < block[0]; i++) { - HDprintf("Row %2lu: ", (unsigned long)(i + start[0])); + printf("Row %2lu: ", (unsigned long)(i + start[0])); for (j = 0; j < block[1]; j++) { - HDprintf("%03d ", *dataptr++); + printf("%03d ", *dataptr++); } - HDprintf("\n"); + printf("\n"); } } @@ -402,14 +402,14 @@ ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block /* print it if VERBOSE_MED */ if (VERBOSE_MED) { - 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"); + 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); - HDprintf("compared values:\n"); + printf("compared values:\n"); ccdataset_print(start, block, dataset); } @@ -432,8 +432,8 @@ ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block } if (*dataptr != *oriptr) { if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED) { - HDprintf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", - (unsigned long)i, (unsigned long)j, *(oriptr), *(dataptr)); + printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n", + (unsigned long)i, (unsigned long)j, *(oriptr), *(dataptr)); } } } @@ -441,9 +441,9 @@ ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block } } if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED) - HDprintf("[more errors ...]\n"); + printf("[more errors ...]\n"); if (vrfyerrs) - HDprintf("%d errors found in ccdataset_vrfy\n", vrfyerrs); + printf("%d errors found in ccdataset_vrfy\n", vrfyerrs); return (vrfyerrs); } @@ -477,7 +477,7 @@ dataset_big_write(void) B_DATATYPE *wdata; /* allocate memory for data buffer */ - wdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((wdata != NULL), "wdata malloc succeeded"); /* setup file access template */ @@ -495,7 +495,7 @@ dataset_big_write(void) /* Each process takes a slabs of rows. */ if (mpi_rank_g == 0) - HDprintf("\nTesting Dataset1 write by ROW\n"); + printf("\nTesting Dataset1 write by ROW\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = (hsize_t)mpi_size_g; @@ -556,7 +556,7 @@ dataset_big_write(void) /* Each process takes a slabs of cols. */ if (mpi_rank_g == 0) - HDprintf("\nTesting Dataset2 write by COL\n"); + printf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = (hsize_t)mpi_size_g; @@ -617,7 +617,7 @@ dataset_big_write(void) /* ALL selection */ if (mpi_rank_g == 0) - HDprintf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); + printf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = 1; @@ -678,7 +678,7 @@ dataset_big_write(void) /* Point selection */ if (mpi_rank_g == 0) - HDprintf("\nTesting Dataset4 write point selection\n"); + printf("\nTesting Dataset4 write point selection\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = (hsize_t)(mpi_size_g * 4); @@ -700,7 +700,7 @@ dataset_big_write(void) num_points = bigcount; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords(start, count, stride, block, num_points, coords, IN_ORDER); @@ -749,7 +749,7 @@ dataset_big_write(void) ret = H5Dclose(dataset); VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - HDfree(wdata); + free(wdata); H5Fclose(fid); } @@ -782,12 +782,12 @@ dataset_big_read(void) herr_t ret; /* Generic return value */ /* allocate memory for data buffer */ - rdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + rdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((rdata != NULL), "rdata malloc succeeded"); - wdata = (B_DATATYPE *)HDmalloc(bigcount * sizeof(B_DATATYPE)); + wdata = (B_DATATYPE *)malloc(bigcount * sizeof(B_DATATYPE)); VRFY_G((wdata != NULL), "wdata malloc succeeded"); - HDmemset(rdata, 0, bigcount * sizeof(B_DATATYPE)); + memset(rdata, 0, bigcount * sizeof(B_DATATYPE)); /* setup file access template */ acc_tpl = H5Pcreate(H5P_FILE_ACCESS); @@ -803,7 +803,7 @@ dataset_big_read(void) VRFY_G((ret >= 0), ""); if (mpi_rank_g == 0) - HDprintf("\nRead Testing Dataset1 by COL\n"); + printf("\nRead Testing Dataset1 by COL\n"); dataset = H5Dopen2(fid, DATASET1, H5P_DEFAULT); VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); @@ -854,7 +854,7 @@ dataset_big_read(void) /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if (ret) { - HDfprintf(stderr, "verify failed\n"); + fprintf(stderr, "verify failed\n"); exit(1); } @@ -866,8 +866,8 @@ dataset_big_read(void) VRFY_G((ret >= 0), "H5Dclose1 succeeded"); if (mpi_rank_g == 0) - HDprintf("\nRead Testing Dataset2 by ROW\n"); - HDmemset(rdata, 0, bigcount * sizeof(B_DATATYPE)); + printf("\nRead Testing Dataset2 by ROW\n"); + memset(rdata, 0, bigcount * sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); @@ -917,7 +917,7 @@ dataset_big_read(void) /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if (ret) { - HDfprintf(stderr, "verify failed\n"); + fprintf(stderr, "verify failed\n"); exit(1); } @@ -929,8 +929,8 @@ dataset_big_read(void) VRFY_G((ret >= 0), "H5Dclose1 succeeded"); if (mpi_rank_g == 0) - HDprintf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); - HDmemset(rdata, 0, bigcount * sizeof(B_DATATYPE)); + printf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); + memset(rdata, 0, bigcount * sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT); VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); @@ -982,7 +982,7 @@ dataset_big_read(void) /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if (ret) { - HDfprintf(stderr, "verify failed\n"); + fprintf(stderr, "verify failed\n"); exit(1); } } @@ -995,7 +995,7 @@ dataset_big_read(void) VRFY_G((ret >= 0), "H5Dclose1 succeeded"); if (mpi_rank_g == 0) - HDprintf("\nRead Testing Dataset4 with Point selection\n"); + printf("\nRead Testing Dataset4 with Point selection\n"); dataset = H5Dopen2(fid, DATASET4, H5P_DEFAULT); VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); @@ -1020,7 +1020,7 @@ dataset_big_read(void) num_points = bigcount; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords(start, count, stride, block, num_points, coords, IN_ORDER); @@ -1031,7 +1031,7 @@ dataset_big_read(void) VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if (coords) - HDfree(coords); + free(coords); /* create a memory dataspace */ /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1057,7 +1057,7 @@ dataset_big_read(void) ret = verify_data(start, count, stride, block, rdata, wdata); if (ret) { - HDfprintf(stderr, "verify failed\n"); + fprintf(stderr, "verify failed\n"); exit(1); } @@ -1068,8 +1068,8 @@ dataset_big_read(void) ret = H5Dclose(dataset); VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - HDfree(wdata); - HDfree(rdata); + free(wdata); + free(rdata); wdata = NULL; rdata = NULL; @@ -1096,9 +1096,9 @@ dataset_big_read(void) /* release data buffers */ if (rdata) - HDfree(rdata); + free(rdata); if (wdata) - HDfree(wdata); + free(wdata); } /* dataset_large_readAll */ @@ -1106,7 +1106,7 @@ static void single_rank_independent_io(void) { if (mpi_rank_g == 0) - HDprintf("single_rank_independent_io\n"); + printf("single_rank_independent_io\n"); if (MAIN_PROCESS) { hsize_t dims[1]; @@ -1153,7 +1153,7 @@ single_rank_independent_io(void) VRFY_G((ret >= 0), "H5Dwrite succeeded"); /* Wipe buffer */ - HDmemset(data, 0, dims[0] * sizeof(int)); + memset(data, 0, dims[0] * sizeof(int)); /* Read data back */ ret = H5Dread(dset_id, H5T_NATIVE_INT, H5S_BLOCK, fspace_id, H5P_DEFAULT, data); @@ -1162,7 +1162,7 @@ single_rank_independent_io(void) /* Verify data */ for (i = 0; i < dims[0]; i++) if (data[i] != (int)(i % (uint64_t)DXFER_BIGCOUNT)) { - HDfprintf(stderr, "verify failed\n"); + fprintf(stderr, "verify failed\n"); exit(1); } @@ -1269,7 +1269,7 @@ coll_chunk1(void) { const char *filename = FILENAME[0]; if (mpi_rank_g == 0) - HDprintf("coll_chunk1\n"); + printf("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); @@ -1322,7 +1322,7 @@ coll_chunk2(void) { const char *filename = FILENAME[0]; if (mpi_rank_g == 0) - HDprintf("coll_chunk2\n"); + printf("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); @@ -1374,7 +1374,7 @@ coll_chunk3(void) { const char *filename = FILENAME[0]; if (mpi_rank_g == 0) - HDprintf("coll_chunk3\n"); + printf("coll_chunk3\n"); coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); @@ -1448,7 +1448,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap dims[1] = space_dim2; /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ @@ -1456,7 +1456,7 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; - coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); + coords = (hsize_t *)malloc(num_points * RANK * sizeof(hsize_t)); VRFY_G((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); @@ -1715,16 +1715,16 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap VRFY_G((status >= 0), ""); if (data_array1) - HDfree(data_array1); + free(data_array1); /* Use collective read to verify the correctness of collective write. */ /* allocate memory for data buffer */ - data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_array1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ - data_origin1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); + data_origin1 = (int *)malloc(dims[0] * dims[1] * sizeof(int)); VRFY_G((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); @@ -1847,11 +1847,11 @@ coll_chunktest(const char *filename, int chunk_factor, int select_factor, int ap /* release data buffers */ if (coords) - HDfree(coords); + free(coords); if (data_array1) - HDfree(data_array1); + free(data_array1); if (data_origin1) - HDfree(data_origin1); + free(data_origin1); } int @@ -1869,7 +1869,7 @@ 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"); + printf("Failed to turn off atexit processing. Continue.\n"); /* set alarm. */ /* TestAlarmOn(); */ @@ -1879,7 +1879,7 @@ main(int argc, char **argv) /* Get the capability flag of the VOL connector being used */ if (H5Pget_vol_cap_flags(acc_plist, &vol_cap_flags_g) < 0) { if (MAIN_PROCESS) - HDprintf("Failed to get the capability flag of the VOL connector being used\n"); + printf("Failed to get the capability flag of the VOL connector being used\n"); MPI_Finalize(); return 0; @@ -1891,7 +1891,7 @@ main(int argc, char **argv) if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) { if (MAIN_PROCESS) - HDprintf( + printf( "API functions for basic file, dataset basic or more aren't supported with this connector\n"); MPI_Finalize(); |