summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5B2cache.c4
-rw-r--r--src/H5Cmpio.c37
-rw-r--r--src/H5Dchunk.c31
-rw-r--r--src/H5Dfill.c5
-rw-r--r--src/H5Dio.c22
-rw-r--r--src/H5Dmpio.c36
-rw-r--r--src/H5Rint.c3
-rw-r--r--src/H5Smpio.c37
-rw-r--r--src/H5Ztrans.c2
-rw-r--r--src/H5mpi.c6
-rw-r--r--src/H5overflow.txt1
-rw-r--r--test/dsets.c24
-rw-r--r--test/swmr_common.c24
-rw-r--r--test/trefer.c6
-rw-r--r--test/use_disable_mdc_flushes.c21
-rw-r--r--test/vds_swmr.h24
-rw-r--r--test/vds_swmr_gen.c6
-rw-r--r--test/vds_swmr_reader.c6
-rw-r--r--testpar/t_2Gio.c215
-rw-r--r--testpar/t_bigio.c62
-rw-r--r--testpar/t_cache.c35
-rw-r--r--testpar/t_chunk_alloc.c14
-rw-r--r--testpar/t_coll_chunk.c30
-rw-r--r--testpar/t_coll_md_read.c14
-rw-r--r--testpar/t_dset.c220
-rw-r--r--testpar/t_file.c16
-rw-r--r--testpar/t_filter_read.c4
-rw-r--r--testpar/t_mdset.c39
-rw-r--r--testpar/t_mpi.c10
-rw-r--r--testpar/t_prestart.c6
-rw-r--r--testpar/t_prop.c2
-rw-r--r--testpar/t_pshutdown.c8
-rw-r--r--testpar/t_span_tree.c58
-rw-r--r--tools/lib/h5diff.c41
-rw-r--r--tools/lib/h5diff_array.c59
-rw-r--r--tools/lib/h5diff_attr.c15
-rw-r--r--tools/lib/h5diff_dset.c43
-rw-r--r--tools/lib/h5diff_util.c3
-rw-r--r--tools/lib/h5tools.c38
-rw-r--r--tools/lib/h5tools_dump.c61
-rw-r--r--tools/lib/h5tools_error.h61
-rw-r--r--tools/lib/h5tools_str.c12
-rw-r--r--tools/src/h5import/h5import.c8
-rw-r--r--tools/src/h5ls/h5ls.c24
-rw-r--r--tools/src/h5repack/h5repack_parse.c2
-rw-r--r--tools/src/misc/h5clear.c2
-rw-r--r--tools/test/h5repack/h5repackgentest.c4
-rw-r--r--tools/test/perform/chunk_cache.c11
-rw-r--r--tools/test/perform/perf.c22
-rw-r--r--tools/test/perform/pio_engine.c200
-rw-r--r--tools/test/perform/pio_perf.c49
51 files changed, 827 insertions, 856 deletions
diff --git a/src/H5B2cache.c b/src/H5B2cache.c
index 65286e6..80cb6c5 100644
--- a/src/H5B2cache.c
+++ b/src/H5B2cache.c
@@ -654,6 +654,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len,
uint32_t stored_chksum; /* Stored metadata checksum value */
unsigned u; /* Local index variable */
H5B2_internal_t *ret_value = NULL; /* Return value */
+ int node_nrec = 0;
FUNC_ENTER_STATIC
@@ -716,7 +717,8 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len,
for(u = 0; u < (unsigned)(internal->nrec + 1); u++) {
/* Decode node pointer */
H5F_addr_decode(udata->f, (const uint8_t **)&image, &(int_node_ptr->addr));
- UINT64DECODE_VAR(image, int_node_ptr->node_nrec, udata->hdr->max_nrec_size);
+ UINT64DECODE_VAR(image, node_nrec, udata->hdr->max_nrec_size);
+ H5_CHECKED_ASSIGN(int_node_ptr->node_nrec, uint16_t, node_nrec, int);
if(udata->depth > 1)
UINT64DECODE_VAR(image, int_node_ptr->all_nrec, udata->hdr->node_info[udata->depth - 1].cum_max_nrec_size)
else
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c
index e784487..2c176e4 100644
--- a/src/H5Cmpio.c
+++ b/src/H5Cmpio.c
@@ -174,13 +174,13 @@ H5C_apply_candidate_list(H5F_t * f,
int mpi_size)
{
int i;
- int m;
- int n;
- unsigned first_entry_to_flush;
- unsigned last_entry_to_flush;
- unsigned total_entries_to_clear = 0;
- unsigned total_entries_to_flush = 0;
- int * candidate_assignment_table = NULL;
+ int m;
+ unsigned n;
+ unsigned first_entry_to_flush;
+ unsigned last_entry_to_flush;
+ unsigned total_entries_to_clear = 0;
+ unsigned total_entries_to_flush = 0;
+ unsigned * candidate_assignment_table = NULL;
unsigned entries_to_flush[H5C_RING_NTYPES];
unsigned entries_to_clear[H5C_RING_NTYPES];
haddr_t addr;
@@ -231,17 +231,18 @@ H5C_apply_candidate_list(H5F_t * f,
HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for entries")
} /* end if */
- n = num_candidates / mpi_size;
- m = num_candidates % mpi_size;
- HDassert(n >= 0);
- if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1))))
+ n = num_candidates / (unsigned)mpi_size;
+ if(num_candidates % (unsigned)mpi_size > INT_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "m overflow")
+ m = (int)(num_candidates % (unsigned)mpi_size);
+
+ if(NULL == (candidate_assignment_table = (unsigned *)H5MM_malloc(sizeof(unsigned) * (size_t)(mpi_size + 1))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table")
candidate_assignment_table[0] = 0;
candidate_assignment_table[mpi_size] = num_candidates;
if(m == 0) { /* mpi_size is an even divisor of num_candidates */
- HDassert(n > 0);
for(i = 1; i < mpi_size; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n;
} /* end if */
@@ -249,7 +250,7 @@ H5C_apply_candidate_list(H5F_t * f,
for(i = 1; i <= m; i++)
candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1;
- if(num_candidates < mpi_size) {
+ if(num_candidates < (unsigned)mpi_size) {
for(i = m + 1; i < mpi_size; i++)
candidate_assignment_table[i] = num_candidates;
} /* end if */
@@ -263,7 +264,7 @@ H5C_apply_candidate_list(H5F_t * f,
#if H5C_DO_SANITY_CHECKS
/* Verify that the candidate assignment table has the expected form */
for(i = 1; i < mpi_size - 1; i++) {
- int a, b;
+ unsigned a, b;
a = candidate_assignment_table[i] - candidate_assignment_table[i - 1];
b = candidate_assignment_table[i + 1] - candidate_assignment_table[i];
@@ -282,7 +283,7 @@ H5C_apply_candidate_list(H5F_t * f,
tbl_buf[i] = '\0';
HDsprintf(&(tbl_buf[0]), "candidate assignment table = ");
for(i = 0; i <= mpi_size; i++)
- HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]);
+ HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[i]);
HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
HDfprintf(stdout, "%s", tbl_buf);
@@ -359,11 +360,11 @@ H5C_apply_candidate_list(H5F_t * f,
n = 0;
for(i = 0; i < H5C_RING_NTYPES; i++) {
m += (int)entries_to_flush[i];
- n += (int)entries_to_clear[i];
+ n += entries_to_clear[i];
} /* end if */
HDassert((unsigned)m == total_entries_to_flush);
- HDassert((unsigned)n == total_entries_to_clear);
+ HDassert(n == total_entries_to_clear);
#endif /* H5C_DO_SANITY_CHECKS */
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
@@ -397,7 +398,7 @@ H5C_apply_candidate_list(H5F_t * f,
done:
if(candidate_assignment_table != NULL)
- candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table);
+ candidate_assignment_table = (unsigned *)H5MM_xfree((void *)candidate_assignment_table);
if(cache_ptr->coll_write_list) {
if(H5SL_close(cache_ptr->coll_write_list) < 0)
HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list")
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index 43cfd02..33950a4 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -1683,7 +1683,7 @@ H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t
/* Iterate through each chunk in the dataset */
while(sel_points) {
H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */
- hssize_t schunk_points; /* Number of elements in chunk selection */
+ hsize_t chunk_points; /* Number of elements in chunk selection */
/* Add temporary chunk to the list of chunks */
@@ -1727,12 +1727,11 @@ H5D__create_chunk_file_map_all(H5D_chunk_map_t *fm, const H5D_io_info_t
} /* end if */
/* Get number of elements selected in chunk */
- if((schunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements")
- H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, schunk_points, hssize_t);
+ chunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace);
+ H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, chunk_points, hsize_t);
/* Decrement # of points left in file selection */
- sel_points -= (hsize_t)schunk_points;
+ sel_points -= chunk_points;
/* Advance to next chunk if we are not done */
if(sel_points > 0) {
@@ -1870,7 +1869,7 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
/* (Casting away const OK - QAK) */
if(TRUE == H5S_SELECT_INTERSECT_BLOCK(fm->file_space, coords, end)) {
H5D_chunk_info_t *new_chunk_info; /* chunk information to insert into skip list */
- hssize_t schunk_points; /* Number of elements in chunk selection */
+ hsize_t chunk_points; /* Number of elements in chunk selection */
/* Create dataspace for chunk, 'AND'ing the overall selection with
* the current chunk.
@@ -1923,12 +1922,11 @@ H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t
} /* end if */
/* Get number of elements selected in chunk */
- if((schunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements")
- H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, schunk_points, hssize_t);
+ chunk_points = H5S_GET_SELECT_NPOINTS(new_chunk_info->fspace);
+ H5_CHECKED_ASSIGN(new_chunk_info->chunk_points, uint32_t, chunk_points, hsize_t);
/* Decrement # of points left in file selection */
- sel_points -= (hsize_t)schunk_points;
+ sel_points -= chunk_points;
/* Leave if we are done */
if(sel_points == 0)
@@ -4983,12 +4981,12 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
/* Distribute evenly the number of blocks between processes. */
if(mpi_size == 0)
HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Resulted in division by zero")
- num_blocks = chunk_info->num_io / mpi_size; /* value should be the same on all procs */
+ num_blocks = (size_t)(chunk_info->num_io / (size_t)mpi_size); /* value should be the same on all procs */
/* after evenly distributing the blocks between processes, are
there any leftover blocks for each individual process
(round-robin) */
- leftover_blocks = chunk_info->num_io % mpi_size;
+ leftover_blocks = (size_t)(chunk_info->num_io % (size_t)mpi_size);
/* Cast values to types needed by MPI */
H5_CHECKED_ASSIGN(blocks, int, num_blocks, size_t);
@@ -4997,9 +4995,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info,
/* Allocate buffers */
/* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */
- if(NULL == (block_lens = (int *)H5MM_malloc((blocks + 1) * sizeof(int))))
+ if(NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int))))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer")
- if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((blocks + 1) * sizeof(MPI_Aint))))
+ if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint))))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer")
for(i = 0 ; i < blocks ; i++) {
@@ -5104,7 +5102,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
const hsize_t *scaled = udata->common.scaled; /* Scaled chunk offset */
H5S_sel_iter_t *chunk_iter = NULL; /* Memory selection iteration info */
hbool_t chunk_iter_init = FALSE; /* Whether the chunk iterator has been initialized */
- hssize_t sel_nelmts; /* Number of elements in selection */
+ hsize_t sel_nelmts; /* Number of elements in selection */
hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */
size_t chunk_size; /*size of a chunk */
void *chunk; /* The file chunk */
@@ -5165,8 +5163,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk)
/* Get the number of elements in the selection */
sel_nelmts = H5S_GET_SELECT_NPOINTS(udata->chunk_space);
- HDassert(sel_nelmts >= 0);
- H5_CHECK_OVERFLOW(sel_nelmts, hssize_t, size_t);
+ H5_CHECK_OVERFLOW(sel_nelmts, hsize_t, size_t);
/* Check for VL datatype & non-default fill value */
if(udata->fb_info.has_vlen_fill_type)
diff --git a/src/H5Dfill.c b/src/H5Dfill.c
index 3ccee90..f5a5238 100644
--- a/src/H5Dfill.c
+++ b/src/H5Dfill.c
@@ -249,12 +249,11 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf,
* of the VL data.
*/
if(TRUE == H5T_detect_class(fill_type, H5T_VLEN, FALSE)) {
- hssize_t nelmts; /* Number of data elements */
+ hsize_t nelmts; /* Number of data elements */
/* Get the number of elements in the selection */
nelmts = H5S_GET_SELECT_NPOINTS(space);
- HDassert(nelmts >= 0);
- H5_CHECK_OVERFLOW(nelmts, hssize_t, size_t);
+ H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t);
/* Allocate a temporary buffer */
if(NULL == (tmp_buf = H5FL_BLK_MALLOC(type_conv, (size_t)nelmts * buf_size)))
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 6b02b68..0f4e703 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -409,9 +409,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Note that if this variable is used, the */
/* projected mem space must be discarded at the */
/* end of the function to avoid a memory leak. */
- H5D_storage_t store; /*union of EFL and chunk pointer in file space */
- hssize_t snelmts; /*total number of elmts (signed) */
- hsize_t nelmts; /*total number of elmts */
+ H5D_storage_t store; /* union of EFL and chunk pointer in file space */
+ hsize_t nelmts; /* total number of elmts */
hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */
char fake_char; /* Temporary variable for NULL buffer pointers */
herr_t ret_value = SUCCEED; /* Return value */
@@ -425,9 +424,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
file_space = dataset->shared->space;
if(!mem_space)
mem_space = file_space;
- if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection")
- H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t);
+ nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
/* Set up datatype info for operation */
if(H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0)
@@ -450,7 +447,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
#endif /*H5_HAVE_PARALLEL*/
/* Make certain that the number of elements in each selection is the same */
- if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))
+ if(nelmts != H5S_GET_SELECT_NPOINTS(file_space))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected")
/* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
@@ -623,9 +620,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
/* Note that if this variable is used, the */
/* projected mem space must be discarded at the */
/* end of the function to avoid a memory leak. */
- H5D_storage_t store; /*union of EFL and chunk pointer in file space */
- hssize_t snelmts; /*total number of elmts (signed) */
- hsize_t nelmts; /*total number of elmts */
+ H5D_storage_t store; /* union of EFL and chunk pointer in file space */
+ hsize_t nelmts; /* total number of elmts */
hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */
char fake_char; /* Temporary variable for NULL buffer pointers */
herr_t ret_value = SUCCEED; /* Return value */
@@ -680,12 +676,10 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
if(!mem_space)
mem_space = file_space;
- if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection")
- H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t);
+ nelmts = H5S_GET_SELECT_NPOINTS(mem_space);
/* Make certain that the number of elements in each selection is the same */
- if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space))
+ if(nelmts != H5S_GET_SELECT_NPOINTS(file_space))
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected")
/* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 0dbbe9f..91557c3 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -2524,7 +2524,9 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm,
} /* end if */
/* Broadcasting the MPI_IO option info. and chunk address info. */
- if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, ((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm)))
+ if((sizeof(haddr_t) + 1) * total_chunks > INT_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow")
+ if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, (int)((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm)))
HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code)
H5MM_memcpy(assign_io_mode, mergebuf, total_chunks);
@@ -2606,7 +2608,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ
H5D_chunk_info_t *chunk_info;
H5D_chunk_ud_t udata;
H5SL_node_t *chunk_node;
- hssize_t select_npoints;
+ hsize_t select_npoints;
hssize_t chunk_npoints;
if(NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(H5D_filtered_collective_io_info_t))))
@@ -2632,8 +2634,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ
H5MM_memcpy(local_info_array[i].scaled, chunk_info->scaled, sizeof(chunk_info->scaled));
- if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
local_info_array[i].io_size = (size_t) select_npoints * type_info->src_type_size;
/* Currently the full overwrite status of a chunk is only obtained on a per-process
@@ -2841,7 +2842,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
if (mpi_rank != chunk_entry->owners.new_owner) {
H5D_chunk_info_t *chunk_info = NULL;
unsigned char *mod_data_p = NULL;
- hssize_t iter_nelmts;
+ hsize_t iter_nelmts;
size_t mod_data_size;
/* Look up the chunk and get its file and memory dataspaces */
@@ -2854,9 +2855,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty
if(H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size")
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
+ H5_CHECK_OVERFLOW(iter_nelmts, hsize_t, size_t);
mod_data_size += (size_t) iter_nelmts * type_info->src_type_size;
if(NULL == (mod_data[num_send_requests] = (unsigned char *) H5MM_malloc(mod_data_size)))
@@ -3088,7 +3089,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
H5Z_EDC_t err_detect; /* Error detection info */
H5Z_cb_t filter_cb; /* I/O filter callback function */
unsigned filter_mask = 0;
- hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */
+ hsize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */
hssize_t extent_npoints;
hsize_t true_chunk_size;
hbool_t mem_iter_init = FALSE;
@@ -3193,17 +3194,15 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information")
file_iter_init = TRUE;
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace);
- if(NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size)))
+ if(NULL == (tmp_gath_buf = H5MM_malloc(iter_nelmts * type_info->src_type_size)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer")
if(!H5D__gather_mem(chunk_entry->buf, file_iter, (size_t) iter_nelmts, tmp_gath_buf))
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't gather from chunk buffer")
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
if(H5D__scatter_mem(tmp_gath_buf, mem_iter, (size_t) iter_nelmts, io_info->u.rbuf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer")
@@ -3211,10 +3210,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
break;
case H5D_IO_OP_WRITE:
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace);
- if(NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size)))
+ if(NULL == (tmp_gath_buf = H5MM_malloc(iter_nelmts * type_info->src_type_size)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer")
/* Gather modification data from the application write buffer into a temporary buffer */
@@ -3230,8 +3228,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information")
mem_iter_init = TRUE;
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace);
/* Scatter the owner's modification data into the chunk data buffer according to
* the file space.
@@ -3262,8 +3259,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information")
mem_iter_init = TRUE;
- if((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid")
+ iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace);
/* Update the chunk data with the received modification data */
if(H5D__scatter_mem(mod_data_p, mem_iter, (size_t) iter_nelmts, chunk_entry->buf) < 0)
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 33ebe53..1df8a20 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -819,6 +819,7 @@ H5R__set_obj_token(H5R_ref_priv_t *ref, const H5O_token_t *obj_token,
HDassert(token_size <= H5O_MAX_TOKEN_SIZE);
H5MM_memcpy(&ref->info.obj.token, obj_token, sizeof(H5O_token_t));
+ HDassert(token_size <= 255);
ref->token_size = (uint8_t)token_size;
FUNC_LEAVE_NOAPI(ret_value)
@@ -1200,7 +1201,7 @@ H5R__decode_obj_token(const unsigned char *buf, size_t *nbytes,
/* Decode token */
H5MM_memcpy(obj_token, p, *token_size);
- *nbytes = (size_t)*token_size + H5_SIZEOF_UINT8_T;
+ *nbytes = (size_t)(*token_size + H5_SIZEOF_UINT8_T);
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 800913f..6397f4b 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -293,8 +293,8 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points,
for(i = 0; i < num_big_types; i++) {
#if MPI_VERSION >= 3
- if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(bigio_count,
- 1, &disp[i*bigio_count], elmt_type, &inner_types[i])))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)bigio_count,
+ 1, &disp[(hsize_t)i*bigio_count], elmt_type, &inner_types[i])))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code)
#else
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)bigio_count,
@@ -308,7 +308,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points,
if(remaining_points) {
#if MPI_VERSION >= 3
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(remaining_points,
- 1, &disp[num_big_types*bigio_count], elmt_type, &inner_types[num_big_types])))
+ 1, &disp[(hsize_t)num_big_types*bigio_count], elmt_type, &inner_types[num_big_types])))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code)
#else
if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)remaining_points,
@@ -403,8 +403,11 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ
curr = space->select.sel_info.pnt_lst->head;
for(u = 0 ; u < num_points ; u++) {
/* Calculate the displacement of the current point */
- disp[u] = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt);
- disp[u] *= elmt_size;
+ hsize_t disp_tmp = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt);
+ if(disp_tmp > LONG_MAX) /* Maximum value of type long */
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "disp overflow")
+ disp[u] = (MPI_Aint)disp_tmp;
+ disp[u] *= (MPI_Aint)elmt_size;
/* This is a File Space used to set the file view, so adjust the displacements
* to have them monotonically non-decreasing.
@@ -423,7 +426,7 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ
*/
if(do_permute) {
if(u > 0 && disp[u] < disp[u - 1]) {
- unsigned s = 0, l = u, m = u / 2;
+ hsize_t s = 0, l = u, m = u / 2;
*is_permuted = TRUE;
do {
@@ -565,7 +568,9 @@ H5S__mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute,
/* Loop, while bytes left in sequence */
while(curr_len > 0) {
/* Set the displacement of the current point */
- disp[u] = curr_off;
+ if(curr_off > LONG_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "curr_off overflow")
+ disp[u] = (MPI_Aint)curr_off;
/* This is a memory displacement, so for each point selected,
* apply the map that was generated by the file selection */
@@ -893,8 +898,14 @@ if(H5DEBUG(S))
****************************************/
/* Calculate start and extent values of this dimension */
- start_disp = d[i].start * offset[i] * elmt_size;
- new_extent = (MPI_Aint)elmt_size * max_xtent[i];
+ /* Check if value overflow to cast to type MPI_Aint */
+ if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow")
+ start_disp = (MPI_Aint)d[i].start * (MPI_Aint)offset[i] * (MPI_Aint)elmt_size;
+
+ if(max_xtent[i] > LONG_MAX)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "max_xtent overflow")
+ new_extent = (MPI_Aint)elmt_size * (MPI_Aint)max_xtent[i];
if(MPI_SUCCESS != (mpi_code = MPI_Type_get_extent(outer_type, &lb, &extent_len)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_get_extent failed", mpi_code)
@@ -1161,7 +1172,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
nelmts = (span->high - span->low) + 1;
/* Store displacement & block length */
- disp[outercount] = (MPI_Aint)elmt_size * span->low;
+ disp[outercount] = (MPI_Aint)elmt_size * (MPI_Aint)span->low;
H5_CHECK_OVERFLOW(nelmts, hsize_t, int)
blocklen[outercount] = (int)nelmts;
@@ -1183,7 +1194,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
/* create the block type from elmt_type while checking the 32 bit int limit */
if((hsize_t)(blocklen[u]) > bigio_count) {
- if(H5_mpio_create_large_type(blocklen[u], 0, *elmt_type, &temp_type) < 0)
+ if(H5_mpio_create_large_type((hsize_t)blocklen[u], 0, *elmt_type, &temp_type) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large element datatype in span_hyper selection")
} /* end if */
else
@@ -1219,7 +1230,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of inner MPI datatypes")
/* Calculate the total bytes of the lower dimension */
- stride = (*down) * elmt_size;
+ stride = (MPI_Aint)(*down) * (MPI_Aint)elmt_size;
/* Loop over span nodes */
outercount = 0;
@@ -1251,7 +1262,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down,
/* Displacement should be in byte and should have dimension information */
/* First using MPI Type vector to build derived data type for this span only */
/* Need to calculate the disp in byte for this dimension. */
- disp[outercount] = span->low * stride;
+ disp[outercount] = (MPI_Aint)span->low * stride;
blocklen[outercount] = 1;
/* Generate MPI datatype for next dimension down */
diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c
index 2245bd3..6d07513 100644
--- a/src/H5Ztrans.c
+++ b/src/H5Ztrans.c
@@ -324,7 +324,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream);
#define H5Z_XFORM_DO_OP5(TYPE, SIZE) \
{ \
- TYPE val = (TYPE)((tree->type == H5Z_XFORM_INTEGER) ? tree->value.int_val : tree->value.float_val); \
+ TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \
H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \
}
diff --git a/src/H5mpi.c b/src/H5mpi.c
index 15451d4..4e1bc95 100644
--- a/src/H5mpi.c
+++ b/src/H5mpi.c
@@ -482,7 +482,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes,
/* Calculate how many Big MPI datatypes are needed to represent the buffer */
num_big_types = (int)(num_elements/bigio_count);
- leftover = num_elements - num_big_types * (hsize_t)bigio_count;
+ leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count;
H5_CHECKED_ASSIGN(remaining_bytes, int, leftover, hsize_t);
/* Create a contiguous datatype of size equal to the largest
@@ -491,11 +491,11 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes,
* use type_hvector to create the type with the displacement provided
*/
if (0 == stride_bytes) {
- if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(bigio_count, old_type, &inner_type)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count, old_type, &inner_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code)
} /* end if */
else
- if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector(bigio_count, 1, stride_bytes, old_type, &inner_type)))
+ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector((int)bigio_count, 1, stride_bytes, old_type, &inner_type)))
HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code)
/* Create a contiguous datatype of the buffer (minus the remaining < 2GB part)
diff --git a/src/H5overflow.txt b/src/H5overflow.txt
index ed71b98..9fb3b89 100644
--- a/src/H5overflow.txt
+++ b/src/H5overflow.txt
@@ -31,6 +31,7 @@
unsigned, UNSIGNED;
int8_t, SIGNED;
int, SIGNED;
+long, SIGNED;
int64_t, SIGNED;
uint8_t, UNSIGNED;
uint16_t, UNSIGNED;
diff --git a/test/dsets.c b/test/dsets.c
index 061642a..bbe2d0f 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -7269,8 +7269,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Generate random point coordinates. Only one point is selected per chunk */
for(i=0; i<NPOINTS; i++){
- chunk_row = (int)(ofs / cols);
- chunk_col = (int)(ofs % cols);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
ofs = (ofs + inc) % (rows * cols);
HDassert(!check2[chunk_row][chunk_col]);
@@ -7390,14 +7390,14 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
for(j = 0; j < nsize[1] / csize[1]; j++)
check2[i][j] = 0;
- rows = (long)(nsize[0] / csize[0]);
- cols = (long)(nsize[1] / csize[1]);
+ H5_CHECKED_ASSIGN(rows, int, nsize[0] / csize[0], long);
+ H5_CHECKED_ASSIGN(cols, int, nsize[1] / csize[1], long);
make_random_offset_and_increment(rows * cols, &ofs, &inc);
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < NPOINTS; i++){
- chunk_row = (int)(ofs / cols);
- chunk_col = (int)(ofs % cols);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
ofs = (ofs + inc) % (rows * cols);
HDassert(!check2[chunk_row][chunk_col]);
@@ -7506,8 +7506,8 @@ test_random_chunks_real(const char *testname, hbool_t early_alloc, hid_t fapl)
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < NPOINTS; i++){
- chunk_row = (int)(ofs / cols);
- chunk_col = (int)(ofs % cols);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
ofs = (ofs + inc) % (rows * cols);
HDassert(!check2[chunk_row][chunk_col]);
@@ -9732,8 +9732,8 @@ test_fixed_array(hid_t fapl)
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < POINTS; i++){
- chunk_row = (int)(ofs / cols);
- chunk_col = (int)(ofs % cols);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
ofs = (ofs + inc) % (rows * cols);
HDassert(!chunks[chunk_row][chunk_col]);
@@ -9861,8 +9861,8 @@ test_fixed_array(hid_t fapl)
/* Generate random point coordinates. Only one point is selected per chunk */
for(i = 0; i < POINTS_BIG; i++){
- chunk_row = (int)(ofs / cols);
- chunk_col = (int)(ofs % cols);
+ H5_CHECKED_ASSIGN(chunk_row, int, ofs / cols, long);
+ H5_CHECKED_ASSIGN(chunk_col, int, ofs % cols, long);
ofs = (ofs + inc) % (rows * cols);
HDassert(!chunks_big[chunk_row][chunk_col]);
diff --git a/test/swmr_common.c b/test/swmr_common.c
index b323769..925dc33 100644
--- a/test/swmr_common.c
+++ b/test/swmr_common.c
@@ -26,7 +26,8 @@
#include "h5test.h"
#include "swmr_common.h"
-
+#include "vds_swmr.h"
+
/*******************/
/* Local Variables */
/*******************/
@@ -73,6 +74,27 @@ unsigned symbol_count[NLEVELS] = {100, 200, 400, 800, 1600};
/* Array of dataset information entries (1 per dataset) */
symbol_info_t *symbol_info[NLEVELS];
+hsize_t PLANES[N_SOURCES][RANK] = {
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH},
+ {1, SM_HEIGHT, WIDTH},
+ {1, LG_HEIGHT, WIDTH}
+};
+
+char FILE_NAMES[N_SOURCES][NAME_LEN] = {
+ {"vds_swmr_src_a.h5"},
+ {"vds_swmr_src_b.h5"},
+ {"vds_swmr_src_c.h5"},
+ {"vds_swmr_src_d.h5"},
+ {"vds_swmr_src_e.h5"},
+ {"vds_swmr_src_f.h5"}
+};
+
+char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
+char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
/*-------------------------------------------------------------------------
* Function: choose_dataset
diff --git a/test/trefer.c b/test/trefer.c
index 441b7aa..fe237d7 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -566,8 +566,8 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
hsize_t *coords; /* Coordinate buffer */
hsize_t low[SPACE2_RANK]; /* Selection bounds */
hsize_t high[SPACE2_RANK]; /* Selection bounds */
- H5R_ref_t *wbuf, /* buffer to write to disk */
- *rbuf; /* buffer read from disk */
+ H5R_ref_t *wbuf, /* buffer to write to disk */
+ *rbuf; /* buffer read from disk */
H5R_ref_t nvrbuf[3]={{{{0}}},{{{101}}},{{{255}}}}; /* buffer with non-valid refs */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
*drbuf; /* Buffer for reading numeric data from disk */
@@ -580,7 +580,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high)
hid_t dset_NA; /* Dataset id for undefined reference */
hid_t space_NA; /* Dataspace id for undefined reference */
hsize_t dims_NA[1] = {1}; /* Dims array for undefined reference */
- H5R_ref_t rdata_NA[1]; /* Read buffer */
+ H5R_ref_t rdata_NA[1]; /* Read buffer */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataset Region Reference Functions\n"));
diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c
index 9cd202c..32a8244 100644
--- a/test/use_disable_mdc_flushes.c
+++ b/test/use_disable_mdc_flushes.c
@@ -108,7 +108,7 @@ parse_option(int argc, char * const argv[])
filename_g = optarg;
break;
case 'n': /* number of planes to write/read */
- if ((nplanes_g = HDatoi(optarg)) <= 0){
+ if ((nplanes_g = (hsize_t)HDatoi(optarg)) <= 0){
HDfprintf(stderr, "bad number of planes %s, must be a positive integer\n", optarg);
usage(progname_g);
Hgoto_error(-1);
@@ -193,17 +193,17 @@ setup_parameters(int argc, char * const argv[])
return(-1);
}
/* set chunk dims */
- chunkdims_g[0] = chunkplanes_g;
- chunkdims_g[1]= chunkdims_g[2] = chunksize_g;
+ chunkdims_g[0] = (hsize_t)chunkplanes_g;
+ chunkdims_g[1]= chunkdims_g[2] = (hsize_t)chunksize_g;
/* set dataset initial and max dims */
dims_g[0] = 0;
max_dims_g[0] = H5S_UNLIMITED;
- dims_g[1] = dims_g[2] = max_dims_g[1] = max_dims_g[2] = chunksize_g;
+ dims_g[1] = dims_g[2] = max_dims_g[1] = max_dims_g[2] = (hsize_t)chunksize_g;
/* set nplanes */
if (nplanes_g == 0)
- nplanes_g = chunksize_g;
+ nplanes_g = (hsize_t)chunksize_g;
/* show parameters and return */
show_parameters();
@@ -299,7 +299,7 @@ write_file(void)
hid_t dcpl; /* Dataset creation property list */
char *name;
UC_CTYPE *buffer, *bufptr; /* data buffer */
- hsize_t cz=chunksize_g; /* Chunk size */
+ hsize_t cz=(hsize_t)chunksize_g; /* Chunk size */
hid_t f_sid; /* dataset file space id */
hid_t m_sid; /* memory space id */
int rank; /* rank */
@@ -413,8 +413,13 @@ write_file(void)
/* fill buffer with value i+1 */
bufptr = buffer;
for (j=0; j<dims[1]; j++)
- for (k=0; k<dims[2]; k++)
- *bufptr++ = i;
+ for (k=0; k<dims[2]; k++) {
+ if(i > SHRT_MAX) {
+ HDfprintf(stderr, "rank(%d) of dataset overflow\n", rank);
+ return -1;
+ }
+ *bufptr++ = (short)i;
+ }
/* extend the dataset by one for new plane */
dims[0]=i+1;
diff --git a/test/vds_swmr.h b/test/vds_swmr.h
index 43c78a4..edb01bc 100644
--- a/test/vds_swmr.h
+++ b/test/vds_swmr.h
@@ -84,31 +84,17 @@
#define N_PLANES_TO_WRITE 25
/* Planes */
-H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK] = {
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH},
- {1, SM_HEIGHT, WIDTH},
- {1, LG_HEIGHT, WIDTH}
-};
+H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK];
/* File names for source datasets */
-H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN] = {
- {"vds_swmr_src_a.h5"},
- {"vds_swmr_src_b.h5"},
- {"vds_swmr_src_c.h5"},
- {"vds_swmr_src_d.h5"},
- {"vds_swmr_src_e.h5"},
- {"vds_swmr_src_f.h5"}
-};
+H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN];
/* VDS file name */
-H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5";
+H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN];
/* Dataset names */
-H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset";
-H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN] = "vds_dset";
+H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN];
+H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN];
/* Fill values */
#endif /* VDS_SWMR_H */
diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c
index 2589653..b14ecc2 100644
--- a/test/vds_swmr_gen.c
+++ b/test/vds_swmr_gen.c
@@ -145,11 +145,13 @@ main(void)
if(H5Sselect_hyperslab(src_sid, H5S_SELECT_SET, start, NULL,
MAX_DIMS[i], NULL) < 0)
TEST_ERROR
- start[1] = map_start;
+ start[1] = (hsize_t)map_start;
if(H5Sselect_hyperslab(vds_sid, H5S_SELECT_SET, start, NULL,
MAX_DIMS[i], NULL) < 0)
TEST_ERROR
- map_start += PLANES[i][1];
+ if(PLANES[i][1] > INT_MAX)
+ TEST_ERROR
+ map_start += (int)PLANES[i][1];
/* Add VDS mapping */
if(H5Pset_virtual(vds_dcplid, vds_sid, FILE_NAMES[i],
diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c
index eb9a82b..1ee65a0 100644
--- a/test/vds_swmr_reader.c
+++ b/test/vds_swmr_reader.c
@@ -45,8 +45,10 @@ main(void)
TEST_ERROR
/* Create the read buffer */
- n_elements = VDS_PLANE[1] * VDS_PLANE[2];
- size = n_elements * sizeof(int);
+ if(VDS_PLANE[1] * VDS_PLANE[2] > INT_MAX)
+ TEST_ERROR
+ n_elements = (int)(VDS_PLANE[1] * VDS_PLANE[2]);
+ size = (size_t)n_elements * sizeof(int);
if(NULL == (buffer = (int *)HDmalloc(size)))
TEST_ERROR
diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c
index a49fefe..977a154 100644
--- a/testpar/t_2Gio.c
+++ b/testpar/t_2Gio.c
@@ -312,61 +312,61 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
switch (mode) {
case BYROW:
/* Each process takes a slabs of rows. */
- block[0] = dim0 / mpi_size;
- block[1] = dim1;
+ block[0] = (hsize_t)dim0 / (hsize_t)mpi_size;
+ block[1] = (hsize_t)dim1;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank * block[0];
+ start[0] = (hsize_t)mpi_rank * block[0];
start[1] = 0;
if (VERBOSE_MED)
HDprintf("slab_set BYROW\n");
break;
case BYCOL:
/* Each process takes a block of columns. */
- block[0] = dim0;
- block[1] = dim1 / mpi_size;
+ block[0] = (hsize_t)dim0;
+ block[1] = (hsize_t)dim1 / (hsize_t)mpi_size;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = mpi_rank * block[1];
+ start[1] = (hsize_t)mpi_rank * block[1];
if (VERBOSE_MED)
HDprintf("slab_set BYCOL\n");
break;
case ZROW:
/* Similar to BYROW except process 0 gets 0 row */
- block[0] = (mpi_rank ? dim0 / mpi_size : 0);
- block[1] = dim1;
+ block[0] = (hsize_t)(mpi_rank ? dim0 / mpi_size : 0);
+ block[1] = (hsize_t)dim1;
stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = (mpi_rank ? mpi_rank * block[0] : 0);
+ start[0] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[0] : 0);
start[1] = 0;
if (VERBOSE_MED)
HDprintf("slab_set ZROW\n");
break;
case ZCOL:
/* Similar to BYCOL except process 0 gets 0 column */
- block[0] = dim0;
- block[1] = (mpi_rank ? dim1 / mpi_size : 0);
+ block[0] = (hsize_t)dim0;
+ block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0);
stride[0] = block[0];
stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ start[1] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[1] : 0);
if (VERBOSE_MED)
HDprintf("slab_set ZCOL\n");
break;
default:
/* Unknown mode. Set it to cover the whole dataset. */
HDprintf("unknown slab_set mode (%d)\n", mode);
- block[0] = dim0;
- block[1] = dim1;
+ block[0] = (hsize_t)dim0;
+ block[1] = (hsize_t)dim1;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
@@ -634,7 +634,8 @@ static int MpioTest2G( MPI_Comm comm )
status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE);
VRFY((status >= 0), "");
- size_t slice_per_process = (shape[0] + mpi_size - 1) / mpi_size;
+ size_t slice_per_process;
+ H5_CHECKED_ASSIGN(slice_per_process, size_t, (shape[0] + (hsize_t)mpi_size - 1) / (hsize_t)mpi_size, hsize_t);
size_t data_size = slice_per_process * shape[1] * shape[2];
size_t data_size_bytes = sizeof(int) * data_size;
data = HDmalloc(data_size_bytes);
@@ -645,7 +646,7 @@ static int MpioTest2G( MPI_Comm comm )
}
hsize_t h5_counts[3] = { slice_per_process, shape[1], shape[2] };
- hsize_t h5_offsets[3] = { mpi_rank * slice_per_process, 0, 0};
+ hsize_t h5_offsets[3] = { (size_t)mpi_rank * slice_per_process, 0, 0};
hid_t filedataspace = H5Screate_simple(3, shape, NULL);
VRFY((filedataspace >= 0), "H5Screate_simple succeeded");
@@ -755,8 +756,8 @@ dataset_writeInd(void)
* and the slabs local to the MPI process.
* ------------------------------------------- */
/* setup dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -876,9 +877,9 @@ dataset_readInd(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* setup file access template */
@@ -1007,12 +1008,12 @@ dataset_writeAll(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* set up the coords array selection */
- num_points = dim1;
- coords = (hsize_t *)HDmalloc(dim1 * MAX_RANK * sizeof(hsize_t));
+ num_points = (size_t)dim1;
+ coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)MAX_RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
@@ -1036,8 +1037,8 @@ dataset_writeAll(void)
* and create the dataset
* ------------------------- */
/* setup 2-D dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -1338,16 +1339,16 @@ dataset_writeAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
block[0] = 1;
- block[1] = dim1;
+ block[1] = (hsize_t)dim1;
stride[0] = 1;
- stride[1] = dim1;
+ stride[1] = (hsize_t)dim1;
count[0] = 1;
count[1] = 1;
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
dataset_fill(start, block, data_array1);
@@ -1394,7 +1395,7 @@ dataset_writeAll(void)
/* Dataset6: point selection in File - Point selection in Memory*/
/* create a file dataspace independently */
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER);
file_dataspace = H5Dget_space (dataset6);
@@ -1432,7 +1433,7 @@ dataset_writeAll(void)
/* Dataset7: point selection in File - All selection in Memory*/
/* create a file dataspace independently */
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset7);
@@ -1538,14 +1539,14 @@ dataset_readAll(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* set up the coords array selection */
- num_points = dim1;
- coords = (hsize_t *)HDmalloc(dim0 * dim1 * MAX_RANK * sizeof(hsize_t));
+ num_points = (size_t)dim1;
+ coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * MAX_RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
@@ -1723,18 +1724,18 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
if(data_origin1) free(data_origin1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
block[0] = 1;
- block[1] = dim1;
+ block[1] = (hsize_t)dim1;
stride[0] = 1;
- stride[1] = dim1;
+ stride[1] = (hsize_t)dim1;
count[0] = 1;
count[1] = 1;
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
dataset_fill(start, block, data_origin1);
@@ -1784,12 +1785,12 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset6: point selection in File - Point selection in Memory*/
/* create a file dataspace independently */
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset6);
@@ -1829,7 +1830,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset7: point selection in memory - All selection in file*/
@@ -1839,12 +1840,12 @@ dataset_readAll(void)
ret = H5Sselect_all(file_dataspace);
VRFY((ret >= 0), "H5Sselect_all succeeded");
- num_points = dim0 * dim1;
+ num_points = (size_t)dim0 * (size_t)dim1;
k=0;
for (i=0 ; i<dim0; i++) {
for (j=0 ; j<dim1; j++) {
- coords[k++] = i;
- coords[k++] = j;
+ coords[k++] = (hsize_t)i;
+ coords[k++] = (hsize_t)j;
}
}
mem_dataspace = H5Dget_space (dataset7);
@@ -1867,7 +1868,7 @@ dataset_readAll(void)
xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset7 succeeded");
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)dim0/(hsize_t)mpi_size * (hsize_t)mpi_rank;
start[1] = 0;
ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1);
if(ret) nerrors++;
@@ -1950,11 +1951,11 @@ extend_writeInd(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
- chunk_dims[0] = chunkdim0;
- chunk_dims[1] = chunkdim1;
+ chunk_dims[0] = (hsize_t)chunkdim0;
+ chunk_dims[1] = (hsize_t)chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
@@ -2041,8 +2042,8 @@ extend_writeInd(void)
VRFY((mem_dataspace >= 0), "");
/* Extend its current dim sizes before writing */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset1, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -2101,8 +2102,8 @@ extend_writeInd(void)
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset2, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -2263,7 +2264,7 @@ extend_writeInd2(void)
* Write to the second half of the dataset
* -------------------------*/
for (i=0; i<(int)orig_size; i++)
- written[i] = orig_size + i;
+ H5_CHECKED_ASSIGN(written[i], int, orig_size + (hsize_t)i, hsize_t);
MESG("data array re-initialized");
if(VERBOSE_MED) {
MESG("writing at offset 10: ");
@@ -2338,11 +2339,11 @@ extend_readInd(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
@@ -2521,11 +2522,11 @@ extend_writeAll(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
- chunk_dims[0] = chunkdim0;
- chunk_dims[1] = chunkdim1;
+ chunk_dims[0] = (hsize_t)chunkdim0;
+ chunk_dims[1] = (hsize_t)chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
@@ -2612,8 +2613,8 @@ extend_writeAll(void)
VRFY((mem_dataspace >= 0), "");
/* Extend its current dim sizes before writing */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset1, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -2695,8 +2696,8 @@ extend_writeAll(void)
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset2, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -2768,11 +2769,11 @@ extend_readAll(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
@@ -2940,7 +2941,7 @@ compress_readAll(void)
hid_t dataspace; /* Dataspace ID */
hid_t dataset; /* Dataset ID */
int rank=1; /* Dataspace rank */
- hsize_t dim=dim0; /* Dataspace dimensions */
+ hsize_t dim=(hsize_t)dim0; /* Dataspace dimensions */
unsigned u; /* Local index variable */
unsigned chunk_opts; /* Chunk options */
unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */
@@ -2968,7 +2969,7 @@ compress_readAll(void)
/* Initialize data buffers */
for(u=0; u<dim;u++)
- data_orig[u]=u;
+ data_orig[u]=(DATATYPE)u;
/* Run test both with and without filters disabled on partial chunks */
for(disable_partial_chunk_filters = 0; disable_partial_chunk_filters <= 1;
@@ -3152,8 +3153,8 @@ none_selection_chunk(void)
MPI_Comm_rank(test_comm,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
- chunk_dims[0] = chunkdim0;
- chunk_dims[1] = chunkdim1;
+ chunk_dims[0] = (hsize_t)chunkdim0;
+ chunk_dims[1] = (hsize_t)chunkdim1;
/* -------------------
* START AN HDF5 FILE
@@ -3183,8 +3184,8 @@ none_selection_chunk(void)
VRFY((ret >= 0), "H5Pset_chunk succeeded");
/* setup dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple(MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3461,8 +3462,8 @@ test_actual_io_mode(int selection_mode) {
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Create the basic Space */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3473,7 +3474,7 @@ test_actual_io_mode(int selection_mode) {
/* If we are not testing contiguous datasets */
if(is_chunked) {
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/mpi_size;
+ chunk_dims[0] = dims[0]/(hsize_t)mpi_size;
chunk_dims[1] = dims[1];
ret = H5Pset_chunk(dcpl, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
@@ -3539,14 +3540,14 @@ test_actual_io_mode(int selection_mode) {
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
} else {
/* Select the first and the nth chunk in the nth column */
- block[0] = dim0 / mpi_size;
- block[1] = dim1 / mpi_size;
+ block[0] = (hsize_t)(dim0 / mpi_size);
+ block[1] = (hsize_t)(dim1 / mpi_size);
count[0] = 2;
count[1] = 1;
- stride[0] = mpi_rank * block[0];
+ stride[0] = (hsize_t)mpi_rank * block[0];
stride[1] = 1;
start[0] = 0;
- start[1] = mpi_rank*block[1];
+ start[1] = (hsize_t)mpi_rank*block[1];
}
test_name = "Multi Chunk - Mixed";
@@ -3577,17 +3578,17 @@ test_actual_io_mode(int selection_mode) {
if(mpi_rank == 0) {
/* Select the first chunk in the first column */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
- block[0] = block[0] / mpi_size;
+ block[0] = block[0] / (hsize_t)mpi_size;
} else {
/* Select the first and the nth chunk in the nth column */
- block[0] = dim0 / mpi_size;
- block[1] = dim1 / mpi_size;
+ block[0] = (hsize_t)(dim0 / mpi_size);
+ block[1] = (hsize_t)(dim1 / mpi_size);
count[0] = 2;
count[1] = 1;
- stride[0] = mpi_rank * block[0];
+ stride[0] = (hsize_t)mpi_rank * block[0];
stride[1] = 1;
start[0] = 0;
- start[1] = mpi_rank*block[1];
+ start[1] = (hsize_t)mpi_rank*block[1];
}
/* If the testname was not already set by the RESET case */
@@ -3660,7 +3661,7 @@ test_actual_io_mode(int selection_mode) {
length = dim0 * dim1;
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * length);
+ buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -3987,8 +3988,8 @@ test_no_collective_cause_mode(int selection_mode)
dims[1] = BIG_Y_FACTOR * 6;
}
else {
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
}
sid = H5Screate_simple (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -4010,7 +4011,7 @@ test_no_collective_cause_mode(int selection_mode)
/* If we are not testing contiguous datasets */
if(is_chunked) {
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/mpi_size;
+ chunk_dims[0] = dims[0]/(hsize_t)mpi_size;
chunk_dims[1] = dims[1];
ret = H5Pset_chunk(dcpl, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
@@ -4091,10 +4092,10 @@ test_no_collective_cause_mode(int selection_mode)
}
/* Get the number of elements in the selection */
- length = dims[0] * dims[1];
+ H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], hsize_t);
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * length);
+ buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -4520,10 +4521,10 @@ dataset_atomicity(void)
buf_size = dim0 * dim1;
/* allocate memory for data buffer */
- write_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
/* setup file access template */
@@ -4539,8 +4540,8 @@ dataset_atomicity(void)
VRFY((ret >= 0), "H5Pclose succeeded");
/* setup dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (MAX_RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -4678,10 +4679,10 @@ dataset_atomicity(void)
VRFY((dataset2 >= 0), "H5Dopen2 succeeded");
/* allocate memory for data buffer */
- write_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
for (i=0 ; i<buf_size ; i++) {
@@ -4698,12 +4699,12 @@ dataset_atomicity(void)
VRFY((atomicity == TRUE), "atomcity set failed");
- block[0] = dim0/mpi_size - 1;
- block[1] = dim1/mpi_size - 1;
+ block[0] = (hsize_t)(dim0/mpi_size) - 1;
+ block[1] = (hsize_t)(dim1/mpi_size) - 1;
stride[0] = block[0] + 1;
stride[1] = block[1] + 1;
- count[0] = mpi_size;
- count[1] = mpi_size;
+ count[0] = (hsize_t)mpi_size;
+ count[1] = (hsize_t)mpi_size;
start[0] = 0;
start[1] = 0;
@@ -4759,19 +4760,19 @@ dataset_atomicity(void)
compare = 5;
for (i=0 ; i<dim0 ; i++) {
- if ((hsize_t)i >= mpi_rank*(block[0]+1)) {
+ if ((hsize_t)i >= (hsize_t)mpi_rank*(block[0]+1)) {
break;
}
- if ((i+1)%(block[0]+1)==0) {
+ if (((hsize_t)i+1)%(block[0]+1)==0) {
k += dim1;
continue;
}
for (j=0 ; j<dim1 ; j++) {
- if ((hsize_t)j >= mpi_rank*(block[1]+1)) {
- k += dim1 - mpi_rank*(block[1]+1);
+ if ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) {
+ H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1) + (hsize_t)k, hsize_t);
break;
}
- if ((j+1)%(block[1]+1)==0) {
+ if (((hsize_t)j+1)%(block[1]+1)==0) {
k++;
continue;
}
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index b681a2a..70c77c3 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -247,7 +247,7 @@ ccslab_set(int mpi_rank,
stride[1] = 1;
count[0] = space_dim1;
count[1] = space_dim2;
- start[0] = mpi_rank*count[0];
+ start[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -256,11 +256,11 @@ ccslab_set(int mpi_rank,
/* Each process takes several disjoint blocks. */
block[0] = 1;
block[1] = 1;
- stride[0] = 3;
- stride[1] = 3;
- count[0] = space_dim1/(stride[0]*block[0]);
- count[1] = (space_dim2)/(stride[1]*block[1]);
- start[0] = space_dim1*mpi_rank;
+ stride[0] = 3;
+ stride[1] = 3;
+ count[0] = space_dim1/(stride[0]*block[0]);
+ count[1] = (space_dim2)/(stride[1]*block[1]);
+ start[0] = space_dim1*(hsize_t)mpi_rank;
start[1] = 0;
break;
@@ -274,7 +274,7 @@ ccslab_set(int mpi_rank,
stride[1] = 1;
count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:space_dim1);
count[1] = space_dim2;
- start[0] = mpi_rank*count[0];
+ start[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -285,14 +285,14 @@ ccslab_set(int mpi_rank,
half of the domain. */
block[0] = 1;
- count[0] = 2;
- stride[0] = space_dim1*mpi_size/4+1;
+ count[0] = 2;
+ stride[0] = (hsize_t)(space_dim1*(hsize_t)mpi_size/4+1);
block[1] = space_dim2;
count[1] = 1;
start[1] = 0;
stride[1] = 1;
- if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank;
- else start[0] = 1 + space_dim1*mpi_size/2 + (mpi_rank-2*mpi_size/3);
+ if((mpi_rank *3)<(mpi_size*2)) start[0] = (hsize_t)mpi_rank;
+ else start[0] = 1 + space_dim1*(hsize_t)mpi_size/2 + (hsize_t)(mpi_rank-2*mpi_size/3);
break;
case BYROW_SELECTINCHUNK:
@@ -300,7 +300,7 @@ ccslab_set(int mpi_rank,
block[0] = 1;
count[0] = 1;
- start[0] = mpi_rank*space_dim1;
+ start[0] = (hsize_t)mpi_rank*space_dim1;
stride[0]= 1;
block[1] = space_dim2;
count[1] = 1;
@@ -311,7 +311,7 @@ ccslab_set(int mpi_rank,
default:
/* Unknown mode. Set it to cover the whole dataset. */
- block[0] = space_dim1*mpi_size;
+ block[0] = space_dim1*(hsize_t)mpi_size;
block[1] = space_dim2;
stride[0] = block[0];
stride[1] = block[1];
@@ -519,7 +519,7 @@ dataset_big_write(void)
HDprintf("\nTesting Dataset1 write by ROW\n");
/* Create a large dataset */
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -527,13 +527,13 @@ dataset_big_write(void)
VRFY((dataset >= 0), "H5Dcreate2 succeeded");
H5Sclose(sid);
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank*block[0];
+ start[0] = (hsize_t)mpi_rank*block[0];
start[1] = 0;
/* create a file dataspace independently */
@@ -582,7 +582,7 @@ dataset_big_write(void)
HDprintf("\nTesting Dataset2 write by COL\n");
/* Create a large dataset */
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -591,13 +591,13 @@ dataset_big_write(void)
H5Sclose(sid);
block[0] = dims[0];
- block[1] = dims[1]/mpi_size;
+ block[1] = dims[1]/(hsize_t)mpi_size;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = mpi_rank*block[1];
+ start[1] = (hsize_t)mpi_rank*block[1];
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset);
@@ -708,7 +708,7 @@ dataset_big_write(void)
HDprintf("\nTesting Dataset4 write point selection\n");
/* Create a large dataset */
dims[0] = bigcount;
- dims[1] = mpi_size * 4;
+ dims[1] = (hsize_t)(mpi_size * 4);
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -723,7 +723,7 @@ dataset_big_write(void)
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = dims[1]/mpi_size * mpi_rank;
+ start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank;
num_points = bigcount;
@@ -836,16 +836,16 @@ dataset_big_read(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
/* Each process takes a slabs of cols. */
block[0] = dims[0];
- block[1] = dims[1]/mpi_size;
+ block[1] = dims[1]/(hsize_t)mpi_size;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = mpi_rank*block[1];
+ start[1] = (hsize_t)mpi_rank*block[1];
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset);
@@ -898,15 +898,15 @@ dataset_big_read(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
dims[0] = bigcount;
- dims[1] = mpi_size;
+ dims[1] = (hsize_t)mpi_size;
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank*block[0];
+ start[0] = (hsize_t)mpi_rank*block[0];
start[1] = 0;
/* create a file dataspace independently */
@@ -1022,7 +1022,7 @@ dataset_big_read(void)
VRFY((dataset >= 0), "H5Dopen2 succeeded");
dims[0] = bigcount;
- dims[1] = mpi_size * 4;
+ dims[1] = (hsize_t)(mpi_size * 4);
block[0] = dims[0]/2;
block[1] = 2;
@@ -1031,7 +1031,7 @@ dataset_big_read(void)
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = dims[1]/mpi_size * mpi_rank;
+ start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank;
fill_datasets(start, block, wdata);
MESG("data_array initialized");
@@ -1461,7 +1461,7 @@ coll_chunktest(const char* filename,
VRFY((status >= 0),"");
/* setup dimensionality object */
- dims[0] = space_dim1*mpi_size;
+ dims[0] = space_dim1*(hsize_t)mpi_size;
dims[1] = space_dim2;
/* allocate memory for data buffer */
@@ -1499,7 +1499,7 @@ coll_chunktest(const char* filename,
VRFY((crp_plist >= 0),"");
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/chunk_factor;
+ chunk_dims[0] = dims[0]/(hsize_t)chunk_factor;
/* to decrease the testing time, maintain bigger chunk size */
(chunk_factor == 1) ? (chunk_dims[1] = space_dim2) : (chunk_dims[1] = space_dim2/2);
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 2340974..954071d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -1619,9 +1619,9 @@ serve_read_request(struct mssg_t * mssg_ptr)
reply.dest = mssg_ptr->src;
reply.mssg_num = -1; /* set by send function */
reply.base_addr = data[target_index].base_addr;
- reply.len = data[target_index].len;
+ H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t);
reply.ver = data[target_index].ver;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
/* and update the counters */
@@ -1841,7 +1841,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
reply.dest = mssg_ptr->src;
reply.mssg_num = -1; /* set by send function */
reply.base_addr = data[target_index].base_addr;
- reply.len = data[target_index].len;
+ H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t);
reply.ver = data[target_index].ver;
reply.count = 0;
reply.magic = MSSG_MAGIC;
@@ -1927,7 +1927,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = total_writes;
+ reply.count = (unsigned)total_writes;
reply.magic = MSSG_MAGIC;
}
@@ -2006,7 +2006,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = total_reads;
+ reply.count = (unsigned)total_reads;
reply.magic = MSSG_MAGIC;
}
@@ -2100,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = data[target_index].writes;
+ reply.count = (unsigned)data[target_index].writes;
reply.magic = MSSG_MAGIC;
}
}
@@ -2197,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = (long)(data[target_index].reads);
+ reply.count = (unsigned)(data[target_index].reads);
reply.magic = MSSG_MAGIC;
}
}
@@ -2633,7 +2633,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = entry_ptr->base_addr;
- mssg.len = entry_ptr->len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
mssg.ver = 0; /* bogus -- should be corrected by server */
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
@@ -2789,7 +2789,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = entry_ptr->base_addr;
- mssg.len = entry_ptr->len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
mssg.ver = entry_ptr->ver;
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -4667,7 +4667,7 @@ verify_entry_reads(haddr_t addr,
}
} else {
- reported_entry_reads = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_reads, int, mssg.count, unsigned);
}
}
@@ -4774,7 +4774,7 @@ verify_entry_writes(haddr_t addr,
}
} else {
- reported_entry_writes = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_writes, int, mssg.count, unsigned);
}
}
@@ -5230,7 +5230,7 @@ server_smoke_check(void)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = data[world_mpi_rank].base_addr;
- mssg.len = data[world_mpi_rank].len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t);
mssg.ver = ++(data[world_mpi_rank].ver);
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -5335,7 +5335,7 @@ server_smoke_check(void)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = data[world_mpi_rank].base_addr;
- mssg.len = data[world_mpi_rank].len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t);
mssg.ver = 0; /* bogus -- should be corrected by server */
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -7265,7 +7265,8 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ H5_CHECK_OVERFLOW(cache_ptr->max_cache_size, size_t, double);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* insert the other half independently */
@@ -7286,7 +7287,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* flush the file */
@@ -7316,7 +7317,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* protect the other half independently */
@@ -7337,7 +7338,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
for ( i = 0; i < (virt_num_data_entries); i++ )
diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c
index bfa0bfe..e6df2d8 100644
--- a/testpar/t_chunk_alloc.c
+++ b/testpar/t_chunk_alloc.c
@@ -95,7 +95,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
/* Only MAINPROCESS should create the file. Others just wait. */
if (MAINPROCESS){
nchunks=chunk_factor*mpi_size;
- dims[0]=nchunks*CHUNK_SIZE;
+ dims[0]=(hsize_t)(nchunks*CHUNK_SIZE);
/* Create the data space with unlimited dimensions. */
dataspace = H5Screate_simple (1, dims, maxdims);
VRFY((dataspace >= 0), "");
@@ -127,7 +127,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
count[0] = 1;
stride[0] = 1;
block[0] = chunk_dims[0];
- offset[0] = (nchunks-2)*chunk_dims[0];
+ offset[0] = (hsize_t)(nchunks-2)*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
VRFY((hrc >= 0), "");
@@ -157,7 +157,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char);
+ est_filesize = (MPI_Offset)nchunks * (MPI_Offset)CHUNK_SIZE * (MPI_Offset)sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
}
@@ -233,7 +233,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
dataspace = H5Dget_space(*dataset);
VRFY((dataspace >= 0), "");
- size[0] = nchunks*CHUNK_SIZE;
+ size[0] = (hsize_t)nchunks*CHUNK_SIZE;
switch (action) {
@@ -245,7 +245,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
stride[0] = 1;
block[0] = chunk_dims[0];
for (i=0; i<nchunks/mpi_size; i++) {
- offset[0] = (i*mpi_size+mpi_rank)*chunk_dims[0];
+ offset[0] = (hsize_t)(i*mpi_size+mpi_rank)*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
VRFY((hrc >= 0), "");
@@ -294,7 +294,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti
/* verify file size */
filesize = get_filesize(filename);
- est_filesize = nchunks*CHUNK_SIZE*sizeof(unsigned char);
+ est_filesize = (MPI_Offset)nchunks*(MPI_Offset)CHUNK_SIZE*(MPI_Offset)sizeof(unsigned char);
VRFY((filesize >= est_filesize), "file size check");
/* Can close some plists */
@@ -374,7 +374,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in
/* reset buffer values */
HDmemset(buffer, -1, CHUNK_SIZE);
- offset[0] = i*chunk_dims[0];
+ offset[0] = (hsize_t)i*chunk_dims[0];
hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block);
VRFY((hrc >= 0), "");
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index 2d758ba..e950015 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -637,7 +637,7 @@ coll_chunktest(const char* filename,
VRFY((status >= 0),"");
/* setup dimensionality object */
- dims[0] = SPACE_DIM1*mpi_size;
+ dims[0] = (hsize_t)(SPACE_DIM1*mpi_size);
dims[1] = SPACE_DIM2;
/* allocate memory for data buffer */
@@ -670,7 +670,7 @@ coll_chunktest(const char* filename,
VRFY((crp_plist >= 0),"");
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/chunk_factor;
+ chunk_dims[0] = dims[0]/(hsize_t)chunk_factor;
/* to decrease the testing time, maintain bigger chunk size */
(chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2);
@@ -1057,7 +1057,7 @@ ccslab_set(int mpi_rank,
stride[1] = 1;
count[0] = SPACE_DIM1;
count[1] = SPACE_DIM2;
- start[0] = mpi_rank*count[0];
+ start[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -1066,11 +1066,11 @@ ccslab_set(int mpi_rank,
/* Each process takes several disjoint blocks. */
block[0] = 1;
block[1] = 1;
- stride[0] = 3;
- stride[1] = 3;
- count[0] = SPACE_DIM1/(stride[0]*block[0]);
- count[1] = (SPACE_DIM2)/(stride[1]*block[1]);
- start[0] = SPACE_DIM1*mpi_rank;
+ stride[0] = 3;
+ stride[1] = 3;
+ count[0] = SPACE_DIM1/(stride[0]*block[0]);
+ count[1] = (SPACE_DIM2)/(stride[1]*block[1]);
+ start[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_rank;
start[1] = 0;
break;
@@ -1084,7 +1084,7 @@ ccslab_set(int mpi_rank,
stride[1] = 1;
count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:SPACE_DIM1);
count[1] = SPACE_DIM2;
- start[0] = mpi_rank*count[0];
+ start[0] = (hsize_t)mpi_rank*count[0];
start[1] = 0;
break;
@@ -1095,14 +1095,14 @@ ccslab_set(int mpi_rank,
half of the domain. */
block[0] = 1;
- count[0] = 2;
- stride[0] = SPACE_DIM1*mpi_size/4+1;
+ count[0] = 2;
+ stride[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size/4+1;
block[1] = SPACE_DIM2;
count[1] = 1;
start[1] = 0;
stride[1] = 1;
- if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank;
- else start[0] = 1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3);
+ if((mpi_rank *3)<(mpi_size*2)) start[0] = (hsize_t)mpi_rank;
+ else start[0] = (hsize_t)(1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3));
break;
case BYROW_SELECTINCHUNK:
@@ -1110,7 +1110,7 @@ ccslab_set(int mpi_rank,
block[0] = 1;
count[0] = 1;
- start[0] = mpi_rank*SPACE_DIM1;
+ start[0] = (hsize_t)(mpi_rank*SPACE_DIM1);
stride[0]= 1;
block[1] = SPACE_DIM2;
count[1] = 1;
@@ -1121,7 +1121,7 @@ ccslab_set(int mpi_rank,
default:
/* Unknown mode. Set it to cover the whole dataset. */
- block[0] = SPACE_DIM1*mpi_size;
+ block[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size;
block[1] = SPACE_DIM2;
stride[0] = block[0];
stride[1] = block[1];
diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c
index c0fe04b..d4b2106 100644
--- a/testpar/t_coll_md_read.c
+++ b/testpar/t_coll_md_read.c
@@ -96,8 +96,8 @@ void test_partial_no_selection_coll_md_read(void)
dataset_dims = HDmalloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims));
VRFY((dataset_dims != NULL), "malloc succeeded");
- dataset_dims[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_size;
- dataset_dims[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE * mpi_size;
+ dataset_dims[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_size;
+ dataset_dims[1] = (hsize_t)PARTIAL_NO_SELECTION_X_DIM_SCALE * (hsize_t)mpi_size;
max_dataset_dims[0] = H5S_UNLIMITED;
max_dataset_dims[1] = H5S_UNLIMITED;
@@ -120,12 +120,12 @@ void test_partial_no_selection_coll_md_read(void)
*
* The ranks will write rows across the dataset.
*/
- start[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_rank;
+ start[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_rank;
start[1] = 0;
stride[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE;
stride[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE;
count[0] = 1;
- count[1] = mpi_size;
+ count[1] = (hsize_t)mpi_size;
block[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE;
block[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE;
@@ -405,7 +405,7 @@ void test_link_chunk_io_sort_chunk_issue(void)
dataset_dims = HDmalloc(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS * sizeof(*dataset_dims));
VRFY((dataset_dims != NULL), "malloc succeeded");
- dataset_dims[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * mpi_size * LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE;
+ dataset_dims[0] = (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * (hsize_t)mpi_size * (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE;
max_dataset_dims[0] = H5S_UNLIMITED;
fspace_id = H5Screate_simple(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS, dataset_dims, max_dataset_dims);
@@ -428,8 +428,8 @@ void test_link_chunk_io_sort_chunk_issue(void)
* The ranks will write rows across the dataset.
*/
stride[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE;
- count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / mpi_size;
- start[0] = count[0] * mpi_rank;
+ count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / (hsize_t)mpi_size;
+ start[0] = count[0] * (hsize_t)mpi_rank;
block[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE;
VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), "H5Sselect_hyperslab succeeded");
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 87782d0..05baf3f 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -48,61 +48,61 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
switch (mode) {
case BYROW:
/* Each process takes a slabs of rows. */
- block[0] = dim0 / mpi_size;
- block[1] = dim1;
+ block[0] = (hsize_t)(dim0 / mpi_size);
+ block[1] = (hsize_t)dim1;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank * block[0];
+ start[0] = (hsize_t)mpi_rank * block[0];
start[1] = 0;
if (VERBOSE_MED)
HDprintf("slab_set BYROW\n");
break;
case BYCOL:
/* Each process takes a block of columns. */
- block[0] = dim0;
- block[1] = dim1 / mpi_size;
+ block[0] = (hsize_t)dim0;
+ block[1] = (hsize_t)(dim1 / mpi_size);
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = mpi_rank * block[1];
+ start[1] = (hsize_t)mpi_rank * block[1];
if (VERBOSE_MED)
HDprintf("slab_set BYCOL\n");
break;
case ZROW:
/* Similar to BYROW except process 0 gets 0 row */
- block[0] = (mpi_rank ? dim0 / mpi_size : 0);
- block[1] = dim1;
+ block[0] = (hsize_t)(mpi_rank ? dim0 / mpi_size : 0);
+ block[1] = (hsize_t)dim1;
stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = (mpi_rank ? mpi_rank * block[0] : 0);
+ start[0] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[0] : 0);
start[1] = 0;
if (VERBOSE_MED)
HDprintf("slab_set ZROW\n");
break;
case ZCOL:
/* Similar to BYCOL except process 0 gets 0 column */
- block[0] = dim0;
- block[1] = (mpi_rank ? dim1 / mpi_size : 0);
+ block[0] = (hsize_t)dim0;
+ block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0);
stride[0] = block[0];
stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */
count[0] = 1;
count[1] = 1;
start[0] = 0;
- start[1] = (mpi_rank ? mpi_rank * block[1] : 0);
+ start[1] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[1] : 0);
if (VERBOSE_MED)
HDprintf("slab_set ZCOL\n");
break;
default:
/* Unknown mode. Set it to cover the whole dataset. */
HDprintf("unknown slab_set mode (%d)\n", mode);
- block[0] = dim0;
- block[1] = dim1;
+ block[0] = (hsize_t)dim0;
+ block[1] = (hsize_t)dim1;
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
@@ -308,7 +308,7 @@ dataset_writeInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* ----------------------------------------
@@ -332,8 +332,8 @@ dataset_writeInd(void)
* and the slabs local to the MPI process.
* ------------------------------------------- */
/* setup dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -453,9 +453,9 @@ dataset_readInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* setup file access template */
@@ -583,12 +583,12 @@ dataset_writeAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* set up the coords array selection */
- num_points = dim1;
- coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t));
+ num_points = (size_t)dim1;
+ coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
@@ -612,8 +612,8 @@ dataset_writeAll(void)
* and create the dataset
* ------------------------- */
/* setup 2-D dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -914,16 +914,16 @@ dataset_writeAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
block[0] = 1;
- block[1] = dim1;
+ block[1] = (hsize_t)dim1;
stride[0] = 1;
- stride[1] = dim1;
+ stride[1] = (hsize_t)dim1;
count[0] = 1;
count[1] = 1;
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)(dim0/mpi_size * mpi_rank);
start[1] = 0;
dataset_fill(start, block, data_array1);
@@ -970,7 +970,7 @@ dataset_writeAll(void)
/* Dataset6: point selection in File - Point selection in Memory*/
/* create a file dataspace independently */
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)(dim0/mpi_size * mpi_rank);
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER);
file_dataspace = H5Dget_space (dataset6);
@@ -1008,7 +1008,7 @@ dataset_writeAll(void)
/* Dataset7: point selection in File - All selection in Memory*/
/* create a file dataspace independently */
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)(dim0/mpi_size * mpi_rank);
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset7);
@@ -1114,14 +1114,14 @@ dataset_readAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* set up the coords array selection */
- num_points = dim1;
- coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t));
+ num_points = (size_t)dim1;
+ coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * (size_t)RANK * sizeof(hsize_t));
VRFY((coords != NULL), "coords malloc succeeded");
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
@@ -1299,18 +1299,18 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
if(data_origin1) free(data_origin1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded");
block[0] = 1;
- block[1] = dim1;
+ block[1] = (hsize_t)dim1;
stride[0] = 1;
- stride[1] = dim1;
+ stride[1] = (hsize_t)dim1;
count[0] = 1;
count[1] = 1;
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)(dim0/mpi_size * mpi_rank);
start[1] = 0;
dataset_fill(start, block, data_origin1);
@@ -1361,12 +1361,12 @@ dataset_readAll(void)
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset6: point selection in File - Point selection in Memory*/
/* create a file dataspace independently */
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)(dim0/mpi_size * mpi_rank);
start[1] = 0;
point_set (start, count, stride, block, num_points, coords, IN_ORDER);
file_dataspace = H5Dget_space (dataset6);
@@ -1406,7 +1406,7 @@ dataset_readAll(void)
H5Pclose(xfer_plist);
if(data_array1) free(data_array1);
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 malloc succeeded");
/* Dataset7: point selection in memory - All selection in file*/
@@ -1416,12 +1416,12 @@ dataset_readAll(void)
ret = H5Sselect_all(file_dataspace);
VRFY((ret >= 0), "H5Sselect_all succeeded");
- num_points = dim0 * dim1;
+ H5_CHECKED_ASSIGN(num_points, size_t, dim0 * dim1, int);
k=0;
for (i=0 ; i<dim0; i++) {
for (j=0 ; j<dim1; j++) {
- coords[k++] = i;
- coords[k++] = j;
+ coords[k++] = (hsize_t)i;
+ coords[k++] = (hsize_t)j;
}
}
mem_dataspace = H5Dget_space (dataset7);
@@ -1444,7 +1444,7 @@ dataset_readAll(void)
xfer_plist, data_array1);
VRFY((ret >= 0), "H5Dread dataset7 succeeded");
- start[0] = dim0/mpi_size * mpi_rank;
+ start[0] = (hsize_t)(dim0/mpi_size * mpi_rank);
start[1] = 0;
ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1);
if(ret) nerrors++;
@@ -1527,11 +1527,11 @@ extend_writeInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
- chunk_dims[0] = chunkdim0;
- chunk_dims[1] = chunkdim1;
+ chunk_dims[0] = (hsize_t)chunkdim0;
+ chunk_dims[1] = (hsize_t)chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
@@ -1618,8 +1618,8 @@ extend_writeInd(void)
VRFY((mem_dataspace >= 0), "");
/* Extend its current dim sizes before writing */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset1, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -1678,8 +1678,8 @@ extend_writeInd(void)
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset2, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -1840,7 +1840,7 @@ extend_writeInd2(void)
* Write to the second half of the dataset
* -------------------------*/
for (i=0; i<(int)orig_size; i++)
- written[i] = orig_size + i;
+ written[i] = (int)orig_size + i;
MESG("data array re-initialized");
if(VERBOSE_MED) {
MESG("writing at offset 10: ");
@@ -1915,11 +1915,11 @@ extend_readInd(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
@@ -2098,11 +2098,11 @@ extend_writeAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
- chunk_dims[0] = chunkdim0;
- chunk_dims[1] = chunkdim1;
+ chunk_dims[0] = (hsize_t)chunkdim0;
+ chunk_dims[1] = (hsize_t)chunkdim1;
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
/* -------------------
@@ -2189,8 +2189,8 @@ extend_writeAll(void)
VRFY((mem_dataspace >= 0), "");
/* Extend its current dim sizes before writing */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset1, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -2272,8 +2272,8 @@ extend_writeAll(void)
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
ret = H5Dset_extent(dataset2, dims);
VRFY((ret >= 0), "H5Dset_extent succeeded");
@@ -2345,11 +2345,11 @@ extend_readAll(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* allocate memory for data buffer */
- data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded");
- data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded");
- data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE));
+ data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE));
VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded");
/* -------------------
@@ -2517,7 +2517,7 @@ compress_readAll(void)
hid_t dataspace; /* Dataspace ID */
hid_t dataset; /* Dataset ID */
int rank=1; /* Dataspace rank */
- hsize_t dim=dim0; /* Dataspace dimensions */
+ hsize_t dim=(hsize_t)dim0; /* Dataspace dimensions */
unsigned u; /* Local index variable */
unsigned chunk_opts; /* Chunk options */
unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */
@@ -2545,7 +2545,7 @@ compress_readAll(void)
/* Initialize data buffers */
for(u=0; u<dim;u++)
- data_orig[u]=u;
+ data_orig[u]=(int)u;
/* Run test both with and without filters disabled on partial chunks */
for(disable_partial_chunk_filters = 0; disable_partial_chunk_filters <= 1;
@@ -2729,8 +2729,8 @@ none_selection_chunk(void)
MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank);
/* setup chunk-size. Make sure sizes are > 0 */
- chunk_dims[0] = chunkdim0;
- chunk_dims[1] = chunkdim1;
+ chunk_dims[0] = (hsize_t)chunkdim0;
+ chunk_dims[1] = (hsize_t)chunkdim1;
/* -------------------
* START AN HDF5 FILE
@@ -2760,8 +2760,8 @@ none_selection_chunk(void)
VRFY((ret >= 0), "H5Pset_chunk succeeded");
/* setup dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3038,8 +3038,8 @@ test_actual_io_mode(int selection_mode) {
VRFY((fid >= 0), "H5Fcreate succeeded");
/* Create the basic Space */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3050,7 +3050,7 @@ test_actual_io_mode(int selection_mode) {
/* If we are not testing contiguous datasets */
if(is_chunked) {
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/mpi_size;
+ chunk_dims[0] = dims[0]/(hsize_t)mpi_size;
chunk_dims[1] = dims[1];
ret = H5Pset_chunk(dcpl, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
@@ -3116,14 +3116,14 @@ test_actual_io_mode(int selection_mode) {
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
} else {
/* Select the first and the nth chunk in the nth column */
- block[0] = dim0 / mpi_size;
- block[1] = dim1 / mpi_size;
+ block[0] = (hsize_t)(dim0 / mpi_size);
+ block[1] = (hsize_t)(dim1 / mpi_size);
count[0] = 2;
count[1] = 1;
- stride[0] = mpi_rank * block[0];
+ stride[0] = (hsize_t)mpi_rank * block[0];
stride[1] = 1;
start[0] = 0;
- start[1] = mpi_rank*block[1];
+ start[1] = (hsize_t)mpi_rank*block[1];
}
test_name = "Multi Chunk - Mixed";
@@ -3154,17 +3154,17 @@ test_actual_io_mode(int selection_mode) {
if(mpi_rank == 0) {
/* Select the first chunk in the first column */
slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL);
- block[0] = block[0] / mpi_size;
+ block[0] = block[0] / (hsize_t)mpi_size;
} else {
/* Select the first and the nth chunk in the nth column */
- block[0] = dim0 / mpi_size;
- block[1] = dim1 / mpi_size;
+ block[0] = (hsize_t)(dim0 / mpi_size);
+ block[1] = (hsize_t)(dim1 / mpi_size);
count[0] = 2;
count[1] = 1;
- stride[0] = mpi_rank * block[0];
+ stride[0] = (hsize_t)mpi_rank * block[0];
stride[1] = 1;
start[0] = 0;
- start[1] = mpi_rank*block[1];
+ start[1] = (hsize_t)mpi_rank*block[1];
}
/* If the testname was not already set by the RESET case */
@@ -3237,7 +3237,7 @@ test_actual_io_mode(int selection_mode) {
length = dim0 * dim1;
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * length);
+ buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -3566,8 +3566,8 @@ test_no_collective_cause_mode(int selection_mode)
dims[1] = COL_FACTOR * 6;
}
else {
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
}
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3589,7 +3589,7 @@ test_no_collective_cause_mode(int selection_mode)
/* If we are not testing contiguous datasets */
if(is_chunked) {
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/mpi_size;
+ chunk_dims[0] = dims[0]/(hsize_t)mpi_size;
chunk_dims[1] = dims[1];
ret = H5Pset_chunk(dcpl, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
@@ -3670,10 +3670,10 @@ test_no_collective_cause_mode(int selection_mode)
}
/* Get the number of elements in the selection */
- length = dims[0] * dims[1];
+ H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], uint64_t);
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * length);
+ buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -3864,8 +3864,8 @@ test_no_collective_cause_mode_filter(int selection_mode)
}
/* Create the basic Space */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -3883,7 +3883,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
/* If we are not testing contiguous datasets */
if(is_chunked) {
/* Set up chunk information. */
- chunk_dims[0] = dims[0]/mpi_size;
+ chunk_dims[0] = dims[0]/(hsize_t)mpi_size;
chunk_dims[1] = dims[1];
ret = H5Pset_chunk(dcpl, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
@@ -3913,7 +3913,7 @@ test_no_collective_cause_mode_filter(int selection_mode)
length = dim0 * dim1;
/* Allocate and initialize the buffer */
- buffer = (int *)HDmalloc(sizeof(int) * length);
+ buffer = (int *)HDmalloc(sizeof(int) * (size_t)length);
VRFY((buffer != NULL), "HDmalloc of buffer succeeded");
for(i = 0; i < length; i++)
buffer[i] = i;
@@ -4099,10 +4099,10 @@ dataset_atomicity(void)
buf_size = dim0 * dim1;
/* allocate memory for data buffer */
- write_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
/* setup file access template */
@@ -4118,8 +4118,8 @@ dataset_atomicity(void)
VRFY((ret >= 0), "H5Pclose succeeded");
/* setup dimensionality object */
- dims[0] = dim0;
- dims[1] = dim1;
+ dims[0] = (hsize_t)dim0;
+ dims[1] = (hsize_t)dim1;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -4257,10 +4257,10 @@ dataset_atomicity(void)
VRFY((dataset2 >= 0), "H5Dopen2 succeeded");
/* allocate memory for data buffer */
- write_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((write_buf != NULL), "write_buf HDcalloc succeeded");
/* allocate memory for data buffer */
- read_buf = (int *)HDcalloc(buf_size, sizeof(int));
+ read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int));
VRFY((read_buf != NULL), "read_buf HDcalloc succeeded");
for (i=0 ; i<buf_size ; i++) {
@@ -4277,12 +4277,12 @@ dataset_atomicity(void)
VRFY((atomicity == TRUE), "atomcity set failed");
- block[0] = dim0/mpi_size - 1;
- block[1] = dim1/mpi_size - 1;
+ block[0] = (hsize_t)(dim0/mpi_size - 1);
+ block[1] = (hsize_t)(dim1/mpi_size - 1);
stride[0] = block[0] + 1;
stride[1] = block[1] + 1;
- count[0] = mpi_size;
- count[1] = mpi_size;
+ count[0] = (hsize_t)mpi_size;
+ count[1] = (hsize_t)mpi_size;
start[0] = 0;
start[1] = 0;
@@ -4338,19 +4338,19 @@ dataset_atomicity(void)
compare = 5;
for (i=0 ; i<dim0 ; i++) {
- if (i >= mpi_rank*(block[0]+1)) {
+ if ((hsize_t)i >= (hsize_t)mpi_rank*(block[0]+1)) {
break;
}
- if ((i+1)%(block[0]+1)==0) {
+ if (((hsize_t)i+1)%(block[0]+1)==0) {
k += dim1;
continue;
}
for (j=0 ; j<dim1 ; j++) {
- if (j >= mpi_rank*(block[1]+1)) {
- k += dim1 - mpi_rank*(block[1]+1);
+ if ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) {
+ H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1), hsize_t);
break;
}
- if ((j+1)%(block[1]+1)==0) {
+ if (((hsize_t)j+1)%(block[1]+1)==0) {
k++;
continue;
}
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 99ac189..6183b8d 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -471,19 +471,19 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str
grp_id = H5Gcreate2(file_id, "GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((grp_id >= 0), "");
- dims[0] = ROW_FACTOR*mpi_size;
- dims[1] = COL_FACTOR*mpi_size;
+ dims[0] = (hsize_t)(ROW_FACTOR*mpi_size);
+ dims[1] = (hsize_t)(COL_FACTOR*mpi_size);
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank*block[0];
+ start[0] = (hsize_t)mpi_rank*block[0];
start[1] = 0;
num_elements = block[0] * block[1];
@@ -632,17 +632,17 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy,
grp_id = H5Gopen2(file_id, "GROUP", H5P_DEFAULT);
VRFY((grp_id >= 0), "");
- dims[0] = ROW_FACTOR*mpi_size;
- dims[1] = COL_FACTOR*mpi_size;
+ dims[0] = (hsize_t)(ROW_FACTOR*mpi_size);
+ dims[1] = (hsize_t)(COL_FACTOR*mpi_size);
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank*block[0];
+ start[0] = (hsize_t)mpi_rank*block[0];
start[1] = 0;
num_elements = block[0] * block[1];
diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c
index cabb51e..7b0e677 100644
--- a/testpar/t_filter_read.c
+++ b/testpar/t_filter_read.c
@@ -74,10 +74,10 @@ filter_read_internal(const char *filename, hid_t dcpl,
hs_size[0] = size[0] = HS_DIM1;
hs_size[1] = HS_DIM2;
- size[1] = hs_size[1] * mpi_size;
+ size[1] = hs_size[1] * (hsize_t)mpi_size;
hs_offset[0] = 0;
- hs_offset[1] = hs_size[1] * mpi_rank;
+ hs_offset[1] = hs_size[1] * (hsize_t)mpi_rank;
/* Create the data space */
sid = H5Screate_simple(2, size, NULL);
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index ee868ee..6cdb0af7 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -157,11 +157,12 @@ void multiple_dset_write(void)
ndatasets = pt->count;
size = get_size();
+ H5_CHECK_OVERFLOW(size, int, size_t);
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- outme = HDmalloc((size_t)(size * size * sizeof(double)));
+ outme = HDmalloc((size_t)size * (size_t)size * sizeof(double));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
@@ -238,15 +239,15 @@ void compact_dataset(void)
size = get_size();
for(i = 0; i < DIM; i++ )
- file_dims[i] = size;
+ file_dims[i] = (hsize_t)size;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
- outme = HDmalloc((size_t)(size * size * sizeof(double)));
+ outme = HDmalloc((size_t)((size_t)size * (size_t)size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
- inme = HDmalloc((size_t)(size * size * sizeof(double)));
+ inme = HDmalloc((size_t)size * (size_t)size * sizeof(double));
VRFY((outme != NULL), "HDmalloc succeeded for inme");
filename = GetTestParameters();
@@ -363,7 +364,7 @@ void null_dataset(void)
hid_t iof, plist, dxpl, dataset, attr, sid;
unsigned uval=2; /* Buffer for writing to dataset */
int val=1; /* Buffer for writing to attribute */
- int nelem;
+ hssize_t nelem;
char dname[]="dataset";
char attr_name[]="attribute";
herr_t ret;
@@ -627,7 +628,7 @@ void dataset_fillvalue(void)
/* Set the dataset dimension to be one row more than number of processes */
/* and calculate the actual dataset size. */
- dset_dims[0]=mpi_size+1;
+ dset_dims[0]=(hsize_t)(mpi_size+1);
dset_size=dset_dims[0]*dset_dims[1]*dset_dims[2]*dset_dims[3];
/* Allocate space for the buffers */
@@ -720,7 +721,7 @@ void dataset_fillvalue(void)
* Each process writes 1 row of data. Thus last row is not written.
*/
/* Create hyperslabs in memory and file dataspaces */
- req_start[0]=mpi_rank;
+ req_start[0]=(hsize_t)mpi_rank;
ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace");
ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL);
@@ -878,7 +879,7 @@ void collective_group_write(void)
chunk_size[0] =(hsize_t)(size / 2);
chunk_size[1] =(hsize_t)(size / 2);
- outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outme = HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type);
@@ -1002,10 +1003,10 @@ group_dataset_read(hid_t fid, int mpi_rank, int m)
size = get_size();
- indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((indata != NULL), "HDmalloc succeeded for indata");
- outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
/* open every group under root group. */
@@ -1173,7 +1174,7 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid)
size = get_size();
- outme = HDmalloc((size_t)(size * size * sizeof(double)));
+ outme = HDmalloc((size_t)size * (size_t)size * sizeof(double));
VRFY((outme != NULL), "HDmalloc succeeded for outme");
for(n = 0; n < NDATASET; n++) {
@@ -1333,10 +1334,10 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid)
size = get_size();
- indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((indata != NULL), "HDmalloc succeeded for indata");
- outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE)));
+ outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE));
VRFY((outdata != NULL), "HDmalloc succeeded for outdata");
for(n=0; n<NDATASET; n++) {
@@ -1490,8 +1491,8 @@ check_value(DATATYPE *indata, DATATYPE *outdata, int size)
get_slab(chunk_origin, chunk_dims, count, NULL, size);
- indata += chunk_origin[0]*size;
- outdata += chunk_origin[0]*size;
+ indata += chunk_origin[0]*(hsize_t)size;
+ outdata += chunk_origin[0]*(hsize_t)size;
for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++)
for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
if(*indata != *outdata )
@@ -1524,15 +1525,15 @@ get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[],
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
if(chunk_origin != NULL) {
- chunk_origin[0] = mpi_rank *(size/mpi_size);
+ chunk_origin[0] = (hsize_t)mpi_rank * (hsize_t)(size/mpi_size);
chunk_origin[1] = 0;
}
if(chunk_dims != NULL) {
- chunk_dims[0] = size/mpi_size;
- chunk_dims[1] = size;
+ chunk_dims[0] = (hsize_t)(size/mpi_size);
+ chunk_dims[1] = (hsize_t)size;
}
if(file_dims != NULL)
- file_dims[0] = file_dims[1] = size;
+ file_dims[0] = file_dims[1] = (hsize_t)size;
if(count != NULL)
count[0] = count[1] = 1;
}
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index fe78317..064fb57 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -302,8 +302,8 @@ static int test_mpio_gb_file(char *filename) {
"proc %d: write to mpi_off=%016llx, %lld\n",
mpi_rank, mpi_off, mpi_off);
/* set data to some trivial pattern for easy verification */
- for (j = 0; j < MB; j++)
- *(buf + j) = (int8_t)(i * mpi_size + mpi_rank);
+ for (j = 0; j < MB; j++)
+ H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int);
if (VERBOSE_MED)
HDfprintf(stdout,
"proc %d: writing %d bytes at offset %lld\n",
@@ -351,7 +351,7 @@ static int test_mpio_gb_file(char *filename) {
mrc = MPI_File_read_at(fh, mpi_off, buf, MB, MPI_BYTE,
&mpi_stat);
INFO((mrc == MPI_SUCCESS), "GB size file read");
- expected = (int8_t)(i * mpi_size + (mpi_size - mpi_rank - 1));
+ H5_CHECKED_ASSIGN(expected, int8_t, i * mpi_size + (mpi_size - mpi_rank - 1), int);
vrfyerrs = 0;
for (j = 0; j < MB; j++) {
if ((*(buf + j) != expected)
@@ -526,7 +526,7 @@ static int test_mpio_1wMr(char *filename, int special_request) {
* ==================================================*/
irank = 0;
for (i = 0; i < DIMSIZE; i++)
- H5_CHECKED_ASSIGN(writedata[i], uint8_t, irank * DIMSIZE + i, int)
+ H5_CHECKED_ASSIGN(writedata[i], uint8_t, irank * DIMSIZE + i, int)
mpi_off = irank * DIMSIZE;
/* Only one process writes */
@@ -697,7 +697,7 @@ static int test_mpio_derived_dtype(char *filename) {
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
retcode = 0;
for (i = 0; i < 3; i++)
- H5_CHECKED_ASSIGN(buf[i], int8_t, i + 1, int);
+ buf[i] = (char)(i + 1);
if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename,
MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh))
diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c
index d75e627..fc9d475 100644
--- a/testpar/t_prestart.c
+++ b/testpar/t_prestart.c
@@ -81,13 +81,13 @@ main (int argc, char **argv)
VRFY((data_array != NULL), "data_array HDmalloc succeeded");
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank*block[0];
+ start[0] = (hsize_t)mpi_rank*block[0];
start[1] = 0;
ret = H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block);
@@ -109,7 +109,7 @@ main (int argc, char **argv)
if(*dataptr != mpi_rank+1) {
HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n",
(unsigned long)i, (unsigned long)j,
- (unsigned long)(i+start[0]), (unsigned long)(j+start[1]),
+ (unsigned long)((hsize_t)i+start[0]), (unsigned long)((hsize_t)j+start[1]),
mpi_rank+1, *(dataptr));
nerrors ++;
}
diff --git a/testpar/t_prop.c b/testpar/t_prop.c
index fd89c6a..62e4dde 100644
--- a/testpar/t_prop.c
+++ b/testpar/t_prop.c
@@ -53,7 +53,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc)
void *rbuf;
MPI_Recv(&recv_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status);
- buf_size = recv_size;
+ buf_size = (size_t)recv_size;
rbuf = (uint8_t *)HDmalloc(buf_size);
MPI_Recv(rbuf, recv_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status);
diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c
index def7071..ddbae9e 100644
--- a/testpar/t_pshutdown.c
+++ b/testpar/t_pshutdown.c
@@ -68,8 +68,8 @@ main (int argc, char **argv)
grp_id = H5Gcreate2(file_id, "Group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
VRFY((grp_id >= 0), "H5Gcreate succeeded");
- dims[0] = ROW_FACTOR*mpi_size;
- dims[1] = COL_FACTOR*mpi_size;
+ dims[0] = (hsize_t)ROW_FACTOR*(hsize_t)mpi_size;
+ dims[1] = (hsize_t)COL_FACTOR*(hsize_t)mpi_size;
sid = H5Screate_simple (RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded");
@@ -81,13 +81,13 @@ main (int argc, char **argv)
VRFY((data_array != NULL), "data_array HDmalloc succeeded");
/* Each process takes a slabs of rows. */
- block[0] = dims[0]/mpi_size;
+ block[0] = dims[0]/(hsize_t)mpi_size;
block[1] = dims[1];
stride[0] = block[0];
stride[1] = block[1];
count[0] = 1;
count[1] = 1;
- start[0] = mpi_rank*block[0];
+ start[0] = (hsize_t)mpi_rank*block[0];
start[1] = 0;
/* put some trivial data in the data_array */
diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c
index c3cc7b5..e1a86a1 100644
--- a/testpar/t_span_tree.c
+++ b/testpar/t_span_tree.c
@@ -246,19 +246,19 @@ void coll_write_test(int chunk_factor)
* Buffers' initialization.
*/
- mdim1[0] = MSPACE1_DIM *mpi_size;
+ mdim1[0] = (hsize_t)(MSPACE1_DIM*mpi_size);
mdim[0] = MSPACE_DIM1;
- mdim[1] = MSPACE_DIM2*mpi_size;
+ mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size);
fsdim[0] = FSPACE_DIM1;
- fsdim[1] = FSPACE_DIM2*mpi_size;
+ fsdim[1] = (hsize_t)(FSPACE_DIM2*mpi_size);
- vector = (int*)HDmalloc(sizeof(int)*mdim1[0]*mpi_size);
- matrix_out = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size);
- matrix_out1 = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size);
+ vector = (int*)HDmalloc(sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size);
+ matrix_out = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size);
+ matrix_out1 = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size);
- HDmemset(vector,0,sizeof(int)*mdim1[0]*mpi_size);
+ HDmemset(vector,0,sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size);
vector[0] = vector[MSPACE1_DIM*mpi_size - 1] = -1;
- for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) vector[i] = i;
+ for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) H5_CHECKED_ASSIGN(vector[i], int, i, unsigned);
/* Grab file access property list */
facc_plist = create_faccess_plist(comm, info, facc_type);
@@ -280,8 +280,8 @@ void coll_write_test(int chunk_factor)
VRFY((ret >= 0),"Fill value creation property list succeeded");
if(chunk_factor != 0) {
- chunk_dims[0] = fsdim[0] / chunk_factor;
- chunk_dims[1] = fsdim[1] / chunk_factor;
+ chunk_dims[0] = fsdim[0] / (hsize_t)chunk_factor;
+ chunk_dims[1] = fsdim[1] / (hsize_t)chunk_factor;
ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims);
VRFY((ret >= 0),"chunk creation property list succeeded");
}
@@ -317,7 +317,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = FHSTART0;
- start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1;
+ start[1] = (hsize_t)(FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1);
stride[0] = FHSTRIDE0;
stride[1] = FHSTRIDE1;
count[0] = FHCOUNT0;
@@ -338,7 +338,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = SHSTART0;
- start[1] = SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank;
+ start[1] = (hsize_t)(SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank);
stride[0] = SHSTRIDE0;
stride[1] = SHSTRIDE1;
count[0] = SHCOUNT0;
@@ -476,7 +476,7 @@ void coll_write_test(int chunk_factor)
*
*/
start[0] = RFFHSTART0;
- start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1;
+ start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1);
block[0] = RFFHBLOCK0;
block[1] = RFFHBLOCK1;
stride[0] = RFFHSTRIDE0;
@@ -503,7 +503,7 @@ void coll_write_test(int chunk_factor)
*/
start[0] = RFSHSTART0;
- start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank;
+ start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank);
block[0] = RFSHBLOCK0;
block[1] = RFSHBLOCK1;
stride[0] = RFSHSTRIDE0;
@@ -542,7 +542,7 @@ void coll_write_test(int chunk_factor)
start[0] = RMFHSTART0;
- start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1;
+ start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1);
block[0] = RMFHBLOCK0;
block[1] = RMFHBLOCK1;
stride[0] = RMFHSTRIDE0;
@@ -565,7 +565,7 @@ void coll_write_test(int chunk_factor)
*
*/
start[0] = RMSHSTART0;
- start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1;
+ start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1);
block[0] = RMSHBLOCK0;
block[1] = RMSHBLOCK1;
stride[0] = RMSHSTRIDE0;
@@ -580,8 +580,8 @@ void coll_write_test(int chunk_factor)
* Initialize data buffer.
*/
- HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
- HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
+ HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
+ HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
/*
* Read data back to the buffer matrix_out.
*/
@@ -704,9 +704,9 @@ coll_read_test(void)
/* Initialize the buffer */
mdim[0] = MSPACE_DIM1;
- mdim[1] = MSPACE_DIM2*mpi_size;
- matrix_out =(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
- matrix_out1=(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
+ mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size);
+ matrix_out =(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
+ matrix_out1=(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
/*** For testing collective hyperslab selection read ***/
@@ -741,7 +741,7 @@ coll_read_test(void)
*
*/
start[0] = RFFHSTART0;
- start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1;
+ start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1);
block[0] = RFFHBLOCK0;
block[1] = RFFHBLOCK1;
stride[0] = RFFHSTRIDE0;
@@ -761,7 +761,7 @@ coll_read_test(void)
*
*/
start[0] = RFSHSTART0;
- start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank;
+ start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank);
block[0] = RFSHBLOCK0;
block[1] = RFSHBLOCK1;
stride[0] = RFSHSTRIDE0;
@@ -791,7 +791,7 @@ coll_read_test(void)
*/
start[0] = RMFHSTART0;
- start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1;
+ start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1);
block[0] = RMFHBLOCK0;
block[1] = RMFHBLOCK1;
stride[0] = RMFHSTRIDE0;
@@ -813,7 +813,7 @@ coll_read_test(void)
*
*/
start[0] = RMSHSTART0;
- start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1;
+ start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1);
block[0] = RMSHBLOCK0;
block[1] = RMSHBLOCK1;
stride[0] = RMSHSTRIDE0;
@@ -828,8 +828,8 @@ coll_read_test(void)
* Initialize data buffer.
*/
- HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
- HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size);
+ HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
+ HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size);
/*
* Read data back to the buffer matrix_out.
@@ -1004,9 +1004,9 @@ lower_dim_size_comp_test__select_checker_board(
* pre-C99 compilers again.
*/
- base_count = dims[sel_offset] / (checker_edge_size * 2);
+ base_count = dims[sel_offset] / (hsize_t)(checker_edge_size * 2);
- if ( (dims[sel_rank] % (checker_edge_size * 2)) > 0 ) {
+ if ( (dims[sel_rank] % (hsize_t)(checker_edge_size * 2)) > 0 ) {
base_count++;
}
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 870c256..7830e25 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -274,7 +274,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2
trav_table_t *table = NULL;
size_t idx;
- H5TOOLS_DEBUG("build_match_list start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/* init */
trav_table_init(info1->fid, &table);
if (table == NULL) {
@@ -382,7 +382,7 @@ build_match_list (const char *objname1, trav_info_t *info1, const char *objname2
done:
*table_out = table;
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
@@ -416,6 +416,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata)
const char *ext_path;
herr_t ret_value = SUCCEED;
+ H5TOOLS_START_DEBUG("");
/* init linkinfo struct */
HDmemset(&lnk_info, 0, sizeof(h5tool_link_info_t));
@@ -499,7 +500,7 @@ trav_grp_symlinks(const char *path, const H5L_info2_t *linfo, void *udata)
done:
if (lnk_info.trg_path)
HDfree(lnk_info.trg_path);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -514,11 +515,7 @@ done:
*-------------------------------------------------------------------------
*/
hsize_t
-h5diff(const char *fname1,
- const char *fname2,
- const char *objname1,
- const char *objname2,
- diff_opt_t *opts)
+h5diff(const char *fname1, const char *fname2, const char *objname1, const char *objname2, diff_opt_t *opts)
{
hid_t file1_id = H5I_INVALID_HID;
hid_t file2_id = H5I_INVALID_HID;
@@ -552,7 +549,7 @@ h5diff(const char *fname1,
trav_table_t *match_list = NULL;
diff_err_t ret_value = H5DIFF_NO_ERR;
- H5TOOLS_DEBUG("h5diff start");
+ H5TOOLS_START_DEBUG("");
/* init filenames */
HDmemset(filenames, 0, MAX_FILENAME * 2);
/* init link info struct */
@@ -972,9 +969,8 @@ done:
H5Fclose(file2_id);
} H5E_END_TRY;
- H5TOOLS_DEBUG("h5diff finish - errstat:%d", opts->err_stat);
+ H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
return nfound;
}
@@ -1012,7 +1008,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
size_t idx2 = 0;
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_DEBUG("diff_match start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/*
* if not root, prepare object name to be pre-appended to group path to
* make full path
@@ -1052,7 +1048,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
*/
#ifdef H5_HAVE_PARALLEL
{
- char *workerTasks = (char*)HDmalloc((g_nTasks - 1) * sizeof(char));
+ char *workerTasks = (char*)HDmalloc((size_t)(g_nTasks - 1) * sizeof(char));
int n;
int busyTasks = 0;
struct diffs_found nFoundbyWorker;
@@ -1061,7 +1057,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
MPI_Status Status;
/*set all tasks as free */
- HDmemset(workerTasks, 1, (g_nTasks - 1));
+ HDmemset(workerTasks, 1, (size_t)(g_nTasks - 1) * sizeof(char));
#endif
for(i = 0; i < table->nobjs; i++) {
@@ -1350,7 +1346,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
} /* end while */
for(i = 1; i < g_nTasks; i++)
- MPI_Send(NULL, 0, MPI_BYTE, i, MPI_TAG_END, MPI_COMM_WORLD);
+ MPI_Send(NULL, 0, MPI_BYTE, (int)i, MPI_TAG_END, MPI_COMM_WORLD);
/* Print any final data waiting in our queue */
print_incoming_data();
@@ -1367,9 +1363,8 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
if (table)
trav_table_free(table);
- H5TOOLS_DEBUG("diff_match finish diffs=%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(" diffs=%d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
return nfound;
}
@@ -1388,12 +1383,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1,
*-------------------------------------------------------------------------
*/
hsize_t
-diff(hid_t file1_id,
- const char *path1,
- hid_t file2_id,
- const char *path2,
- diff_opt_t * opts,
- diff_args_t *argdata)
+diff(hid_t file1_id, const char *path1, hid_t file2_id, const char *path2, diff_opt_t * opts, diff_args_t *argdata)
{
int status = -1;
hid_t dset1_id = H5I_INVALID_HID;
@@ -1413,7 +1403,7 @@ diff(hid_t file1_id,
h5tool_link_info_t linkinfo1;
h5tool_link_info_t linkinfo2;
- H5TOOLS_DEBUG("diff start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/*init link info struct */
HDmemset(&linkinfo1, 0, sizeof(h5tool_link_info_t));
@@ -1803,9 +1793,8 @@ done:
/* enable error reporting */
} H5E_END_TRY;
- H5TOOLS_DEBUG("diff finish:%d - errstat:%d", nfound, opts->err_stat);
+ H5TOOLS_ENDDEBUG(": %d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
return nfound;
}
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index e99b2cc..6cfe3d2 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -261,19 +261,9 @@ static void close_member_types(mcomp_t *members);
*-------------------------------------------------------------------------
*/
-hsize_t diff_array(
- void *_mem1,
- void *_mem2,
- hsize_t nelmts,
- hsize_t hyper_start,
- int rank,
- hsize_t *dims,
- diff_opt_t *opts,
- const char *name1,
- const char *name2,
- hid_t m_type,
- hid_t container1_id,
- hid_t container2_id) /* dataset where the reference came from*/
+hsize_t diff_array(void *_mem1, void *_mem2, hsize_t nelmts, hsize_t hyper_start,
+ int rank, hsize_t *dims, diff_opt_t *opts, const char *name1, const char *name2,
+ hid_t m_type, hid_t container1_id, hid_t container2_id)
{
hsize_t nfound = 0; /* number of differences found */
size_t size; /* size of datum */
@@ -287,7 +277,7 @@ hsize_t diff_array(
mcomp_t members;
H5T_class_t type_class;
- H5TOOLS_DEBUG("diff_array start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/* get the size. */
size = H5Tget_size(m_type);
type_class = H5Tget_class(m_type);
@@ -384,7 +374,7 @@ hsize_t diff_array(
} /* switch */
H5TOOLS_DEBUG("diff_array finish:%d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG("exit: %d", nfound);
+ H5TOOLS_ENDDEBUG(": %d", nfound);
return nfound;
}
@@ -421,20 +411,9 @@ hsize_t diff_array(
* Dereference the object and compare the type (basic object type).
*-------------------------------------------------------------------------
*/
-static hsize_t diff_datum(
- void *_mem1,
- void *_mem2,
- hid_t m_type,
- hsize_t index,
- int rank,
- hsize_t *dims,
- hsize_t *acc,
- hsize_t *pos,
- diff_opt_t *opts,
- const char *obj1,
- const char *obj2,
- hid_t container1_id,
- hid_t container2_id, /*where the reference came from*/
+static hsize_t diff_datum(void *_mem1, void *_mem2, hid_t m_type, hsize_t index, int rank,
+ hsize_t *dims, hsize_t *acc, hsize_t *pos, diff_opt_t *opts, const char *obj1, const char *obj2,
+ hid_t container1_id, hid_t container2_id,
int *ph, /*print header */
mcomp_t *members) /*compound members */
{
@@ -456,7 +435,7 @@ static hsize_t diff_datum(
hbool_t both_zero;
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_DEBUG("diff_datum start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
type_size = H5Tget_size(m_type);
type_class = H5Tget_class(m_type);
@@ -2238,7 +2217,7 @@ done:
H5TOOLS_DEBUG("diff_datum finish:%d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return nfound;
}
@@ -2327,7 +2306,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
hsize_t nfound_p = 0; /* point differences found */
hsize_t ret_value = 0;
- H5TOOLS_DEBUG("diff_region start");
+ H5TOOLS_START_DEBUG("");
ndims1 = H5Sget_simple_extent_ndims(region1_id);
ndims2 = H5Sget_simple_extent_ndims(region2_id);
@@ -2508,7 +2487,7 @@ static hsize_t diff_region(hid_t obj1_id, hid_t obj2_id, hid_t region1_id, hid_t
ret_value = nfound_p + nfound_b;
done:
- H5TOOLS_ENDDEBUG("exit with diffs:%d", ret_value);
+ H5TOOLS_ENDDEBUG(" with diffs:%d", ret_value);
return ret_value;
}
@@ -2530,7 +2509,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
HDmemcpy(&temp1_uchar, mem1, sizeof(unsigned char));
HDmemcpy(&temp2_uchar, mem2, sizeof(unsigned char));
- H5TOOLS_DEBUG("character_compare start %d=%d",temp1_uchar,temp2_uchar);
+ H5TOOLS_START_DEBUG(" %d=%d",temp1_uchar,temp2_uchar);
if (temp1_uchar != temp2_uchar) {
if (print_data(opts)) {
@@ -2543,9 +2522,7 @@ static hsize_t character_compare(char *mem1, char *mem2, hsize_t i, size_t u,
}
nfound++;
}
- H5TOOLS_DEBUG("character_compare finish");
-
- H5TOOLS_ENDDEBUG("exit: %d", nfound);
+ H5TOOLS_ENDDEBUG(": %d", nfound);
return nfound;
}
@@ -4523,7 +4500,7 @@ int ull2float(unsigned long long ull_value, float *f_value)
size_t dst_size;
int ret_value = 0;
- H5TOOLS_DEBUG("ull2float start");
+ H5TOOLS_START_DEBUG("");
if ((dxpl_id = H5Pcreate(H5P_DATASET_XFER)) < 0)
H5TOOLS_GOTO_ERROR(FAIL, "H5Pcreate failed");
@@ -4548,9 +4525,7 @@ done:
if (buf)
HDfree(buf);
- H5TOOLS_DEBUG("ull2float finish");
-
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -4628,7 +4603,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts)
return FALSE;
}
- if (H5_DBL_ABS_EQUAL(value, expected))
+ if (H5_LDBL_ABS_EQUAL(value, expected))
return TRUE;
if (opts->use_system_epsilon)
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index d1b4697..087414d 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -153,7 +153,7 @@ static herr_t build_match_list_attrs(hid_t loc1_id, hid_t loc2_id, table_attrs_t
herr_t ret_value = SUCCEED;
- H5TOOLS_DEBUG("build_match_list_attrs start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
if(H5Oget_info3(loc1_id, &oinfo1, H5O_INFO_NUM_ATTRS) < 0) {
H5TOOLS_GOTO_ERROR(FAIL, "H5Oget_info first object failed");
@@ -299,9 +299,8 @@ done:
H5Aclose(attr2_id);
} H5E_END_TRY;
- H5TOOLS_DEBUG("build_match_list_attrs end - errstat:%d", opts->err_stat);
+ H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
return ret_value;
}
@@ -340,7 +339,7 @@ hsize_t diff_attr_data(hid_t attr1_id, hid_t attr2_id, const char *name1, const
int j;
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_DEBUG("diff_attr_data start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/* get the datatypes */
if((ftype1_id = H5Aget_type(attr1_id)) < 0)
@@ -517,9 +516,8 @@ done:
H5Sclose(space2_id);
} H5E_END_TRY;
- H5TOOLS_DEBUG("diff_attr_data end - errstat:%d", opts->err_stat);
+ H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
return nfound;
}
@@ -548,7 +546,7 @@ hsize_t diff_attr(hid_t loc1_id, hid_t loc2_id, const char *path1, const char *p
hsize_t nfound_total = 0;
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_DEBUG("diff_attr start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
if(build_match_list_attrs(loc1_id, loc2_id, &match_list_attrs, opts) < 0) {
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "build_match_list_attrs failed");
@@ -600,8 +598,7 @@ done:
H5Aclose(attr2_id);
} H5E_END_TRY;
- H5TOOLS_DEBUG("diff_attr end - errstat:%d", opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG(" - errstat:%d", opts->err_stat);
return nfound_total;
}
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index f757f92..cea20a8 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -27,11 +27,7 @@
* Return: Number of differences found
*-------------------------------------------------------------------------
*/
-hsize_t diff_dataset(hid_t file1_id,
- hid_t file2_id,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *opts)
+hsize_t diff_dataset(hid_t file1_id, hid_t file2_id, const char *obj1_name, const char *obj2_name, diff_opt_t *opts)
{
int status = -1;
hid_t did1 = H5I_INVALID_HID;
@@ -41,7 +37,7 @@ hsize_t diff_dataset(hid_t file1_id,
hsize_t nfound = 0;
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_DEBUG("diff_dataset start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/*-------------------------------------------------------------------------
* open the handles
*-------------------------------------------------------------------------
@@ -92,8 +88,7 @@ done:
/* enable error reporting */
} H5E_END_TRY;
- H5TOOLS_DEBUG("diff_dataset finish:%d - errstat:%d", nfound, opts->err_stat);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG(":%d - errstat:%d", nfound, opts->err_stat);
return nfound;
}
@@ -148,11 +143,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-hsize_t diff_datasetid(hid_t did1,
- hid_t did2,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *opts)
+hsize_t diff_datasetid(hid_t did1, hid_t did2, const char *obj1_name, const char *obj2_name, diff_opt_t *opts)
{
hid_t sid1 = H5I_INVALID_HID;
hid_t sid2 = H5I_INVALID_HID;
@@ -197,7 +188,7 @@ hsize_t diff_datasetid(hid_t did1,
unsigned int vl_data2 = 0; /*contains VL datatypes */
diff_err_t ret_value = opts->err_stat;
- H5TOOLS_DEBUG("diff_datasetid start - errstat:%d", opts->err_stat);
+ H5TOOLS_START_DEBUG(" - errstat:%d", opts->err_stat);
/* Get the dataspace handle */
if((sid1 = H5Dget_space(did1)) < 0)
H5TOOLS_GOTO_ERROR(H5DIFF_ERR, "H5Dget_space failed");
@@ -606,8 +597,7 @@ done:
/* enable error reporting */
} H5E_END_TRY;
- H5TOOLS_DEBUG("diff_datasetid return:%d with nfound:%d", ret_value, nfound);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG(": %d with nfound:%d", ret_value, nfound);
return nfound;
}
@@ -623,18 +613,10 @@ done:
*-------------------------------------------------------------------------
*/
-int diff_can_type(hid_t f_tid1, /* file data type */
- hid_t f_tid2, /* file data type */
- int rank1,
- int rank2,
- hsize_t *dims1,
- hsize_t *dims2,
- hsize_t *maxdim1,
- hsize_t *maxdim2,
- const char *obj1_name,
- const char *obj2_name,
- diff_opt_t *opts,
- int is_compound)
+int diff_can_type(hid_t f_tid1, hid_t f_tid2, int rank1, int rank2,
+ hsize_t *dims1, hsize_t *dims2, hsize_t *maxdim1, hsize_t *maxdim2,
+ const char *obj1_name, const char *obj2_name,
+ diff_opt_t *opts, int is_compound)
{
H5T_class_t tclass1;
H5T_class_t tclass2;
@@ -643,7 +625,7 @@ int diff_can_type(hid_t f_tid1, /* file data type */
int i;
int ret_value = 1;
- H5TOOLS_DEBUG("diff_can_type start");
+ H5TOOLS_START_DEBUG("");
/*-------------------------------------------------------------------------
* check for the same class
*-------------------------------------------------------------------------
@@ -851,8 +833,7 @@ done:
if (ret_value < 0)
opts->err_stat = H5DIFF_ERR;
- H5TOOLS_DEBUG("diff_can_type end - %d", ret_value);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG(" - %d", ret_value);
return ret_value;
}
diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c
index 8da995a..59b11d6 100644
--- a/tools/lib/h5diff_util.c
+++ b/tools/lib/h5diff_util.c
@@ -341,6 +341,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
{
herr_t ret_value = SUCCEED;
+ H5TOOLS_START_DEBUG("");
if((*m_size1) != (*m_size2)) {
if((*m_size1) < (*m_size2)) {
H5Tclose(*m_tid1);
@@ -363,7 +364,7 @@ herr_t match_up_memsize (hid_t f_tid1_id, hid_t f_tid2_id,
H5TOOLS_GOTO_ERROR(FAIL, "native type sizes do not compare");
done:
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index cb9b92c..47f6e3f 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -22,6 +22,12 @@
#include "h5tools_utils.h"
#include "H5private.h"
+#ifdef H5_TOOLS_DEBUG
+/* global debug variables */
+int H5tools_INDENT_g = 0;
+#endif
+
+
/* global variables */
hid_t H5tools_ERR_STACK_g = 0;
hid_t H5tools_ERR_CLS_g = H5I_INVALID_HID;
@@ -741,7 +747,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
if (!ctx->need_prefix)
return;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
HDmemset(&prefix, 0, sizeof(h5tools_str_t));
HDmemset(&str, 0, sizeof(h5tools_str_t));
@@ -809,7 +815,7 @@ h5tools_simple_prefix(FILE *stream, const h5tool_format_t *info,
h5tools_str_close(&prefix);
h5tools_str_close(&str);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
@@ -934,7 +940,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info,
if (stream == NULL)
return dimension_break;
- H5TOOLS_DEBUG("enter need_prefix=%d", ctx->need_prefix);
+ H5TOOLS_START_DEBUG(" need_prefix=%d", ctx->need_prefix);
H5TOOLS_DEBUG("elmt_counter=%ld - local_elmt_counter=%ld", elmt_counter, local_elmt_counter);
s = h5tools_str_fmt(buffer, (size_t)0, "%s");
@@ -1061,7 +1067,7 @@ h5tools_render_element(FILE *stream, const h5tool_format_t *info,
ctx->prev_multiline = multiline;
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return dimension_break;
}
@@ -1102,7 +1108,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
int secnum; /* section sequence number */
int multiline; /* datum was multiline */
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
H5TOOLS_DEBUG("elmt_counter=%ld - local_elmt_counter=%ld", elmt_counter, local_elmt_counter);
s = h5tools_str_fmt(buffer, (size_t)0, "%s");
@@ -1212,7 +1218,7 @@ h5tools_render_region_element(FILE *stream, const h5tool_format_t *info,
ctx->prev_multiline = multiline;
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return dimension_break;
}
@@ -1231,7 +1237,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
int i;
unsigned j;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
if(ctx->ndims > 0) {
ctx->acc[ctx->ndims - 1] = 1;
@@ -1243,7 +1249,7 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims)
ctx->pos[j] = 0;
}
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
@@ -1265,7 +1271,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
hbool_t past_catch = FALSE;
int ret_value = 0;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
if((size = H5Tget_size(tid)) == 0)
H5TOOLS_THROW((-1), "H5Tget_size failed");
@@ -1481,7 +1487,7 @@ render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t
} /* end switch */
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1514,6 +1520,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream,
hid_t sid1 = H5I_INVALID_HID;
int ret_value = -1;
+ H5TOOLS_START_DEBUG("");
/* Get the dataspace of the dataset */
if((sid1 = H5Dget_space(region_id)) < 0)
H5TOOLS_THROW((-1), "H5Dget_space failed");
@@ -1580,7 +1587,7 @@ CATCH
if(H5Sclose(sid1) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1609,6 +1616,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id,
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
+ H5TOOLS_START_DEBUG("");
if((snblocks = H5Sget_select_hyper_nblocks(region_space)) <= 0)
H5TOOLS_THROW(FALSE, "H5Sget_select_hyper_nblocks failed");
nblocks = (hsize_t)snblocks;
@@ -1644,7 +1652,7 @@ done:
H5_LEAVE(TRUE)
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1676,6 +1684,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id,
void *region_buf = NULL;
int ret_value = 0;
+ H5TOOLS_START_DEBUG("");
if((type_size = H5Tget_size(type_id)) == 0)
H5TOOLS_GOTO_ERROR((-1), "H5Tget_size failed");
@@ -1705,7 +1714,7 @@ done:
if(H5Sclose(mem_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1732,6 +1741,7 @@ render_bin_output_region_points(hid_t region_space, hid_t region_id,
hbool_t past_catch = FALSE;
hbool_t ret_value = TRUE;
+ H5TOOLS_START_DEBUG("");
if((snpoints = H5Sget_select_elem_npoints(region_space)) <= 0)
H5TOOLS_THROW(FALSE, "H5Sget_select_elem_npoints failed");
npoints = (hsize_t)snpoints;
@@ -1758,7 +1768,7 @@ done:
H5_LEAVE(ret_value)
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c
index 7f29c6b..3cca910 100644
--- a/tools/lib/h5tools_dump.c
+++ b/tools/lib/h5tools_dump.c
@@ -273,7 +273,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai
* to the ctx->size_last_dim. */
int ret_value = 0;
- H5TOOLS_DEBUG("enter file=%p", (void*)stream);
+ H5TOOLS_START_DEBUG(" file=%p", (void*)stream);
H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* binary dump */
if (bin_output && (rawdatastream != NULL)) {
@@ -460,8 +460,7 @@ done:
CATCH
- H5TOOLS_ENDDEBUG("exit");
-
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -484,8 +483,7 @@ CATCH
*-------------------------------------------------------------------------
*/
static int
-h5tools_print_region_data_blocks(hid_t region_id,
- FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx,
+h5tools_print_region_data_blocks(hid_t region_id, FILE *stream, const h5tool_format_t *info, h5tools_context_t *cur_ctx,
h5tools_str_t *buffer, /* string into which to render */
size_t ncols, unsigned ndims, hid_t type_id, hsize_t nblocks, hsize_t *ptdata)
{
@@ -517,7 +515,7 @@ h5tools_print_region_data_blocks(hid_t region_id,
HDmemset(&ctx, 0, sizeof(ctx));
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
if((type_size = H5Tget_size(type_id)) == 0)
H5TOOLS_THROW(FAIL, "H5Tget_size failed");
@@ -635,7 +633,7 @@ done:
if(H5Sclose(sid1) < 0)
H5TOOLS_ERROR(FAIL, "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -690,6 +688,7 @@ h5tools_dump_region_data_blocks(hid_t region_space, hid_t region_id,
HDassert(ctx);
HDassert(buffer);
+ H5TOOLS_START_DEBUG("");
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -853,7 +852,7 @@ done:
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -903,7 +902,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id,
HDassert(ptdata);
HDassert(ndims > 0);
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
HDmemset(&ctx, 0, sizeof(ctx));
/* Allocate space for the dimension array */
@@ -991,7 +990,7 @@ CATCH
if(H5Sclose(mem_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1043,6 +1042,7 @@ h5tools_dump_region_data_points(hid_t region_space, hid_t region_id,
HDassert(ctx);
HDassert(buffer);
+ H5TOOLS_START_DEBUG("");
outputformat = *info;
outputformat.idx_fmt = "";
outputformat.idx_n_fmt = "";
@@ -1202,7 +1202,7 @@ done:
H5_LEAVE(dimension_break)
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1241,8 +1241,7 @@ CATCH
*/
static herr_t
h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
- hid_t dset, hid_t p_type,
- hid_t f_space, hsize_t hyperslab_count,
+ hid_t dset, hid_t p_type, hid_t f_space, hsize_t hyperslab_count,
hsize_t *temp_start, /* start inside offset count loop */
hsize_t *temp_count, /* count inside offset count loop */
hsize_t *temp_block, /* block size used in loop */
@@ -1271,6 +1270,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c
unsigned int vl_data = 0; /* contains VL datatypes */
herr_t ret_value = SUCCEED;
+ H5TOOLS_START_DEBUG("");
if ((size_t) ctx->ndims > NELMTS(sm_size))
H5TOOLS_THROW(FAIL, "ndims and sm_size comparision failed");
@@ -1391,7 +1391,7 @@ CATCH
if(sm_buf)
HDfree(sm_buf);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1568,8 +1568,7 @@ h5tools_display_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools
*-------------------------------------------------------------------------
*/
static herr_t
-h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx,
- hid_t dset, hid_t p_type)
+h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx, hid_t dset, hid_t p_type)
{
int sndims;
hid_t f_space = H5I_INVALID_HID; /* file data space */
@@ -1578,6 +1577,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_co
hbool_t past_catch = FALSE;
herr_t ret_value = SUCCEED;
+ H5TOOLS_START_DEBUG("");
if((f_space = H5Dget_space(dset)) < 0)
H5TOOLS_THROW(FAIL, "H5Dget_space failed");
@@ -1603,7 +1603,7 @@ CATCH
if(f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_THROW(FAIL, "H5Sclose failed");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1656,7 +1656,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont
unsigned int vl_data = 0; /* contains VL datatypes */
int ret_value = 0;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
if (H5I_INVALID_HID == (f_space = H5Dget_space(dset)))
H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
@@ -1796,7 +1796,7 @@ done:
if(f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1827,7 +1827,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte
/* VL data special information */
unsigned int vl_data = 0; /* contains VL datatypes */
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
if (H5I_INVALID_HID == (f_space = H5Aget_space(attr_id)))
H5TOOLS_GOTO_ERROR((-1), "H5Dget_space failed");
@@ -1890,7 +1890,7 @@ done:
if(f_space >= 0 && H5Sclose(f_space) < 0)
H5TOOLS_ERROR((-1), "H5Sclose failed");
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1922,6 +1922,7 @@ h5tools_dump_dset(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tool_format_t info_dflt;
int ret_value = 0;
+ H5TOOLS_START_DEBUG("");
/* Use default values */
if (!stream)
stream = rawoutstream;
@@ -1973,7 +1974,7 @@ done:
if (f_space > 0)
H5Sclose(f_space);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -1997,6 +1998,7 @@ h5tools_dump_mem(FILE *stream, const h5tool_format_t *info, h5tools_context_t *c
h5tool_format_t info_dflt;
int ret_value = 0;
+ H5TOOLS_START_DEBUG("");
/* Use default values */
if (!stream)
stream = rawoutstream;
@@ -2042,7 +2044,7 @@ done:
if (f_space > 0)
H5Sclose(f_space);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -2085,6 +2087,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
const char *order_s = NULL; /* byte order string */
int ret_value = 0;
+ H5TOOLS_START_DEBUG("");
if((type_class = H5Tget_class(type)) < 0)
H5TOOLS_THROW((-1), "H5Tget_class failed");
if (object_search && H5Tcommitted(type) > 0) {
@@ -2635,7 +2638,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_
}
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -2661,6 +2664,7 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
int i;
int ret_value = 0;
+ H5TOOLS_START_DEBUG("");
if((ndims = H5Sget_simple_extent_dims(space, size, maxsize)) < 0)
H5TOOLS_THROW((-1), "H5Sget_simple_extent_dims failed");
@@ -2712,7 +2716,7 @@ h5tools_print_dataspace(h5tools_str_t *buffer, hid_t space)
} /* end switch */
CATCH
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -2747,6 +2751,7 @@ h5tools_print_enum(FILE *stream, h5tools_str_t *buffer, const h5tool_format_t *i
hbool_t past_catch = FALSE;
int ret_value = 0;
+ H5TOOLS_START_DEBUG("");
if (info->line_ncols > 0)
ncols = info->line_ncols;
@@ -2858,7 +2863,7 @@ CATCH
if(0 == nmembs)
h5tools_str_append(buffer, "\n<empty>");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return ret_value;
}
@@ -3991,7 +3996,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, h5tools_context_t *
h5tool_format_t outputformat;
H5R_ref_t *ref_buf = NULL;
- H5TOOLS_DEBUG("enter file=%p", (void*)stream);
+ H5TOOLS_START_DEBUG(" file=%p", (void*)stream);
H5TOOLS_DEBUG("rawdata file=%p", (void*)rawdatastream);
/* setup */
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -4365,6 +4370,6 @@ done:
}
h5tools_str_close(&buffer);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
diff --git a/tools/lib/h5tools_error.h b/tools/lib/h5tools_error.h
index 784b86a..4e2e935 100644
--- a/tools/lib/h5tools_error.h
+++ b/tools/lib/h5tools_error.h
@@ -21,10 +21,9 @@
#include "H5Eprivate.h" /* Error handling */
/* tools-HDF5 Error variables */
+H5TOOLS_DLLVAR int H5tools_INDENT_g;
H5TOOLS_DLLVAR hid_t H5tools_ERR_STACK_g;
-H5TOOLS_DLLVAR hid_t H5tools_DBG_ERR_STACK_g;
H5TOOLS_DLLVAR hid_t H5tools_ERR_CLS_g;
-H5TOOLS_DLLVAR hid_t H5tools_DBG_ERR_CLS_g;
H5TOOLS_DLLVAR hid_t H5E_tools_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_id_g;
H5TOOLS_DLLVAR hid_t H5E_tools_min_info_id_g;
@@ -53,9 +52,6 @@ do {
if ((H5tools_ERR_STACK_g = H5Ecreate_stack()) < 0) \
HDfprintf(stderr, "Failed to create HDF5 tools error stack\n"); \
\
- /* Create new HDF5 error stack for debugging, if tools debugging is enabled */ \
- H5TOOLS_CREATE_DEBUG_STACK(); \
- \
/* Register errors from the HDF5 tools as a new error class */ \
if ((H5tools_ERR_CLS_g = H5Eregister_class("H5tools", "HDF5:tools", lib_str)) < 0) \
HDfprintf(stderr, "Failed to register HDF5 tools error class\n"); \
@@ -96,9 +92,6 @@ do {
if (H5Eunregister_class(H5tools_ERR_CLS_g) < 0) \
HDfprintf(stderr, "Failed to unregister the HDF5 tools error class\n"); \
\
- /* Close the tools debugging error stack, if it was created */ \
- H5TOOLS_CLOSE_DEBUG_STACK(); \
- \
/* Close the tools error stack */ \
if (H5Eclose_stack(H5tools_ERR_STACK_g) < 0) \
HDfprintf(stderr, "Failed to close HDF5 tools error stack\n"); \
@@ -174,47 +167,35 @@ do {
#ifdef H5_TOOLS_DEBUG
-#define H5TOOLS_CREATE_DEBUG_STACK() \
+#define H5TOOLS_START_DEBUG(...) \
do { \
- /* Create new HDF5 error stack for debugging */ \
- if ((H5tools_DBG_ERR_STACK_g = H5Ecreate_stack()) < 0) \
- HDfprintf(stderr, "Failed to create HDF5 tools debugging error stack\n"); \
- \
- /* Register debugging output from the HDF5 tools as a new error class */ \
- if ((H5tools_DBG_ERR_CLS_g = H5Eregister_class("H5tools-debug", "HDF5:tools", lib_str)) < 0) \
- HDfprintf(stderr, "Failed to register HDF5 tools debugging error class\n"); \
-} while(0)
-
-#define H5TOOLS_CLOSE_DEBUG_STACK() \
-do { \
- /* Unregister the HDF5 tools debugging error class */ \
- if (H5Eunregister_class(H5tools_DBG_ERR_CLS_g) < 0) \
- HDfprintf(stderr, "Failed to unregister the HDF5 tools debugging error class\n"); \
- \
- /* Close the tools debugging error stack */ \
- if (H5Eclose_stack(H5tools_DBG_ERR_STACK_g) < 0) \
- HDfprintf(stderr, "Failed to close HDF5 tools debugging error stack\n"); \
+ H5tools_INDENT_g += 2; \
+ HDfprintf(stderr, "%*sENTER %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ HDfflush(stderr); \
} while(0)
-#define H5TOOLS_DEBUG(...) \
-do { \
- H5TOOLS_PUSH_ERROR(H5tools_DBG_ERR_STACK_g, H5tools_DBG_ERR_CLS_g, H5E_tools_g, H5E_tools_min_dbg_id_g, __VA_ARGS__); \
+#define H5TOOLS_DEBUG(...) \
+do { \
+ HDfprintf(stderr, "%*s %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ HDfflush(stderr); \
} while(0)
-#define H5TOOLS_ENDDEBUG(...) \
-do { \
- H5TOOLS_PUSH_ERROR(H5tools_DBG_ERR_STACK_g, H5tools_DBG_ERR_CLS_g, H5E_tools_g, H5E_tools_min_dbg_id_g, __VA_ARGS__); \
- H5Eprint2(H5tools_DBG_ERR_STACK_g, stderr); \
+#define H5TOOLS_ENDDEBUG(...) \
+do { \
+ HDfprintf(stderr, "%*sEXIT %s:%d in %s()...", H5tools_INDENT_g, "", __FILE__, __LINE__, FUNC); \
+ HDfprintf(stderr, __VA_ARGS__); \
+ HDfprintf(stderr, "\n"); \
+ H5tools_INDENT_g -= 2; \
+ HDfflush(stderr); \
} while(0)
#else
-#define H5TOOLS_CREATE_DEBUG_STACK() \
-do { \
- ; \
-} while(0)
-
-#define H5TOOLS_CLOSE_DEBUG_STACK() \
+#define H5TOOLS_START_DEBUG(...) \
do { \
; \
} while(0)
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index c9e7e94..6515ecd 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -292,7 +292,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
size_t i = 0;
hsize_t curr_pos = elmtno;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
H5TOOLS_DEBUG("elmtno=%ld, ctx->ndims=%d", elmtno, ctx->ndims);
h5tools_str_reset(str);
@@ -325,7 +325,7 @@ h5tools_str_prefix(h5tools_str_t *str/*in,out*/, const h5tool_format_t *info,
h5tools_str_append(str, OPT(info->idx_n_fmt, HSIZE_T_FORMAT), (hsize_t)elmtno);
H5TOOLS_DEBUG("str=%s", str->s);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
/* Add prefix and suffix to the index */
return h5tools_str_fmt(str, (size_t)0, OPT(info->idx_fmt, "%s: "));
@@ -693,7 +693,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
H5T_class_t type_class;
char *ret_value = NULL;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
/* Build default formats for long long types */
if(!fmt_llong[0]) {
HDsnprintf(fmt_llong, sizeof(fmt_llong), "%%%sd", H5_PRINTF_LL_WIDTH);
@@ -1346,7 +1346,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5tool_format_t *info, hid_t contai
ret_value = h5tools_str_fmt(str, start, OPT(info->elmt_fmt, "%s"));
- H5TOOLS_ENDDEBUG("exit with %s", ret_value);
+ H5TOOLS_ENDDEBUG(" with %s", ret_value);
return ret_value;
}
@@ -1364,7 +1364,7 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp)
{
ssize_t buf_size;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
h5tools_str_append(str, " \"");
buf_size = H5Rget_file_name(ref_vp, NULL, 0);
@@ -1406,7 +1406,7 @@ h5tools_str_sprint_reference(h5tools_str_t *str, H5R_ref_t *ref_vp)
}
h5tools_str_append(str, "\"");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index 0c0e0fb..fc4d431 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -4728,15 +4728,15 @@ uint32_t swap_uint32(uint32_t val)
int32_t swap_int32(int32_t val)
{
- val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF);
+ val = (int32_t)(((uint32_t)(val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF));
return (val << 16) | ((val >> 16) & 0xFFFF);
}
int64_t swap_int64(int64_t val)
{
- val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL);
- val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL);
- return (val << 32) | ((val >> 32) & 0xFFFFFFFFULL);
+ val = (int64_t)(((uint64_t)(val << 8) & 0xFF00FF00FF00FF00ULL) | ((uint64_t)(val >> 8) & 0x00FF00FF00FF00FFULL));
+ val = (int64_t)(((uint64_t)(val << 16) & 0xFFFF0000FFFF0000ULL) | ((uint64_t)(val >> 16) & 0x0000FFFF0000FFFFULL));
+ return (int64_t)((uint64_t)(val << 32) | ((uint64_t)(val >> 32) & 0xFFFFFFFFULL));
}
uint64_t swap_uint64(uint64_t val)
diff --git a/tools/src/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c
index 8f8272c..3dfbb49 100644
--- a/tools/src/h5ls/h5ls.c
+++ b/tools/src/h5ls/h5ls.c
@@ -1307,7 +1307,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx
h5tools_str_t buffer; /* string into which to render */
h5tools_context_t datactx; /* print context */
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
datactx = *ctx; /* print context */
/* Assume entire data space to be printed */
@@ -1513,7 +1513,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx
PRINTVALSTREAM(stream, "\n");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
@@ -1542,7 +1542,7 @@ dump_dataset_values(hid_t dset)
h5tool_format_t *info = &ls_dataformat;
H5R_ref_t *ref_buf = NULL;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
f_type = H5Dget_type(dset);
space = H5Dget_space(dset);
@@ -1656,7 +1656,7 @@ dump_dataset_values(hid_t dset)
init_acc_pos(&ctx, total_size);
ctx.need_prefix = TRUE;
- if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), ndims))) {
+ if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) {
H5TOOLS_DEBUG("H5Dread reference read");
if(H5Dread(dset, H5T_STD_REF, H5S_ALL, H5S_ALL, H5P_DEFAULT, ref_buf) < 0) {
HDfree(ref_buf);
@@ -1682,7 +1682,7 @@ done:
PRINTVALSTREAM(rawoutstream, "\n");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
@@ -1712,7 +1712,7 @@ dump_attribute_values(hid_t attr)
h5tool_format_t *info = &ls_dataformat;
H5R_ref_t *ref_buf = NULL;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
f_type = H5Aget_type(attr);
space = H5Aget_space(attr);
@@ -1827,7 +1827,7 @@ dump_attribute_values(hid_t attr)
init_acc_pos(&ctx, total_size);
ctx.need_prefix = TRUE;
- if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), ndims))) {
+ if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) {
H5TOOLS_DEBUG("H5Aread reference read");
if(H5Aread(attr, H5T_STD_REF, ref_buf) < 0) {
HDfree(ref_buf);
@@ -1859,7 +1859,7 @@ done:
PRINTVALSTREAM(rawoutstream, "\n");
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
}
/*-------------------------------------------------------------------------
@@ -1888,7 +1888,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -1962,7 +1962,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain
H5TOOLS_DEBUG("Attribute open failed");
h5tools_str_close(&buffer);
}
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return 0;
}
@@ -2300,7 +2300,7 @@ list_obj(const char *name, const H5O_info2_t *oinfo, const char *first_seen, voi
h5tools_context_t ctx; /* print context */
h5tool_format_t *info = &ls_dataformat;
- H5TOOLS_DEBUG("enter");
+ H5TOOLS_START_DEBUG("");
HDmemset(&ctx, 0, sizeof(ctx));
HDmemset(&buffer, 0, sizeof(h5tools_str_t));
@@ -2438,7 +2438,7 @@ done:
}
h5tools_str_close(&buffer);
- H5TOOLS_ENDDEBUG("exit");
+ H5TOOLS_ENDDEBUG("");
return 0;
} /* end list_obj() */
diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c
index 03fcf0e..95cacc1 100644
--- a/tools/src/h5repack/h5repack_parse.c
+++ b/tools/src/h5repack/h5repack_parse.c
@@ -228,7 +228,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
l = 0;
}
else if (f == -1) {
- filt->filt_flag = HDstrtoul(stype, NULL, 0);
+ filt->filt_flag = (unsigned)HDstrtoul(stype, NULL, 0);
f = 0;
}
else if (p == -1) {
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index 927167b..38fa6a2 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -175,7 +175,7 @@ parse_command_line(int argc, const char **argv)
usage(h5tools_getprogname());
goto done;
}
- increment = HDatoi(opt_arg);
+ increment = (hsize_t)HDatoi(opt_arg);
}
break;
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
index 7c0e7f1..a61d8d7 100644
--- a/tools/test/h5repack/h5repackgentest.c
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -147,7 +147,7 @@ __make_file(const char *basename, struct external_def *ext,
H5REPACKGENTEST_OOPS;
}
- space_id = H5Screate_simple(rank, dims, NULL);
+ space_id = H5Screate_simple((int)rank, dims, NULL);
if (space_id == H5I_INVALID_HID)
H5REPACKGENTEST_OOPS;
@@ -296,7 +296,7 @@ generate_f32le(hbool_t external) {
/* Generate values */
for (i = 0, k = 0, n = 0; i < dims[0]; i++) {
for (j = 0; j < dims[1]; j++, k++, n++) {
- wdata[k] = (float)(n * 801.1 * ((k % 5 == 1) ? (-1) : (1)));
+ wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1));
}
}
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
index 1d2e791..5557558 100644
--- a/tools/test/perform/chunk_cache.c
+++ b/tools/test/perform/chunk_cache.c
@@ -247,7 +247,8 @@ static int check_partial_chunks_perf(hid_t file)
dataset = H5Dopen2 (file, DSET1_NAME, dapl);
- memspace = H5Screate_simple(row_rank, row_dim, NULL);
+ H5_CHECK_OVERFLOW(row_rank, hsize_t, int);
+ memspace = H5Screate_simple((int)row_rank, row_dim, NULL);
filespace = H5Dget_space(dataset);
nbytes_global = 0;
@@ -256,7 +257,7 @@ static int check_partial_chunks_perf(hid_t file)
/* Read the data row by row */
for(i = 0; i < DSET1_DIM1; i++) {
- start[0] = i;
+ start[0] = (hsize_t)i;
if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
start, NULL, count, NULL) < 0)
goto error;
@@ -318,7 +319,9 @@ static int check_hash_value_perf(hid_t file)
if((dataset = H5Dopen2 (file, DSET2_NAME, dapl)) < 0)
goto error;
- if((memspace = H5Screate_simple(column_rank, column_dim, NULL)) < 0)
+
+ H5_CHECK_OVERFLOW(column_rank, hsize_t, int);
+ if((memspace = H5Screate_simple((int)column_rank, column_dim, NULL)) < 0)
goto error;
if((filespace = H5Dget_space(dataset)) < 0)
goto error;
@@ -329,7 +332,7 @@ static int check_hash_value_perf(hid_t file)
/* Read the data column by column */
for(i = 0; i < DSET2_DIM2; i++) {
- start[1] = i;
+ start[1] = (hsize_t)i;
if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
start, NULL, count, NULL) < 0)
goto error;
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index 8926d14..3f56d8b 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
iter_jump = nprocs * opt_block;
/* setup a buffer of data to write */
- if (!(tmp = (char *) malloc(opt_block + 256))) {
+ if (!(tmp = (char *) malloc((size_t)opt_block + 256))) {
perror("malloc");
goto die_jar_jar_die;
}
@@ -166,7 +166,7 @@ int main(int argc, char **argv)
if (opt_correct) {
/* do the same buffer setup for verifiable data */
- if (!(tmp2 = (char *) malloc(opt_block + 256))) {
+ if (!(tmp2 = (char *) malloc((size_t)opt_block + 256))) {
perror("malloc2");
goto die_jar_jar_die;
}
@@ -216,7 +216,7 @@ int main(int argc, char **argv)
VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL);
/* define a contiquous dataset of opt_iter*nprocs*opt_block chars */
- dims[0] = opt_iter * nprocs * opt_block;
+ dims[0] = (hsize_t)opt_iter * (hsize_t)nprocs * (hsize_t)opt_block;
sid = H5Screate_simple(RANK, dims, NULL);
VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL);
dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid,
@@ -224,7 +224,7 @@ int main(int argc, char **argv)
VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL);
/* create the memory dataspace and the file dataspace */
- dims[0] = opt_block;
+ dims[0] = (hsize_t)opt_block;
mem_dataspace = H5Screate_simple(RANK, dims, NULL);
VRFY((mem_dataspace >= 0), "", H5FATAL);
file_dataspace = H5Dget_space(dataset);
@@ -236,7 +236,7 @@ int main(int argc, char **argv)
for(j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
- stride[0] = block[0] = opt_block;
+ stride[0] = block[0] = (hsize_t)opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL);
@@ -289,7 +289,7 @@ int main(int argc, char **argv)
for (j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
- stride[0] = block[0] = opt_block;
+ stride[0] = block[0] = (hsize_t)opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL);
@@ -320,7 +320,7 @@ int main(int argc, char **argv)
/* if the user wanted to check correctness, compare the write
* buffer to the read buffer */
- if (opt_correct && memcmp(buf, buf2, opt_block)) {
+ if (opt_correct && memcmp(buf, buf2, (size_t)opt_block)) {
HDfprintf(stderr, "node %d, correctness test failed\n", mynod);
my_correct = 0;
MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
@@ -361,8 +361,8 @@ int main(int argc, char **argv)
/* print out the results on one node */
if (mynod == 0) {
- read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
- write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
+ read_bw = (double)((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0);
+ write_bw = (double)((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0);
printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs,
opt_iter, (long)opt_block);
@@ -433,9 +433,9 @@ parse_args(int argc, char **argv)
{
char *p;
- opt_alignment = HDatoi(optarg);
+ opt_alignment = (hsize_t)HDatoi(optarg);
if(NULL != (p = (char*)HDstrchr(optarg, '/')))
- opt_threshold = HDatoi(p + 1);
+ opt_threshold = (hsize_t)HDatoi(p + 1);
}
HDfprintf(stdout,
"alignment/threshold=%Hu/%Hu\n",
diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c
index f3cb3ec..8bc522f 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/test/perform/pio_engine.c
@@ -251,7 +251,7 @@ do_pio(parameters param)
}
if (!param.dim2d){
- if(((snbytes/pio_mpi_nprocs_g)%buf_size)!=0) {
+ if(((size_t)(snbytes/pio_mpi_nprocs_g)%buf_size)!=0) {
HDfprintf(stderr,
"Dataset size/process (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
"trasfer buffer size (%zu)\n",
@@ -260,7 +260,7 @@ do_pio(parameters param)
}
}
else {
- if((snbytes%buf_size)!=0) {
+ if(((size_t)snbytes%buf_size)!=0) {
HDfprintf(stderr,
"Dataset side size (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the "
"trasfer buffer size (%zu)\n",
@@ -580,7 +580,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end if */
/* Interleaved Pattern: */
else {
- bytes_begin[0] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[0] = (off_t)(blk_size*(size_t)pio_mpi_rank_g);
} /* end else */
/* Prepare buffer for verifying data */
@@ -604,9 +604,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
bytes_begin[0] = 0;
if(!parms->h5_use_chunks || parms->io_type==PHDF5)
- bytes_begin[1] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)(blk_size*(size_t)pio_mpi_rank_g);
else
- bytes_begin[1] = (off_t)(blk_size*blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)(blk_size*blk_size*(size_t)pio_mpi_rank_g);
} /* end else */
/* Prepare buffer for verifying data */
@@ -684,7 +684,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build contiguous file's derived type */
- mrc = MPI_Type_vector((int)blk_size, (int)1, (int)(snbytes/buf_size),
+ mrc = MPI_Type_vector((int)blk_size, (int)1, (int)((size_t)snbytes/buf_size),
mpi_partial_buffer_cont, &mpi_cont_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -702,7 +702,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build interleaved file's derived type */
- mrc = MPI_Type_vector((int)buf_size, (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)buf_size, (int)1, (int)((size_t)snbytes/blk_size),
mpi_partial_buffer_inter, &mpi_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -729,7 +729,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build chunk interleaved file's derived type */
- mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)((size_t)snbytes/blk_size),
mpi_full_chunk, &mpi_chunk_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -745,22 +745,22 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
if (!parms->dim2d){
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = nbytes;
+ h5dims[0] = (hsize_t)nbytes;
h5dset_space_id = H5Screate_simple(1, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
+ h5start[0] = (hsize_t)bytes_begin[0];
h5stride[0] = h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5stride[0] = blk_size*pio_mpi_nprocs_g;
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5stride[0] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end else */
@@ -788,16 +788,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = snbytes;
- h5dims[1] = snbytes;
+ h5dims[0] = (hsize_t)snbytes;
+ h5dims[1] = (hsize_t)snbytes;
h5dset_space_id = H5Screate_simple(2, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = 1;
h5stride[1] = h5block[0] = h5block[1] = blk_size;
h5count[0] = 1;
@@ -806,10 +806,10 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = blk_size;
- h5stride[1] = blk_size*pio_mpi_nprocs_g;
+ h5stride[1] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = h5block[1] = blk_size;
h5count[0] = buf_size/blk_size;
h5count[1] = 1;
@@ -973,7 +973,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((rc != 0), "POSIXWRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1002,7 +1002,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(ssize_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -1016,8 +1016,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/blk_size)
- /snbytes)*(blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/blk_size)
+ /(size_t)snbytes)*(blk_size*(size_t)snbytes)+(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -1028,9 +1028,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)((((nbytes_xfer/buf_size)
- *pio_mpi_nprocs_g)/snbytes)*(buf_size*snbytes)
- +((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes);
+ file_offset=posix_file_offset+(off_t)(((((size_t)nbytes_xfer/buf_size)
+ *(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*(buf_size*(size_t)snbytes)
+ +(((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -1061,16 +1061,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
*snbytes/blk_size*(blk_size*blk_size))+((nbytes_xfer/(buf_size/blk_size))
*pio_mpi_nprocs_g)%(snbytes/blk_size*(blk_size*blk_size))); */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)+((nbytes_xfer/(buf_size/blk_size))
- *pio_mpi_nprocs_g)%(snbytes*blk_size));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)+(((size_t)nbytes_xfer/(buf_size/blk_size))
+ *(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* file_offset_advance = (off_t)(snbytes/blk_size*(blk_size*blk_size)); */
- file_offset_advance = (off_t)(snbytes*blk_size);
+ file_offset_advance = (off_t)snbytes*(off_t)blk_size;
} /* end else */
} /* end else */
@@ -1097,7 +1097,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(ssize_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -1128,7 +1128,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1153,7 +1153,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(ssize_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -1174,7 +1174,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1193,7 +1193,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(ssize_t)buf_size;
} /* end else */
} /* end else */
} /* end if */
@@ -1204,8 +1204,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+((nbytes_xfer/blk_size)/snbytes)*
- (blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/blk_size)/(size_t)snbytes)*
+ (blk_size*(size_t)snbytes))+(MPI_Offset)(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -1219,8 +1219,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+(((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)/snbytes)*
- (buf_size*snbytes)+((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes;
+ mpi_offset=mpi_file_offset+(MPI_Offset)(((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*
+ (buf_size*(size_t)snbytes))+(MPI_Offset)((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -1257,16 +1257,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
(buf_size/blk_size*snbytes/blk_size*(blk_size*blk_size))+
((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes
/blk_size*(blk_size*blk_size)); */
- mpi_offset=mpi_file_offset+((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)
- +((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes*blk_size);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes))
+ +(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size))*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* mpi_offset_advance = (MPI_Offset)(snbytes/blk_size*(blk_size*blk_size)); */
- mpi_offset_advance = (MPI_Offset)(snbytes*blk_size);
+ mpi_offset_advance = (MPI_Offset)((size_t)snbytes*blk_size);
/* MPI type to be used for collective access */
mpi_collective_type = mpi_chunk_inter_type;
@@ -1292,7 +1292,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(ssize_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -1315,7 +1315,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size*blk_size;
+ nbytes_xfer+=(off_t)buf_size*(off_t)blk_size;
} /* end else */
} /* end else */
@@ -1344,22 +1344,22 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dwrite");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size;
+ nbytes_xfer += (ssize_t)buf_size;
} /* end if */
/* 2D dataspace */
else {
/* Set up the file dset space id to move the selection to process */
if (!parms->interleaved){
/* Contiguous pattern */
- h5offset[0] = (nbytes_xfer/(snbytes*blk_size))*blk_size;
- h5offset[1] = (nbytes_xfer%(snbytes*blk_size))/blk_size;
+ h5offset[0] = (hssize_t)(((size_t)nbytes_xfer/((size_t)snbytes*blk_size))*blk_size);
+ h5offset[1] = (hssize_t)(((size_t)nbytes_xfer%((size_t)snbytes*blk_size))/blk_size);
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5offset[0] = ((nbytes_xfer*pio_mpi_nprocs_g)/(snbytes*buf_size))*buf_size;
- h5offset[1] = ((nbytes_xfer*pio_mpi_nprocs_g)%(snbytes*buf_size))/buf_size;
+ h5offset[0] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*buf_size))*buf_size);
+ h5offset[1] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*buf_size))/buf_size);
} /* end else */
hrc = H5Soffset_simple(h5dset_space_id, h5offset);
@@ -1371,7 +1371,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dwrite");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size*blk_size;
+ nbytes_xfer += (off_t)buf_size*(off_t)blk_size;
} /* end else */
@@ -1560,7 +1560,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end if */
/* Interleaved Pattern: */
else {
- bytes_begin[0] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[0] = (off_t)blk_size*(off_t)pio_mpi_rank_g;
} /* end else */
}/* end if */
/* 2D dataspace */
@@ -1582,9 +1582,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
bytes_begin[0] = 0;
if (!parms->h5_use_chunks || parms->io_type==PHDF5)
- bytes_begin[1] = (off_t)(blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)blk_size*(off_t)pio_mpi_rank_g;
else
- bytes_begin[1] = (off_t)(blk_size*blk_size*pio_mpi_rank_g);
+ bytes_begin[1] = (off_t)blk_size*(off_t)blk_size*(off_t)pio_mpi_rank_g;
} /* end else */
} /* end else */
@@ -1656,7 +1656,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build contiguous file's derived type */
- mrc = MPI_Type_vector((int)blk_size, (int)1, (int)(snbytes/buf_size),
+ mrc = MPI_Type_vector((int)blk_size, (int)1, (int)((size_t)snbytes/buf_size),
mpi_partial_buffer_cont, &mpi_cont_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -1674,7 +1674,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build interleaved file's derived type */
- mrc = MPI_Type_vector((int)buf_size, (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)buf_size, (int)1, (int)((size_t)snbytes/blk_size),
mpi_partial_buffer_inter, &mpi_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -1701,7 +1701,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT");
/* Build chunk interleaved file's derived type */
- mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)(snbytes/blk_size),
+ mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)((size_t)snbytes/blk_size),
mpi_full_chunk, &mpi_chunk_inter_type);
VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE");
@@ -1716,22 +1716,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
if (!parms->dim2d){
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = nbytes;
+ h5dims[0] = (hsize_t)nbytes;
h5dset_space_id = H5Screate_simple(1, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
+ h5start[0] = (hsize_t)bytes_begin[0];
h5stride[0] = h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5stride[0] = blk_size*pio_mpi_nprocs_g;
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5stride[0] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = blk_size;
h5count[0] = buf_size/blk_size;
} /* end else */
@@ -1759,16 +1759,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
if(nbytes>0) {
/* define a contiguous dataset of nbytes native bytes */
- h5dims[0] = snbytes;
- h5dims[1] = snbytes;
+ h5dims[0] = (hsize_t)snbytes;
+ h5dims[1] = (hsize_t)snbytes;
h5dset_space_id = H5Screate_simple(2, h5dims, NULL);
VRFY((h5dset_space_id >= 0), "H5Screate_simple");
/* Set up the file dset space id to select the pattern to access */
if (!parms->interleaved){
/* Contiguous pattern */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = 1;
h5stride[1] = h5block[0] = h5block[1] = blk_size;
h5count[0] = 1;
@@ -1777,10 +1777,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5start[0] = bytes_begin[0];
- h5start[1] = bytes_begin[1];
+ h5start[0] = (hsize_t)bytes_begin[0];
+ h5start[1] = (hsize_t)bytes_begin[1];
h5stride[0] = blk_size;
- h5stride[1] = blk_size*pio_mpi_nprocs_g;
+ h5stride[1] = blk_size*(size_t)pio_mpi_nprocs_g;
h5block[0] = h5block[1] = blk_size;
h5count[0] = buf_size/blk_size;
h5count[1] = 1;
@@ -1904,7 +1904,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((rc != 0), "POSIXREAD");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -1933,7 +1933,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(off_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -1947,8 +1947,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/blk_size)
- /snbytes)*(blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/blk_size)
+ /(size_t)snbytes)*(blk_size*(size_t)snbytes)+(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -1959,9 +1959,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute file offset */
- file_offset=posix_file_offset+(off_t)((((nbytes_xfer/buf_size)
- *pio_mpi_nprocs_g)/snbytes)*(buf_size*snbytes)
- +((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes);
+ file_offset=posix_file_offset+(off_t)(((((size_t)nbytes_xfer/buf_size)
+ *(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*(buf_size*(size_t)snbytes)
+ +(((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -1992,16 +1992,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
*snbytes/blk_size*(blk_size*blk_size))+((nbytes_xfer/(buf_size/blk_size))
*pio_mpi_nprocs_g)%(snbytes/blk_size*(blk_size*blk_size))); */
- file_offset=posix_file_offset+(off_t)(((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)+((nbytes_xfer/(buf_size/blk_size))
- *pio_mpi_nprocs_g)%(snbytes*blk_size));
+ file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)+(((size_t)nbytes_xfer/(buf_size/blk_size))
+ *(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* file_offset_advance = (off_t)(snbytes/blk_size*(blk_size*blk_size)); */
- file_offset_advance = (off_t)(snbytes*blk_size);
+ file_offset_advance = (off_t)((size_t)snbytes*blk_size);
} /* end else */
} /* end else */
@@ -2028,7 +2028,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(off_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -2058,7 +2058,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -2083,7 +2083,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=blk_size;
/* Advance global offset in dataset */
- nbytes_xfer+=blk_size;
+ nbytes_xfer+=(off_t)blk_size;
/* Decrement number of bytes left this time */
nbytes_toxfer-=blk_size;
@@ -2104,7 +2104,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end if */
/* Interleaved access pattern */
else {
@@ -2123,7 +2123,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size;
+ nbytes_xfer+=(off_t)buf_size;
} /* end else */
} /* end else */
} /* end if */
@@ -2134,8 +2134,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Contiguous access pattern */
if (!parms->interleaved) {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+((nbytes_xfer/blk_size)/snbytes)*
- (blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/blk_size)/(size_t)snbytes)*
+ (blk_size*(size_t)snbytes))+(MPI_Offset)(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = buf_size;
@@ -2149,8 +2149,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Interleaved access pattern */
else {
/* Compute offset in file */
- mpi_offset=mpi_file_offset+(((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)/snbytes)*
- (buf_size*snbytes)+((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes;
+ mpi_offset=mpi_file_offset+(MPI_Offset)(((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*
+ (buf_size*(size_t)snbytes))+(MPI_Offset)((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes);
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size;
@@ -2187,16 +2187,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
(buf_size/blk_size*snbytes/blk_size*(blk_size*blk_size))+
((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes
/blk_size*(blk_size*blk_size)); */
- mpi_offset=mpi_file_offset+((nbytes_xfer/(buf_size/blk_size)
- *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)
- +((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes*blk_size);
+ mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size)
+ *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes))
+ +(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size))*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size));
/* Number of bytes to be transferred per I/O operation */
nbytes_xfer_advance = blk_size * blk_size;
/* Global offset advance after each I/O operation */
/* mpi_offset_advance = (MPI_Offset)(snbytes/blk_size*(blk_size*blk_size)); */
- mpi_offset_advance = (MPI_Offset)(snbytes*blk_size);
+ mpi_offset_advance = (MPI_Offset)((size_t)snbytes*blk_size);
/* MPI type to be used for collective access */
mpi_collective_type = mpi_chunk_inter_type;
@@ -2222,7 +2222,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
buf_p+=nbytes_xfer_advance;
/* Advance global offset in dataset */
- nbytes_xfer+=nbytes_xfer_advance;
+ nbytes_xfer+=(off_t)nbytes_xfer_advance;
/* Decrement number of bytes left this time */
nbytes_toxfer-=nbytes_xfer_advance;
@@ -2245,7 +2245,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((mrc==MPI_SUCCESS), "MPIO_READ");
/* Advance global offset in dataset */
- nbytes_xfer+=buf_size*blk_size;
+ nbytes_xfer+=(off_t)buf_size*(off_t)blk_size;
} /* end else */
} /* end else */
@@ -2273,21 +2273,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dread");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size;
+ nbytes_xfer += (off_t)buf_size;
} /* end if */
/* 2D dataspace */
else {
/* Set up the file dset space id to move the selection to process */
if (!parms->interleaved){
/* Contiguous pattern */
- h5offset[0] = (nbytes_xfer/(snbytes*blk_size))*blk_size;
- h5offset[1] = (nbytes_xfer%(snbytes*blk_size))/blk_size;
+ h5offset[0] = (hssize_t)(((size_t)nbytes_xfer/((size_t)snbytes*blk_size))*blk_size);
+ h5offset[1] = (hssize_t)(((size_t)nbytes_xfer%((size_t)snbytes*blk_size))/blk_size);
} /* end if */
else {
/* Interleaved access pattern */
/* Skip offset over blocks of other processes */
- h5offset[0] = ((nbytes_xfer*pio_mpi_nprocs_g)/(snbytes*buf_size))*buf_size;
- h5offset[1] = ((nbytes_xfer*pio_mpi_nprocs_g)%(snbytes*buf_size))/buf_size;
+ h5offset[0] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*buf_size))*buf_size);
+ h5offset[1] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*buf_size))/buf_size);
} /* end else */
hrc = H5Soffset_simple(h5dset_space_id, h5offset);
@@ -2299,7 +2299,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
VRFY((hrc >= 0), "H5Dread");
/* Increment number of bytes transferred */
- nbytes_xfer += buf_size*blk_size;
+ nbytes_xfer += (off_t)buf_size*(off_t)blk_size;
} /* end else */
break;
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 1a40f44..4c0ec5e 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -81,7 +81,7 @@
#define PIO_HDF5 0x4
#define DBL_EPSILON 2.2204460492503131e-16
-#define H5_DBL_ABS_EQUAL(X,Y) (fabsf((X)-(Y)) < DBL_EPSILON)
+#define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON)
/* report 0.0 in case t is zero too */
#define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t)))
@@ -315,6 +315,7 @@ static void output_report(const char *fmt, ...);
static void print_indent(register int indent);
static void usage(const char *prog);
static void report_parameters(struct options *opts);
+static off_t squareo(off_t);
/*
* Function: main
@@ -397,6 +398,12 @@ finish:
return exit_value;
}
+off_t
+squareo(off_t x)
+{
+ return x * x;
+}
+
/*
* Function: run_test_loop
* Purpose: Run the I/O tests. Write the results to OUTPUT.
@@ -432,8 +439,8 @@ run_test_loop(struct options *opts)
parms.interleaved = opts->interleaved;
parms.collective = opts->collective;
parms.dim2d = opts->dim2d;
- parms.h5_align = opts->h5_alignment;
- parms.h5_thresh = opts->h5_threshold;
+ parms.h5_align = (hsize_t)opts->h5_alignment;
+ parms.h5_thresh = (hsize_t)opts->h5_threshold;
parms.h5_use_chunks = opts->h5_use_chunks;
parms.h5_write_only = opts->h5_write_only;
parms.verify = opts->verify;
@@ -460,7 +467,7 @@ run_test_loop(struct options *opts)
parms.buf_size = buf_size;
if (parms.dim2d){
- parms.num_bytes = (off_t)pow((double)(opts->num_bpp*parms.num_procs),2);
+ parms.num_bytes = squareo(opts->num_bpp * parms.num_procs);
if (parms.interleaved)
output_report("Transfer Buffer Size: %ldx%ld bytes, File size: %.2f MB\n",
buf_size, opts->blk_size,
@@ -883,7 +890,7 @@ accumulate_minmax_stuff(minmax *mm, int count)
int i;
minmax total_mm;
- total_mm.sum = 0.0;
+ total_mm.sum = 0.0f;
total_mm.max = -DBL_MAX;
total_mm.min = DBL_MAX;
total_mm.num = count;
@@ -1159,10 +1166,10 @@ report_parameters(struct options *opts)
recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n");
HDfprintf(output, "rank %d: File size=", rank);
- recover_size_and_print((long long)(pow((double)(opts->num_bpp * opts->min_num_procs),2)
- * opts->num_dsets), ":");
- recover_size_and_print((long long)(pow((double)(opts->num_bpp * opts->max_num_procs),2)
- * opts->num_dsets), "\n");
+ recover_size_and_print((long long)(squareo(opts->num_bpp * opts->min_num_procs)
+ * opts->num_dsets), ":");
+ recover_size_and_print((long long)(squareo(opts->num_bpp * opts->max_num_procs)
+ * opts->num_dsets), "\n");
HDfprintf(output, "rank %d: Transfer buffer size=", rank);
if(opts->interleaved){
@@ -1326,7 +1333,7 @@ parse_command_line(int argc, char *argv[])
break;
#endif /* 0 */
case 'B':
- cl_opts->blk_size = parse_size_directive(opt_arg);
+ cl_opts->blk_size = (size_t)parse_size_directive(opt_arg);
break;
case 'c':
/* Turn on chunked HDF5 dataset creation */
@@ -1427,10 +1434,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->h5_write_only = TRUE;
break;
case 'x':
- cl_opts->min_xfer_size = parse_size_directive(opt_arg);
+ cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg);
break;
case 'X':
- cl_opts->max_xfer_size = parse_size_directive(opt_arg);
+ cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg);
break;
case 'h':
case '?':
@@ -1450,13 +1457,13 @@ parse_command_line(int argc, char *argv[])
}
if (cl_opts->max_xfer_size == 0)
- cl_opts->max_xfer_size = cl_opts->num_bpp;
+ cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp;
if (cl_opts->min_xfer_size == 0)
- cl_opts->min_xfer_size = (cl_opts->num_bpp)/2;
+ cl_opts->min_xfer_size = (size_t)(cl_opts->num_bpp)/2;
if (cl_opts->blk_size == 0)
- cl_opts->blk_size = (cl_opts->num_bpp)/2;
+ cl_opts->blk_size = (size_t)(cl_opts->num_bpp)/2;
/* set default if none specified yet */
@@ -1466,15 +1473,15 @@ parse_command_line(int argc, char *argv[])
/* verify parameters sanity. Adjust if needed. */
/* cap xfer_size with bytes per process */
if (!cl_opts->dim2d) {
- if (cl_opts->min_xfer_size > cl_opts->num_bpp)
- cl_opts->min_xfer_size = cl_opts->num_bpp;
- if (cl_opts->max_xfer_size > cl_opts->num_bpp)
- cl_opts->max_xfer_size = cl_opts->num_bpp;
+ if (cl_opts->min_xfer_size > (size_t)cl_opts->num_bpp)
+ cl_opts->min_xfer_size = (size_t)cl_opts->num_bpp;
+ if (cl_opts->max_xfer_size > (size_t)cl_opts->num_bpp)
+ cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp;
}
if (cl_opts->min_xfer_size > cl_opts->max_xfer_size)
cl_opts->min_xfer_size = cl_opts->max_xfer_size;
- if (cl_opts->blk_size > cl_opts->num_bpp )
- cl_opts->blk_size = cl_opts->num_bpp;
+ if (cl_opts->blk_size > (size_t)cl_opts->num_bpp )
+ cl_opts->blk_size = (size_t)cl_opts->num_bpp;
/* check range of number of processes */
if (cl_opts->min_num_procs <= 0)
cl_opts->min_num_procs = 1;