summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2020-01-24 18:05:09 (GMT)
committerkmu <kmu@hdfgroup.org>2020-01-24 18:05:09 (GMT)
commitfb6328b6315d62aed57a98058c711ef086aa0db1 (patch)
treebb85224bcdcb2826bfe98b7b80b756613b65788a /testpar
parente938f4407eeea3f55dc5df291a2a83854f54404a (diff)
parent590aaff33046df99a4d88ba59e4b461e060b36e4 (diff)
downloadhdf5-fb6328b6315d62aed57a98058c711ef086aa0db1.zip
hdf5-fb6328b6315d62aed57a98058c711ef086aa0db1.tar.gz
hdf5-fb6328b6315d62aed57a98058c711ef086aa0db1.tar.bz2
Merge branch 'develop' of https://git.hdfgroup.org/scm/~kmu/hdf5 into develop
Diffstat (limited to 'testpar')
-rw-r--r--testpar/CMakeLists.txt4
-rw-r--r--testpar/t_2Gio.c219
-rw-r--r--testpar/t_bigio.c63
-rw-r--r--testpar/t_cache.c62
-rw-r--r--testpar/t_chunk_alloc.c14
-rw-r--r--testpar/t_coll_chunk.c31
-rw-r--r--testpar/t_coll_md_read.c15
-rw-r--r--testpar/t_dset.c228
-rw-r--r--testpar/t_file.c16
-rw-r--r--testpar/t_filter_read.c6
-rw-r--r--testpar/t_mdset.c50
-rw-r--r--testpar/t_mpi.c6
-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_shapesame.c15
-rw-r--r--testpar/t_span_tree.c75
17 files changed, 405 insertions, 415 deletions
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index 9795c65..3e4957d 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -79,4 +79,6 @@ foreach (h5_testp ${H5P_TESTS})
ADD_H5P_EXE(${h5_testp})
endforeach ()
-include (CMakeTests.cmake)
+if (HDF5_TEST_PARALLEL)
+ include (CMakeTests.cmake)
+endif ()
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index d48dfca..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;
@@ -552,7 +552,7 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]
#define H5FILE_NAME "hugefile.h5"
#define DATASETNAME "dataset"
-int MpioTest2G( MPI_Comm comm )
+static int MpioTest2G( MPI_Comm comm )
{
/*
* HDF5 APIs definitions
@@ -634,7 +634,8 @@ 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 @@ 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;
@@ -3891,8 +3892,6 @@ actual_io_mode_tests(void) {
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
-#define DSET_NOCOLCAUSE "nocolcause"
-#define NELM 2
#define FILE_EXTERNAL "nocolcause_extern.data"
static void
test_no_collective_cause_mode(int selection_mode)
@@ -3989,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");
@@ -4012,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");
@@ -4093,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;
@@ -4522,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 */
@@ -4541,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");
@@ -4680,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++) {
@@ -4700,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;
@@ -4761,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 12c1023..70c77c3 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -27,7 +27,6 @@ const char *FILENAME[3]={ "bigio_test.h5",
#define DATASET2 "DSET2"
#define DATASET3 "DSET3"
#define DATASET4 "DSET4"
-#define DATASET5 "DSET5"
#define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/
#define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */
#define DXFER_BIGCOUNT (1 < 29)
@@ -248,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;
@@ -257,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;
@@ -275,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;
@@ -286,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:
@@ -301,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;
@@ -312,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];
@@ -520,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");
@@ -528,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 */
@@ -583,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");
@@ -592,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);
@@ -709,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");
@@ -724,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;
@@ -837,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);
@@ -899,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 */
@@ -1023,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;
@@ -1032,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");
@@ -1462,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 */
@@ -1500,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 cde19fe..954071d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -28,7 +28,7 @@
#include "H5Fpkg.h"
#include "H5Iprivate.h"
#include "H5MFprivate.h"
-
+#include "H5private.h"
#define BASE_ADDR (haddr_t)1024
@@ -38,7 +38,6 @@ int failures = 0;
hbool_t verbose = TRUE; /* used to control error messages */
#define NFILENAME 2
-#define PARATESTFILE filenames[0]
const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL};
#ifndef PATH_MAX
#define PATH_MAX 512
@@ -219,7 +218,9 @@ struct datum data[NUM_DATA_ENTRIES];
#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES
#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10)
/* Use a smaller test size to avoid creating huge MPE logfiles. */
+#ifdef H5_HAVE_MPE
#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100)
+#endif
int virt_num_data_entries = NUM_DATA_ENTRIES;
@@ -1618,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 */
@@ -1761,7 +1762,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
int target_index;
- int new_ver_num;
+ int new_ver_num = 0;
haddr_t target_addr;
#if DO_WRITE_REQ_ACK
struct mssg_t reply;
@@ -1840,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;
@@ -1926,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;
}
@@ -2005,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;
}
@@ -2099,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;
}
}
@@ -2196,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;
}
}
@@ -2378,7 +2379,7 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr)
*-------------------------------------------------------------------------
*/
static void *
-datum_deserialize(const void * image_ptr,
+datum_deserialize(const void H5_ATTR_NDEBUG_UNUSED *image_ptr,
H5_ATTR_UNUSED size_t len,
void * udata_ptr,
hbool_t * dirty_ptr)
@@ -2491,14 +2492,13 @@ datum_image_len(const void *thing, size_t *image_len)
*/
static herr_t
datum_serialize(const H5F_t *f,
- void *image_ptr,
+ void H5_ATTR_NDEBUG_UNUSED *image_ptr,
size_t len,
void *thing_ptr)
{
herr_t ret_value = SUCCEED;
int idx;
struct datum * entry_ptr;
- H5C_t * cache_ptr;
struct H5AC_aux_t * aux_ptr;
HDassert( thing_ptr );
@@ -2509,11 +2509,8 @@ datum_serialize(const H5F_t *f,
HDassert( f );
HDassert( f->shared );
HDassert( f->shared->cache );
-
- cache_ptr = f->shared->cache;
-
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( cache_ptr->aux_ptr );
+ HDassert( f->shared->cache->magic == H5C__H5C_T_MAGIC );
+ HDassert( f->shared->cache->aux_ptr );
aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr);
@@ -2636,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;
@@ -2792,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;
@@ -4612,7 +4609,7 @@ verify_entry_reads(haddr_t addr,
int expected_entry_reads)
{
hbool_t success = TRUE;
- int reported_entry_reads;
+ int reported_entry_reads = 0;
struct mssg_t mssg;
if ( success ) {
@@ -4670,11 +4667,11 @@ verify_entry_reads(haddr_t addr,
}
} else {
- reported_entry_reads = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_reads, int, mssg.count, unsigned);
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_reads != expected_entry_reads ) {
@@ -4719,7 +4716,7 @@ verify_entry_writes(haddr_t addr,
int expected_entry_writes)
{
hbool_t success = TRUE;
- int reported_entry_writes;
+ int reported_entry_writes = 0;
struct mssg_t mssg;
if ( success ) {
@@ -4777,11 +4774,11 @@ verify_entry_writes(haddr_t addr,
}
} else {
- reported_entry_writes = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_writes, int, mssg.count, unsigned);
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_writes != expected_entry_writes ) {
@@ -5233,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;
@@ -5338,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;
@@ -7268,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 */
@@ -7289,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 */
@@ -7319,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 */
@@ -7340,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 40cc1ca..e950015 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -620,7 +620,6 @@ coll_chunktest(const char* filename,
size_t num_points; /* for point selection */
hsize_t *coords = NULL; /* for point selection */
hsize_t current_dims; /* for point selection */
- int i;
/* set up MPI parameters */
MPI_Comm_size(comm,&mpi_size);
@@ -638,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 */
@@ -671,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);
@@ -1058,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;
@@ -1067,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;
@@ -1085,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;
@@ -1096,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:
@@ -1111,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;
@@ -1122,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 912388c..d4b2106 100644
--- a/testpar/t_coll_md_read.c
+++ b/testpar/t_coll_md_read.c
@@ -34,7 +34,6 @@
#define MULTI_CHUNK_IO_ADDRMAP_ISSUE_DIMS 2
-#define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_NO_SEL_PROCESS (mpi_rank == mpi_size - 1)
#define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DATASET_NAME "linked_chunk_io_sort_chunk_issue"
#define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE 20000
#define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE 1
@@ -97,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;
@@ -121,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;
@@ -406,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);
@@ -429,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 832a47f..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 */
@@ -567,7 +567,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;
@@ -584,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");
/* -------------------
@@ -613,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");
@@ -915,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);
@@ -971,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);
@@ -1009,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);
@@ -1098,7 +1097,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 */
@@ -1116,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");
/* -------------------
@@ -1301,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);
@@ -1363,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);
@@ -1408,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*/
@@ -1418,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);
@@ -1446,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++;
@@ -1529,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");
/* -------------------
@@ -1620,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");
@@ -1680,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");
@@ -1842,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: ");
@@ -1917,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");
/* -------------------
@@ -2100,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");
/* -------------------
@@ -2191,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");
@@ -2274,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");
@@ -2347,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");
/* -------------------
@@ -2519,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 */
@@ -2547,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;
@@ -2731,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
@@ -2762,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");
@@ -3040,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");
@@ -3052,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");
@@ -3118,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";
@@ -3156,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 */
@@ -3239,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;
@@ -3470,8 +3468,9 @@ actual_io_mode_tests(void) {
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
+#ifdef LATER
#define DSET_NOCOLCAUSE "nocolcause"
-#define NELM 2
+#endif
#define FILE_EXTERNAL "nocolcause_extern.data"
static void
test_no_collective_cause_mode(int selection_mode)
@@ -3482,7 +3481,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;
@@ -3568,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");
@@ -3591,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");
@@ -3672,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;
@@ -3797,6 +3795,7 @@ test_no_collective_cause_mode(int selection_mode)
* Programmer: Jonathan Kim
* Date: Aug, 2012
*/
+#ifdef LATER
static void
test_no_collective_cause_mode_filter(int selection_mode)
{
@@ -3865,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");
@@ -3884,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");
@@ -3914,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;
@@ -4008,6 +4007,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
HDfree(buffer);
return;
}
+#endif
/* Function: no_collective_cause_tests
*
@@ -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 28baed5..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);
@@ -215,7 +215,9 @@ test_filter_read(void)
unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */
herr_t hrc;
const char *filename;
+#ifdef H5_HAVE_FILTER_FLETCHER32
hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */
+#endif
#ifdef H5_HAVE_FILTER_DEFLATE
hsize_t deflate_size; /* Size of dataset with deflate filter */
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 63ac8d3..6cdb0af7 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -13,6 +13,7 @@
#include "testphdf5.h"
#include "H5Dprivate.h"
+#include "H5private.h"
#define DIM 2
#define SIZE 32
@@ -156,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);
@@ -237,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();
@@ -332,7 +334,7 @@ void compact_dataset(void)
/* Verify data value */
for(i = 0; i < size; i++)
for(j = 0; j < size; j++)
- if(inme[(i * size) + j] != outme[(i * size) + j])
+ if(!H5_DBL_ABS_EQUAL(inme[(i * size) + j], outme[(i * size) + j]))
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
HDprintf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]);
@@ -362,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;
@@ -626,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 */
@@ -719,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);
@@ -877,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);
@@ -1001,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. */
@@ -1172,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++) {
@@ -1332,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++) {
@@ -1489,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 )
@@ -1523,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;
}
@@ -1959,7 +1961,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm)
/* private communicator size and rank */
int mpi_size;
int mpi_rank;
- int mrc; /* mpi error code */
+ int mrc; /* mpi error code */
/* steps to verify and have been verified */
int steps = 0;
int steps_done = 0;
@@ -2477,7 +2479,7 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm)
/* compare read data with expected data */
for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
- if (data_read[j] != data[j]){
+ if (!H5_DBL_ABS_EQUAL(data_read[j], data[j])){
HDfprintf(stdout,
"%0d:%s: Reading datasets value failed in "
"Dataset %d, at position %d: expect %f, got %f.\n",
@@ -2540,7 +2542,7 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm)
VRFY((err >= 0), "H5Aread failed.\n");
/* compare read attribute data with expected data */
for ( j = 0; j < LOCAL_DATA_SIZE; j++ )
- if (att_read[j] != att[j]){
+ if (!H5_DBL_ABS_EQUAL(att_read[j], att[j])){
HDfprintf(stdout,
"%0d:%s: Mismatched attribute data read in Dataset %d, at position %d: expect %f, got %f.\n",
mpi_rank, fcn_name, i, j, att[j], att_read[j]);
@@ -2592,7 +2594,7 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm)
VRFY((err >= 0), "H5Aread failed.\n");
/* compare read attribute data with expected data */
for ( j = 0; j < LARGE_ATTR_SIZE; j++ )
- if (lg_att_read[j] != lg_att[j]){
+ if (!H5_DBL_ABS_EQUAL(lg_att_read[j], lg_att[j])){
HDfprintf(stdout,
"%0d:%s: Mismatched large attribute data read in Dataset %d, at position %d: expect %f, got %f.\n",
mpi_rank, fcn_name, i, j, lg_att[j], lg_att_read[j]);
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 91b8f8c..064fb57 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -302,7 +302,7 @@ 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++)
+ for (j = 0; j < MB; j++)
H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int);
if (VERBOSE_MED)
HDfprintf(stdout,
@@ -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_shapesame.c b/testpar/t_shapesame.c
index abbfbb3..c12cf5a 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -1981,7 +1981,6 @@ contig_hs_dr_pio_test__run_test(const int test_num,
#if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG
const char *fcnName = "contig_hs_dr_pio_test__run_test()";
#endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
- int mpi_rank;
struct hs_dr_pio_test_vars_t test_vars =
{
/* int mpi_size = */ -1,
@@ -2049,9 +2048,6 @@ contig_hs_dr_pio_test__run_test(const int test_num,
small_rank, large_rank, use_collective_io,
dset_type, express_test, tv_ptr);
- /* initialize the local copy of mpi_rank */
- mpi_rank = tv_ptr->mpi_rank;
-
/* initialize skips & max_skips */
tv_ptr->skips = *skips_ptr;
tv_ptr->max_skips = max_skips;
@@ -3520,7 +3516,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()";
#endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */
hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
int i, j, k, l;
size_t u;
size_t start_index;
@@ -3768,8 +3763,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr)
/* verify that expected data is retrieved */
- mis_match = FALSE;
-
expected_value = (uint32_t)(
(i * tv_ptr->edge_size * tv_ptr->edge_size *
tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -3878,7 +3871,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()";
#endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */
hbool_t data_ok = FALSE;
- hbool_t mis_match = FALSE;
int i, j, k, l;
size_t u;
size_t start_index;
@@ -4138,8 +4130,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr)
HDassert( stop_index < tv_ptr->large_ds_size );
- mis_match = FALSE;
-
data_ok = TRUE;
ptr_1 = tv_ptr->large_ds_buf_1;
@@ -4235,7 +4225,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
#if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG
const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()";
#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
- int mpi_rank; /* needed by VRFY */
struct hs_dr_pio_test_vars_t test_vars =
{
/* int mpi_size = */ -1,
@@ -4305,10 +4294,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num,
tv_ptr);
- /* initialize the local copy of mpi_rank */
- mpi_rank = tv_ptr->mpi_rank;
-
-
/* initialize skips & max_skips */
tv_ptr->skips = *skips_ptr;
tv_ptr->max_skips = max_skips;
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index 9a4ac4d..e1a86a1 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -37,7 +37,7 @@
static void coll_write_test(int chunk_factor);
-static void coll_read_test(int chunk_factor);
+static void coll_read_test(void);
/*-------------------------------------------------------------------------
@@ -84,7 +84,7 @@ void
coll_irregular_cont_read(void)
{
- coll_read_test(0);
+ coll_read_test();
}
@@ -133,7 +133,7 @@ void
coll_irregular_simple_chunk_read(void)
{
- coll_read_test(1);
+ coll_read_test();
}
@@ -181,7 +181,7 @@ void
coll_irregular_complex_chunk_read(void)
{
- coll_read_test(4);
+ coll_read_test();
}
@@ -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.
*/
@@ -662,7 +662,7 @@ void coll_write_test(int chunk_factor)
*-------------------------------------------------------------------------
*/
static void
-coll_read_test(int chunk_factor)
+coll_read_test(void)
{
const char *filename;
@@ -704,9 +704,9 @@ coll_read_test(int chunk_factor)
/* 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(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;
@@ -761,7 +761,7 @@ coll_read_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;
@@ -791,7 +791,7 @@ coll_read_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;
@@ -813,7 +813,7 @@ coll_read_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;
@@ -828,8 +828,8 @@ coll_read_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.
@@ -923,7 +923,9 @@ coll_read_test(int chunk_factor)
****************************************************************/
#define LDSCT_DS_RANK 5
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
#define LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK 0
+#endif
#define LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG 0
@@ -1002,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++;
}
@@ -1558,7 +1560,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
size_t small_ds_size;
size_t small_ds_slice_size;
size_t large_ds_size;
+#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
size_t large_ds_slice_size;
+#endif
uint32_t expected_value;
uint32_t * small_ds_buf_0 = NULL;
uint32_t * small_ds_buf_1 = NULL;
@@ -1612,9 +1616,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size,
small_ds_size = (size_t)((mpi_size + 1) * 1 * 1 * 10 * 10);
small_ds_slice_size = (size_t) ( 1 * 1 * 10 * 10);
large_ds_size = (size_t)((mpi_size + 1) * 10 * 10 * 10 * 10);
- large_ds_slice_size = (size_t) (10 * 10 * 10 * 10);
#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG
+ large_ds_slice_size = (size_t) (10 * 10 * 10 * 10);
+
if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) {
HDfprintf(stdout, "%s:%d: small ds size / slice size = %d / %d.\n",
fcnName, mpi_rank,