summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2020-01-23 21:12:00 (GMT)
committerkmu <kmu@hdfgroup.org>2020-01-23 21:12:00 (GMT)
commit838d4ec56bfc82266a2110635e14d36e075075cc (patch)
tree0da94266f7a4f65b4f2f9045c2913dce9ec89863 /testpar
parenta9aaad9be317ed92150ccc6b4e8574e596447dba (diff)
downloadhdf5-838d4ec56bfc82266a2110635e14d36e075075cc.zip
hdf5-838d4ec56bfc82266a2110635e14d36e075075cc.tar.gz
hdf5-838d4ec56bfc82266a2110635e14d36e075075cc.tar.bz2
squash cast warning fix
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_2Gio.c215
-rw-r--r--testpar/t_bigio.c62
-rw-r--r--testpar/t_cache.c35
-rw-r--r--testpar/t_chunk_alloc.c14
-rw-r--r--testpar/t_coll_chunk.c30
-rw-r--r--testpar/t_coll_md_read.c14
-rw-r--r--testpar/t_dset.c220
-rw-r--r--testpar/t_file.c16
-rw-r--r--testpar/t_filter_read.c4
-rw-r--r--testpar/t_mdset.c39
-rw-r--r--testpar/t_mpi.c10
-rw-r--r--testpar/t_prestart.c6
-rw-r--r--testpar/t_prop.c2
-rw-r--r--testpar/t_pshutdown.c8
-rw-r--r--testpar/t_span_tree.c58
15 files changed, 368 insertions, 365 deletions
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index a49fefe..977a154 100644
--- a/testpar/t_2Gio.c
+++ b/testpar/t_2Gio.c
@@ -312,61 +312,61 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
switch (mode) {
case BYROW:
/* Each process takes a slabs of rows. */
- block[0] = dim0 / mpi_size;
- block[1] = dim1;
+ block[0] = (hsize_t)dim0 / (hsize_t)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 / (hsize_t)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] = (hsize_t)(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 */
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ start[1] = (hsize_t)(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;
@@ -634,7 +634,8 @@ static int MpioTest2G( MPI_Comm comm )
status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
VRFY((status >= 0), "");
- size_t slice_per_process = (shape[0] + mpi_size - 1) / mpi_size;
+ size_t slice_per_process;
+ H5_CHECKED_ASSIGN(slice_per_process, size_t, (shape[0] + (hsize_t)mpi_size - 1) / (hsize_t)mpi_size, hsize_t);
size_t data_size = slice_per_process * shape[1] * shape[2];
size_t data_size_bytes = sizeof(int) * data_size;
data = HDmalloc(data_size_bytes);
@@ -645,7 +646,7 @@ static int MpioTest2G( MPI_Comm comm )
}
hsize_t h5_counts[3] = { slice_per_process, shape[1], shape[2] };
- hsize_t h5_offsets[3] = { mpi_rank * slice_per_process, 0, 0};
+ hsize_t h5_offsets[3] = { (size_t)mpi_rank * slice_per_process, 0, 0};
hid_t filedataspace = H5Screate_simple(3, shape, NULL);
VRFY((filedataspace >= 0), "H5Screate_simple succeeded");
@@ -755,8 +756,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 (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -876,9 +877,9 @@ dataset_readInd(void)
MPI_Comm_rank(test_comm,&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 */
@@ -1007,12 +1008,12 @@ dataset_writeAll(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* set up the coords array selection */
- num_points = dim1;
- coords = (hsize_t *)HDmalloc(dim1 * MAX_RANK * sizeof(hsize_t));
+ num_points = (size_t)dim1;
+ coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)MAX_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");
/* -------------------
@@ -1036,8 +1037,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 (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -1338,16 +1339,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/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
dataset_fill(start, block, data_array1);
@@ -1394,7 +1395,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/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER);
file_dataspace = H5Dget_space (dataset6);
@@ -1432,7 +1433,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/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset7);
@@ -1538,14 +1539,14 @@ dataset_readAll(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* set up the coords array selection */
- num_points = dim1;
- coords = (hsize_t *)HDmalloc(dim0 * dim1 * MAX_RANK * sizeof(hsize_t));
+ num_points = (size_t)dim1;
+ coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * MAX_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");
/* -------------------
@@ -1723,18 +1724,18 @@ dataset_readAll(void)
if(data_array1) 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/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
dataset_fill(start, block, data_origin1);
@@ -1784,12 +1785,12 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
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/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset6);
@@ -1829,7 +1830,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
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*/
@@ -1839,12 +1840,12 @@ dataset_readAll(void)
ret = H5Sselect_all(file_dataspace);
VRFY((ret >= 0), "H5Sselect_all succeeded");
- num_points = dim0 * dim1;
+ num_points = (size_t)dim0 * (size_t)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);
@@ -1867,7 +1868,7 @@ dataset_readAll(void)
xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset7 succeeded");
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1);
if(ret) nerrors++;
@@ -1950,11 +1951,11 @@ extend_writeInd(void)
MPI_Comm_rank(test_comm,&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");
/* -------------------
@@ -2041,8 +2042,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");
@@ -2101,8 +2102,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");
@@ -2263,7 +2264,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;
+ H5_CHECKED_ASSIGN(written[i], int, orig_size + (hsize_t)i, hsize_t);
MESG("data array re-initialized");
if(VERBOSE_MED) {
MESG("writing at offset 10: ");
@@ -2338,11 +2339,11 @@ extend_readInd(void)
MPI_Comm_rank(test_comm,&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");
/* -------------------
@@ -2521,11 +2522,11 @@ extend_writeAll(void)
MPI_Comm_rank(test_comm,&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");
/* -------------------
@@ -2612,8 +2613,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");
@@ -2695,8 +2696,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");
@@ -2768,11 +2769,11 @@ extend_readAll(void)
MPI_Comm_rank(test_comm,&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");
/* -------------------
@@ -2940,7 +2941,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 */
@@ -2968,7 +2969,7 @@ compress_readAll(void)
/* Initialize data buffers */
for(u=0; u<dim;u++)
- data_orig[u]=u;
+ data_orig[u]=(DATATYPE)u;
/* Run test both with and without filters disabled on partial chunks */
for(disable_partial_chunk_filters = 0; disable_partial_chunk_filters <= 1;
@@ -3152,8 +3153,8 @@ none_selection_chunk(void)
MPI_Comm_rank(test_comm,&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
@@ -3183,8 +3184,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(MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3461,8 +3462,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 (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3473,7 +3474,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");
@@ -3539,14 +3540,14 @@ test_actual_io_mode(int selection_mode) {
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
} 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";
@@ -3577,17 +3578,17 @@ 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 */
@@ -3660,7 +3661,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;
@@ -3987,8 +3988,8 @@ test_no_collective_cause_mode(int selection_mode)
dims[1] = BIG_Y_FACTOR * 6;
}
else {
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
}
sid = H5Screate_simple (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -4010,7 +4011,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");
@@ -4091,10 +4092,10 @@ test_no_collective_cause_mode(int selection_mode)
}
/* Get the number of elements in the selection */
- length = dims[0] * dims[1];
+ H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], hsize_t);
/* 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;
@@ -4520,10 +4521,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 */
@@ -4539,8 +4540,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 (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -4678,10 +4679,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++) {
@@ -4698,12 +4699,12 @@ dataset_atomicity(void)
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;
@@ -4759,19 +4760,19 @@ dataset_atomicity(void)
compare = 5;
for (i=0 ; i<dim0 ; i++) {
- if ((hsize_t)i >= mpi_rank*(block[0]+1)) {
+ if ((hsize_t)i >= (hsize_t)mpi_rank*(block[0]+1)) {
break;
}
- if ((i+1)%(block[0]+1)==0) {
+ if (((hsize_t)i+1)%(block[0]+1)==0) {
k += dim1;
continue;
}
for (j=0 ; j<dim1 ; j++) {
- if ((hsize_t)j >= mpi_rank*(block[1]+1)) {
- k += dim1 - mpi_rank*(block[1]+1);
+ if ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) {
+ H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1) + (hsize_t)k, hsize_t);
break;
}
- if ((j+1)%(block[1]+1)==0) {
+ if (((hsize_t)j+1)%(block[1]+1)==0) {
k++;
continue;
}
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index b681a2a..70c77c3 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -247,7 +247,7 @@ ccslab_set(int mpi_rank,
stride[1] = 1;
count[0] = space_dim1;
count[1] = space_dim2;
- start[0] = mpi_rank*count[0];
+ start[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -256,11 +256,11 @@ ccslab_set(int mpi_rank,
/* 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;
+ 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*(hsize_t)mpi_rank;
start[1] = 0;
break;
@@ -274,7 +274,7 @@ ccslab_set(int mpi_rank,
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[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -285,14 +285,14 @@ ccslab_set(int mpi_rank,
half of the domain. */
block[0] = 1;
- count[0] = 2;
- stride[0] = space_dim1*mpi_size/4+1;
+ count[0] = 2;
+ stride[0] = (hsize_t)(space_dim1*(hsize_t)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] = (hsize_t)mpi_rank;
+ else start[0] = 1 + space_dim1*(hsize_t)mpi_size/2 + (hsize_t)(mpi_rank-2*mpi_size/3);
break;
case BYROW_SELECTINCHUNK:
@@ -300,7 +300,7 @@ ccslab_set(int mpi_rank,
block[0] = 1;
count[0] = 1;
- start[0] = mpi_rank*space_dim1;
+ start[0] = (hsize_t)mpi_rank*space_dim1;
stride[0]= 1;
block[1] = space_dim2;
count[1] = 1;
@@ -311,7 +311,7 @@ ccslab_set(int mpi_rank,
default:
/* Unknown mode. Set it to cover the whole dataset. */
- block[0] = space_dim1*mpi_size;
+ block[0] = space_dim1*(hsize_t)mpi_size;
block[1] = space_dim2;
stride[0] = block[0];
stride[1] = block[1];
@@ -519,7 +519,7 @@ dataset_big_write(void)
HDprintf("\nTesting Dataset1 write by ROW\n");
/* Create a large dataset */
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -527,13 +527,13 @@ dataset_big_write(void)
VRFY((dataset >= 0), "H5Dcreate2 succeeded");
H5Sclose(sid);
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
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;
/* create a file dataspace independently */
@@ -582,7 +582,7 @@ dataset_big_write(void)
HDprintf("\nTesting Dataset2 write by COL\n");
/* Create a large dataset */
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -591,13 +591,13 @@ dataset_big_write(void)
H5Sclose(sid);
block[0] = dims[0];
- block[1] = dims[1]/mpi_size;
+ block[1] = dims[1]/(hsize_t)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];
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset);
@@ -708,7 +708,7 @@ dataset_big_write(void)
HDprintf("\nTesting Dataset4 write point selection\n");
/* Create a large dataset */
dims[0] = bigcount;
- dims[1] = mpi_size * 4;
+ dims[1] = (hsize_t)(mpi_size * 4);
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -723,7 +723,7 @@ dataset_big_write(void)
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = dims[1]/mpi_size * mpi_rank;
+ start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank;
num_points = bigcount;
@@ -836,16 +836,16 @@ dataset_big_read(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
/* Each process takes a slabs of cols. */
block[0] = dims[0];
- block[1] = dims[1]/mpi_size;
+ block[1] = dims[1]/(hsize_t)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];
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset);
@@ -898,15 +898,15 @@ dataset_big_read(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
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;
/* create a file dataspace independently */
@@ -1022,7 +1022,7 @@ dataset_big_read(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
dims[0] = bigcount;
- dims[1] = mpi_size * 4;
+ dims[1] = (hsize_t)(mpi_size * 4);
block[0] = dims[0]/2;
block[1] = 2;
@@ -1031,7 +1031,7 @@ dataset_big_read(void)
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = dims[1]/mpi_size * mpi_rank;
+ start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank;
fill_datasets(start, block, wdata);
MESG("data_array initialized");
@@ -1461,7 +1461,7 @@ coll_chunktest(const char* filename,
VRFY((status >= 0),"");
/* setup dimensionality object */
- dims[0] = space_dim1*mpi_size;
+ dims[0] = space_dim1*(hsize_t)mpi_size;
dims[1] = space_dim2;
/* allocate memory for data buffer */
@@ -1499,7 +1499,7 @@ coll_chunktest(const char* filename,
VRFY((crp_plist >= 0),"");
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/chunk_factor;
+ chunk_dims[0] = dims[0]/(hsize_t)chunk_factor;
/* to decrease the testing time, maintain bigger chunk size */
(chunk_factor == 1) ? (chunk_dims[1] = space_dim2) : (chunk_dims[1] = space_dim2/2);
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 058cde6..09d2ecc 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -1619,9 +1619,9 @@ serve_read_request(struct mssg_t * mssg_ptr)
reply.dest = mssg_ptr->src;
reply.mssg_num = -1; /* set by send function */
reply.base_addr = data[target_index].base_addr;
- reply.len = data[target_index].len;
+ H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t);
reply.ver = data[target_index].ver;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
/* and update the counters */
@@ -1841,7 +1841,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
reply.dest = mssg_ptr->src;
reply.mssg_num = -1; /* set by send function */
reply.base_addr = data[target_index].base_addr;
- reply.len = data[target_index].len;
+ H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t);
reply.ver = data[target_index].ver;
reply.count = 0;
reply.magic = MSSG_MAGIC;
@@ -1927,7 +1927,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = total_writes;
+ reply.count = (unsigned)total_writes;
reply.magic = MSSG_MAGIC;
}
@@ -2006,7 +2006,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = total_reads;
+ reply.count = (unsigned)total_reads;
reply.magic = MSSG_MAGIC;
}
@@ -2100,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = data[target_index].writes;
+ reply.count = (unsigned)data[target_index].writes;
reply.magic = MSSG_MAGIC;
}
}
@@ -2197,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = (long)(data[target_index].reads);
+ reply.count = (unsigned)(data[target_index].reads);
reply.magic = MSSG_MAGIC;
}
}
@@ -2633,7 +2633,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = entry_ptr->base_addr;
- mssg.len = entry_ptr->len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
mssg.ver = 0; /* bogus -- should be corrected by server */
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
@@ -2789,7 +2789,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = entry_ptr->base_addr;
- mssg.len = entry_ptr->len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
mssg.ver = entry_ptr->ver;
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -4667,7 +4667,7 @@ verify_entry_reads(haddr_t addr,
}
} else {
- reported_entry_reads = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_reads, int, mssg.count, unsigned);
}
}
@@ -4774,7 +4774,7 @@ verify_entry_writes(haddr_t addr,
}
} else {
- reported_entry_writes = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_writes, int, mssg.count, unsigned);
}
}
@@ -5230,7 +5230,7 @@ server_smoke_check(void)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = data[world_mpi_rank].base_addr;
- mssg.len = data[world_mpi_rank].len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t);
mssg.ver = ++(data[world_mpi_rank].ver);
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -5335,7 +5335,7 @@ server_smoke_check(void)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = data[world_mpi_rank].base_addr;
- mssg.len = data[world_mpi_rank].len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t);
mssg.ver = 0; /* bogus -- should be corrected by server */
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -7265,7 +7265,8 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ H5_CHECK_OVERFLOW(cache_ptr->max_cache_size, size_t, double);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* insert the other half independently */
@@ -7286,7 +7287,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* flush the file */
@@ -7316,7 +7317,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* protect the other half independently */
@@ -7337,7 +7338,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
for ( i = 0; i < (virt_num_data_entries); i++ )
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index bfa0bfe..e6df2d8 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -95,7 +95,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
/* Only MAINPROCESS should create the file. Others just wait. */
if (MAINPROCESS){
nchunks=chunk_factor*mpi_size;
- dims[0]=nchunks*CHUNK_SIZE;
+ dims[0]=(hsize_t)(nchunks*CHUNK_SIZE);
/* Create the data space with unlimited dimensions. */
dataspace = H5Screate_simple (1, dims, maxdims);
VRFY((dataspace >= 0), "");
@@ -127,7 +127,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
count[0] = 1;
stride[0] = 1;
block[0] = chunk_dims[0];
- offset[0] = (nchunks-2)*chunk_dims[0];
+ offset[0] = (hsize_t)(nchunks-2)*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
VRFY((hrc >= 0), "");
@@ -157,7 +157,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char);
+ est_filesize = (MPI_Offset)nchunks * (MPI_Offset)CHUNK_SIZE * (MPI_Offset)sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
}
@@ -233,7 +233,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
dataspace = H5Dget_space(*dataset);
VRFY((dataspace >= 0), "");
- size[0] = nchunks*CHUNK_SIZE;
+ size[0] = (hsize_t)nchunks*CHUNK_SIZE;
switch (action) {
@@ -245,7 +245,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
stride[0] = 1;
block[0] = chunk_dims[0];
for (i=0; i<nchunks/mpi_size; i++) {
- offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
+ offset[0] = (hsize_t)(i*mpi_size+mpi_rank)*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
VRFY((hrc >= 0), "");
@@ -294,7 +294,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks*CHUNK_SIZE*sizeof(unsigned char);
+ est_filesize = (MPI_Offset)nchunks*(MPI_Offset)CHUNK_SIZE*(MPI_Offset)sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
/* Can close some plists */
@@ -374,7 +374,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
/* reset buffer values */
HDmemset(buffer, -1, CHUNK_SIZE);
- offset[0] = i*chunk_dims[0];
+ offset[0] = (hsize_t)i*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
VRFY((hrc >= 0), "");
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index 2d758ba..e950015 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -637,7 +637,7 @@ coll_chunktest(const char* filename,
VRFY((status >= 0),"");
/* setup dimensionality object */
- dims[0] = SPACE_DIM1*mpi_size;
+ dims[0] = (hsize_t)(SPACE_DIM1*mpi_size);
dims[1] = SPACE_DIM2;
/* allocate memory for data buffer */
@@ -670,7 +670,7 @@ coll_chunktest(const char* filename,
VRFY((crp_plist >= 0),"");
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/chunk_factor;
+ chunk_dims[0] = dims[0]/(hsize_t)chunk_factor;
/* to decrease the testing time, maintain bigger chunk size */
(chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2);
@@ -1057,7 +1057,7 @@ ccslab_set(int mpi_rank,
stride[1] = 1;
count[0] = SPACE_DIM1;
count[1] = SPACE_DIM2;
- start[0] = mpi_rank*count[0];
+ start[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -1066,11 +1066,11 @@ ccslab_set(int mpi_rank,
/* 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;
+ stride[0] = 3;
+ stride[1] = 3;
+ count[0] = SPACE_DIM1/(stride[0]*block[0]);
+ count[1] = (SPACE_DIM2)/(stride[1]*block[1]);
+ start[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_rank;
start[1] = 0;
break;
@@ -1084,7 +1084,7 @@ ccslab_set(int mpi_rank,
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[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -1095,14 +1095,14 @@ ccslab_set(int mpi_rank,
half of the domain. */
block[0] = 1;
- count[0] = 2;
- stride[0] = SPACE_DIM1*mpi_size/4+1;
+ count[0] = 2;
+ stride[0] = (hsize_t)SPACE_DIM1*(hsize_t)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] = (hsize_t)mpi_rank;
+ else start[0] = (hsize_t)(1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3));
break;
case BYROW_SELECTINCHUNK:
@@ -1110,7 +1110,7 @@ ccslab_set(int mpi_rank,
block[0] = 1;
count[0] = 1;
- start[0] = mpi_rank*SPACE_DIM1;
+ start[0] = (hsize_t)(mpi_rank*SPACE_DIM1);
stride[0]= 1;
block[1] = SPACE_DIM2;
count[1] = 1;
@@ -1121,7 +1121,7 @@ ccslab_set(int mpi_rank,
default:
/* Unknown mode. Set it to cover the whole dataset. */
- block[0] = SPACE_DIM1*mpi_size;
+ block[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size;
block[1] = SPACE_DIM2;
stride[0] = block[0];
stride[1] = block[1];
diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c
index c0fe04b..d4b2106 100644
--- a/testpar/t_coll_md_read.c
+++ b/testpar/t_coll_md_read.c
@@ -96,8 +96,8 @@ void test_partial_no_selection_coll_md_read(void)
dataset_dims = HDmalloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims));
VRFY((dataset_dims != NULL), "malloc succeeded");
- dataset_dims[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_size;
- dataset_dims[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE * mpi_size;
+ dataset_dims[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_size;
+ dataset_dims[1] = (hsize_t)PARTIAL_NO_SELECTION_X_DIM_SCALE * (hsize_t)mpi_size;
max_dataset_dims[0] = H5S_UNLIMITED;
max_dataset_dims[1] = H5S_UNLIMITED;
@@ -120,12 +120,12 @@ void test_partial_no_selection_coll_md_read(void)
*
* The ranks will write rows across the dataset.
*/
- start[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_rank;
+ start[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_rank;
start[1] = 0;
stride[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE;
stride[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE;
count[0] = 1;
- count[1] = mpi_size;
+ count[1] = (hsize_t)mpi_size;
block[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE;
block[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE;
@@ -405,7 +405,7 @@ void test_link_chunk_io_sort_chunk_issue(void)
dataset_dims = HDmalloc(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS * sizeof(*dataset_dims));
VRFY((dataset_dims != NULL), "malloc succeeded");
- dataset_dims[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * mpi_size * LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE;
+ dataset_dims[0] = (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * (hsize_t)mpi_size * (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE;
max_dataset_dims[0] = H5S_UNLIMITED;
fspace_id = H5Screate_simple(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS, dataset_dims, max_dataset_dims);
@@ -428,8 +428,8 @@ void test_link_chunk_io_sort_chunk_issue(void)
* The ranks will write rows across the dataset.
*/
stride[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE;
- count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / mpi_size;
- start[0] = count[0] * mpi_rank;
+ count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / (hsize_t)mpi_size;
+ start[0] = count[0] * (hsize_t)mpi_rank;
block[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE;
VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), "H5Sselect_hyperslab succeeded");
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 87782d0..05baf3f 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[],
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] = (hsize_t)(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 */
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ start[1] = (hsize_t)(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;
@@ -308,7 +308,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");
/* ----------------------------------------
@@ -332,8 +332,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");
@@ -453,9 +453,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 */
@@ -583,12 +583,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");
/* -------------------
@@ -612,8 +612,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");
@@ -914,16 +914,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);
@@ -970,7 +970,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);
@@ -1008,7 +1008,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);
@@ -1114,14 +1114,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 * (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");
- 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");
/* -------------------
@@ -1299,18 +1299,18 @@ dataset_readAll(void)
if(data_array1) 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);
@@ -1361,12 +1361,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);
@@ -1406,7 +1406,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
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*/
@@ -1416,12 +1416,12 @@ dataset_readAll(void)
ret = H5Sselect_all(file_dataspace);
VRFY((ret >= 0), "H5Sselect_all succeeded");
- num_points = dim0 * dim1;
+ H5_CHECKED_ASSIGN(num_points, size_t, dim0 * dim1, int);
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);
@@ -1444,7 +1444,7 @@ dataset_readAll(void)
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);
if(ret) nerrors++;
@@ -1527,11 +1527,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");
/* -------------------
@@ -1618,8 +1618,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");
@@ -1678,8 +1678,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");
@@ -1840,7 +1840,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: ");
@@ -1915,11 +1915,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");
/* -------------------
@@ -2098,11 +2098,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");
/* -------------------
@@ -2189,8 +2189,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");
@@ -2272,8 +2272,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");
@@ -2345,11 +2345,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");
/* -------------------
@@ -2517,7 +2517,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 */
@@ -2545,7 +2545,7 @@ compress_readAll(void)
/* Initialize data buffers */
for(u=0; u<dim;u++)
- data_orig[u]=u;
+ data_orig[u]=(int)u;
/* Run test both with and without filters disabled on partial chunks */
for(disable_partial_chunk_filters = 0; disable_partial_chunk_filters <= 1;
@@ -2729,8 +2729,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
@@ -2760,8 +2760,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");
@@ -3038,8 +3038,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");
@@ -3050,7 +3050,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");
@@ -3116,14 +3116,14 @@ test_actual_io_mode(int selection_mode) {
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
} 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";
@@ -3154,17 +3154,17 @@ 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 */
@@ -3237,7 +3237,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;
@@ -3566,8 +3566,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");
@@ -3589,7 +3589,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");
@@ -3670,10 +3670,10 @@ test_no_collective_cause_mode(int selection_mode)
}
/* Get the number of elements in the selection */
- length = dims[0] * dims[1];
+ H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], uint64_t);
/* 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;
@@ -3864,8 +3864,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");
@@ -3883,7 +3883,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");
@@ -3913,7 +3913,7 @@ test_no_collective_cause_mode_filter(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;
@@ -4099,10 +4099,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 */
@@ -4118,8 +4118,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");
@@ -4257,10 +4257,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++) {
@@ -4277,12 +4277,12 @@ dataset_atomicity(void)
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;
@@ -4338,19 +4338,19 @@ dataset_atomicity(void)
compare = 5;
for (i=0 ; i<dim0 ; i++) {
- if (i >= mpi_rank*(block[0]+1)) {
+ if ((hsize_t)i >= (hsize_t)mpi_rank*(block[0]+1)) {
break;
}
- if ((i+1)%(block[0]+1)==0) {
+ if (((hsize_t)i+1)%(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 ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) {
+ H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1), hsize_t);
break;
}
- if ((j+1)%(block[1]+1)==0) {
+ if (((hsize_t)j+1)%(block[1]+1)==0) {
k++;
continue;
}
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 99ac189..6183b8d 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -471,19 +471,19 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
grp_id = H5Gcreate2(file_id, "GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((grp_id >= 0), "");
- dims[0] = ROW_FACTOR*mpi_size;
- dims[1] = COL_FACTOR*mpi_size;
+ dims[0] = (hsize_t)(ROW_FACTOR*mpi_size);
+ dims[1] = (hsize_t)(COL_FACTOR*mpi_size);
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
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;
num_elements = block[0] * block[1];
@@ -632,17 +632,17 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
grp_id = H5Gopen2(file_id, "GROUP", H5P_DEFAULT);
VRFY((grp_id >= 0), "");
- dims[0] = ROW_FACTOR*mpi_size;
- dims[1] = COL_FACTOR*mpi_size;
+ dims[0] = (hsize_t)(ROW_FACTOR*mpi_size);
+ dims[1] = (hsize_t)(COL_FACTOR*mpi_size);
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
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;
num_elements = block[0] * block[1];
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index cabb51e..7b0e677 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -74,10 +74,10 @@ filter_read_internal(const char *filename, hid_t dcpl,
hs_size[0] = size[0] = HS_DIM1;
hs_size[1] = HS_DIM2;
- size[1] = hs_size[1] * mpi_size;
+ size[1] = hs_size[1] * (hsize_t)mpi_size;
hs_offset[0] = 0;
- hs_offset[1] = hs_size[1] * mpi_rank;
+ hs_offset[1] = hs_size[1] * (hsize_t)mpi_rank;
/* Create the data space */
sid = H5Screate_simple(2, size, NULL);
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index ee868ee..6cdb0af7 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -157,11 +157,12 @@ void multiple_dset_write(void)
ndatasets = pt->count;
size = get_size();
+ H5_CHECK_OVERFLOW(size, int, size_t);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- outme = HDmalloc((size_t)(size * size * sizeof(double)));
+ outme = HDmalloc((size_t)size * (size_t)size * sizeof(double));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
@@ -238,15 +239,15 @@ void compact_dataset(void)
size = get_size();
for(i = 0; i < DIM; i++ )
- file_dims[i] = size;
+ file_dims[i] = (hsize_t)size;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- outme = HDmalloc((size_t)(size * size * sizeof(double)));
+ outme = HDmalloc((size_t)((size_t)size * (size_t)size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
- inme = HDmalloc((size_t)(size * size * sizeof(double)));
+ inme = HDmalloc((size_t)size * (size_t)size * sizeof(double));
VRFY((outme != NULL), "HDmalloc succeeded for inme");
filename = GetTestParameters();
@@ -363,7 +364,7 @@ void null_dataset(void)
hid_t iof, plist, dxpl, dataset, attr, sid;
unsigned uval=2; /* Buffer for writing to dataset */
int val=1; /* Buffer for writing to attribute */
- int nelem;
+ hssize_t nelem;
char dname[]="dataset";
char attr_name[]="attribute";
herr_t ret;
@@ -627,7 +628,7 @@ void dataset_fillvalue(void)
/* Set the dataset dimension to be one row more than number of processes */
/* and calculate the actual dataset size. */
- dset_dims[0]=mpi_size+1;
+ dset_dims[0]=(hsize_t)(mpi_size+1);
dset_size=dset_dims[0]*dset_dims[1]*dset_dims[2]*dset_dims[3];
/* Allocate space for the buffers */
@@ -720,7 +721,7 @@ void dataset_fillvalue(void)
* Each process writes 1 row of data. Thus last row is not written.
*/
/* Create hyperslabs in memory and file dataspaces */
- req_start[0]=mpi_rank;
+ req_start[0]=(hsize_t)mpi_rank;
ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace");
ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
@@ -878,7 +879,7 @@ void collective_group_write(void)
chunk_size[0] =(hsize_t)(size / 2);
chunk_size[1] =(hsize_t)(size / 2);
- outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outme = HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
@@ -1002,10 +1003,10 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
size = get_size();
- indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((indata != NULL), "HDmalloc succeeded for indata");
- outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
/* open every group under root group. */
@@ -1173,7 +1174,7 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
size = get_size();
- outme = HDmalloc((size_t)(size * size * sizeof(double)));
+ outme = HDmalloc((size_t)size * (size_t)size * sizeof(double));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
for(n = 0; n < NDATASET; n++) {
@@ -1333,10 +1334,10 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
size = get_size();
- indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((indata != NULL), "HDmalloc succeeded for indata");
- outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
for(n=0; n<NDATASET; n++) {
@@ -1490,8 +1491,8 @@ check_value(DATATYPE *indata, DATATYPE *outdata, int size)
get_slab(chunk_origin, chunk_dims, count, NULL, size);
- indata += chunk_origin[0]*size;
- outdata += chunk_origin[0]*size;
+ indata += chunk_origin[0]*(hsize_t)size;
+ outdata += chunk_origin[0]*(hsize_t)size;
for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++)
for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
if(*indata != *outdata )
@@ -1524,15 +1525,15 @@ get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[],
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
if(chunk_origin != NULL) {
- chunk_origin[0] = mpi_rank *(size/mpi_size);
+ chunk_origin[0] = (hsize_t)mpi_rank * (hsize_t)(size/mpi_size);
chunk_origin[1] = 0;
}
if(chunk_dims != NULL) {
- chunk_dims[0] = size/mpi_size;
- chunk_dims[1] = size;
+ chunk_dims[0] = (hsize_t)(size/mpi_size);
+ chunk_dims[1] = (hsize_t)size;
}
if(file_dims != NULL)
- file_dims[0] = file_dims[1] = size;
+ file_dims[0] = file_dims[1] = (hsize_t)size;
if(count != NULL)
count[0] = count[1] = 1;
}
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index fe78317..064fb57 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -302,8 +302,8 @@ static int test_mpio_gb_file(char *filename) {
"proc %d: write to mpi_off=%016llx, %lld\n",
mpi_rank, mpi_off, mpi_off);
/* set data to some trivial pattern for easy verification */
- for (j = 0; j < MB; j++)
- *(buf + j) = (int8_t)(i * mpi_size + mpi_rank);
+ for (j = 0; j < MB; j++)
+ H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int);
if (VERBOSE_MED)
HDfprintf(stdout,
"proc %d: writing %d bytes at offset %lld\n",
@@ -351,7 +351,7 @@ static int test_mpio_gb_file(char *filename) {
mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE,
&mpi_stat);
INFO((mrc == MPI_SUCCESS), "GB size file read");
- expected = (int8_t)(i * mpi_size + (mpi_size - mpi_rank - 1));
+ H5_CHECKED_ASSIGN(expected, int8_t, i * mpi_size + (mpi_size - mpi_rank - 1), int);
vrfyerrs = 0;
for (j = 0; j < MB; j++) {
if ((*(buf + j) != expected)
@@ -526,7 +526,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
* ==================================================*/
irank = 0;
for (i = 0; i < DIMSIZE; i++)
- H5_CHECKED_ASSIGN(writedata[i], uint8_t, irank * DIMSIZE + i, int)
+ H5_CHECKED_ASSIGN(writedata[i], uint8_t, irank * DIMSIZE + i, int)
mpi_off = irank * DIMSIZE;
/* Only one process writes */
@@ -697,7 +697,7 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
retcode = 0;
for (i = 0; i < 3; i++)
- H5_CHECKED_ASSIGN(buf[i], int8_t, i + 1, int);
+ buf[i] = (char)(i + 1);
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c
index d75e627..fc9d475 100644
--- a/testpar/t_prestart.c
+++ b/testpar/t_prestart.c
@@ -81,13 +81,13 @@ main (int argc, char **argv)
VRFY((data_array != NULL), "data_array HDmalloc succeeded");
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
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;
ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
@@ -109,7 +109,7 @@ main (int argc, char **argv)
if(*dataptr != mpi_rank+1) {
HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
- (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
+ (unsigned long)((hsize_t)i+start[0]), (unsigned long)((hsize_t)j+start[1]),
mpi_rank+1, *(dataptr));
nerrors ++;
}
diff --git a/testpar/t_prop.c b/testpar/t_prop.c
index fd89c6a..62e4dde 100644
--- a/testpar/t_prop.c
+++ b/testpar/t_prop.c
@@ -53,7 +53,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc)
void *rbuf;
MPI_Recv(&recv_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status);
- buf_size = recv_size;
+ buf_size = (size_t)recv_size;
rbuf = (uint8_t *)HDmalloc(buf_size);
MPI_Recv(rbuf, recv_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status);
diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c
index def7071..ddbae9e 100644
--- a/testpar/t_pshutdown.c
+++ b/testpar/t_pshutdown.c
@@ -68,8 +68,8 @@ main (int argc, char **argv)
grp_id = H5Gcreate2(file_id, "Group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((grp_id >= 0), "H5Gcreate succeeded");
- dims[0] = ROW_FACTOR*mpi_size;
- dims[1] = COL_FACTOR*mpi_size;
+ dims[0] = (hsize_t)ROW_FACTOR*(hsize_t)mpi_size;
+ dims[1] = (hsize_t)COL_FACTOR*(hsize_t)mpi_size;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -81,13 +81,13 @@ main (int argc, char **argv)
VRFY((data_array != NULL), "data_array HDmalloc succeeded");
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
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;
/* put some trivial data in the data_array */
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index c3cc7b5..e1a86a1 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -246,19 +246,19 @@ void coll_write_test(int chunk_factor)
* Buffers' initialization.
*/
- mdim1[0] = MSPACE1_DIM *mpi_size;
+ mdim1[0] = (hsize_t)(MSPACE1_DIM*mpi_size);
mdim[0] = MSPACE_DIM1;
- mdim[1] = MSPACE_DIM2*mpi_size;
+ mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size);
fsdim[0] = FSPACE_DIM1;
- fsdim[1] = FSPACE_DIM2*mpi_size;
+ fsdim[1] = (hsize_t)(FSPACE_DIM2*mpi_size);
- vector = (int*)HDmalloc(sizeof(int)*mdim1[0]*mpi_size);
- matrix_out = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size);
- matrix_out1 = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size);
+ vector = (int*)HDmalloc(sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size);
+ matrix_out = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size);
+ matrix_out1 = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size);
- HDmemset(vector,0,sizeof(int)*mdim1[0]*mpi_size);
+ HDmemset(vector,0,sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size);
vector[0] = vector[MSPACE1_DIM*mpi_size - 1] = -1;
- for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) vector[i] = i;
+ for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) H5_CHECKED_ASSIGN(vector[i], int, i, unsigned);
/* Grab file access property list */
facc_plist = create_faccess_plist(comm, info, facc_type);
@@ -280,8 +280,8 @@ void coll_write_test(int chunk_factor)
VRFY((ret >= 0),"Fill value creation property list succeeded");
if(chunk_factor != 0) {
- chunk_dims[0] = fsdim[0] / chunk_factor;
- chunk_dims[1] = fsdim[1] / chunk_factor;
+ chunk_dims[0] = fsdim[0] / (hsize_t)chunk_factor;
+ chunk_dims[1] = fsdim[1] / (hsize_t)chunk_factor;
ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
}
@@ -317,7 +317,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = FHSTART0;
- start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1;
+ start[1] = (hsize_t)(FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1);
stride[0] = FHSTRIDE0;
stride[1] = FHSTRIDE1;
count[0] = FHCOUNT0;
@@ -338,7 +338,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = SHSTART0;
- start[1] = SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank;
+ start[1] = (hsize_t)(SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank);
stride[0] = SHSTRIDE0;
stride[1] = SHSTRIDE1;
count[0] = SHCOUNT0;
@@ -476,7 +476,7 @@ void coll_write_test(int chunk_factor)
*
*/
start[0] = RFFHSTART0;
- start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1;
+ start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1);
block[0] = RFFHBLOCK0;
block[1] = RFFHBLOCK1;
stride[0] = RFFHSTRIDE0;
@@ -503,7 +503,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = RFSHSTART0;
- start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank;
+ start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank);
block[0] = RFSHBLOCK0;
block[1] = RFSHBLOCK1;
stride[0] = RFSHSTRIDE0;
@@ -542,7 +542,7 @@ void coll_write_test(int chunk_factor)
start[0] = RMFHSTART0;
- start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1;
+ start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1);
block[0] = RMFHBLOCK0;
block[1] = RMFHBLOCK1;
stride[0] = RMFHSTRIDE0;
@@ -565,7 +565,7 @@ void coll_write_test(int chunk_factor)
*
*/
start[0] = RMSHSTART0;
- start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1;
+ start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1);
block[0] = RMSHBLOCK0;
block[1] = RMSHBLOCK1;
stride[0] = RMSHSTRIDE0;
@@ -580,8 +580,8 @@ void coll_write_test(int chunk_factor)
* Initialize data buffer.
*/
- HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
- HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
+ HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
+ HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
/*
* Read data back to the buffer matrix_out.
*/
@@ -704,9 +704,9 @@ coll_read_test(void)
/* Initialize the buffer */
mdim[0] = MSPACE_DIM1;
- mdim[1] = MSPACE_DIM2*mpi_size;
- matrix_out =(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
- matrix_out1=(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
+ mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size);
+ matrix_out =(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
+ matrix_out1=(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
/*** For testing collective hyperslab selection read ***/
@@ -741,7 +741,7 @@ coll_read_test(void)
*
*/
start[0] = RFFHSTART0;
- start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1;
+ start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1);
block[0] = RFFHBLOCK0;
block[1] = RFFHBLOCK1;
stride[0] = RFFHSTRIDE0;
@@ -761,7 +761,7 @@ coll_read_test(void)
*
*/
start[0] = RFSHSTART0;
- start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank;
+ start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank);
block[0] = RFSHBLOCK0;
block[1] = RFSHBLOCK1;
stride[0] = RFSHSTRIDE0;
@@ -791,7 +791,7 @@ coll_read_test(void)
*/
start[0] = RMFHSTART0;
- start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1;
+ start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1);
block[0] = RMFHBLOCK0;
block[1] = RMFHBLOCK1;
stride[0] = RMFHSTRIDE0;
@@ -813,7 +813,7 @@ coll_read_test(void)
*
*/
start[0] = RMSHSTART0;
- start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1;
+ start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1);
block[0] = RMSHBLOCK0;
block[1] = RMSHBLOCK1;
stride[0] = RMSHSTRIDE0;
@@ -828,8 +828,8 @@ coll_read_test(void)
* Initialize data buffer.
*/
- HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
- HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
+ HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
+ HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
/*
* Read data back to the buffer matrix_out.
@@ -1004,9 +1004,9 @@ lower_dim_size_comp_test__select_checker_board(
* pre-C99 compilers again.
*/
- base_count = dims[sel_offset] / (checker_edge_size * 2);
+ base_count = dims[sel_offset] / (hsize_t)(checker_edge_size * 2);
- if ( (dims[sel_rank] % (checker_edge_size * 2)) > 0 ) {
+ if ( (dims[sel_rank] % (hsize_t)(checker_edge_size * 2)) > 0 ) {
base_count++;
}