summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-05-08 09:38:32 (GMT)
committerGitHub <noreply@github.com>2022-05-08 09:38:32 (GMT)
commitea27e1380cf02e5f92d61cf9509596914c14e4df (patch)
treee753ad8ab4717fd9c1359b7a65dad274c599ca1c /testpar
parentc0f314ad03f5ef0b4366ee625c83a7955a9ea87f (diff)
downloadhdf5-ea27e1380cf02e5f92d61cf9509596914c14e4df.zip
hdf5-ea27e1380cf02e5f92d61cf9509596914c14e4df.tar.gz
hdf5-ea27e1380cf02e5f92d61cf9509596914c14e4df.tar.bz2
Fixes for various warnings/alignment with develop branch (#1755)
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_cache.c55
-rw-r--r--testpar/t_dset.c12
-rw-r--r--testpar/t_file.c9
-rw-r--r--testpar/t_mdset.c8
-rw-r--r--testpar/t_shapesame.c27
-rw-r--r--testpar/t_span_tree.c87
6 files changed, 93 insertions, 105 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index ca3d467..9cbe429 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -1501,10 +1501,10 @@ 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;
- reply.ver = data[target_index].ver;
- reply.count = 0;
- reply.magic = MSSG_MAGIC;
+ 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;
/* and update the counters */
total_reads++;
@@ -1707,10 +1707,10 @@ 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;
- reply.ver = data[target_index].ver;
- reply.count = 0;
- reply.magic = MSSG_MAGIC;
+ 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;
/* and send it */
success = send_mssg(&reply, TRUE);
@@ -2431,10 +2431,10 @@ 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;
- mssg.ver = 0; /* bogus -- should be corrected by server */
- mssg.count = 0; /* not used */
- mssg.magic = MSSG_MAGIC;
+ 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;
if (!send_mssg(&mssg, FALSE)) {
@@ -2576,10 +2576,10 @@ 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;
- mssg.ver = entry_ptr->ver;
- mssg.count = 0;
- mssg.magic = MSSG_MAGIC;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
+ mssg.ver = entry_ptr->ver;
+ mssg.count = 0;
+ mssg.magic = MSSG_MAGIC;
if (!send_mssg(&mssg, FALSE)) {
@@ -4296,7 +4296,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
}
else {
- reported_entry_reads = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_reads, int, mssg.count, unsigned);
}
}
@@ -4393,7 +4393,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
}
else {
- reported_entry_writes = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_writes, int, mssg.count, unsigned);
}
}
@@ -4808,10 +4808,10 @@ 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;
- mssg.ver = ++(data[world_mpi_rank].ver);
- mssg.count = 0;
- mssg.magic = MSSG_MAGIC;
+ 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;
if (!(success = send_mssg(&mssg, FALSE))) {
@@ -4905,10 +4905,10 @@ 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;
- mssg.ver = 0; /* bogus -- should be corrected by server */
- mssg.count = 0;
- mssg.magic = MSSG_MAGIC;
+ 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;
if (success) {
@@ -6704,7 +6704,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);
}
/* Restore collective metadata reads state */
H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag);
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 03213db..8a0694e 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -3437,9 +3437,9 @@ test_no_collective_cause_mode(int selection_mode)
const char *test_name;
hbool_t is_chunked = 1;
hbool_t is_independent = 0;
- int mpi_size = -1;
- int mpi_rank = -1;
- int length;
+ size_t length;
+ int mpi_size = -1;
+ int mpi_rank = -1;
int * buffer;
int i;
MPI_Comm mpi_comm;
@@ -3594,12 +3594,12 @@ test_no_collective_cause_mode(int selection_mode)
}
/* Get the number of elements in the selection */
- length = dims[0] * dims[1];
+ length = (size_t)(dims[0] * dims[1]);
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
+ buffer = (int *)HDmalloc(sizeof(int) * length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
- for (i = 0; i < length; i++)
+ for (i = 0; (size_t)i < length; i++)
buffer[i] = i;
/* Set up the dxpl for the write */
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 7807052..695e6d0 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -106,7 +106,7 @@ test_split_comm_access(void)
/* delete the test file */
if (sub_mpi_rank == 0) {
- mrc = MPI_File_delete((char *)filename, info);
+ mrc = MPI_File_delete(filename, info);
/*VRFY((mrc==MPI_SUCCESS), ""); */
}
}
@@ -119,8 +119,11 @@ test_split_comm_access(void)
void
test_page_buffer_access(void)
{
- hid_t file_id = -1; /* File ID */
- hid_t fcpl, fapl, fapl_self;
+ hid_t file_id = -1; /* File ID */
+ hid_t fcpl, fapl;
+#if 0
+ hid_t fapl_self;
+#endif
size_t page_count = 0;
int i, num_elements = 200;
haddr_t raw_addr, meta_addr;
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index aecd76b..b773bdf 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -323,7 +323,7 @@ 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]);
@@ -2326,7 +2326,7 @@ 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",
@@ -2388,7 +2388,7 @@ 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",
@@ -2439,7 +2439,7 @@ 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",
diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c
index 9d450f5..a87ad73 100644
--- a/testpar/t_shapesame.c
+++ b/testpar/t_shapesame.c
@@ -352,14 +352,9 @@ hs_dr_pio_test__setup(const int test_num, const int edge_size, const int checker
*
* JRM -- 9/16/10
*/
- if (express_test == 0) {
- tv_ptr->chunk_dims[0] = 1;
- }
- else {
+ tv_ptr->chunk_dims[0] = 1;
- tv_ptr->chunk_dims[0] = 1;
- }
tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = tv_ptr->chunk_dims[3] = tv_ptr->chunk_dims[4] =
(hsize_t)(tv_ptr->chunk_edge_size);
@@ -1705,7 +1700,6 @@ contig_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i
#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,
/* int mpi_rank = */ -1,
@@ -1770,9 +1764,6 @@ contig_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i
hs_dr_pio_test__setup(test_num, edge_size, -1, chunk_edge_size, 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;
@@ -3059,8 +3050,7 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t *tv_ptr)
#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG
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;
+ hbool_t data_ok = FALSE;
int i, j, k, l;
size_t u;
size_t start_index;
@@ -3266,8 +3256,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) +
(j * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) +
@@ -3358,8 +3346,7 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr)
#if CHECKER_BOARD_HS_DR_PIO_TEST__M2D_S2L__DEBUG
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;
+ hbool_t data_ok = FALSE;
int i, j, k, l;
size_t u;
size_t start_index;
@@ -3575,8 +3562,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t *tv_ptr)
HDassert(start_index < stop_index);
HDassert(stop_index < tv_ptr->large_ds_size);
- mis_match = FALSE;
-
data_ok = TRUE;
ptr_1 = tv_ptr->large_ds_buf_1;
@@ -3647,8 +3632,7 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i
{
#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 */
+#endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */
struct hs_dr_pio_test_vars_t test_vars = {
/* int mpi_size = */ -1,
/* int mpi_rank = */ -1,
@@ -3713,9 +3697,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, const int edge_size, const i
hs_dr_pio_test__setup(test_num, edge_size, checker_edge_size, chunk_edge_size, 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;
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index e6fc9aa..6f0efa3 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -45,7 +45,7 @@
#define LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG 0
static void coll_write_test(int chunk_factor);
-static void coll_read_test(int chunk_factor);
+static void coll_read_test(void);
/*-------------------------------------------------------------------------
* Function: coll_irregular_cont_write
@@ -88,7 +88,7 @@ void
coll_irregular_cont_read(void)
{
- coll_read_test(0);
+ coll_read_test();
}
/*-------------------------------------------------------------------------
@@ -132,7 +132,7 @@ void
coll_irregular_simple_chunk_read(void)
{
- coll_read_test(1);
+ coll_read_test();
}
/*-------------------------------------------------------------------------
@@ -176,7 +176,7 @@ void
coll_irregular_complex_chunk_read(void)
{
- coll_read_test(4);
+ coll_read_test();
}
/*-------------------------------------------------------------------------
@@ -216,9 +216,9 @@ coll_write_test(int chunk_factor)
hsize_t block[2]; /* Block sizes */
hsize_t chunk_dims[2];
- herr_t ret;
- unsigned i;
- int fillvalue = 0; /* Fill value for the dataset */
+ herr_t ret;
+ int i;
+ int fillvalue = 0; /* Fill value for the dataset */
int *matrix_out = NULL;
int *matrix_out1 = NULL; /* Buffer to read from the dataset */
@@ -653,7 +653,7 @@ coll_write_test(int chunk_factor)
*-------------------------------------------------------------------------
*/
static void
-coll_read_test(int chunk_factor)
+coll_read_test(void)
{
const char *filename;
@@ -672,7 +672,7 @@ coll_read_test(int chunk_factor)
hsize_t block[2]; /* Block sizes */
herr_t ret;
- unsigned i;
+ int i;
int *matrix_out;
int *matrix_out1; /* Buffer to read from the dataset */
@@ -1461,38 +1461,40 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_
size_t small_ds_size;
size_t small_ds_slice_size;
size_t large_ds_size;
- size_t large_ds_slice_size;
- uint32_t expected_value;
- uint32_t * small_ds_buf_0 = NULL;
- uint32_t * small_ds_buf_1 = NULL;
- uint32_t * large_ds_buf_0 = NULL;
- uint32_t * large_ds_buf_1 = NULL;
- uint32_t * ptr_0;
- uint32_t * ptr_1;
- hsize_t small_chunk_dims[LDSCT_DS_RANK];
- hsize_t large_chunk_dims[LDSCT_DS_RANK];
- hsize_t small_dims[LDSCT_DS_RANK];
- hsize_t large_dims[LDSCT_DS_RANK];
- hsize_t start[LDSCT_DS_RANK];
- hsize_t stride[LDSCT_DS_RANK];
- hsize_t count[LDSCT_DS_RANK];
- hsize_t block[LDSCT_DS_RANK];
- hsize_t small_sel_start[LDSCT_DS_RANK];
- hsize_t large_sel_start[LDSCT_DS_RANK];
- hid_t full_mem_small_ds_sid;
- hid_t full_file_small_ds_sid;
- hid_t mem_small_ds_sid;
- hid_t file_small_ds_sid;
- hid_t full_mem_large_ds_sid;
- hid_t full_file_large_ds_sid;
- hid_t mem_large_ds_sid;
- hid_t file_large_ds_sid;
- hid_t small_ds_dcpl_id = H5P_DEFAULT;
- hid_t large_ds_dcpl_id = H5P_DEFAULT;
- hid_t small_dataset; /* Dataset ID */
- hid_t large_dataset; /* Dataset ID */
- htri_t check; /* Shape comparison return value */
- herr_t ret; /* Generic return value */
+#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;
+ uint32_t *large_ds_buf_0 = NULL;
+ uint32_t *large_ds_buf_1 = NULL;
+ uint32_t *ptr_0;
+ uint32_t *ptr_1;
+ hsize_t small_chunk_dims[LDSCT_DS_RANK];
+ hsize_t large_chunk_dims[LDSCT_DS_RANK];
+ hsize_t small_dims[LDSCT_DS_RANK];
+ hsize_t large_dims[LDSCT_DS_RANK];
+ hsize_t start[LDSCT_DS_RANK];
+ hsize_t stride[LDSCT_DS_RANK];
+ hsize_t count[LDSCT_DS_RANK];
+ hsize_t block[LDSCT_DS_RANK];
+ hsize_t small_sel_start[LDSCT_DS_RANK];
+ hsize_t large_sel_start[LDSCT_DS_RANK];
+ hid_t full_mem_small_ds_sid;
+ hid_t full_file_small_ds_sid;
+ hid_t mem_small_ds_sid;
+ hid_t file_small_ds_sid;
+ hid_t full_mem_large_ds_sid;
+ hid_t full_file_large_ds_sid;
+ hid_t mem_large_ds_sid;
+ hid_t file_large_ds_sid;
+ hid_t small_ds_dcpl_id = H5P_DEFAULT;
+ hid_t large_ds_dcpl_id = H5P_DEFAULT;
+ hid_t small_dataset; /* Dataset ID */
+ hid_t large_dataset; /* Dataset ID */
+ htri_t check; /* Shape comparison return value */
+ herr_t ret; /* Generic return value */
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1512,9 +1514,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, const hbool_t use_
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,
(int)small_ds_size, (int)small_ds_slice_size);