diff options
Diffstat (limited to 'testpar/t_dset.c')
-rw-r--r-- | testpar/t_dset.c | 219 |
1 files changed, 108 insertions, 111 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c index dbc466f..400dc36 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -48,61 +48,61 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], hsize_t s switch (mode) { case BYROW: /* Each process takes a slabs of rows. */ - block[0] = dim0 / mpi_size; - block[1] = dim1; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)dim1; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank * block[0]; + start[0] = (hsize_t)mpi_rank * block[0]; start[1] = 0; if (VERBOSE_MED) HDprintf("slab_set BYROW\n"); break; case BYCOL: /* Each process takes a block of columns. */ - block[0] = dim0; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)(dim1 / mpi_size); stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = mpi_rank * block[1]; + start[1] = (hsize_t)mpi_rank * block[1]; if (VERBOSE_MED) HDprintf("slab_set BYCOL\n"); break; case ZROW: /* Similar to BYROW except process 0 gets 0 row */ - block[0] = (mpi_rank ? dim0 / mpi_size : 0); - block[1] = dim1; + block[0] = (hsize_t)(mpi_rank ? dim0 / mpi_size : 0); + block[1] = (hsize_t)dim1; stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */ stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = (mpi_rank ? mpi_rank * block[0] : 0); + start[0] = (mpi_rank ? (hsize_t)mpi_rank * block[0] : 0); start[1] = 0; if (VERBOSE_MED) HDprintf("slab_set ZROW\n"); break; case ZCOL: /* Similar to BYCOL except process 0 gets 0 column */ - block[0] = dim0; - block[1] = (mpi_rank ? dim1 / mpi_size : 0); + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0); stride[0] = block[0]; - stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ + stride[1] = (hsize_t)(mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = (mpi_rank ? mpi_rank * block[1] : 0); + start[1] = (mpi_rank ? (hsize_t)mpi_rank * block[1] : 0); if (VERBOSE_MED) HDprintf("slab_set ZCOL\n"); break; default: /* Unknown mode. Set it to cover the whole dataset. */ HDprintf("unknown slab_set mode (%d)\n", mode); - block[0] = dim0; - block[1] = dim1; + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)dim1; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; @@ -303,7 +303,7 @@ dataset_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ---------------------------------------- @@ -326,8 +326,8 @@ dataset_writeInd(void) * and the slabs local to the MPI process. * ------------------------------------------- */ /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -441,9 +441,9 @@ dataset_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* setup file access template */ @@ -555,7 +555,6 @@ dataset_writeAll(void) size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ hsize_t current_dims; /* for point selection */ - int i; herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -572,12 +571,12 @@ dataset_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* set up the coords array selection */ - num_points = dim1; - coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t)); + num_points = (size_t)dim1; + coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -600,8 +599,8 @@ dataset_writeAll(void) * and create the dataset * ------------------------- */ /* setup 2-D dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -889,16 +888,16 @@ dataset_writeAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); block[0] = 1; - block[1] = dim1; + block[1] = (hsize_t)dim1; stride[0] = 1; - stride[1] = dim1; + stride[1] = (hsize_t)dim1; count[0] = 1; count[1] = 1; - start[0] = dim0 / mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0 / mpi_size * mpi_rank); start[1] = 0; dataset_fill(start, block, data_array1); @@ -944,7 +943,7 @@ dataset_writeAll(void) /* Dataset6: point selection in File - Point selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0 / mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0 / mpi_size * mpi_rank); start[1] = 0; point_set(start, count, stride, block, num_points, coords, OUT_OF_ORDER); file_dataspace = H5Dget_space(dataset6); @@ -981,7 +980,7 @@ dataset_writeAll(void) /* Dataset7: point selection in File - All selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0 / mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0 / mpi_size * mpi_rank); start[1] = 0; point_set(start, count, stride, block, num_points, coords, IN_ORDER); file_dataspace = H5Dget_space(dataset7); @@ -1071,7 +1070,6 @@ dataset_readAll(void) size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ - hsize_t current_dims; /* for point selection */ int i, j, k; herr_t ret; /* Generic return value */ @@ -1089,14 +1087,14 @@ dataset_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* set up the coords array selection */ - num_points = dim1; - coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t)); + num_points = (size_t)dim1; + coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -1273,18 +1271,18 @@ dataset_readAll(void) free(data_array1); if (data_origin1) free(data_origin1); - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); block[0] = 1; - block[1] = dim1; + block[1] = (hsize_t)dim1; stride[0] = 1; - stride[1] = dim1; + stride[1] = (hsize_t)dim1; count[0] = 1; count[1] = 1; - start[0] = dim0 / mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0 / mpi_size * mpi_rank); start[1] = 0; dataset_fill(start, block, data_origin1); @@ -1334,12 +1332,12 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset6: point selection in File - Point selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0 / mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0 / mpi_size * mpi_rank); start[1] = 0; point_set(start, count, stride, block, num_points, coords, IN_ORDER); file_dataspace = H5Dget_space(dataset6); @@ -1380,7 +1378,7 @@ dataset_readAll(void) if (data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset7: point selection in memory - All selection in file*/ @@ -1390,12 +1388,12 @@ dataset_readAll(void) ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_all succeeded"); - num_points = dim0 * dim1; + num_points = (size_t)(dim0 * dim1); k = 0; for (i = 0; i < dim0; i++) { for (j = 0; j < dim1; j++) { - coords[k++] = i; - coords[k++] = j; + coords[k++] = (hsize_t)i; + coords[k++] = (hsize_t)j; } } mem_dataspace = H5Dget_space(dataset7); @@ -1417,7 +1415,7 @@ dataset_readAll(void) ret = H5Dread(dataset7, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); VRFY((ret >= 0), "H5Dread dataset7 succeeded"); - start[0] = dim0 / mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0 / mpi_size * mpi_rank); start[1] = 0; ret = dataset_vrfy(start, count, stride, block, data_array1 + (dim0 / mpi_size * dim1 * mpi_rank), data_origin1); @@ -1503,11 +1501,11 @@ extend_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -1591,8 +1589,8 @@ extend_writeInd(void) VRFY((mem_dataspace >= 0), ""); /* Extend its current dim sizes before writing */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset1, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -1648,8 +1646,8 @@ extend_writeInd(void) H5Sclose(file_dataspace); /* Extend dataset2 and try again. Should succeed. */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset2, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -1807,7 +1805,7 @@ extend_writeInd2(void) * Write to the second half of the dataset * -------------------------*/ for (i = 0; i < (int)orig_size; i++) - written[i] = orig_size + i; + written[i] = (int)orig_size + i; MESG("data array re-initialized"); if (VERBOSE_MED) { MESG("writing at offset 10: "); @@ -1881,11 +1879,11 @@ extend_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -2063,11 +2061,11 @@ extend_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -2151,8 +2149,8 @@ extend_writeAll(void) VRFY((mem_dataspace >= 0), ""); /* Extend its current dim sizes before writing */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset1, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -2229,8 +2227,8 @@ extend_writeAll(void) H5Sclose(file_dataspace); /* Extend dataset2 and try again. Should succeed. */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset2, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -2301,11 +2299,11 @@ extend_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_array2 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0 * dim1 * sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0 * (size_t)dim1 * sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -2471,7 +2469,7 @@ compress_readAll(void) hid_t dataspace; /* Dataspace ID */ hid_t dataset; /* Dataset ID */ int rank = 1; /* Dataspace rank */ - hsize_t dim = dim0; /* Dataspace dimensions */ + hsize_t dim = (hsize_t)dim0; /* Dataspace dimensions */ unsigned u; /* Local index variable */ unsigned chunk_opts; /* Chunk options */ unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */ @@ -2684,8 +2682,8 @@ none_selection_chunk(void) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* ------------------- * START AN HDF5 FILE @@ -2715,8 +2713,8 @@ none_selection_chunk(void) VRFY((ret >= 0), "H5Pset_chunk succeeded"); /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -2989,8 +2987,8 @@ test_actual_io_mode(int selection_mode) VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3001,7 +2999,7 @@ test_actual_io_mode(int selection_mode) /* If we are not testing contiguous datasets */ if (is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0] / mpi_size; + chunk_dims[0] = dims[0] / (hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0), "chunk creation property list succeeded"); @@ -3067,14 +3065,14 @@ test_actual_io_mode(int selection_mode) } else { /* Select the first and the nth chunk in the nth column */ - block[0] = dim0 / mpi_size; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)(dim1 / mpi_size); count[0] = 2; count[1] = 1; - stride[0] = mpi_rank * block[0]; + stride[0] = (hsize_t)mpi_rank * block[0]; stride[1] = 1; start[0] = 0; - start[1] = mpi_rank * block[1]; + start[1] = (hsize_t)mpi_rank * block[1]; } test_name = "Multi Chunk - Mixed"; @@ -3105,18 +3103,18 @@ test_actual_io_mode(int selection_mode) if (mpi_rank == 0) { /* Select the first chunk in the first column */ slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); - block[0] = block[0] / mpi_size; + block[0] = block[0] / (hsize_t)mpi_size; } else { /* Select the first and the nth chunk in the nth column */ - block[0] = dim0 / mpi_size; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)(dim1 / mpi_size); count[0] = 2; count[1] = 1; - stride[0] = mpi_rank * block[0]; + stride[0] = (hsize_t)mpi_rank * block[0]; stride[1] = 1; start[0] = 0; - start[1] = mpi_rank * block[1]; + start[1] = (hsize_t)mpi_rank * block[1]; } /* If the testname was not already set by the RESET case */ @@ -3189,7 +3187,7 @@ test_actual_io_mode(int selection_mode) length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3437,7 +3435,6 @@ test_no_collective_cause_mode(int selection_mode) uint32_t no_collective_cause_global_write = 0; uint32_t no_collective_cause_global_read = 0; uint32_t no_collective_cause_global_expected = 0; - hsize_t coord[NELM][RANK]; const char *filename; const char *test_name; @@ -3525,8 +3522,8 @@ test_no_collective_cause_mode(int selection_mode) dims[1] = COL_FACTOR * 6; } else { - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; } sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3547,7 +3544,7 @@ test_no_collective_cause_mode(int selection_mode) /* If we are not testing contiguous datasets */ if (is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0] / mpi_size; + chunk_dims[0] = dims[0] / (hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0), "chunk creation property list succeeded"); @@ -3629,7 +3626,7 @@ test_no_collective_cause_mode(int selection_mode) length = dims[0] * dims[1]; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for (i = 0; i < length; i++) buffer[i] = i; @@ -3821,8 +3818,8 @@ test_no_collective_cause_mode_filter(int selection_mode) } /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3839,7 +3836,7 @@ test_no_collective_cause_mode_filter(int selection_mode) /* If we are not testing contiguous datasets */ if (is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0] / mpi_size; + chunk_dims[0] = dims[0] / (hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0), "chunk creation property list succeeded"); @@ -4055,10 +4052,10 @@ dataset_atomicity(void) buf_size = dim0 * dim1; /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc(buf_size, sizeof(int)); + write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc(buf_size, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); /* setup file access template */ @@ -4074,8 +4071,8 @@ dataset_atomicity(void) VRFY((ret >= 0), "H5Pclose succeeded"); /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -4214,10 +4211,10 @@ dataset_atomicity(void) VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc(buf_size, sizeof(int)); + write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc(buf_size, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); for (i = 0; i < buf_size; i++) { @@ -4233,12 +4230,12 @@ dataset_atomicity(void) VRFY((ret >= 0), "atomcity get failed"); VRFY((atomicity == TRUE), "atomcity set failed"); - block[0] = dim0 / mpi_size - 1; - block[1] = dim1 / mpi_size - 1; + block[0] = (hsize_t)(dim0 / mpi_size - 1); + block[1] = (hsize_t)(dim1 / mpi_size - 1); stride[0] = block[0] + 1; stride[1] = block[1] + 1; - count[0] = mpi_size; - count[1] = mpi_size; + count[0] = (hsize_t)mpi_size; + count[1] = (hsize_t)mpi_size; start[0] = 0; start[1] = 0; @@ -4296,19 +4293,19 @@ dataset_atomicity(void) compare = 5; for (i = 0; i < dim0; i++) { - if (i >= mpi_rank * (block[0] + 1)) { + if (i >= mpi_rank * ((int)block[0] + 1)) { break; } - if ((i + 1) % (block[0] + 1) == 0) { + if ((i + 1) % ((int)block[0] + 1) == 0) { k += dim1; continue; } for (j = 0; j < dim1; j++) { - if (j >= mpi_rank * (block[1] + 1)) { - k += dim1 - mpi_rank * (block[1] + 1); + if (j >= mpi_rank * ((int)block[1] + 1)) { + k += dim1 - mpi_rank * ((int)block[1] + 1); break; } - if ((j + 1) % (block[1] + 1) == 0) { + if ((j + 1) % ((int)block[1] + 1) == 0) { k++; continue; } |