diff options
author | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-29 20:12:18 (GMT) |
---|---|---|
committer | Kimmy Mu <kmu@hdfgroup.org> | 2020-01-29 20:12:18 (GMT) |
commit | 8c60f6264c46cd9155ce34e12e29e9b0272c0c67 (patch) | |
tree | 4ee7db9cfd3ff489825e82a23b6e010245fe4183 | |
parent | 91d29817413e00f1dcd006d13790df6ce7aeb5c0 (diff) | |
parent | 781fa57f6ee816e037dd12fff02d37ff7ec9c2b1 (diff) | |
download | hdf5-8c60f6264c46cd9155ce34e12e29e9b0272c0c67.zip hdf5-8c60f6264c46cd9155ce34e12e29e9b0272c0c67.tar.gz hdf5-8c60f6264c46cd9155ce34e12e29e9b0272c0c67.tar.bz2 |
Merge pull request #2324 in HDFFV/hdf5 from ~KMU/hdf5:hdf5_1_12 to hdf5_1_12
* commit '781fa57f6ee816e037dd12fff02d37ff7ec9c2b1':
pick up missing piece from merge
Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop
remove redundent definition
Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop
Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop
Merge pull request #2315 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop
missing prototype warning
prototype issue
Merge pull request #2306 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop
Merge pull request #2300 in HDFFV/hdf5 from ~KMU/hdf5:squashed_cast to develop
Merge pull request #2291 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/uninitialized to develop
Merge pull request #2295 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/float to develop
Merge pull request #2292 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/prototype to develop
Merge pull request #2094 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/unused to develop
108 files changed, 1494 insertions, 1459 deletions
@@ -239,6 +239,7 @@ sub argstring ($$$) { # certain type qualifiers, and indirection. $atype =~ s/^\bconst\b//; $atype =~ s/\bH5_ATTR_UNUSED\b//g; + $atype =~ s/\bH5_ATTR_NDEBUG_UNUSED\b//g; $atype =~ s/\s+/ /g; $ptr = length $1 if $atype =~ s/(\*+)//; $atype =~ s/^\s+//; diff --git a/src/H5ACmpio.c b/src/H5ACmpio.c index e4b81fa..fadde28 100644 --- a/src/H5ACmpio.c +++ b/src/H5ACmpio.c @@ -498,7 +498,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t *aux_ptr, +H5AC__construct_candidate_list(H5AC_t *cache_ptr, H5AC_aux_t H5_ATTR_NDEBUG_UNUSED *aux_ptr, int sync_point_op) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Aint.c b/src/H5Aint.c index 046af87..4690616 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -2061,7 +2061,7 @@ done: */ H5A_t * H5A__attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info) + H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info) { H5A_t *attr_dst = NULL; /* Destination attribute */ hid_t tid_src = -1; /* Datatype ID for source datatype */ @@ -2020,7 +2020,6 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) { H5B_t *bt = NULL; /* The B-tree */ H5UC_t *rc_shared; /* Ref-counted shared info */ - H5B_shared_t *shared; /* Pointer to shared B-tree info */ H5B_cache_ud_t cache_udata; /* User-data for metadata cache callback */ htri_t ret_value = SUCCEED; /* Return value */ @@ -2038,8 +2037,7 @@ H5B_valid(H5F_t *f, const H5B_class_t *type, haddr_t addr) /* Get shared info for B-tree */ if(NULL == (rc_shared = (type->get_shared)(f, NULL))) HGOTO_ERROR(H5E_BTREE, H5E_CANTGET, FAIL, "can't retrieve B-tree's shared ref. count object") - shared = (H5B_shared_t *)H5UC_GET_OBJ(rc_shared); - HDassert(shared); + HDassert((H5B_shared_t *)H5UC_GET_OBJ(rc_shared)); /* * Load the tree node. 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/H5B2dbg.c b/src/H5B2dbg.c index 0e3ebd5..b5b1c03 100644 --- a/src/H5B2dbg.c +++ b/src/H5B2dbg.c @@ -87,7 +87,7 @@ */ herr_t H5B2__hdr_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, - const H5B2_class_t *type, haddr_t obj_addr) + const H5B2_class_t H5_ATTR_NDEBUG_UNUSED *type, haddr_t H5_ATTR_NDEBUG_UNUSED obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header info */ unsigned u; /* Local index variable */ @@ -182,7 +182,7 @@ done: */ herr_t H5B2__int_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, - const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t obj_addr) + const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, unsigned depth, haddr_t H5_ATTR_NDEBUG_UNUSED obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ H5B2_internal_t *internal = NULL; /* B-tree internal node */ @@ -294,7 +294,7 @@ done: */ herr_t H5B2__leaf_debug(H5F_t *f, haddr_t addr, FILE *stream, int indent, int fwidth, - const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t obj_addr) + const H5B2_class_t *type, haddr_t hdr_addr, unsigned nrec, haddr_t H5_ATTR_NDEBUG_UNUSED obj_addr) { H5B2_hdr_t *hdr = NULL; /* B-tree header */ H5B2_leaf_t *leaf = NULL; /* B-tree leaf node */ diff --git a/src/H5B2internal.c b/src/H5B2internal.c index 7f6b80a..92c802e 100644 --- a/src/H5B2internal.c +++ b/src/H5B2internal.c @@ -1355,7 +1355,7 @@ done: *------------------------------------------------------------------------- */ H5_ATTR_PURE herr_t -H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal) +H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_internal_t *internal) { hsize_t tot_all_nrec; /* Total number of records at or below this node */ uint16_t u, v; /* Local index variables */ @@ -1396,7 +1396,7 @@ H5B2__assert_internal(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2 *------------------------------------------------------------------------- */ H5_ATTR_PURE herr_t -H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2) +H5B2__assert_internal2(hsize_t parent_all_nrec, const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, const H5B2_internal_t *internal, const H5B2_internal_t *internal2) { hsize_t tot_all_nrec; /* Total number of records at or below this node */ uint16_t u, v; /* Local index variables */ diff --git a/src/H5B2leaf.c b/src/H5B2leaf.c index beca40c..7ed0468 100644 --- a/src/H5B2leaf.c +++ b/src/H5B2leaf.c @@ -1027,7 +1027,8 @@ done: *------------------------------------------------------------------------- */ H5_ATTR_PURE herr_t -H5B2__assert_leaf(const H5B2_hdr_t *hdr, const H5B2_leaf_t *leaf) +H5B2__assert_leaf(const H5B2_hdr_t H5_ATTR_NDEBUG_UNUSED *hdr, + const H5B2_leaf_t H5_ATTR_NDEBUG_UNUSED *leaf) { /* General sanity checking on node */ HDassert(leaf->nrec <= hdr->node_info->split_nrec); @@ -1056,7 +1056,6 @@ H5C_flush_cache(H5F_t *f, unsigned flags) H5C_ring_t ring; H5C_t * cache_ptr; hbool_t destroy; - hbool_t ignore_protected; herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -1101,9 +1100,8 @@ H5C_flush_cache(H5F_t *f, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry") #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ - ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 ); destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); - HDassert( ! ( destroy && ignore_protected ) ); + HDassert( ! ( destroy && ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 )) ); HDassert( ! ( cache_ptr->flush_in_progress ) ); cache_ptr->flush_in_progress = TRUE; @@ -3856,7 +3854,11 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, { herr_t ret_value = SUCCEED; /* Return value */ +#if H5C_DO_SANITY_CHECKS FUNC_ENTER_STATIC +#else + FUNC_ENTER_STATIC_NOERR +#endif /* Sanity checking */ HDassert(cache_ptr); @@ -3873,7 +3875,9 @@ H5C__unpin_entry_real(H5C_t *cache_ptr, H5C_cache_entry_t *entry_ptr, /* Update the stats for an unpin operation */ H5C__UPDATE_STATS_FOR_UNPIN(cache_ptr, entry_ptr) +#if H5C_DO_SANITY_CHECKS done: +#endif FUNC_LEAVE_NOAPI(ret_value) } /* H5C__unpin_entry_real() */ @@ -105,7 +105,7 @@ } /* end if */ #endif /* H5_HAVE_PARALLEL */ -#ifdef H5_HAVE_PARALLEL +#if defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY) /* Macro for the duplicated code to test and set properties for a property list */ #define H5CX_TEST_SET_PROP(PROP_NAME, PROP_FIELD) \ { \ @@ -127,7 +127,9 @@ (*head)->ctx.H5_GLUE(PROP_FIELD,_set) = TRUE; \ } /* end if */ \ } +#endif /* defined(H5_HAVE_PARALLEL) && defined(H5_HAVE_INSTRUMENTED_LIBRARY) */ +#ifdef H5_HAVE_PARALLEL /* Macro for the duplicated code to test and set properties for a property list */ #define H5CX_SET_PROP(PROP_NAME, PROP_FIELD) \ if((*head)->ctx.H5_GLUE(PROP_FIELD,_set)) { \ diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c index dd9e9b2..5ac354d 100644 --- a/src/H5Clog_json.c +++ b/src/H5Clog_json.c @@ -1281,7 +1281,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config, +H5C__json_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t H5_ATTR_NDEBUG_UNUSED *config, herr_t fxn_ret_value) { H5C_log_json_udata_t *json_udata = (H5C_log_json_udata_t *)(udata); 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/H5Dbtree.c b/src/H5Dbtree.c index c13c36a..098e01b 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -253,7 +253,7 @@ H5D__btree_get_shared(const H5F_t H5_ATTR_UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D__btree_new_node(H5F_t *f, H5B_ins_t op, void *_lt_key, void *_udata, +H5D__btree_new_node(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; @@ -536,7 +536,7 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5D__btree_insert(H5F_t *f, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, +H5D__btree_insert(H5F_t H5_ATTR_NDEBUG_UNUSED *f, haddr_t H5_ATTR_NDEBUG_UNUSED addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t H5_ATTR_UNUSED *rt_key_changed, haddr_t *new_node_p/*out*/) { diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 2e4a3f6..8d1ba80 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) @@ -2131,7 +2129,7 @@ H5D__create_chunk_mem_map_1d(const H5D_chunk_map_t *fm) { H5D_chunk_info_t *chunk_info; /* Pointer to chunk information */ H5SL_node_t *curr_node; /* Current node in skip list */ - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -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/H5Dint.c b/src/H5Dint.c index c3e0c0d..436a507 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -89,7 +89,7 @@ static herr_t H5D__init_storage(const H5D_io_info_t *io_info, hbool_t full_overw hsize_t old_dim[]); static herr_t H5D__append_flush_setup(H5D_t *dset, hid_t dapl_id); static herr_t H5D__close_cb(H5VL_object_t *dset_vol_obj); -static herr_t H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize); +static herr_t H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize); static herr_t H5D__prepare_minimized_oh(H5F_t *file, H5D_t *dset, H5O_loc_t *oloc); static size_t H5D__calculate_minimum_header_size(H5F_t *file, H5D_t *dset, H5O_t *ohdr); static void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); @@ -737,14 +737,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__use_minimized_dset_headers(H5F_t *file, H5D_t *dset, hbool_t *minimize) +H5D__use_minimized_dset_headers(H5F_t *file, hbool_t *minimize) { herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT; HDassert(file); - HDassert(dset); HDassert(minimize); /* Get the dataset object header minimize flag for this call */ @@ -1015,7 +1014,7 @@ H5D__update_oh_info(H5F_t *file, H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value info") } /* end if */ - if(H5D__use_minimized_dset_headers(file, dset, &minimize_header) == FAIL) + if(H5D__use_minimized_dset_headers(file, &minimize_header) == FAIL) HGOTO_ERROR(H5E_ARGS, H5E_CANTGET, FAIL, "can't get minimize settings") if(TRUE == minimize_header) { 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/H5Dnone.c b/src/H5Dnone.c index 9346220..2093512 100644 --- a/src/H5Dnone.c +++ b/src/H5Dnone.c @@ -378,7 +378,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D__none_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, +H5D__none_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Dsingle.c b/src/H5Dsingle.c index 4510a03..8efa771 100644 --- a/src/H5Dsingle.c +++ b/src/H5Dsingle.c @@ -437,7 +437,7 @@ H5D__single_idx_delete(const H5D_chk_idx_info_t *idx_info) *------------------------------------------------------------------------- */ static herr_t -H5D__single_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, +H5D__single_idx_copy_setup(const H5D_chk_idx_info_t H5_ATTR_NDEBUG_UNUSED *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5EAcache.c b/src/H5EAcache.c index 1fd9c44..1d182a4 100644 --- a/src/H5EAcache.c +++ b/src/H5EAcache.c @@ -1543,7 +1543,7 @@ END_FUNC(STATIC) /* end H5EA__cache_sblock_verify_chksum() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5EA__cache_dblock_deserialize(const void *_image, size_t len, +H5EA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ @@ -2080,7 +2080,7 @@ END_FUNC(STATIC) /* end H5EA__cache_dblk_page_image_len() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5EA__cache_dblk_page_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, +H5EA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)) /* Local variables */ diff --git a/src/H5EAtest.c b/src/H5EAtest.c index 814e64f..58e255a 100644 --- a/src/H5EAtest.c +++ b/src/H5EAtest.c @@ -279,7 +279,7 @@ END_FUNC(STATIC) /* end H5EA__test_encode() */ */ BEGIN_FUNC(STATIC, NOERR, herr_t, SUCCEED, -, -H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void *_ctx)) +H5EA__test_decode(const void *_raw, void *_elmt, size_t nelmts, void H5_ATTR_NDEBUG_UNUSED *_ctx)) /* Local variables */ #ifndef NDEBUG diff --git a/src/H5FAcache.c b/src/H5FAcache.c index 2f0d1b4..922153c 100644 --- a/src/H5FAcache.c +++ b/src/H5FAcache.c @@ -253,7 +253,7 @@ END_FUNC(STATIC) /* end H5FA__cache_hdr_verify_chksum() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5FA__cache_hdr_deserialize(const void *_image, size_t len, +H5FA__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ @@ -651,7 +651,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblock_verify_chksum() */ */ BEGIN_FUNC(STATIC, ERR, void *, NULL, NULL, -H5FA__cache_dblock_deserialize(const void *_image, size_t len, +H5FA__cache_dblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty)) /* Local variables */ @@ -1178,7 +1178,7 @@ END_FUNC(STATIC) /* end H5FA__cache_dblk_page_image_len() */ */ BEGIN_FUNC(STATIC, ERR, herr_t, SUCCEED, FAIL, -H5FA__cache_dblk_page_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_UNUSED len, +H5FA__cache_dblk_page_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *_image, size_t H5_ATTR_UNUSED len, void *_thing)) /* Local variables */ @@ -665,14 +665,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size) +H5FS_size(const H5FS_t *fspace, hsize_t *meta_size) { FUNC_ENTER_NOAPI_NOINIT_NOERR /* * Check arguments. */ - HDassert(f); HDassert(fspace); HDassert(meta_size); diff --git a/src/H5FScache.c b/src/H5FScache.c index cb0abe9..d5f2817 100644 --- a/src/H5FScache.c +++ b/src/H5FScache.c @@ -241,7 +241,7 @@ H5FS__cache_hdr_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5FS__cache_hdr_deserialize(const void *_image, size_t len, void *_udata, +H5FS__cache_hdr_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5FS_t *fspace = NULL; /* Free space header info */ @@ -404,8 +404,8 @@ H5FS__cache_hdr_image_len(const void *_thing, size_t *image_len) */ static herr_t H5FS__cache_hdr_pre_serialize(H5F_t *f, void *_thing, - haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t *new_addr, size_t *new_len, - unsigned *flags) + haddr_t addr, size_t H5_ATTR_UNUSED len, haddr_t H5_ATTR_NDEBUG_UNUSED *new_addr, + size_t H5_ATTR_NDEBUG_UNUSED *new_len, unsigned *flags) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ H5AC_ring_t orig_ring = H5AC_RING_INV; /* Original ring value */ @@ -694,7 +694,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len, +H5FS__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5FS_t *fspace = (H5FS_t *)_thing; /* Pointer to the object */ @@ -979,8 +979,8 @@ H5FS__cache_sinfo_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU *------------------------------------------------------------------------- */ static void * -H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, - hbool_t *dirty) +H5FS__cache_sinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, + hbool_t H5_ATTR_NDEBUG_UNUSED *dirty) { H5FS_sinfo_cache_ud_t *udata = (H5FS_sinfo_cache_ud_t *)_udata; /* User data for callback */ H5FS_t *fspace; /* free space manager */ @@ -1025,11 +1025,11 @@ H5FS__cache_sinfo_deserialize(const void *_image, size_t len, void *_udata, /* Check for any serialized sections */ if(fspace->serial_sect_count > 0) { - hsize_t old_tot_sect_count; /* Total section count from header */ - hsize_t old_serial_sect_count; /* Total serializable section count from header */ - hsize_t old_ghost_sect_count; /* Total ghost section count from header */ - hsize_t old_tot_space; /* Total space managed from header */ - unsigned sect_cnt_size; /* The size of the section size counts */ + hsize_t old_tot_sect_count; /* Total section count from header */ + hsize_t H5_ATTR_NDEBUG_UNUSED old_serial_sect_count; /* Total serializable section count from header */ + hsize_t H5_ATTR_NDEBUG_UNUSED old_ghost_sect_count; /* Total ghost section count from header */ + hsize_t H5_ATTR_NDEBUG_UNUSED old_tot_space; /* Total space managed from header */ + unsigned sect_cnt_size; /* The size of the section size counts */ /* Compute the size of the section counts */ sect_cnt_size = H5VM_limit_enc_size((uint64_t)fspace->serial_sect_count); @@ -1141,7 +1141,6 @@ static herr_t H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) { const H5FS_sinfo_t *sinfo = (const H5FS_sinfo_t *)_thing; /* Pointer to the object */ - const H5FS_t *fspace; /* Free space header */ FUNC_ENTER_STATIC_NOERR @@ -1149,10 +1148,9 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) HDassert(sinfo); HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); - fspace = sinfo->fspace; - HDassert(fspace); - HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(sinfo->fspace); + HDassert(sinfo->fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); HDassert(image_len); /* Set the image length size */ @@ -1180,7 +1178,8 @@ H5FS__cache_sinfo_image_len(const void *_thing, size_t *image_len) */ static herr_t H5FS__cache_sinfo_pre_serialize(H5F_t *f, void *_thing, haddr_t addr, - size_t len, haddr_t *new_addr, size_t *new_len, unsigned *flags) + size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr, size_t H5_ATTR_NDEBUG_UNUSED *new_len, + unsigned *flags) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ H5FS_t *fspace; /* Free space header */ @@ -1267,7 +1266,6 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, void *_thing) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ - H5FS_t *fspace; /* Free space header */ H5FS_iter_ud_t udata; /* User data for callbacks */ uint8_t *image = (uint8_t *)_image; /* Pointer into raw data buffer */ uint8_t *chksum_image = NULL; /* Points to chksum location */ @@ -1283,12 +1281,11 @@ H5FS__cache_sinfo_serialize(const H5F_t *f, void *_image, size_t len, HDassert(sinfo); HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); - fspace = sinfo->fspace; - HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(fspace->cache_info.is_pinned); - HDassert(fspace->sect_size == len); - HDassert(fspace->sect_cls); + HDassert(sinfo->fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(sinfo->fspace->cache_info.is_pinned); + HDassert(sinfo->fspace->sect_size == len); + HDassert(sinfo->fspace->sect_cls); /* Magic number */ H5MM_memcpy(image, H5FS_SINFO_MAGIC, (size_t)H5_SIZEOF_MAGIC); @@ -1418,7 +1415,6 @@ static herr_t H5FS__cache_sinfo_free_icr(void *_thing) { H5FS_sinfo_t *sinfo = (H5FS_sinfo_t *)_thing; /* Pointer to the object */ - H5FS_t *fspace; /* Free space header */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -1427,10 +1423,9 @@ H5FS__cache_sinfo_free_icr(void *_thing) HDassert(sinfo); HDassert(sinfo->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC); HDassert(sinfo->cache_info.type == H5AC_FSPACE_SINFO); - fspace = sinfo->fspace; - HDassert(fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); - HDassert(fspace->cache_info.type == H5AC_FSPACE_HDR); - HDassert(fspace->cache_info.is_pinned); + HDassert(sinfo->fspace->cache_info.magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + HDassert(sinfo->fspace->cache_info.type == H5AC_FSPACE_HDR); + HDassert(sinfo->fspace->cache_info.is_pinned); /* Destroy free space info */ if(H5FS__sinfo_dest(sinfo) < 0) diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index 31fc63c..d2e1f90 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -182,7 +182,7 @@ H5_DLL H5FS_t *H5FS_create(H5F_t *f, haddr_t *fs_addr, const H5FS_create_t *fs_c H5_DLL H5FS_t *H5FS_open(H5F_t *f, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); -H5_DLL herr_t H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size); +H5_DLL herr_t H5FS_size(const H5FS_t *fspace, hsize_t *meta_size); H5_DLL herr_t H5FS_delete(H5F_t *f, haddr_t fs_addr); H5_DLL herr_t H5FS_close(H5F_t *f, H5FS_t *fspace); H5_DLL herr_t H5FS_alloc_hdr(H5F_t *f, H5FS_t *fspace, haddr_t *fs_addr); diff --git a/src/H5Fint.c b/src/H5Fint.c index 1fd8f48..74189c1 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1509,8 +1509,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id) H5P_genplist_t *a_plist; /*file access property list */ H5F_close_degree_t fc_degree; /*file close degree */ size_t page_buf_size; - unsigned page_buf_min_meta_perc; - unsigned page_buf_min_raw_perc; + unsigned page_buf_min_meta_perc = 0; + unsigned page_buf_min_raw_perc = 0; hbool_t set_flag = FALSE; /*set the status_flags in the superblock */ hbool_t clear = FALSE; /*clear the status_flags */ hbool_t evict_on_close; /* evict on close value from plist */ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 125d6cf..f95f13d 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -344,7 +344,7 @@ H5F__cache_superblock_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *------------------------------------------------------------------------- */ static herr_t -H5F__cache_superblock_get_final_load_size(const void *_image, size_t image_len, +H5F__cache_superblock_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ @@ -434,7 +434,7 @@ H5F__cache_superblock_verify_chksum(const void *_image, size_t len, void *_udata *------------------------------------------------------------------------- */ static void * -H5F__cache_superblock_deserialize(const void *_image, size_t len, void *_udata, +H5F__cache_superblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5F_super_t *sblock = NULL; /* File's superblock */ @@ -867,7 +867,7 @@ H5F__cache_drvrinfo_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *i *------------------------------------------------------------------------- */ static herr_t -H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t image_len, +H5F__cache_drvrinfo_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ @@ -911,7 +911,7 @@ done: *------------------------------------------------------------------------- */ static void * -H5F__cache_drvrinfo_deserialize(const void *_image, size_t len, void *_udata, +H5F__cache_drvrinfo_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5O_drvinfo_t *drvinfo = NULL; /* Driver info */ @@ -1006,7 +1006,7 @@ H5F__cache_drvrinfo_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t len, +H5F__cache_drvrinfo_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5O_drvinfo_t *drvinfo = (H5O_drvinfo_t *)_thing; /* Pointer to the object */ diff --git a/src/H5Gnode.c b/src/H5Gnode.c index d11d7a0..35b90f3 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -762,12 +762,11 @@ done: *------------------------------------------------------------------------- */ static H5B_ins_t -H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, +H5G_node_remove(H5F_t *f, haddr_t addr, void H5_ATTR_NDEBUG_UNUSED *_lt_key/*in,out*/, hbool_t H5_ATTR_UNUSED *lt_key_changed/*out*/, void *_udata/*in,out*/, void *_rt_key/*in,out*/, hbool_t *rt_key_changed/*out*/) { - H5G_node_key_t *lt_key = (H5G_node_key_t *)_lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *)_rt_key; H5G_bt_rm_t *udata = (H5G_bt_rm_t *)_udata; H5G_node_t *sn = NULL; @@ -781,7 +780,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, /* Check arguments */ HDassert(f); HDassert(H5F_addr_defined(addr)); - HDassert(lt_key); + HDassert((H5G_node_key_t *)_lt_key); HDassert(rt_key); HDassert(udata && udata->common.heap); diff --git a/src/H5HFcache.c b/src/H5HFcache.c index 2d1c1f2..4a2ff91 100644 --- a/src/H5HFcache.c +++ b/src/H5HFcache.c @@ -403,7 +403,7 @@ H5HF__cache_hdr_get_initial_load_size(void *_udata, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_hdr_get_final_load_size(const void *_image, size_t image_len, +H5HF__cache_hdr_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { H5HF_hdr_t hdr; /* Temporary fractal heap header */ @@ -749,7 +749,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t len, +H5HF__cache_hdr_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HF_hdr_t *hdr = (H5HF_hdr_t *)_thing; /* Fractal heap info */ @@ -979,8 +979,8 @@ H5HF__cache_iblock_verify_chksum(const void *_image, size_t len, void H5_ATTR_UN *------------------------------------------------------------------------- */ static void * -H5HF__cache_iblock_deserialize(const void *_image, size_t len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) +H5HF__cache_iblock_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ H5HF_iblock_cache_ud_t *udata = (H5HF_iblock_cache_ud_t *)_udata; /* User data for callback */ @@ -1326,7 +1326,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t len, +H5HF__cache_iblock_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HF_hdr_t *hdr; /* Shared fractal heap information */ @@ -1471,8 +1471,8 @@ H5HF__cache_iblock_notify(H5AC_notify_action_t action, void *_thing) else { /* if this is a child iblock, verify that the pointers are */ /* either uninitialized or set up correctly. */ - H5HF_indirect_t *par_iblock = iblock->parent; - unsigned indir_idx; /* Index in parent's child iblock pointer array */ + H5HF_indirect_t H5_ATTR_NDEBUG_UNUSED *par_iblock = iblock->parent; + unsigned H5_ATTR_NDEBUG_UNUSED indir_idx; /* Index in parent's child iblock pointer array */ /* Sanity check */ HDassert(par_iblock->child_iblocks); @@ -2438,8 +2438,8 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF__cache_dblock_serialize(const H5F_t *f, void *image, size_t len, - void *_thing) +H5HF__cache_dblock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, + size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HF_direct_t *dblock = (H5HF_direct_t *)_thing; /* Direct block info */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5HFsection.c b/src/H5HFsection.c index f5ac8e5..c11bc34 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -1185,9 +1185,9 @@ H5HF__sect_single_valid(const H5FS_section_class_t H5_ATTR_UNUSED *cls, const H5 H5HF_indirect_t *iblock; /* Indirect block that section's direct block resides in */ haddr_t dblock_addr; /* Direct block address */ size_t dblock_size; /* Direct block size */ - size_t dblock_overhead; /* Direct block's overhead */ unsigned dblock_status = 0; /* Direct block's status in the metadata cache */ - herr_t status; /* Generic status value */ + size_t H5_ATTR_NDEBUG_UNUSED dblock_overhead; /* Direct block's overhead */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Generic status value */ /* Sanity check settings for section's direct block's parent */ iblock = sect->u.single.parent; @@ -2038,7 +2038,7 @@ H5HF__sect_row_valid(const H5FS_section_class_t *cls, const H5FS_section_info_t const H5HF_hdr_t *hdr; /* Fractal heap header */ const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Pointer to section to check */ const H5HF_free_section_t *indir_sect; /* Pointer to underlying indirect section */ - unsigned indir_idx; /* Index of row in underlying indirect section's row array */ + unsigned H5_ATTR_NDEBUG_UNUSED indir_idx; /* Index of row in underlying indirect section's row array */ FUNC_ENTER_STATIC_NOERR @@ -4125,7 +4125,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) dir_nrows = (max_dir_row - start_row) + 1; HDassert(dir_nrows == sect->u.indirect.dir_nrows); for(u = 0; u < dir_nrows; u++) { - const H5HF_free_section_t *tmp_row_sect; /* Pointer to row section */ + const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_row_sect; /* Pointer to row section */ tmp_row_sect = sect->u.indirect.dir_rows[u]; HDassert(tmp_row_sect->sect_info.type == H5HF_FSPACE_SECT_FIRST_ROW @@ -4133,7 +4133,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) HDassert(tmp_row_sect->u.row.under == sect); HDassert(tmp_row_sect->u.row.row == (start_row + u)); if(u > 0) { - const H5HF_free_section_t *tmp_row_sect2; /* Pointer to row section */ + const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_row_sect2; /* Pointer to row section */ tmp_row_sect2 = sect->u.indirect.dir_rows[u - 1]; HDassert(tmp_row_sect2->u.row.row < tmp_row_sect->u.row.row); @@ -4160,7 +4160,7 @@ H5HF_sect_indirect_valid(const H5HF_hdr_t *hdr, const H5HF_free_section_t *sect) HDassert(tmp_child_sect->sect_info.type == H5HF_FSPACE_SECT_INDIRECT); HDassert(tmp_child_sect->u.indirect.parent == sect); if(u > 0) { - const H5HF_free_section_t *tmp_child_sect2; /* Pointer to child indirect section */ + const H5HF_free_section_t H5_ATTR_NDEBUG_UNUSED *tmp_child_sect2; /* Pointer to child indirect section */ tmp_child_sect2 = sect->u.indirect.indir_ents[u - 1]; HDassert(H5F_addr_lt(tmp_child_sect2->sect_info.addr, tmp_child_sect->sect_info.addr)); diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 37a0502..ad5ff0f 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -447,7 +447,7 @@ H5HF__space_size(H5HF_hdr_t *hdr, hsize_t *fs_size) /* Get free space metadata size */ if(hdr->fspace) { - if(H5FS_size(hdr->f, hdr->fspace, fs_size) < 0) + if(H5FS_size(hdr->fspace, fs_size) < 0) HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't retrieve FS meta storage info") } /* end if */ else diff --git a/src/H5HGcache.c b/src/H5HGcache.c index 29e88df..18625cc 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -202,7 +202,7 @@ H5HG__cache_heap_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *imag *------------------------------------------------------------------------- */ static herr_t -H5HG__cache_heap_get_final_load_size(const void *image, size_t image_len, +H5HG__cache_heap_get_final_load_size(const void *image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *udata, size_t *actual_len) { H5HG_heap_t heap; /* Global heap */ @@ -432,7 +432,7 @@ H5HG__cache_heap_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HG__cache_heap_serialize(const H5F_t *f, void *image, size_t len, +H5HG__cache_heap_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, size_t len, void *_thing) { H5HG_heap_t *heap = (H5HG_heap_t *)_thing; diff --git a/src/H5HLcache.c b/src/H5HLcache.c index 8b04b47..b0ac05f 100644 --- a/src/H5HLcache.c +++ b/src/H5HLcache.c @@ -364,7 +364,7 @@ H5HL__cache_prefix_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *im *------------------------------------------------------------------------- */ static herr_t -H5HL__cache_prefix_get_final_load_size(const void *_image, size_t image_len, +H5HL__cache_prefix_get_final_load_size(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { const uint8_t *image = (const uint8_t *)_image; /* Pointer into raw data buffer */ @@ -415,8 +415,8 @@ done: *------------------------------------------------------------------------- */ static void * -H5HL__cache_prefix_deserialize(const void *_image, size_t len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) +H5HL__cache_prefix_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5HL_t *heap = NULL; /* Local heap */ H5HL_prfx_t *prfx = NULL; /* Heap prefix deserialized */ @@ -555,7 +555,7 @@ H5HL__cache_prefix_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HL__cache_prefix_serialize(const H5F_t *f, void *_image, size_t len, +H5HL__cache_prefix_serialize(const H5_ATTR_NDEBUG_UNUSED H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HL_prfx_t *prfx = (H5HL_prfx_t *)_thing; /* Pointer to local heap prefix to query */ @@ -826,8 +826,8 @@ H5HL__cache_datablock_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5HL__cache_datablock_serialize(const H5F_t *f, void *image, size_t len, - void *_thing) +H5HL__cache_datablock_serialize(const H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *image, + size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5HL_t *heap; /* Pointer to the local heap */ H5HL_dblk_t *dblk = (H5HL_dblk_t *)_thing; /* Pointer to the local heap data block */ @@ -2290,7 +2290,7 @@ H5MF_get_freespace(H5F_t *f, hsize_t *tot_space, hsize_t *meta_size) /* Retrieve free space size from free space manager */ if(H5FS_sect_stats(f->shared->fs_man[type], &type_fs_size, NULL) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space stats") - if(H5FS_size(f, f->shared->fs_man[type], &type_meta_size) < 0) + if(H5FS_size(f->shared->fs_man[type], &type_meta_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space metadata stats") /* Increment total free space for types */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index 23aba09..2d95ee9 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -334,7 +334,7 @@ H5O__ainfo_free(void *mesg) *------------------------------------------------------------------------- */ static herr_t -H5O__ainfo_delete(H5F_t *f, H5O_t *open_oh, void *_mesg) +H5O__ainfo_delete(H5F_t *f, H5O_t H5_ATTR_NDEBUG_UNUSED *open_oh, void *_mesg) { H5O_ainfo_t *ainfo = (H5O_ainfo_t *)_mesg; herr_t ret_value = SUCCEED; /* Return value */ @@ -405,9 +405,9 @@ H5O_ainfo_pre_copy_file(H5F_t H5_ATTR_UNUSED *file_src, const void H5_ATTR_UNUSE *------------------------------------------------------------------------- */ static void * -H5O__ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, +H5O__ainfo_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, void *mesg_src, H5F_t *file_dst, hbool_t H5_ATTR_UNUSED *recompute_size, unsigned H5_ATTR_UNUSED *mesg_flags, - H5O_copy_t *cpy_info, void H5_ATTR_UNUSED *udata) + H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index c1f90cb..8850ef6 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -111,7 +111,7 @@ H5FL_EXTERN(H5O_cont_t); *------------------------------------------------------------------------- */ static herr_t -H5O__add_gap(H5F_t *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, +H5O__add_gap(H5F_t H5_ATTR_NDEBUG_UNUSED *f, H5O_t *oh, unsigned chunkno, hbool_t *chk_dirtied, size_t idx, uint8_t *new_gap_loc, size_t new_gap_size) { hbool_t merged_with_null; /* Whether the gap was merged with a null message */ diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 683d155..8bad181 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -201,7 +201,7 @@ H5O__cache_get_initial_load_size(void H5_ATTR_UNUSED *_udata, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5O__cache_get_final_load_size(const void *image, size_t image_len, +H5O__cache_get_final_load_size(const void *image, size_t H5_ATTR_NDEBUG_UNUSED image_len, void *_udata, size_t *actual_len) { H5O_cache_ud_t *udata = (H5O_cache_ud_t *)_udata; /* User data for callback */ @@ -306,7 +306,7 @@ H5O__cache_verify_chksum(const void *_image, size_t len, void *_udata) *------------------------------------------------------------------------- */ static void * -H5O__cache_deserialize(const void *image, size_t len, void *_udata, +H5O__cache_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t *dirty) { H5O_t *oh = NULL; /* Object header read in */ @@ -763,7 +763,7 @@ H5O__cache_chk_verify_chksum(const void *_image, size_t len, void *_udata) *------------------------------------------------------------------------- */ static void * -H5O__cache_chk_deserialize(const void *image, size_t len, void *_udata, +H5O__cache_chk_deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_udata, hbool_t *dirty) { H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk proxy object */ diff --git a/src/H5Omessage.c b/src/H5Omessage.c index 18f3706..d66ea69 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1686,17 +1686,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_msg_reset_share(unsigned type_id, void *mesg) +H5O_msg_reset_share(unsigned H5_ATTR_NDEBUG_UNUSED type_id, void *mesg) { - const H5O_msg_class_t *type; /* Actual H5O class type for the ID */ - FUNC_ENTER_NOAPI_NOINIT_NOERR /* Check args */ HDassert(type_id < NELMTS(H5O_msg_class_g)); - type = H5O_msg_class_g[type_id]; /* map the type ID to the actual type object */ - HDassert(type); - HDassert(type->share_flags & H5O_SHARE_IS_SHARABLE); + HDassert(H5O_msg_class_g[type_id]); /* map the type ID to the actual type object */ + HDassert(H5O_msg_class_g[type_id]->share_flags & H5O_SHARE_IS_SHARABLE); HDassert(mesg); /* Reset the shared component in the message to zero. */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 67ca76f..b49e501 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -589,9 +589,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O__shared_copy_file(H5F_t *file_src, H5F_t *file_dst, +H5O__shared_copy_file(H5F_t H5_ATTR_NDEBUG_UNUSED *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, - hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, + hbool_t H5_ATTR_UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t H5_ATTR_NDEBUG_UNUSED *cpy_info, void H5_ATTR_UNUSED *udata) { const H5O_shared_t *shared_src = (const H5O_shared_t *)_native_src; /* Alias to shared info in native source */ diff --git a/src/H5Oshared.h b/src/H5Oshared.h index 8040a6a..e4ad980 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -381,7 +381,7 @@ done: *------------------------------------------------------------------------- */ static H5_INLINE herr_t -H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, +H5O_SHARED_POST_COPY_FILE(const H5O_loc_t H5_ATTR_NDEBUG_UNUSED *oloc_src, const void *mesg_src, H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, H5O_copy_t *cpy_info) { diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 22252d3..3668229 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -5753,10 +5753,10 @@ H5P__facc_vol_cmp(const void *_info1, const void *_info2, size_t H5_ATTR_UNUSED { const H5VL_connector_prop_t *info1 = (const H5VL_connector_prop_t *)_info1; /* Create local aliases for values */ const H5VL_connector_prop_t *info2 = (const H5VL_connector_prop_t *)_info2; - H5VL_class_t *cls1, *cls2; /* connector class for each property */ - int cmp_value = 0; /* Value from comparison */ - herr_t status; /* Status from info comparison */ - int ret_value = 0; /* Return value */ + H5VL_class_t *cls1, *cls2; /* connector class for each property */ + int cmp_value = 0; /* Value from comparison */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Status from info comparison */ + int ret_value = 0; /* Return value */ FUNC_ENTER_STATIC_NOERR diff --git a/src/H5Pint.c b/src/H5Pint.c index 2911eef..0810427 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -2780,8 +2780,8 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__poke_plist_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, - void *_udata) +H5P__poke_plist_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, + H5P_genprop_t *prop, void *_udata) { H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2827,7 +2827,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__poke_pclass_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, +H5P__poke_pclass_cb(H5P_genplist_t *plist, const char H5_ATTR_NDEBUG_UNUSED *name, H5P_genprop_t *prop, void *_udata) { H5P_prop_set_ud_t *udata = (H5P_prop_set_ud_t *)_udata; /* User data for callback */ @@ -4260,10 +4260,9 @@ property list class. REVISION LOG --------------------------------------------------------------------------*/ static int -H5P__iterate_pclass_cb(void *_item, void *_key, void *_udata) +H5P__iterate_pclass_cb(void *_item, void H5_ATTR_NDEBUG_UNUSED *_key, void *_udata) { H5P_genprop_t *item = (H5P_genprop_t *)_item; /* Pointer to the property */ - char *key = (char *)_key; /* Pointer to the property's name */ H5P_iter_pclass_ud_t *udata = (H5P_iter_pclass_ud_t *)_udata; /* Pointer to user data */ int ret_value = 0; /* Return value */ @@ -4271,7 +4270,7 @@ H5P__iterate_pclass_cb(void *_item, void *_key, void *_udata) /* Sanity check */ HDassert(item); - HDassert(key); + HDassert((char *)_key); /* Check if we've found the correctly indexed property */ if(*udata->curr_idx_ptr >= udata->prev_idx) { @@ -4397,8 +4396,8 @@ done: REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5P__peek_cb(H5P_genplist_t *plist, const char *name, H5P_genprop_t *prop, - void *_udata) +H5P__peek_cb(H5P_genplist_t H5_ATTR_NDEBUG_UNUSED *plist, const char H5_ATTR_NDEBUG_UNUSED *name, + H5P_genprop_t *prop, void *_udata) { H5P_prop_get_ud_t *udata = (H5P_prop_get_ud_t *)_udata; /* User data for callback */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Plapl.c b/src/H5Plapl.c index 7a7cc23..c4642e2 100644 --- a/src/H5Plapl.c +++ b/src/H5Plapl.c @@ -567,7 +567,7 @@ H5P__lacc_elink_fapl_cmp(const void *value1, const void *value2, size_t H5_ATTR_ if(obj1 == NULL && obj2 != NULL) HGOTO_DONE(1); if(obj1 != NULL && obj2 == NULL) HGOTO_DONE(-1); if(obj1 && obj2) { - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; status = H5P__cmp_plist(obj1, obj2, &ret_value); HDassert(status >= 0); diff --git a/src/H5Pmapl.c b/src/H5Pmapl.c index fe5be0f..3a3f619 100644 --- a/src/H5Pmapl.c +++ b/src/H5Pmapl.c @@ -137,6 +137,7 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P__macc_reg_prop() */ +#ifdef H5_HAVE_MAP_API /*------------------------------------------------------------------------- * Function: H5Pset_map_iterate_hints @@ -214,4 +215,4 @@ H5Pget_map_iterate_hints(hid_t mapl_id, size_t *key_prefetch_size, size_t *key_a done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_map_iterate_hints() */ - +#endif diff --git a/src/H5Rint.c b/src/H5Rint.c index af1b6e2..486c1ff 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) @@ -652,7 +652,7 @@ int H5SL_term_package(void) /* Terminate all the factories */ if(H5SL_fac_nused_g > 0) { size_t i; - herr_t ret; + herr_t H5_ATTR_NDEBUG_UNUSED ret; for(i = 0; i < H5SL_fac_nused_g; i++) { ret = H5FL_fac_term(H5SL_fac_g[i]); diff --git a/src/H5SMcache.c b/src/H5SMcache.c index ee28fa4..6d0f2b0 100644 --- a/src/H5SMcache.c +++ b/src/H5SMcache.c @@ -212,8 +212,8 @@ H5SM__cache_table_verify_chksum(const void *_image, size_t len, void H5_ATTR_UNU *------------------------------------------------------------------------- */ static void * -H5SM__cache_table_deserialize(const void *_image, size_t len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) +H5SM__cache_table_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5F_t *f; /* File pointer -- from user data */ H5SM_master_table_t *table = NULL; /* Shared message table that we deserializing */ @@ -364,7 +364,7 @@ H5SM__cache_table_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t len, +H5SM__cache_table_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5SM_master_table_t *table = (H5SM_master_table_t *)_thing; /* Shared message table to encode */ @@ -568,8 +568,8 @@ H5SM__cache_list_verify_chksum(const void *_image, size_t H5_ATTR_UNUSED len, vo *------------------------------------------------------------------------- */ static void * -H5SM__cache_list_deserialize(const void *_image, size_t len, void *_udata, - hbool_t H5_ATTR_UNUSED *dirty) +H5SM__cache_list_deserialize(const void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, + void *_udata, hbool_t H5_ATTR_UNUSED *dirty) { H5SM_list_t *list = NULL; /* The SOHM list being read in */ H5SM_list_cache_ud_t *udata = (H5SM_list_cache_ud_t *)_udata; /* User data for callback */ @@ -687,7 +687,7 @@ H5SM__cache_list_image_len(const void *_thing, size_t *image_len) *------------------------------------------------------------------------- */ static herr_t -H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t len, +H5SM__cache_list_serialize(const H5F_t *f, void *_image, size_t H5_ATTR_NDEBUG_UNUSED len, void *_thing) { H5SM_list_t *list = (H5SM_list_t *)_thing ; /* Instance being serialized */ 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/H5Tconv.c b/src/H5Tconv.c index 8a0c562..29fd582 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -1848,7 +1848,7 @@ H5T_conv_struct_free(H5T_conv_struct_t *priv) for(i = 0; i < priv->src_nmembs; i++) if(src2dst[i] >= 0) { - int status; + int H5_ATTR_NDEBUG_UNUSED status; status = H5I_dec_ref(src_memb_id[i]); HDassert(status >= 0); diff --git a/src/H5Tref.c b/src/H5Tref.c index 83604c1..f97b78a 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -784,7 +784,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t src_size, +H5T__ref_disk_read(H5VL_object_t *src_file, const void *src_buf, size_t H5_ATTR_NDEBUG_UNUSED src_size, H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, size_t dst_size) { const uint8_t *p = (const uint8_t *)src_buf; @@ -1101,7 +1101,11 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, { size_t ret_value = sizeof(struct H5Tref_dsetreg); +#ifndef NDEBUG FUNC_ENTER_STATIC +#else + FUNC_ENTER_STATIC_NOERR +#endif HDassert(src_buf); @@ -1125,7 +1129,9 @@ H5T__ref_dsetreg_disk_getsize(H5VL_object_t H5_ATTR_UNUSED *src_file, } #endif /* NDEBUG */ +#ifndef NDEBUG done: +#endif FUNC_LEAVE_NOAPI(ret_value) } /* end H5T__ref_dsetreg_disk_getsize() */ 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 b25f744..d9f161c 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -75,7 +75,7 @@ H5_mpi_set_bigio_count(hsize_t new_count) *------------------------------------------------------------------------- */ hsize_t -H5_mpi_get_bigio_count() +H5_mpi_get_bigio_count(void) { return bigio_count; } @@ -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/src/H5private.h b/src/H5private.h index f46a3a8..74fab79 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -305,15 +305,21 @@ */ #ifdef __cplusplus # define H5_ATTR_FORMAT(X,Y,Z) /*void*/ -# define H5_ATTR_UNUSED /*void*/ -# define H5_ATTR_NORETURN /*void*/ -# define H5_ATTR_CONST /*void*/ -# define H5_ATTR_PURE /*void*/ -# define H5_ATTR_FALLTHROUGH /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NDEBUG_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ +# define H5_ATTR_CONST /*void*/ +# define H5_ATTR_PURE /*void*/ +# define H5_ATTR_FALLTHROUGH /*void*/ #else /* __cplusplus */ #if defined(H5_HAVE_ATTRIBUTE) && !defined(__SUNPRO_C) # define H5_ATTR_FORMAT(X,Y,Z) __attribute__((format(X, Y, Z))) # define H5_ATTR_UNUSED __attribute__((unused)) +#ifndef NDEBUG +#define H5_ATTR_NDEBUG_UNUSED /*void*/ +#else /* NDEBUG */ +#define H5_ATTR_NDEBUG_UNUSED H5_ATTR_UNUSED +#endif /* NDEBUG */ # define H5_ATTR_NORETURN __attribute__((noreturn)) # define H5_ATTR_CONST __attribute__((const)) # define H5_ATTR_PURE __attribute__((pure)) @@ -324,11 +330,12 @@ #endif #else # define H5_ATTR_FORMAT(X,Y,Z) /*void*/ -# define H5_ATTR_UNUSED /*void*/ -# define H5_ATTR_NORETURN /*void*/ -# define H5_ATTR_CONST /*void*/ -# define H5_ATTR_PURE /*void*/ -# define H5_ATTR_FALLTHROUGH /*void*/ +# define H5_ATTR_UNUSED /*void*/ +# define H5_ATTR_NDEBUG_UNUSED /*void*/ +# define H5_ATTR_NORETURN /*void*/ +# define H5_ATTR_CONST /*void*/ +# define H5_ATTR_PURE /*void*/ +# define H5_ATTR_FALLTHROUGH /*void*/ #endif #endif /* __cplusplus */ @@ -1609,7 +1616,7 @@ extern char *strdup(const char *s); srctype _tmp_src = (srctype)(src); \ dsttype _tmp_dst = (dsttype)(_tmp_src); \ HDassert(_tmp_src >= 0); \ - HDassert(_tmp_src == _tmp_dst); \ + HDassert(_tmp_src == (srctype)_tmp_dst); \ (dst) = _tmp_dst; \ } @@ -2677,7 +2684,7 @@ H5_DLL herr_t H5_combine_path(const char *path1, const char *path2, char **ful #ifdef H5_HAVE_PARALLEL /* Generic MPI functions */ H5_DLL hsize_t H5_mpi_set_bigio_count(hsize_t new_count); -H5_DLL hsize_t H5_mpi_get_bigio_count(); +H5_DLL hsize_t H5_mpi_get_bigio_count(void); H5_DLL herr_t H5_mpi_comm_dup(MPI_Comm comm, MPI_Comm *comm_new); H5_DLL herr_t H5_mpi_info_dup(MPI_Info info, MPI_Info *info_new); H5_DLL herr_t H5_mpi_comm_free(MPI_Comm *comm); diff --git a/test/cache_common.c b/test/cache_common.c index f977c3c..038a0ed 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -17,6 +17,7 @@ * This file contains common code for tests of the cache * implemented in H5C.c */ +#include "H5private.h" #include "H5CXprivate.h" /* API Contexts */ #include "H5MMprivate.h" @@ -553,7 +554,7 @@ addr_to_type_and_index(haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -get_initial_load_size(void *udata, size_t *image_length, int32_t entry_type) +get_initial_load_size(void *udata, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -663,7 +664,7 @@ notify_get_initial_load_size(void *udata, size_t *image_length) */ static herr_t get_final_load_size(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED image_len, - void *udata, size_t *actual_len, int32_t entry_type) + void *udata, size_t *actual_len, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -723,7 +724,8 @@ variable_get_final_load_size(const void *image, size_t image_len, */ static htri_t -verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, int32_t entry_type) +verify_chksum(const void H5_ATTR_UNUSED *image, size_t H5_ATTR_UNUSED len, void *udata, + int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -776,8 +778,8 @@ variable_verify_chksum(const void *image, size_t len, void *udata) *------------------------------------------------------------------------- */ static void * -deserialize(const void *image, size_t len, void *udata, hbool_t *dirty, - int32_t entry_type) +deserialize(const void *image, size_t H5_ATTR_NDEBUG_UNUSED len, void *udata, hbool_t *dirty, + int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; test_entry_t *base_addr; @@ -933,12 +935,10 @@ notify_deserialize(const void *image, size_t len, void *udata, hbool_t *dirty) *------------------------------------------------------------------------- */ herr_t -image_len(const void *thing, size_t *image_length, int32_t entry_type) +image_len(const void *thing, size_t *image_length, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { const test_entry_t *entry; - test_entry_t *base_addr; int32_t type; - int32_t idx; HDassert(thing); HDassert(image_length); @@ -948,14 +948,12 @@ image_len(const void *thing, size_t *image_length, int32_t entry_type) HDassert(entry->self == entry); type = entry->type; - idx = entry->index; HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); HDassert(type == entry_type); - HDassert((idx >= 0) && (idx <= max_indices[type])); + HDassert((entry->index >= 0) && (entry->index <= max_indices[type])); - base_addr = entries[type]; - HDassert(entry == &(base_addr[idx])); + HDassert(entry == &(entries[type][entry->index])); if(type != VARIABLE_ENTRY_TYPE) HDassert(entry->size == entry_sizes[type]); @@ -1055,18 +1053,15 @@ notify_image_len(const void *thing, size_t *image_length) *------------------------------------------------------------------------- */ herr_t -pre_serialize(H5F_t *f, +pre_serialize(H5F_t H5_ATTR_NDEBUG_UNUSED *f, void *thing, - haddr_t addr, - size_t len, + haddr_t H5_ATTR_NDEBUG_UNUSED addr, + size_t H5_ATTR_NDEBUG_UNUSED len, haddr_t *new_addr_ptr, size_t *new_len_ptr, unsigned *flags_ptr) { test_entry_t *entry; - test_entry_t *base_addr; - int32_t type; - int32_t idx; int32_t i; HDassert(f); @@ -1086,16 +1081,9 @@ pre_serialize(H5F_t *f, /* shouldn't serialize the entry unless it is dirty */ HDassert(entry->is_dirty); - - type = entry->type; - idx = entry->index; - - HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((idx >= 0) && (idx <= max_indices[type])); - - base_addr = entries[type]; - - HDassert(entry == &(base_addr[idx])); + HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); + HDassert((entry->index >= 0) && (entry->index <= max_indices[entry->type])); + HDassert(entry == &(entries[entry->type][entry->index])); HDassert(entry->num_flush_ops >= 0); HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); @@ -1307,9 +1295,7 @@ herr_t serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thing) { test_entry_t *entry; - test_entry_t *base_addr; int32_t type; - int32_t idx; HDassert(image_ptr); HDassert(thing); @@ -1323,14 +1309,11 @@ serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, void *thin HDassert(entry->is_dirty); type = entry->type; - idx = entry->index; HDassert((type >= 0) && (type < NUMBER_OF_ENTRY_TYPES)); - HDassert((idx >= 0) && (idx <= max_indices[type])); + HDassert((entry->index >= 0) && (entry->index <= max_indices[type])); - base_addr = entries[type]; - - HDassert(entry == &(base_addr[idx])); + HDassert(entry == &(entries[type][entry->index])); HDassert(entry->num_flush_ops >= 0); HDassert(entry->num_flush_ops < MAX_FLUSH_OPS); @@ -1461,21 +1444,19 @@ notify_serialize(const H5F_t H5_ATTR_UNUSED *f, void *image_ptr, size_t len, *------------------------------------------------------------------------- */ static herr_t -notify(H5C_notify_action_t action, void *thing, int32_t entry_type) +notify(H5C_notify_action_t action, void *thing, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { test_entry_t *entry; - test_entry_t *base_addr; HDassert(thing); entry = (test_entry_t *)thing; - base_addr = entries[entry->type]; HDassert(entry->index >= 0); HDassert(entry->index <= max_indices[entry->type]); HDassert((entry->type >= 0) && (entry->type < NUMBER_OF_ENTRY_TYPES)); HDassert(entry->type == entry_type); - HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == &(entries[entry->type][entry->index])); HDassert(entry == entry->self); if(!(action == H5C_NOTIFY_ACTION_ENTRY_DIRTIED && entry->action == TEST_ENTRY_ACTION_MOVE)) HDassert(entry->header.addr == entry->addr); @@ -1540,18 +1521,14 @@ notify_notify(H5C_notify_action_t action, void *thing) *------------------------------------------------------------------------- */ herr_t -free_icr(test_entry_t *entry, int32_t entry_type) +free_icr(test_entry_t *entry, int32_t H5_ATTR_NDEBUG_UNUSED entry_type) { - test_entry_t *base_addr; - HDassert(entry); - base_addr = entries[entry->type]; - HDassert(entry->type == entry_type); HDassert(entry->index >= 0); HDassert(entry->index <= max_indices[entry->type]); - HDassert(entry == &(base_addr[entry->index])); + HDassert(entry == &(entries[entry->type][entry->index])); HDassert(entry == entry->self); HDassert(entry->cache_ptr != NULL); HDassert(entry->cache_ptr->magic == H5C__H5C_T_MAGIC); diff --git a/test/cache_tagging.c b/test/cache_tagging.c index 564e5bc..cf0cd8d 100644 --- a/test/cache_tagging.c +++ b/test/cache_tagging.c @@ -3900,9 +3900,10 @@ check_invalid_tag_application(void) #if H5C_DO_TAGGING_SANITY_CHECKS error: if(api_ctx_pushed) H5CX_pop(); -#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ return 1; +#endif /* H5C_DO_TAGGING_SANITY_CHECKS */ + } /* check_invalid_tag_application */ diff --git a/test/dsets.c b/test/dsets.c index 82766bf..8f89d82 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -7165,8 +7165,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]); @@ -7286,14 +7286,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]); @@ -7402,8 +7402,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]); @@ -7551,10 +7551,10 @@ static herr_t test_deprec(hid_t file) { hid_t dataset, space, small_space, create_parms, dcpl; - hsize_t dims[2], small_dims[2]; - hsize_t deprec_size; - herr_t status; - hsize_t csize[2]; + hsize_t dims[2], small_dims[2]; + hsize_t deprec_size; + herr_t H5_ATTR_NDEBUG_UNUSED status; + hsize_t csize[2]; TESTING("deprecated API routines"); @@ -9524,8 +9524,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]); @@ -9653,8 +9653,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/dtypes.c b/test/dtypes.c index b88e5b7..4805b0b 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -6732,7 +6732,7 @@ static void create_del_obj_named_test_file(const char *filename, hid_t fapl, hid_t my_fapl; /* Copy of file access property list ID */ hid_t dcpl; /* Dataset creation property list ID */ unsigned use_at_least_v18;/* Whether to use old or new format */ - herr_t status; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Generic return value */ /* Make copy of FAPL */ my_fapl = H5Pcopy(fapl); @@ -7528,7 +7528,7 @@ error: *------------------------------------------------------------------------- */ static int -set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) +set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t is_multi_or_split) { H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl_arr[H5FD_MEM_NTYPES]; @@ -7537,7 +7537,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) hbool_t relax; H5FD_mem_t mt; - HDassert(multi || split); + HDassert(is_multi_or_split); HDmemset(memb_name, 0, sizeof memb_name); @@ -7545,7 +7545,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) if(H5Pget_fapl_multi(fapl, memb_map, memb_fapl_arr, memb_name, memb_addr, &relax) < 0) TEST_ERROR - if(split) { + if(is_multi_or_split) { /* Set memb_addr aligned */ memb_addr[H5FD_MEM_SUPER] = ((memb_addr[H5FD_MEM_SUPER] + pagesize - 1) / pagesize) * pagesize; memb_addr[H5FD_MEM_DRAW] = ((memb_addr[H5FD_MEM_DRAW] + pagesize - 1) / pagesize) * pagesize; @@ -7614,7 +7614,7 @@ test_page_alloc_xfree(const char *env_h5_drvr, hid_t fapl) if((fapl_new = H5Pcopy(fapl)) < 0) TEST_ERROR if(multi || split) - if(set_multi_split(fapl_new, 4096, multi, split) < 0) + if(set_multi_split(fapl_new, 4096, split) < 0) TEST_ERROR; /* Test with TRUE or FALSE for persisting free-space */ diff --git a/test/page_buffer.c b/test/page_buffer.c index 5313c9b..21ffbf5 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -38,23 +38,25 @@ #define FILENAME_LEN 1024 + +/* test routines */ +#ifdef H5_HAVE_PARALLEL +static unsigned verify_page_buffering_disabled(hid_t orig_fapl, + const char *env_h5_drvr); +#else #define NUM_DSETS 5 #define NX 100 #define NY 50 -/* helper routines */ -static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl); -static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size); - -/* test routines */ static unsigned test_args(hid_t fapl, const char *env_h5_drvr); static unsigned test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr); static unsigned test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr); static unsigned test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr); static unsigned test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr); -#ifdef H5_HAVE_PARALLEL -static unsigned verify_page_buffering_disabled(hid_t orig_fapl, - const char *env_h5_drvr); + +/* helper routines */ +static unsigned create_file(char *filename, hid_t fcpl, hid_t fapl); +static unsigned open_file(char *filename, hid_t fapl, hsize_t page_size, size_t page_buffer_size); #endif /* H5_HAVE_PARALLEL */ const char *FILENAME[] = { @@ -62,6 +64,7 @@ const char *FILENAME[] = { NULL }; +#ifndef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- * Function: create_file() @@ -296,6 +299,7 @@ error: } H5E_END_TRY; return 1; } +#endif /* H5_HAVE_PARALLEL */ /* * @@ -357,6 +361,7 @@ error: } /* set_multi_split() */ +#ifndef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- * Function: test_args() @@ -379,6 +384,7 @@ error: * *------------------------------------------------------------------------- */ + static unsigned test_args(hid_t orig_fapl, const char *env_h5_drvr) { @@ -2002,6 +2008,7 @@ error: return 1; } /* test_stats_collection */ +#endif /* #ifndef H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- 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/tfile.c b/test/tfile.c index 2752282..663556c 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -25,6 +25,7 @@ #include "H5Iprivate.h" #include "H5Pprivate.h" #include "H5VLprivate.h" /* Virtual Object Layer */ +#include "H5private.h" /* * This file needs to access private information from the H5F package. @@ -4208,7 +4209,7 @@ test_filespace_info(const char *env_h5_drvr) ** *****************************************************************/ static int -set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) +set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t split) { H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl_arr[H5FD_MEM_NTYPES]; @@ -4217,7 +4218,7 @@ set_multi_split(hid_t fapl, hsize_t pagesize, hbool_t multi, hbool_t split) hbool_t relax; H5FD_mem_t mt; - HDassert(split || multi); + HDassert(split); HDmemset(memb_name, 0, sizeof memb_name); @@ -4308,7 +4309,7 @@ test_file_freespace(const char *env_h5_drvr) my_fapl = new_fapl; if(multi_vfd || split_vfd) { - ret = set_multi_split(new_fapl, FSP_SIZE_DEF, multi_vfd, split_vfd); + ret = set_multi_split(new_fapl, FSP_SIZE_DEF, split_vfd); CHECK(ret, FAIL, "set_multi_split"); } @@ -4474,7 +4475,7 @@ test_sects_freespace(const char *env_h5_drvr, hbool_t new_format) /* Set up paged aligned address space for multi/split driver */ if(multi_vfd || split_vfd) { - ret = set_multi_split(fapl, FSP_SIZE_DEF, multi_vfd, split_vfd); + ret = set_multi_split(fapl, FSP_SIZE_DEF, split_vfd); CHECK(ret, FAIL, "set_multi_split"); } diff --git a/test/tmisc.c b/test/tmisc.c index 7b7f5ba..0ea9c4c 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -128,15 +128,19 @@ typedef struct /* Definitions for misc. test #8 */ #define MISC8_FILE "tmisc8.h5" #define MISC8_DSETNAME1 "Dataset1" -#define MISC8_DSETNAME2 "Dataset2" -#define MISC8_DSETNAME3 "Dataset3" #define MISC8_DSETNAME4 "Dataset4" #define MISC8_DSETNAME5 "Dataset5" +#define MISC8_DSETNAME8 "Dataset8" + +#ifndef H5_HAVE_PARALLEL +#define MISC8_DSETNAME2 "Dataset2" +#define MISC8_DSETNAME3 "Dataset3" #define MISC8_DSETNAME6 "Dataset6" #define MISC8_DSETNAME7 "Dataset7" -#define MISC8_DSETNAME8 "Dataset8" #define MISC8_DSETNAME9 "Dataset9" #define MISC8_DSETNAME10 "Dataset10" +#endif + #define MISC8_RANK 2 #define MISC8_DIM0 50 #define MISC8_DIM1 50 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/tselect.c b/test/tselect.c index 27bc36b..390f61f 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -25,7 +25,6 @@ #define H5S_TESTING #include "testhdf5.h" -#include "hdf5.h" #include "H5Spkg.h" /* Dataspaces */ #define FILENAME "tselect.h5" @@ -1613,7 +1612,7 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) ****************************************************************/ static void verify_select_hyper_contig_dr__run_test(const uint16_t *cube_buf, - size_t cube_size, unsigned edge_size, unsigned cube_rank) + size_t H5_ATTR_NDEBUG_UNUSED cube_size, unsigned edge_size, unsigned cube_rank) { const uint16_t *cube_ptr; /* Pointer into the cube buffer */ uint16_t expected_value; /* Expected value in dataset */ diff --git a/test/use_common.c b/test/use_common.c index 9effa06..4111b24 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -343,44 +343,45 @@ int write_uc_file(hbool_t tosend, hid_t fid) count[1]=dims[1]; count[2]=dims[2]; for (i=0; i<UC_opts.nplanes; i++){ - /* fill buffer with value i+1 */ - bufptr = buffer; - for (j=0; j<dims[1]; j++) - for (k=0; k<dims[2]; k++) - *bufptr++ = (UC_CTYPE)i; + /* fill buffer with value i+1 */ + bufptr = buffer; + for (j=0; j<dims[1]; j++) + for (k=0; k<dims[2]; k++) + *bufptr++ = (UC_CTYPE)i; /* Cork the dataset's metadata in the cache, if SWMR is enabled */ - if(UC_opts.use_swmr) + if(UC_opts.use_swmr) { if(H5Odisable_mdc_flushes(dsid) < 0) { HDfprintf(stderr, "H5Odisable_mdc_flushes failed\n"); return -1; } + } - /* extend the dataset by one for new plane */ - dims[0]=i+1; + /* extend the dataset by one for new plane */ + dims[0]=i+1; if(H5Dset_extent(dsid, dims) < 0){ HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } /* Get the dataset's dataspace */ if((f_sid = H5Dget_space(dsid)) < 0){ HDfprintf(stderr, "H5Dset_extent failed\n"); return -1; - } + } - start[0]=i; + start[0]=i; /* Choose the next plane to write */ if(H5Sselect_hyperslab(f_sid, H5S_SELECT_SET, start, NULL, count, NULL) < 0){ HDfprintf(stderr, "Failed H5Sselect_hyperslab\n"); return -1; - } + } /* Write plane to the dataset */ if(H5Dwrite(dsid, UC_DATATYPE, m_sid, f_sid, H5P_DEFAULT, buffer) < 0){ HDfprintf(stderr, "Failed H5Dwrite\n"); return -1; - } + } /* Uncork the dataset's metadata from the cache, if SWMR is enabled */ if(UC_opts.use_swmr) @@ -389,12 +390,11 @@ int write_uc_file(hbool_t tosend, hid_t fid) return -1; } - /* flush file to make the just written plane available. */ - if(H5Dflush(dsid) < 0) - { - HDfprintf(stderr, "Failed to H5Fflush file\n"); - return -1; - } + /* flush file to make the just written plane available. */ + if(H5Dflush(dsid) < 0) { + HDfprintf(stderr, "Failed to H5Fflush file\n"); + return -1; + } } /* Done writing. Free/Close all resources including data file */ 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 eb2dcf4..edb01bc 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -84,31 +84,17 @@ #define N_PLANES_TO_WRITE 25 /* Planes */ -static 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 */ -static 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 */ -static char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5"; +H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN]; /* Dataset names */ -static char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; -static 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 252e1ee..6b9aaeb 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -285,61 +285,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; @@ -525,7 +525,7 @@ dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[] #define H5FILE_NAME "hugefile.h5" #define DATASETNAME "dataset" -int MpioTest2G( MPI_Comm comm, int mpi_rank ) +static int MpioTest2G( MPI_Comm comm, int mpi_rank ) { /* * HDF5 APIs definitions @@ -538,13 +538,12 @@ int MpioTest2G( MPI_Comm comm, int mpi_rank ) hid_t plist_id; /* property list identifier */ hid_t filespace; /* file and memory dataspace identifiers */ int *data; /* pointer to data buffer to write */ - hsize_t shape[3] = {1024, 1024, 1152}; size_t data_size, data_size_bytes, slice_per_process = shape[0]/2; size_t tot_size_bytes = sizeof(int); hsize_t chunk[3] = {4, shape[1], shape[2]}; 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}; /* @@ -732,8 +731,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"); @@ -853,9 +852,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 */ @@ -984,12 +983,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"); /* ------------------- @@ -1013,8 +1012,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"); @@ -1315,16 +1314,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); @@ -1371,7 +1370,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); @@ -1409,7 +1408,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); @@ -1515,14 +1514,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"); /* ------------------- @@ -1700,18 +1699,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); @@ -1761,12 +1760,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); @@ -1806,7 +1805,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*/ @@ -1816,12 +1815,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); @@ -1844,7 +1843,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++; @@ -1927,11 +1926,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"); /* ------------------- @@ -2018,8 +2017,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"); @@ -2078,8 +2077,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"); @@ -2125,7 +2124,7 @@ extend_writeInd2(void) { const char *filename; hid_t fid; /* HDF5 file ID */ - hid_t fapl; /* File access templates */ + hid_t fapl_id; /* File access templates */ hid_t fs; /* File dataspace ID */ hid_t ms; /* Memory dataspace ID */ hid_t dataset; /* Dataset ID */ @@ -2153,15 +2152,15 @@ extend_writeInd2(void) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - fapl = create_faccess_plist(test_comm, MPI_INFO_NULL, facc_type); - VRFY((fapl >= 0), "create_faccess_plist succeeded"); + fapl_id = create_faccess_plist(test_comm, MPI_INFO_NULL, facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist succeeded"); /* create the file collectively */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ - ret = H5Pclose(fapl); + ret = H5Pclose(fapl_id); VRFY((ret >= 0), "H5Pclose succeeded"); @@ -2240,7 +2239,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: "); @@ -2315,11 +2314,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"); /* ------------------- @@ -2498,11 +2497,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"); /* ------------------- @@ -2589,8 +2588,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"); @@ -2672,8 +2671,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"); @@ -2745,11 +2744,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"); /* ------------------- @@ -2917,7 +2916,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 */ @@ -2945,7 +2944,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; @@ -3129,8 +3128,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 @@ -3160,8 +3159,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"); @@ -3379,7 +3378,7 @@ test_actual_io_mode(int selection_mode) { hid_t sid = -1; hid_t dataset = -1; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl = -1; + hid_t fapl_id = -1; hid_t mem_space = -1; hid_t file_space = -1; hid_t dcpl = -1; @@ -3430,16 +3429,16 @@ test_actual_io_mode(int selection_mode) { HDassert(filename != NULL); /* Setup the file access template */ - fapl = create_faccess_plist(mpi_comm, mpi_info, facc_type); - VRFY((fapl >= 0), "create_faccess_plist() succeeded"); + fapl_id = create_faccess_plist(mpi_comm, mpi_info, facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist() succeeded"); /* Create the file */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); 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"); @@ -3450,7 +3449,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"); @@ -3516,14 +3515,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"; @@ -3554,17 +3553,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 */ @@ -3637,7 +3636,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; @@ -3766,7 +3765,7 @@ test_actual_io_mode(int selection_mode) { /* Release some resources */ ret = H5Sclose(sid); - ret = H5Pclose(fapl); + ret = H5Pclose(fapl_id); ret = H5Pclose(dcpl); ret = H5Pclose(dxpl_write); ret = H5Pclose(dxpl_read); @@ -3868,8 +3867,6 @@ actual_io_mode_tests(void) { * Programmer: Jonathan Kim * Date: Aug, 2012 */ -#define DSET_NOCOLCAUSE "nocolcause" -#define NELM 2 #define FILE_EXTERNAL "nocolcause_extern.data" static void test_no_collective_cause_mode(int selection_mode) @@ -3897,7 +3894,7 @@ test_no_collective_cause_mode(int selection_mode) hid_t sid = -1; hid_t dataset = -1; hid_t data_type = H5T_NATIVE_INT; - hid_t fapl = -1; + hid_t fapl_id = -1; hid_t dcpl = -1; hid_t dxpl_write = -1; hid_t dxpl_read = -1; @@ -3966,8 +3963,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"); @@ -3978,18 +3975,18 @@ test_no_collective_cause_mode(int selection_mode) HDassert(filename != NULL); /* Setup the file access template */ - fapl = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); - VRFY((fapl >= 0), "create_faccess_plist() succeeded"); + fapl_id = create_faccess_plist(mpi_comm, mpi_info, l_facc_type); + VRFY((fapl_id >= 0), "create_faccess_plist() succeeded"); /* Create the file */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); VRFY((fid >= 0), "H5Fcreate succeeded"); /* 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"); @@ -4070,10 +4067,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; @@ -4149,8 +4146,8 @@ test_no_collective_cause_mode(int selection_mode) /* Release some resources */ if (sid) H5Sclose(sid); - if (fapl) - H5Pclose(fapl); + if (fapl_id) + H5Pclose(fapl_id); if (dcpl) H5Pclose(dcpl); if (dxpl_write) @@ -4499,10 +4496,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 */ @@ -4518,8 +4515,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"); @@ -4657,10 +4654,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++) { @@ -4677,12 +4674,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; @@ -4738,19 +4735,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 c6a1178..ada832c 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -15,7 +15,7 @@ const char *FILENAME[3]={ "bigio_test.h5", /* Define some handy debugging shorthands, routines, ... */ /* debugging tools */ -#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ +#define MAIN_PROCESS (!mpi_rank_g) /* define process 0 as main process */ /* Constants definitions */ #define RANK 2 @@ -27,7 +27,6 @@ const char *FILENAME[3]={ "bigio_test.h5", #define DATASET2 "DSET2" #define DATASET3 "DSET3" #define DATASET4 "DSET4" -#define DATASET5 "DSET5" #define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ #define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ #define DXFER_BIGCOUNT (1 < 29) @@ -44,16 +43,13 @@ int facc_type = FACC_MPIO; /*Test file access type */ int dxfer_coll_type = DXFER_COLLECTIVE_IO; size_t bigcount = (size_t)DXFER_BIGCOUNT; int nerrors = 0; -int mpi_size, mpi_rank; +static int mpi_size_g, mpi_rank_g; hsize_t space_dim1 = SPACE_DIM1 * 256; // 4096 hsize_t space_dim2 = SPACE_DIM2; static void coll_chunktest(const char* filename, int chunk_factor, int select_factor, int api_option, int file_selection, int mem_selection, int mode); -hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type); - -hsize_t H5_mpi_set_bigio_count(hsize_t new_count); /* * Setup the coordinates for point selection. @@ -250,7 +246,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; @@ -259,11 +255,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; @@ -277,7 +273,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; @@ -288,14 +284,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: @@ -303,18 +299,18 @@ 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; - stride[1]= 1; - start[1] = 0; + block[1] = space_dim2; + count[1] = 1; + stride[1]= 1; + start[1] = 0; break; 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]; @@ -501,53 +497,53 @@ dataset_big_write(void) /* allocate memory for data buffer */ wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); - VRFY((wdata != NULL), "wdata malloc succeeded"); + VRFY_G((wdata != NULL), "wdata malloc succeeded"); /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "H5P_FILE_ACCESS"); + VRFY_G((acc_tpl >= 0), "H5P_FILE_ACCESS"); H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* create the file collectively */ fid = H5Fcreate(FILENAME[0], H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); - VRFY((fid >= 0), "H5Fcreate succeeded"); + VRFY_G((fid >= 0), "H5Fcreate succeeded"); /* Release file-access template */ ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); /* Each process takes a slabs of rows. */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset1 write by ROW\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size_g; sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET1, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size_g; 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_g*block[0]; start[1] = 0; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill the local slab with some trivial data */ fill_datasets(start, block, wdata); @@ -559,17 +555,17 @@ dataset_big_write(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -577,40 +573,40 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); /* Each process takes a slabs of cols. */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size_g; sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET2, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); block[0] = dims[0]; - block[1] = dims[1]/mpi_size; + block[1] = dims[1]/(hsize_t)mpi_size_g; 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_g*block[1]; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill the local slab with some trivial data */ fill_datasets(start, block, wdata); @@ -622,17 +618,17 @@ dataset_big_write(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -640,51 +636,51 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); /* ALL selection */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nTesting Dataset3 write select ALL proc 0, NONE others\n"); /* Create a large dataset */ dims[0] = bigcount; dims[1] = 1; sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET3, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(mpi_rank == 0) { + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); + if(mpi_rank_g == 0) { ret = H5Sselect_all(file_dataspace); - VRFY((ret >= 0), "H5Sset_all succeeded"); + VRFY_G((ret >= 0), "H5Sset_all succeeded"); } else { ret = H5Sselect_none(file_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - if(mpi_rank != 0) { + VRFY_G((mem_dataspace >= 0), ""); + if(mpi_rank_g != 0) { ret = H5Sselect_none(mem_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* fill the local slab with some trivial data */ @@ -696,7 +692,7 @@ dataset_big_write(void) ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -704,19 +700,19 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); /* Point selection */ - if (mpi_rank == 0) + if (mpi_rank_g == 0) 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_g * 4); sid = H5Screate_simple (RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); + VRFY_G((sid >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate2(fid, DATASET4, H5T_NATIVE_LLONG, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); block[0] = dims[0]/2; @@ -726,19 +722,19 @@ 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_g * (hsize_t)mpi_rank_g; num_points = bigcount; coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); - VRFY((coords != NULL), "coords malloc succeeded"); + VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords (start, count, stride, block, num_points, coords, IN_ORDER); /* create a file dataspace */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); + VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if(coords) free(coords); @@ -755,21 +751,21 @@ dataset_big_write(void) * appears to cause problems with 32 bit compilers. */ mem_dataspace = H5Screate_simple (1, dims, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((xfer_plist >= 0), "H5Pcreate xfer succeeded"); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pset_dxpl_mpio succeeded"); + VRFY_G((ret >= 0), "H5Pset_dxpl_mpio succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } ret = H5Dwrite(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, wdata); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dwrite dataset1 succeeded"); /* release all temporary handles. */ H5Sclose(file_dataspace); @@ -777,7 +773,7 @@ dataset_big_write(void) H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); HDfree(wdata); H5Fclose(fid); @@ -813,52 +809,52 @@ dataset_big_read(void) /* allocate memory for data buffer */ rdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); - VRFY((rdata != NULL), "rdata malloc succeeded"); + VRFY_G((rdata != NULL), "rdata malloc succeeded"); wdata = (B_DATATYPE *)HDmalloc(bigcount*sizeof(B_DATATYPE)); - VRFY((wdata != NULL), "wdata malloc succeeded"); + VRFY_G((wdata != NULL), "wdata malloc succeeded"); HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((acc_tpl >= 0), "H5P_FILE_ACCESS"); + VRFY_G((acc_tpl >= 0), "H5P_FILE_ACCESS"); H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); /* open the file collectively */ fid=H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_tpl); - VRFY((fid >= 0), "H5Fopen succeeded"); + VRFY_G((fid >= 0), "H5Fopen succeeded"); /* Release file-access template */ ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset1 by COL\n"); dataset = H5Dopen2(fid, DATASET1, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size_g; /* 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_g; 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_g*block[1]; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill dataset with test data */ fill_datasets(start, block, wdata); @@ -869,18 +865,18 @@ dataset_big_read(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset1 succeeded"); /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); @@ -891,36 +887,36 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset2 by ROW\n"); HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET2, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size_g; /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size_g; 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_g*block[0]; start[1] = 0; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); + VRFY_G((ret >= 0), "H5Sset_hyperslab succeeded"); /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, block, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* fill dataset with test data */ fill_datasets(start, block, wdata); @@ -931,18 +927,18 @@ dataset_big_read(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset2 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset2 succeeded"); /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); @@ -953,35 +949,35 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset3 read select ALL proc 0, NONE others\n"); HDmemset(rdata, 0, bigcount*sizeof(B_DATATYPE)); dataset = H5Dopen2(fid, DATASET3, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; dims[1] = 1; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - if(mpi_rank == 0) { + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); + if(mpi_rank_g == 0) { ret = H5Sselect_all(file_dataspace); - VRFY((ret >= 0), "H5Sset_all succeeded"); + VRFY_G((ret >= 0), "H5Sset_all succeeded"); } else { ret = H5Sselect_none(file_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* create a memory dataspace independently */ mem_dataspace = H5Screate_simple (RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - if(mpi_rank != 0) { + VRFY_G((mem_dataspace >= 0), ""); + if(mpi_rank_g != 0) { ret = H5Sselect_none(mem_dataspace); - VRFY((ret >= 0), "H5Sset_none succeeded"); + VRFY_G((ret >= 0), "H5Sset_none succeeded"); } /* fill dataset with test data */ @@ -993,20 +989,20 @@ dataset_big_read(void) /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset3 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset3 succeeded"); - if(mpi_rank == 0) { + if(mpi_rank_g == 0) { /* verify the read data with original expected data */ ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} @@ -1017,15 +1013,15 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("\nRead Testing Dataset4 with Point selection\n"); dataset = H5Dopen2(fid, DATASET4, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dopen2 succeeded"); + VRFY_G((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = mpi_size * 4; + dims[1] = (hsize_t)(mpi_size_g * 4); block[0] = dims[0]/2; block[1] = 2; @@ -1034,7 +1030,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_g * (hsize_t)mpi_rank_g; fill_datasets(start, block, wdata); MESG("data_array initialized"); @@ -1046,14 +1042,14 @@ dataset_big_read(void) num_points = bigcount; coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); - VRFY((coords != NULL), "coords malloc succeeded"); + VRFY_G((coords != NULL), "coords malloc succeeded"); set_coords (start, count, stride, block, num_points, coords, IN_ORDER); /* create a file dataspace */ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); + VRFY_G((file_dataspace >= 0), "H5Dget_space succeeded"); ret = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((ret >= 0), "H5Sselect_elements succeeded"); + VRFY_G((ret >= 0), "H5Sselect_elements succeeded"); if(coords) HDfree(coords); @@ -1063,22 +1059,22 @@ dataset_big_read(void) * appears to cause problems with 32 bit compilers. */ mem_dataspace = H5Screate_simple (1, dims, NULL); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); /* set up the collective transfer properties list */ xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0), "H5Pcreate xfer succeeded"); + VRFY_G((ret >= 0), "H5Pcreate xfer succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { ret = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((ret>= 0),"set independent IO collectively succeeded"); + VRFY_G((ret>= 0),"set independent IO collectively succeeded"); } /* read data collectively */ ret = H5Dread(dataset, H5T_NATIVE_LLONG, mem_dataspace, file_dataspace, xfer_plist, rdata); - VRFY((ret >= 0), "H5Dread dataset1 succeeded"); + VRFY_G((ret >= 0), "H5Dread dataset1 succeeded"); ret = verify_data(start, count, stride, block, rdata, wdata); if(ret) {HDfprintf(stderr, "verify failed\n"); exit(1);} @@ -1088,7 +1084,7 @@ dataset_big_read(void) H5Sclose(mem_dataspace); H5Pclose(xfer_plist); ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); HDfree(wdata); HDfree(rdata); @@ -1109,7 +1105,7 @@ dataset_big_read(void) if (xfer_plist != -1) H5Pclose(xfer_plist); if (dataset != -1) { ret = H5Dclose(dataset); - VRFY((ret >= 0), "H5Dclose1 succeeded"); + VRFY_G((ret >= 0), "H5Dclose1 succeeded"); } H5Fclose(fid); @@ -1122,10 +1118,10 @@ dataset_big_read(void) static void single_rank_independent_io(void) { - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("single_rank_independent_io\n"); - if (MAINPROCESS) { + if (MAIN_PROCESS) { hsize_t dims[] = { LARGE_DIM }; hid_t file_id = -1; hid_t fapl_id = -1; @@ -1135,14 +1131,14 @@ single_rank_independent_io(void) void *data = NULL; fapl_id = H5Pcreate(H5P_FILE_ACCESS); - VRFY((fapl_id >= 0), "H5P_FILE_ACCESS"); + VRFY_G((fapl_id >= 0), "H5P_FILE_ACCESS"); H5Pset_fapl_mpio(fapl_id, MPI_COMM_SELF, MPI_INFO_NULL); file_id = H5Fcreate(FILENAME[1], H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); - VRFY((file_id >= 0), "H5Dcreate2 succeeded"); + VRFY_G((file_id >= 0), "H5Dcreate2 succeeded"); fspace_id = H5Screate_simple(1, dims, NULL); - VRFY((fspace_id >= 0), "H5Screate_simple fspace_id succeeded"); + VRFY_G((fspace_id >= 0), "H5Screate_simple fspace_id succeeded"); /* * Create and write to a >2GB dataset from a single rank. @@ -1150,18 +1146,18 @@ single_rank_independent_io(void) dset_id = H5Dcreate2(file_id, "test_dset", H5T_NATIVE_INT, fspace_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dset_id >= 0), "H5Dcreate2 succeeded"); + VRFY_G((dset_id >= 0), "H5Dcreate2 succeeded"); data = malloc(LARGE_DIM * sizeof(int)); - if (mpi_rank == 0) + if (mpi_rank_g == 0) H5Sselect_all(fspace_id); else H5Sselect_none(fspace_id); dims[0] = LARGE_DIM; mspace_id = H5Screate_simple(1, dims, NULL); - VRFY((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); + VRFY_G((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); free(data); @@ -1191,7 +1187,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); ret_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((ret_pl >= 0), "H5P_FILE_ACCESS"); + VRFY_G((ret_pl >= 0), "H5P_FILE_ACCESS"); if (l_facc_type == FACC_DEFAULT) return (ret_pl); @@ -1199,11 +1195,11 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) if (l_facc_type == FACC_MPIO){ /* set Parallel access with communicator */ ret = H5Pset_fapl_mpio(ret_pl, comm, info); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); ret = H5Pset_all_coll_metadata_ops(ret_pl, TRUE); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); ret = H5Pset_coll_metadata_write(ret_pl, TRUE); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); return(ret_pl); } @@ -1211,17 +1207,17 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type) hid_t mpio_pl; mpio_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((mpio_pl >= 0), ""); + VRFY_G((mpio_pl >= 0), ""); /* set Parallel access with communicator */ ret = H5Pset_fapl_mpio(mpio_pl, comm, info); - VRFY((ret >= 0), ""); + VRFY_G((ret >= 0), ""); /* setup file access template */ ret_pl = H5Pcreate (H5P_FILE_ACCESS); - VRFY((ret_pl >= 0), ""); + VRFY_G((ret_pl >= 0), ""); /* set Parallel access with communicator */ ret = H5Pset_fapl_split(ret_pl, ".meta", mpio_pl, ".raw", mpio_pl); - VRFY((ret >= 0), "H5Pset_fapl_split succeeded"); + VRFY_G((ret >= 0), "H5Pset_fapl_split succeeded"); H5Pclose(mpio_pl); return(ret_pl); } @@ -1270,7 +1266,7 @@ void coll_chunk1(void) { const char *filename = FILENAME[0]; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("coll_chunk1\n"); coll_chunktest(filename, 1, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1324,7 +1320,7 @@ void coll_chunk2(void) { const char *filename = FILENAME[0]; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("coll_chunk2\n"); coll_chunktest(filename, 1, BYROW_DISCONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); @@ -1379,18 +1375,18 @@ void coll_chunk3(void) { const char *filename = FILENAME[0]; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("coll_chunk3\n"); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, HYPER, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, HYPER, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, ALL, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, POINT, OUT_OF_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, HYPER, OUT_OF_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); - coll_chunktest(filename, mpi_size, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, ALL, IN_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, POINT, IN_ORDER); + coll_chunktest(filename, mpi_size_g, BYROW_CONT, API_NONE, POINT, HYPER, IN_ORDER); } @@ -1455,29 +1451,29 @@ coll_chunktest(const char* filename, /* Create the data space */ acc_plist = create_faccess_plist(comm,info,facc_type); - VRFY((acc_plist >= 0),""); + VRFY_G((acc_plist >= 0),""); file = H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_plist); - VRFY((file >= 0),"H5Fcreate succeeded"); + VRFY_G((file >= 0),"H5Fcreate succeeded"); status = H5Pclose(acc_plist); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); /* setup dimensionality object */ - dims[0] = space_dim1*mpi_size; + dims[0] = space_dim1*(hsize_t)mpi_size_g; dims[1] = space_dim2; /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0] * dims[1] * sizeof(int)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* set up dimensions of the slab this process accesses */ - ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + ccslab_set(mpi_rank_g, mpi_size_g, start, count, stride, block, select_factor); /* set up the coords array selection */ num_points = block[0] * block[1] * count[0] * count[1]; coords = (hsize_t *)HDmalloc(num_points * RANK * sizeof(hsize_t)); - VRFY((coords != NULL), "coords malloc succeeded"); + VRFY_G((coords != NULL), "coords malloc succeeded"); point_set(start, count, stride, block, num_points, coords, mode); /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1485,36 +1481,36 @@ coll_chunktest(const char* filename, * appears to cause problems with 32 bit compilers. */ file_dataspace = H5Screate_simple(2, dims, NULL); - VRFY((file_dataspace >= 0), "file dataspace created succeeded"); + VRFY_G((file_dataspace >= 0), "file dataspace created succeeded"); if(ALL != mem_selection) { mem_dataspace = H5Screate_simple(2, dims, NULL); - VRFY((mem_dataspace >= 0), "mem dataspace created succeeded"); + VRFY_G((mem_dataspace >= 0), "mem dataspace created succeeded"); } else { /* Putting the warning about H5Screate_simple (above) into practice... */ hsize_t dsdims[1] = {num_points}; mem_dataspace = H5Screate_simple (1, dsdims, NULL); - VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + VRFY_G((mem_dataspace >= 0), "mem_dataspace create succeeded"); } crp_plist = H5Pcreate(H5P_DATASET_CREATE); - VRFY((crp_plist >= 0),""); + VRFY_G((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); status = H5Pset_chunk(crp_plist, 2, chunk_dims); - VRFY((status >= 0),"chunk creation property list succeeded"); + VRFY_G((status >= 0),"chunk creation property list succeeded"); dataset = H5Dcreate2(file, DSET_COLLECTIVE_CHUNK_NAME, H5T_NATIVE_INT, file_dataspace, H5P_DEFAULT, crp_plist, H5P_DEFAULT); - VRFY((dataset >= 0),"dataset created succeeded"); + VRFY_G((dataset >= 0),"dataset created succeeded"); status = H5Pclose(crp_plist); - VRFY((status >= 0), ""); + VRFY_G((status >= 0), ""); /*put some trivial data in the data array */ ccdataset_fill(start, stride, count,block, data_array1, mem_selection); @@ -1524,93 +1520,93 @@ coll_chunktest(const char* filename, switch (file_selection) { case HYPER: status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(file_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(file_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } switch (mem_selection) { case HYPER: status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(mem_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(mem_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } /* set up the collective transfer property list */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0), ""); + VRFY_G((xfer_plist >= 0), ""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((status>= 0),"MPIO collective transfer property succeeded"); + VRFY_G((status>= 0),"MPIO collective transfer property succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { status = H5Pset_dxpl_mpio_collective_opt(xfer_plist, H5FD_MPIO_INDIVIDUAL_IO); - VRFY((status>= 0),"set independent IO collectively succeeded"); + VRFY_G((status>= 0),"set independent IO collectively succeeded"); } switch(api_option){ case API_LINK_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_ONE_IO); - VRFY((status>= 0),"collective chunk optimization succeeded"); + VRFY_G((status>= 0),"collective chunk optimization succeeded"); break; case API_MULTI_HARD: status = H5Pset_dxpl_mpio_chunk_opt(xfer_plist,H5FD_MPIO_CHUNK_MULTI_IO); - VRFY((status>= 0),"collective chunk optimization succeeded "); + VRFY_G((status>= 0),"collective chunk optimization succeeded "); break; case API_LINK_TRUE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,2); - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); break; case API_LINK_FALSE: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,6); - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); break; case API_MULTI_COLL: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,50); - VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk ratio succeeded"); break; case API_MULTI_IND: status = H5Pset_dxpl_mpio_chunk_opt_num(xfer_plist,8);/* make sure it is using multi-chunk IO */ - VRFY((status>= 0),"collective chunk optimization set chunk number succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk number succeeded"); status = H5Pset_dxpl_mpio_chunk_opt_ratio(xfer_plist,100); - VRFY((status>= 0),"collective chunk optimization set chunk ratio succeeded"); + VRFY_G((status>= 0),"collective chunk optimization set chunk ratio succeeded"); break; default: @@ -1624,42 +1620,42 @@ coll_chunktest(const char* filename, prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_MULTI_HARD: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_LINK_TRUE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_LINK_FALSE: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_MULTI_COLL: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; case API_MULTI_IND: prop_value = H5D_XFER_COLL_CHUNK_DEF; status = H5Pinsert2(xfer_plist, H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME, H5D_XFER_COLL_CHUNK_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); - VRFY((status >= 0),"testing property list inserted succeeded"); + VRFY_G((status >= 0),"testing property list inserted succeeded"); break; default: @@ -1671,45 +1667,45 @@ coll_chunktest(const char* filename, /* write data collectively */ status = H5Dwrite(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); - VRFY((status >= 0),"dataset write succeeded"); + VRFY_G((status >= 0),"dataset write succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY if(facc_type == FACC_MPIO) { switch(api_option){ case API_LINK_HARD: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_HARD_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set LINK COLLECTIVE IO directly succeeded"); break; case API_MULTI_HARD: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_HARD_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO optimization succeeded"); break; case API_LINK_TRUE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_TRUE_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set LINK COLLECTIVE IO succeeded"); break; case API_LINK_FALSE: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_LINK_NUM_FALSE_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set LINK IO transferring to multi-chunk IO succeeded"); break; case API_MULTI_COLL: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_COLL_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set MULTI-CHUNK COLLECTIVE IO with optimization succeeded"); break; case API_MULTI_IND: status = H5Pget(xfer_plist,H5D_XFER_COLL_CHUNK_MULTI_RATIO_IND_NAME,&prop_value); - VRFY((status >= 0),"testing property list get succeeded"); - VRFY((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); + VRFY_G((status >= 0),"testing property list get succeeded"); + VRFY_G((prop_value == 0),"API to set MULTI-CHUNK IO transferring to independent IO succeeded"); break; default: @@ -1719,20 +1715,20 @@ coll_chunktest(const char* filename, #endif status = H5Dclose(dataset); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); status = H5Pclose(xfer_plist); - VRFY((status >= 0),"property list closed"); + VRFY_G((status >= 0),"property list closed"); status = H5Sclose(file_dataspace); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); status = H5Sclose(mem_dataspace); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); status = H5Fclose(file); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); if (data_array1) HDfree(data_array1); @@ -1740,35 +1736,35 @@ coll_chunktest(const char* filename, /* allocate memory for data buffer */ data_array1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); - VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); + VRFY_G((data_array1 != NULL), "data_array1 malloc succeeded"); /* allocate memory for data buffer */ data_origin1 = (int *)HDmalloc(dims[0]*dims[1]*sizeof(int)); - VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); + VRFY_G((data_origin1 != NULL), "data_origin1 malloc succeeded"); acc_plist = create_faccess_plist(comm, info, facc_type); - VRFY((acc_plist >= 0),"MPIO creation property list succeeded"); + VRFY_G((acc_plist >= 0),"MPIO creation property list succeeded"); file = H5Fopen(FILENAME[0],H5F_ACC_RDONLY,acc_plist); - VRFY((file >= 0),"H5Fcreate succeeded"); + VRFY_G((file >= 0),"H5Fcreate succeeded"); status = H5Pclose(acc_plist); - VRFY((status >= 0),""); + VRFY_G((status >= 0),""); /* open the collective dataset*/ dataset = H5Dopen2(file, DSET_COLLECTIVE_CHUNK_NAME, H5P_DEFAULT); - VRFY((dataset >= 0), ""); + VRFY_G((dataset >= 0), ""); /* set up dimensions of the slab this process accesses */ - ccslab_set(mpi_rank, mpi_size, start, count, stride, block, select_factor); + ccslab_set(mpi_rank_g, mpi_size_g, start, count, stride, block, select_factor); /* obtain the file and mem dataspace*/ file_dataspace = H5Dget_space (dataset); - VRFY((file_dataspace >= 0), ""); + VRFY_G((file_dataspace >= 0), ""); if (ALL != mem_selection) { mem_dataspace = H5Dget_space (dataset); - VRFY((mem_dataspace >= 0), ""); + VRFY_G((mem_dataspace >= 0), ""); } else { /* Warning: H5Screate_simple requires an array of hsize_t elements @@ -1777,92 +1773,92 @@ coll_chunktest(const char* filename, */ hsize_t dsdims[1] = {num_points}; mem_dataspace = H5Screate_simple (1, dsdims, NULL); - VRFY((mem_dataspace >= 0), "mem_dataspace create succeeded"); + VRFY_G((mem_dataspace >= 0), "mem_dataspace create succeeded"); } switch (file_selection) { case HYPER: status = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(file_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(file_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(file_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } switch (mem_selection) { case HYPER: status = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((status >= 0),"hyperslab selection succeeded"); + VRFY_G((status >= 0),"hyperslab selection succeeded"); break; case POINT: if (num_points) { status = H5Sselect_elements(mem_dataspace, H5S_SELECT_SET, num_points, coords); - VRFY((status >= 0),"Element selection succeeded"); + VRFY_G((status >= 0),"Element selection succeeded"); } else { status = H5Sselect_none(mem_dataspace); - VRFY((status >= 0),"none selection succeeded"); + VRFY_G((status >= 0),"none selection succeeded"); } break; case ALL: status = H5Sselect_all(mem_dataspace); - VRFY((status >= 0), "H5Sselect_all succeeded"); + VRFY_G((status >= 0), "H5Sselect_all succeeded"); break; } /* fill dataset with test data */ ccdataset_fill(start, stride,count,block, data_origin1, mem_selection); xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + VRFY_G((xfer_plist >= 0),""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((status>= 0),"MPIO collective transfer property succeeded"); + VRFY_G((status>= 0),"MPIO collective transfer property succeeded"); if(dxfer_coll_type == DXFER_INDEPENDENT_IO) { status = H5Pset_dxpl_mpio_collective_opt(xfer_plist,H5FD_MPIO_INDIVIDUAL_IO); - VRFY((status>= 0),"set independent IO collectively succeeded"); + VRFY_G((status>= 0),"set independent IO collectively succeeded"); } status = H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, xfer_plist, data_array1); - VRFY((status >=0),"dataset read succeeded"); + VRFY_G((status >=0),"dataset read succeeded"); /* verify the read data with original expected data */ status = ccdataset_vrfy(start, count, stride, block, data_array1, data_origin1, mem_selection); if (status) nerrors++; status = H5Pclose(xfer_plist); - VRFY((status >= 0),"property list closed"); + VRFY_G((status >= 0),"property list closed"); /* close dataset collectively */ status=H5Dclose(dataset); - VRFY((status >= 0), "H5Dclose"); + VRFY_G((status >= 0), "H5Dclose"); /* release all IDs created */ status = H5Sclose(file_dataspace); - VRFY((status >= 0),"H5Sclose"); + VRFY_G((status >= 0),"H5Sclose"); status = H5Sclose(mem_dataspace); - VRFY((status >= 0),"H5Sclose"); + VRFY_G((status >= 0),"H5Sclose"); /* close the file collectively */ status = H5Fclose(file); - VRFY((status >= 0),"H5Fclose"); + VRFY_G((status >= 0),"H5Fclose"); /* release data buffers */ if(coords) HDfree(coords); @@ -1940,8 +1936,8 @@ int main(int argc, char **argv) } MPI_Init(&argc, &argv); - MPI_Comm_size(MPI_COMM_WORLD,&mpi_size); - MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); + MPI_Comm_size(MPI_COMM_WORLD,&mpi_size_g); + MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank_g); /* Attempt to turn off atexit post processing so that in case errors * happen during the test and the process is aborted, it will not get @@ -1955,7 +1951,7 @@ int main(int argc, char **argv) /* set alarm. */ ALARM_ON; - ExpressMode = do_express_test(mpi_rank); + ExpressMode = do_express_test(mpi_rank_g); dataset_big_write(); MPI_Barrier(MPI_COMM_WORLD); @@ -1964,7 +1960,7 @@ int main(int argc, char **argv) MPI_Barrier(MPI_COMM_WORLD); if (ExpressMode > 0) { - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDprintf("***Express test mode on. Several tests are skipped\n"); } else { @@ -1980,7 +1976,7 @@ int main(int argc, char **argv) /* turn off alarm */ ALARM_OFF; - if (mpi_rank == 0) + if (mpi_rank_g == 0) HDremove(FILENAME[0]); /* close HDF5 library */ diff --git a/testpar/t_cache.c b/testpar/t_cache.c index cde19fe..09d2ecc 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -28,7 +28,7 @@ #include "H5Fpkg.h" #include "H5Iprivate.h" #include "H5MFprivate.h" - +#include "H5private.h" #define BASE_ADDR (haddr_t)1024 @@ -38,7 +38,6 @@ int failures = 0; hbool_t verbose = TRUE; /* used to control error messages */ #define NFILENAME 2 -#define PARATESTFILE filenames[0] const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL}; #ifndef PATH_MAX #define PATH_MAX 512 @@ -219,7 +218,9 @@ struct datum data[NUM_DATA_ENTRIES]; #define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES #define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10) /* Use a smaller test size to avoid creating huge MPE logfiles. */ +#ifdef H5_HAVE_MPE #define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100) +#endif int virt_num_data_entries = NUM_DATA_ENTRIES; @@ -1618,9 +1619,9 @@ serve_read_request(struct mssg_t * mssg_ptr) reply.dest = mssg_ptr->src; reply.mssg_num = -1; /* set by send function */ reply.base_addr = data[target_index].base_addr; - reply.len = data[target_index].len; + H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t); reply.ver = data[target_index].ver; - reply.count = 0; + reply.count = 0; reply.magic = MSSG_MAGIC; /* and update the counters */ @@ -1761,7 +1762,7 @@ serve_write_request(struct mssg_t * mssg_ptr) hbool_t report_mssg = FALSE; hbool_t success = TRUE; int target_index; - int new_ver_num; + int new_ver_num = 0; haddr_t target_addr; #if DO_WRITE_REQ_ACK struct mssg_t reply; @@ -1840,7 +1841,7 @@ serve_write_request(struct mssg_t * mssg_ptr) reply.dest = mssg_ptr->src; reply.mssg_num = -1; /* set by send function */ reply.base_addr = data[target_index].base_addr; - reply.len = data[target_index].len; + H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t); reply.ver = data[target_index].ver; reply.count = 0; reply.magic = MSSG_MAGIC; @@ -1926,7 +1927,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr) reply.base_addr = 0; reply.len = 0; reply.ver = 0; - reply.count = total_writes; + reply.count = (unsigned)total_writes; reply.magic = MSSG_MAGIC; } @@ -2005,7 +2006,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr) reply.base_addr = 0; reply.len = 0; reply.ver = 0; - reply.count = total_reads; + reply.count = (unsigned)total_reads; reply.magic = MSSG_MAGIC; } @@ -2099,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = data[target_index].writes; + reply.count = (unsigned)data[target_index].writes; reply.magic = MSSG_MAGIC; } } @@ -2196,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = (long)(data[target_index].reads); + reply.count = (unsigned)(data[target_index].reads); reply.magic = MSSG_MAGIC; } } @@ -2378,7 +2379,7 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr) *------------------------------------------------------------------------- */ static void * -datum_deserialize(const void * image_ptr, +datum_deserialize(const void H5_ATTR_NDEBUG_UNUSED *image_ptr, H5_ATTR_UNUSED size_t len, void * udata_ptr, hbool_t * dirty_ptr) @@ -2491,14 +2492,13 @@ datum_image_len(const void *thing, size_t *image_len) */ static herr_t datum_serialize(const H5F_t *f, - void *image_ptr, + void H5_ATTR_NDEBUG_UNUSED *image_ptr, size_t len, void *thing_ptr) { herr_t ret_value = SUCCEED; int idx; struct datum * entry_ptr; - H5C_t * cache_ptr; struct H5AC_aux_t * aux_ptr; HDassert( thing_ptr ); @@ -2509,11 +2509,8 @@ datum_serialize(const H5F_t *f, HDassert( f ); HDassert( f->shared ); HDassert( f->shared->cache ); - - cache_ptr = f->shared->cache; - - HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->aux_ptr ); + HDassert( f->shared->cache->magic == H5C__H5C_T_MAGIC ); + HDassert( f->shared->cache->aux_ptr ); aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr); @@ -2636,7 +2633,7 @@ datum_notify(H5C_notify_action_t action, void *thing) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t); mssg.ver = 0; /* bogus -- should be corrected by server */ mssg.count = 0; /* not used */ mssg.magic = MSSG_MAGIC; @@ -2792,7 +2789,7 @@ datum_notify(H5C_notify_action_t action, void *thing) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t); mssg.ver = entry_ptr->ver; mssg.count = 0; mssg.magic = MSSG_MAGIC; @@ -4612,7 +4609,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads) { hbool_t success = TRUE; - int reported_entry_reads; + int reported_entry_reads = 0; struct mssg_t mssg; if ( success ) { @@ -4670,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); } } @@ -4719,7 +4716,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes) { hbool_t success = TRUE; - int reported_entry_writes; + int reported_entry_writes = 0; struct mssg_t mssg; if ( success ) { @@ -4777,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); } } @@ -5233,7 +5230,7 @@ server_smoke_check(void) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = data[world_mpi_rank].base_addr; - mssg.len = data[world_mpi_rank].len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t); mssg.ver = ++(data[world_mpi_rank].ver); mssg.count = 0; mssg.magic = MSSG_MAGIC; @@ -5338,7 +5335,7 @@ server_smoke_check(void) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = data[world_mpi_rank].base_addr; - mssg.len = data[world_mpi_rank].len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t); mssg.ver = 0; /* bogus -- should be corrected by server */ mssg.count = 0; mssg.magic = MSSG_MAGIC; @@ -7268,7 +7265,8 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + H5_CHECK_OVERFLOW(cache_ptr->max_cache_size, size_t, double); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } /* insert the other half independently */ @@ -7289,7 +7287,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } /* flush the file */ @@ -7319,7 +7317,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } /* protect the other half independently */ @@ -7340,7 +7338,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } for ( i = 0; i < (virt_num_data_entries); i++ ) diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index bfa0bfe..e716f41 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), ""); @@ -385,18 +385,18 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in /* set expected value according the write pattern */ switch (write_pattern) { - case all: - value = i%mpi_size + 1; - break; - case none: - value = 0; - break; - case sec_last: - if (i==nchunks-2) - value = 100; - else + case all: + value = i%mpi_size + 1; + break; + case none: value = 0; break; + case sec_last: + if (i==nchunks-2) + value = 100; + else + value = 0; + break; default: HDassert(0); } diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 40cc1ca..e950015 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -620,7 +620,6 @@ coll_chunktest(const char* filename, size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ hsize_t current_dims; /* for point selection */ - int i; /* set up MPI parameters */ MPI_Comm_size(comm,&mpi_size); @@ -638,7 +637,7 @@ coll_chunktest(const char* filename, VRFY((status >= 0),""); /* setup dimensionality object */ - dims[0] = SPACE_DIM1*mpi_size; + dims[0] = (hsize_t)(SPACE_DIM1*mpi_size); dims[1] = SPACE_DIM2; /* allocate memory for data buffer */ @@ -671,7 +670,7 @@ coll_chunktest(const char* filename, VRFY((crp_plist >= 0),""); /* Set up chunk information. */ - chunk_dims[0] = dims[0]/chunk_factor; + chunk_dims[0] = dims[0]/(hsize_t)chunk_factor; /* to decrease the testing time, maintain bigger chunk size */ (chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2); @@ -1058,7 +1057,7 @@ ccslab_set(int mpi_rank, stride[1] = 1; count[0] = SPACE_DIM1; count[1] = SPACE_DIM2; - start[0] = mpi_rank*count[0]; + start[0] = (hsize_t)mpi_rank*count[0]; start[1] = 0; break; @@ -1067,11 +1066,11 @@ ccslab_set(int mpi_rank, /* Each process takes several disjoint blocks. */ block[0] = 1; block[1] = 1; - stride[0] = 3; - stride[1] = 3; - count[0] = SPACE_DIM1/(stride[0]*block[0]); - count[1] = (SPACE_DIM2)/(stride[1]*block[1]); - start[0] = SPACE_DIM1*mpi_rank; + stride[0] = 3; + stride[1] = 3; + count[0] = SPACE_DIM1/(stride[0]*block[0]); + count[1] = (SPACE_DIM2)/(stride[1]*block[1]); + start[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_rank; start[1] = 0; break; @@ -1085,7 +1084,7 @@ ccslab_set(int mpi_rank, stride[1] = 1; count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:SPACE_DIM1); count[1] = SPACE_DIM2; - start[0] = mpi_rank*count[0]; + start[0] = (hsize_t)mpi_rank*count[0]; start[1] = 0; break; @@ -1096,14 +1095,14 @@ ccslab_set(int mpi_rank, half of the domain. */ block[0] = 1; - count[0] = 2; - stride[0] = SPACE_DIM1*mpi_size/4+1; + count[0] = 2; + stride[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size/4+1; block[1] = SPACE_DIM2; count[1] = 1; start[1] = 0; stride[1] = 1; - if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank; - else start[0] = 1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3); + if((mpi_rank *3)<(mpi_size*2)) start[0] = (hsize_t)mpi_rank; + else start[0] = (hsize_t)(1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3)); break; case BYROW_SELECTINCHUNK: @@ -1111,7 +1110,7 @@ ccslab_set(int mpi_rank, block[0] = 1; count[0] = 1; - start[0] = mpi_rank*SPACE_DIM1; + start[0] = (hsize_t)(mpi_rank*SPACE_DIM1); stride[0]= 1; block[1] = SPACE_DIM2; count[1] = 1; @@ -1122,7 +1121,7 @@ ccslab_set(int mpi_rank, default: /* Unknown mode. Set it to cover the whole dataset. */ - block[0] = SPACE_DIM1*mpi_size; + block[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size; block[1] = SPACE_DIM2; stride[0] = block[0]; stride[1] = block[1]; diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c index 912388c..d4b2106 100644 --- a/testpar/t_coll_md_read.c +++ b/testpar/t_coll_md_read.c @@ -34,7 +34,6 @@ #define MULTI_CHUNK_IO_ADDRMAP_ISSUE_DIMS 2 -#define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_NO_SEL_PROCESS (mpi_rank == mpi_size - 1) #define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DATASET_NAME "linked_chunk_io_sort_chunk_issue" #define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE 20000 #define LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE 1 @@ -97,8 +96,8 @@ void test_partial_no_selection_coll_md_read(void) dataset_dims = HDmalloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims)); VRFY((dataset_dims != NULL), "malloc succeeded"); - dataset_dims[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_size; - dataset_dims[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE * mpi_size; + dataset_dims[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_size; + dataset_dims[1] = (hsize_t)PARTIAL_NO_SELECTION_X_DIM_SCALE * (hsize_t)mpi_size; max_dataset_dims[0] = H5S_UNLIMITED; max_dataset_dims[1] = H5S_UNLIMITED; @@ -121,12 +120,12 @@ void test_partial_no_selection_coll_md_read(void) * * The ranks will write rows across the dataset. */ - start[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_rank; + start[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_rank; start[1] = 0; stride[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE; stride[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE; count[0] = 1; - count[1] = mpi_size; + count[1] = (hsize_t)mpi_size; block[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE; block[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE; @@ -406,7 +405,7 @@ void test_link_chunk_io_sort_chunk_issue(void) dataset_dims = HDmalloc(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS * sizeof(*dataset_dims)); VRFY((dataset_dims != NULL), "malloc succeeded"); - dataset_dims[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * mpi_size * LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE; + dataset_dims[0] = (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * (hsize_t)mpi_size * (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE; max_dataset_dims[0] = H5S_UNLIMITED; fspace_id = H5Screate_simple(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS, dataset_dims, max_dataset_dims); @@ -429,8 +428,8 @@ void test_link_chunk_io_sort_chunk_issue(void) * The ranks will write rows across the dataset. */ stride[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE; - count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / mpi_size; - start[0] = count[0] * mpi_rank; + count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / (hsize_t)mpi_size; + start[0] = count[0] * (hsize_t)mpi_rank; block[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE; VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), "H5Sselect_hyperslab succeeded"); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 832a47f..13f9e89 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] = (mpi_rank ? (hsize_t)mpi_rank * block[0] : 0); start[1] = 0; if (VERBOSE_MED) HDprintf("slab_set ZROW\n"); break; case ZCOL: /* Similar to BYCOL except process 0 gets 0 column */ - block[0] = dim0; - block[1] = (mpi_rank ? dim1 / mpi_size : 0); + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0); stride[0] = block[0]; - stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ + stride[1] = (hsize_t)(mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = (mpi_rank ? mpi_rank * block[1] : 0); + start[1] = (mpi_rank ? (hsize_t)mpi_rank * block[1] : 0); if (VERBOSE_MED) HDprintf("slab_set ZCOL\n"); break; default: /* Unknown mode. Set it to cover the whole dataset. */ HDprintf("unknown slab_set mode (%d)\n", mode); - block[0] = dim0; - block[1] = dim1; + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)dim1; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; @@ -308,7 +308,7 @@ dataset_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ---------------------------------------- @@ -332,8 +332,8 @@ dataset_writeInd(void) * and the slabs local to the MPI process. * ------------------------------------------- */ /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -453,9 +453,9 @@ dataset_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* setup file access template */ @@ -567,7 +567,6 @@ dataset_writeAll(void) size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ hsize_t current_dims; /* for point selection */ - int i; herr_t ret; /* Generic return value */ int mpi_size, mpi_rank; @@ -584,12 +583,12 @@ dataset_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* set up the coords array selection */ - num_points = dim1; - coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t)); + num_points = (size_t)dim1; + coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -613,8 +612,8 @@ dataset_writeAll(void) * and create the dataset * ------------------------- */ /* setup 2-D dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -915,16 +914,16 @@ dataset_writeAll(void) if(data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); block[0] = 1; - block[1] = dim1; + block[1] = (hsize_t)dim1; stride[0] = 1; - stride[1] = dim1; + stride[1] = (hsize_t)dim1; count[0] = 1; count[1] = 1; - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; dataset_fill(start, block, data_array1); @@ -971,7 +970,7 @@ dataset_writeAll(void) /* Dataset6: point selection in File - Point selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); file_dataspace = H5Dget_space (dataset6); @@ -1009,7 +1008,7 @@ dataset_writeAll(void) /* Dataset7: point selection in File - All selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; point_set (start, count, stride, block, num_points, coords, IN_ORDER); file_dataspace = H5Dget_space (dataset7); @@ -1098,7 +1097,6 @@ dataset_readAll(void) size_t num_points; /* for point selection */ hsize_t *coords = NULL; /* for point selection */ - hsize_t current_dims; /* for point selection */ int i,j,k; herr_t ret; /* Generic return value */ @@ -1116,14 +1114,14 @@ dataset_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* set up the coords array selection */ - num_points = dim1; - coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t)); + num_points = (size_t)dim1; + coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -1301,18 +1299,18 @@ dataset_readAll(void) if(data_array1) free(data_array1); if(data_origin1) free(data_origin1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); block[0] = 1; - block[1] = dim1; + block[1] = (hsize_t)dim1; stride[0] = 1; - stride[1] = dim1; + stride[1] = (hsize_t)dim1; count[0] = 1; count[1] = 1; - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; dataset_fill(start, block, data_origin1); @@ -1363,12 +1361,12 @@ dataset_readAll(void) if(data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset6: point selection in File - Point selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; point_set (start, count, stride, block, num_points, coords, IN_ORDER); file_dataspace = H5Dget_space (dataset6); @@ -1408,7 +1406,7 @@ dataset_readAll(void) H5Pclose(xfer_plist); if(data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset7: point selection in memory - All selection in file*/ @@ -1418,12 +1416,12 @@ dataset_readAll(void) ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_all succeeded"); - num_points = dim0 * dim1; + num_points = (size_t)(dim0 * dim1); k=0; for (i=0 ; i<dim0; i++) { for (j=0 ; j<dim1; j++) { - coords[k++] = i; - coords[k++] = j; + coords[k++] = (hsize_t)i; + coords[k++] = (hsize_t)j; } } mem_dataspace = H5Dget_space (dataset7); @@ -1446,7 +1444,7 @@ dataset_readAll(void) xfer_plist, data_array1); VRFY((ret >= 0), "H5Dread dataset7 succeeded"); - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1); if(ret) nerrors++; @@ -1529,11 +1527,11 @@ extend_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -1620,8 +1618,8 @@ extend_writeInd(void) VRFY((mem_dataspace >= 0), ""); /* Extend its current dim sizes before writing */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset1, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -1680,8 +1678,8 @@ extend_writeInd(void) H5Sclose(file_dataspace); /* Extend dataset2 and try again. Should succeed. */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset2, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -1841,8 +1839,9 @@ extend_writeInd2(void) /* ------------------------- * Write to the second half of the dataset * -------------------------*/ + H5_CHECK_OVERFLOW(orig_size, hsize_t, int); for (i=0; i<(int)orig_size; i++) - written[i] = orig_size + i; + written[i] = (int)orig_size + i; MESG("data array re-initialized"); if(VERBOSE_MED) { MESG("writing at offset 10: "); @@ -1917,11 +1916,11 @@ extend_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -2100,11 +2099,11 @@ extend_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -2191,8 +2190,8 @@ extend_writeAll(void) VRFY((mem_dataspace >= 0), ""); /* Extend its current dim sizes before writing */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset1, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -2274,8 +2273,8 @@ extend_writeAll(void) H5Sclose(file_dataspace); /* Extend dataset2 and try again. Should succeed. */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset2, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -2347,11 +2346,11 @@ extend_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -2519,7 +2518,7 @@ compress_readAll(void) hid_t dataspace; /* Dataspace ID */ hid_t dataset; /* Dataset ID */ int rank=1; /* Dataspace rank */ - hsize_t dim=dim0; /* Dataspace dimensions */ + hsize_t dim=(hsize_t)dim0; /* Dataspace dimensions */ unsigned u; /* Local index variable */ unsigned chunk_opts; /* Chunk options */ unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */ @@ -2547,7 +2546,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; @@ -2731,8 +2730,8 @@ none_selection_chunk(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* ------------------- * START AN HDF5 FILE @@ -2762,8 +2761,8 @@ none_selection_chunk(void) VRFY((ret >= 0), "H5Pset_chunk succeeded"); /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3040,8 +3039,8 @@ test_actual_io_mode(int selection_mode) { VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3052,7 +3051,7 @@ test_actual_io_mode(int selection_mode) { /* If we are not testing contiguous datasets */ if(is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0]/mpi_size; + chunk_dims[0] = dims[0]/(hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); @@ -3118,14 +3117,14 @@ test_actual_io_mode(int selection_mode) { slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); } else { /* Select the first and the nth chunk in the nth column */ - block[0] = dim0 / mpi_size; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)(dim1 / mpi_size); count[0] = 2; count[1] = 1; - stride[0] = mpi_rank * block[0]; + stride[0] = (hsize_t)mpi_rank * block[0]; stride[1] = 1; start[0] = 0; - start[1] = mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank*block[1]; } test_name = "Multi Chunk - Mixed"; @@ -3156,17 +3155,17 @@ test_actual_io_mode(int selection_mode) { if(mpi_rank == 0) { /* Select the first chunk in the first column */ slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); - block[0] = block[0] / mpi_size; + block[0] = block[0] / (hsize_t)mpi_size; } else { /* Select the first and the nth chunk in the nth column */ - block[0] = dim0 / mpi_size; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)(dim1 / mpi_size); count[0] = 2; count[1] = 1; - stride[0] = mpi_rank * block[0]; + stride[0] = (hsize_t)mpi_rank * block[0]; stride[1] = 1; start[0] = 0; - start[1] = mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank*block[1]; } /* If the testname was not already set by the RESET case */ @@ -3239,7 +3238,7 @@ test_actual_io_mode(int selection_mode) { length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3470,8 +3469,9 @@ actual_io_mode_tests(void) { * Programmer: Jonathan Kim * Date: Aug, 2012 */ +#ifdef LATER #define DSET_NOCOLCAUSE "nocolcause" -#define NELM 2 +#endif #define FILE_EXTERNAL "nocolcause_extern.data" static void test_no_collective_cause_mode(int selection_mode) @@ -3482,7 +3482,6 @@ test_no_collective_cause_mode(int selection_mode) uint32_t no_collective_cause_global_write = 0; uint32_t no_collective_cause_global_read = 0; uint32_t no_collective_cause_global_expected = 0; - hsize_t coord[NELM][RANK]; const char * filename; const char * test_name; @@ -3568,8 +3567,8 @@ test_no_collective_cause_mode(int selection_mode) dims[1] = COL_FACTOR * 6; } else { - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; } sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3591,7 +3590,7 @@ test_no_collective_cause_mode(int selection_mode) /* If we are not testing contiguous datasets */ if(is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0]/mpi_size; + chunk_dims[0] = dims[0]/(hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); @@ -3672,10 +3671,10 @@ test_no_collective_cause_mode(int selection_mode) } /* Get the number of elements in the selection */ - length = dims[0] * dims[1]; + H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], uint64_t); /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3797,6 +3796,7 @@ test_no_collective_cause_mode(int selection_mode) * Programmer: Jonathan Kim * Date: Aug, 2012 */ +#ifdef LATER static void test_no_collective_cause_mode_filter(int selection_mode) { @@ -3865,8 +3865,8 @@ test_no_collective_cause_mode_filter(int selection_mode) } /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3884,7 +3884,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"); @@ -4008,6 +4008,7 @@ test_no_collective_cause_mode_filter(int selection_mode) HDfree(buffer); return; } +#endif /* Function: no_collective_cause_tests * @@ -4099,10 +4100,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 +4119,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 +4258,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 +4278,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; @@ -4337,20 +4338,22 @@ dataset_atomicity(void) compare = 5; + H5_CHECK_OVERFLOW(block[0], hsize_t, int); + H5_CHECK_OVERFLOW(block[1], hsize_t, int); for (i=0 ; i<dim0 ; i++) { - if (i >= mpi_rank*(block[0]+1)) { + if (i >= mpi_rank*((int)block[0]+1)) { break; } - if ((i+1)%(block[0]+1)==0) { + if ((i+1)%((int)block[0]+1)==0) { k += dim1; continue; } for (j=0 ; j<dim1 ; j++) { - if (j >= mpi_rank*(block[1]+1)) { - k += dim1 - mpi_rank*(block[1]+1); + if (j >= mpi_rank*((int)block[1]+1)) { + k += dim1 - mpi_rank*((int)block[1]+1); break; } - if ((j+1)%(block[1]+1)==0) { + if ((j+1)%((int)block[1]+1)==0) { k++; continue; } diff --git a/testpar/t_file.c b/testpar/t_file.c index 99ac189..6183b8d 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -471,19 +471,19 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str grp_id = H5Gcreate2(file_id, "GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((grp_id >= 0), ""); - dims[0] = ROW_FACTOR*mpi_size; - dims[1] = COL_FACTOR*mpi_size; + dims[0] = (hsize_t)(ROW_FACTOR*mpi_size); + dims[1] = (hsize_t)(COL_FACTOR*mpi_size); sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; num_elements = block[0] * block[1]; @@ -632,17 +632,17 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, grp_id = H5Gopen2(file_id, "GROUP", H5P_DEFAULT); VRFY((grp_id >= 0), ""); - dims[0] = ROW_FACTOR*mpi_size; - dims[1] = COL_FACTOR*mpi_size; + dims[0] = (hsize_t)(ROW_FACTOR*mpi_size); + dims[1] = (hsize_t)(COL_FACTOR*mpi_size); /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; num_elements = block[0] * block[1]; diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index 28baed5..7b0e677 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -74,10 +74,10 @@ filter_read_internal(const char *filename, hid_t dcpl, hs_size[0] = size[0] = HS_DIM1; hs_size[1] = HS_DIM2; - size[1] = hs_size[1] * mpi_size; + size[1] = hs_size[1] * (hsize_t)mpi_size; hs_offset[0] = 0; - hs_offset[1] = hs_size[1] * mpi_rank; + hs_offset[1] = hs_size[1] * (hsize_t)mpi_rank; /* Create the data space */ sid = H5Screate_simple(2, size, NULL); @@ -215,7 +215,9 @@ test_filter_read(void) unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */ herr_t hrc; const char *filename; +#ifdef H5_HAVE_FILTER_FLETCHER32 hsize_t fletcher32_size; /* Size of dataset with Fletcher32 checksum */ +#endif #ifdef H5_HAVE_FILTER_DEFLATE hsize_t deflate_size; /* Size of dataset with deflate filter */ diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 63ac8d3..db0d059 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -13,6 +13,7 @@ #include "testphdf5.h" #include "H5Dprivate.h" +#include "H5private.h" #define DIM 2 #define SIZE 32 @@ -156,11 +157,12 @@ void multiple_dset_write(void) ndatasets = pt->count; size = get_size(); + H5_CHECK_OVERFLOW(size, int, size_t); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - outme = HDmalloc((size_t)(size * size * sizeof(double))); + outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); VRFY((outme != NULL), "HDmalloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); @@ -233,19 +235,22 @@ void compact_dataset(void) char dname[]="dataset"; herr_t ret; const char *filename; +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + hbool_t prop_value; +#endif 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(); @@ -312,7 +317,6 @@ void compact_dataset(void) VRFY((dataset >= 0), "H5Dopen2 succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - hbool_t prop_value; prop_value = H5D_XFER_COLL_RANK0_BCAST_DEF; ret = H5Pinsert2(dxpl, H5D_XFER_COLL_RANK0_BCAST_NAME, H5D_XFER_COLL_RANK0_BCAST_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); @@ -332,7 +336,7 @@ void compact_dataset(void) /* Verify data value */ for(i = 0; i < size; i++) for(j = 0; j < size; j++) - if(inme[(i * size) + j] != outme[(i * size) + j]) + if(!H5_DBL_ABS_EQUAL(inme[(i * size) + j], outme[(i * size) + j])) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) HDprintf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]); @@ -362,7 +366,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; @@ -618,6 +622,9 @@ void dataset_fillvalue(void) int acc, i, ii, j, k, l; /* Local index variables */ herr_t ret; /* Generic return value */ const char *filename; +#ifdef H5_HAVE_INSTRUMENTED_LIBRARY + hbool_t prop_value; +#endif MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -626,7 +633,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 */ @@ -662,7 +669,6 @@ void dataset_fillvalue(void) VRFY((dxpl >= 0), "H5Pcreate succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY - hbool_t prop_value; prop_value = H5D_XFER_COLL_RANK0_BCAST_DEF; ret = H5Pinsert2(dxpl, H5D_XFER_COLL_RANK0_BCAST_NAME, H5D_XFER_COLL_RANK0_BCAST_SIZE, &prop_value, NULL, NULL, NULL, NULL, NULL, NULL); @@ -719,7 +725,7 @@ void dataset_fillvalue(void) * Each process writes 1 row of data. Thus last row is not written. */ /* Create hyperslabs in memory and file dataspaces */ - req_start[0]=mpi_rank; + req_start[0]=(hsize_t)mpi_rank; ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace"); ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); @@ -877,7 +883,7 @@ void collective_group_write(void) chunk_size[0] =(hsize_t)(size / 2); chunk_size[1] =(hsize_t)(size / 2); - outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outme = HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((outme != NULL), "HDmalloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); @@ -1001,10 +1007,10 @@ group_dataset_read(hid_t fid, int mpi_rank, int m) size = get_size(); - indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); /* open every group under root group. */ @@ -1172,7 +1178,7 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - outme = HDmalloc((size_t)(size * size * sizeof(double))); + outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); VRFY((outme != NULL), "HDmalloc succeeded for outme"); for(n = 0; n < NDATASET; n++) { @@ -1332,10 +1338,10 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); for(n=0; n<NDATASET; n++) { @@ -1489,8 +1495,8 @@ check_value(DATATYPE *indata, DATATYPE *outdata, int size) get_slab(chunk_origin, chunk_dims, count, NULL, size); - indata += chunk_origin[0]*size; - outdata += chunk_origin[0]*size; + indata += chunk_origin[0]*(hsize_t)size; + outdata += chunk_origin[0]*(hsize_t)size; for(i=chunk_origin[0]; i<(chunk_origin[0]+chunk_dims[0]); i++) for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) { if(*indata != *outdata ) @@ -1523,15 +1529,15 @@ get_slab(hsize_t chunk_origin[], hsize_t chunk_dims[], hsize_t count[], MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); if(chunk_origin != NULL) { - chunk_origin[0] = mpi_rank *(size/mpi_size); + chunk_origin[0] = (hsize_t)mpi_rank * (hsize_t)(size/mpi_size); chunk_origin[1] = 0; } if(chunk_dims != NULL) { - chunk_dims[0] = size/mpi_size; - chunk_dims[1] = size; + chunk_dims[0] = (hsize_t)(size/mpi_size); + chunk_dims[1] = (hsize_t)size; } if(file_dims != NULL) - file_dims[0] = file_dims[1] = size; + file_dims[0] = file_dims[1] = (hsize_t)size; if(count != NULL) count[0] = count[1] = 1; } @@ -1959,7 +1965,7 @@ void rr_obj_hdr_flush_confusion_writer(MPI_Comm comm) /* private communicator size and rank */ int mpi_size; int mpi_rank; - int mrc; /* mpi error code */ + int mrc; /* mpi error code */ /* steps to verify and have been verified */ int steps = 0; int steps_done = 0; @@ -2477,7 +2483,7 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm) /* compare read data with expected data */ for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) - if (data_read[j] != data[j]){ + if (!H5_DBL_ABS_EQUAL(data_read[j], data[j])){ HDfprintf(stdout, "%0d:%s: Reading datasets value failed in " "Dataset %d, at position %d: expect %f, got %f.\n", @@ -2540,7 +2546,7 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm) VRFY((err >= 0), "H5Aread failed.\n"); /* compare read attribute data with expected data */ for ( j = 0; j < LOCAL_DATA_SIZE; j++ ) - if (att_read[j] != att[j]){ + if (!H5_DBL_ABS_EQUAL(att_read[j], att[j])){ HDfprintf(stdout, "%0d:%s: Mismatched attribute data read in Dataset %d, at position %d: expect %f, got %f.\n", mpi_rank, fcn_name, i, j, att[j], att_read[j]); @@ -2592,7 +2598,7 @@ void rr_obj_hdr_flush_confusion_reader(MPI_Comm comm) VRFY((err >= 0), "H5Aread failed.\n"); /* compare read attribute data with expected data */ for ( j = 0; j < LARGE_ATTR_SIZE; j++ ) - if (lg_att_read[j] != lg_att[j]){ + if (!H5_DBL_ABS_EQUAL(lg_att_read[j], lg_att[j])){ HDfprintf(stdout, "%0d:%s: Mismatched large attribute data read in Dataset %d, at position %d: expect %f, got %f.\n", mpi_rank, fcn_name, i, j, lg_att[j], lg_att_read[j]); diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index fe78317..2dbb4d2 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -302,7 +302,7 @@ static int test_mpio_gb_file(char *filename) { "proc %d: write to mpi_off=%016llx, %lld\n", mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ - for (j = 0; j < MB; j++) + for (j = 0; j < MB; j++) *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) HDfprintf(stdout, @@ -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..cf974e8 100644 --- a/testpar/t_prestart.c +++ b/testpar/t_prestart.c @@ -34,8 +34,8 @@ main (int argc, char **argv) hid_t file_id, dset_id, grp_id; hid_t fapl, sid, mem_dataspace; herr_t ret; - char filename[1024]; - int mpi_size, mpi_rank, ndims, i, j; + char filename[1024]; + int mpi_size, mpi_rank, ndims; MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; hsize_t dims[RANK]; @@ -43,6 +43,7 @@ main (int argc, char **argv) hsize_t count[RANK]; hsize_t stride[RANK]; hsize_t block[RANK]; + hsize_t i, j; DATATYPE *data_array = NULL, *dataptr; /* data buffer */ MPI_Init(&argc, &argv); @@ -73,21 +74,21 @@ main (int argc, char **argv) ndims = H5Sget_simple_extent_dims(sid, dims, NULL); VRFY((ndims == 2), "H5Sget_simple_extent_dims succeeded"); - VRFY(dims[0] == ROW_FACTOR*mpi_size, "Wrong dataset dimensions"); - VRFY(dims[1] == COL_FACTOR*mpi_size, "Wrong dataset dimensions"); + VRFY(dims[0] == (hsize_t)(ROW_FACTOR*mpi_size), "Wrong dataset dimensions"); + VRFY(dims[1] == (hsize_t)(COL_FACTOR*mpi_size), "Wrong dataset dimensions"); /* allocate memory for data buffer */ data_array = (DATATYPE *)HDmalloc(dims[0]*dims[1]*sizeof(DATATYPE)); 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 +110,7 @@ main (int argc, char **argv) if(*dataptr != mpi_rank+1) { HDprintf("Dataset Verify failed at [%lu][%lu](row %lu, col %lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, - (unsigned long)(i+start[0]), (unsigned long)(j+start[1]), + (unsigned long)((hsize_t)i+start[0]), (unsigned long)((hsize_t)j+start[1]), mpi_rank+1, *(dataptr)); nerrors ++; } diff --git a/testpar/t_prop.c b/testpar/t_prop.c index fd89c6a..62e4dde 100644 --- a/testpar/t_prop.c +++ b/testpar/t_prop.c @@ -53,7 +53,7 @@ test_encode_decode(hid_t orig_pl, int mpi_rank, int recv_proc) void *rbuf; MPI_Recv(&recv_size, 1, MPI_INT, 0, 123, MPI_COMM_WORLD, &status); - buf_size = recv_size; + buf_size = (size_t)recv_size; rbuf = (uint8_t *)HDmalloc(buf_size); MPI_Recv(rbuf, recv_size, MPI_BYTE, 0, 124, MPI_COMM_WORLD, &status); diff --git a/testpar/t_pshutdown.c b/testpar/t_pshutdown.c index def7071..ddbae9e 100644 --- a/testpar/t_pshutdown.c +++ b/testpar/t_pshutdown.c @@ -68,8 +68,8 @@ main (int argc, char **argv) grp_id = H5Gcreate2(file_id, "Group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((grp_id >= 0), "H5Gcreate succeeded"); - dims[0] = ROW_FACTOR*mpi_size; - dims[1] = COL_FACTOR*mpi_size; + dims[0] = (hsize_t)ROW_FACTOR*(hsize_t)mpi_size; + dims[1] = (hsize_t)COL_FACTOR*(hsize_t)mpi_size; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -81,13 +81,13 @@ main (int argc, char **argv) VRFY((data_array != NULL), "data_array HDmalloc succeeded"); /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; /* put some trivial data in the data_array */ diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index abbfbb3..34fcc72 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -397,14 +397,9 @@ hs_dr_pio_test__setup(const int test_num, * * JRM -- 9/16/10 */ - if ( express_test == 0 ) { - tv_ptr->chunk_dims[0] = 1; + tv_ptr->chunk_dims[0] = 1; - } else { - - tv_ptr->chunk_dims[0] = 1; - } tv_ptr->chunk_dims[1] = tv_ptr->chunk_dims[2] = tv_ptr->chunk_dims[3] = tv_ptr->chunk_dims[4] = (hsize_t)(tv_ptr->chunk_edge_size); @@ -1981,7 +1976,6 @@ contig_hs_dr_pio_test__run_test(const int test_num, #if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; #endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; struct hs_dr_pio_test_vars_t test_vars = { /* int mpi_size = */ -1, @@ -2049,9 +2043,6 @@ contig_hs_dr_pio_test__run_test(const int test_num, small_rank, large_rank, use_collective_io, dset_type, express_test, tv_ptr); - /* initialize the local copy of mpi_rank */ - mpi_rank = tv_ptr->mpi_rank; - /* initialize skips & max_skips */ tv_ptr->skips = *skips_ptr; tv_ptr->max_skips = max_skips; @@ -3520,7 +3511,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()"; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; int i, j, k, l; size_t u; size_t start_index; @@ -3768,8 +3758,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* verify that expected data is retrieved */ - mis_match = FALSE; - expected_value = (uint32_t)( (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -3878,7 +3866,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; int i, j, k, l; size_t u; size_t start_index; @@ -4138,8 +4125,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) HDassert( stop_index < tv_ptr->large_ds_size ); - mis_match = FALSE; - data_ok = TRUE; ptr_1 = tv_ptr->large_ds_buf_1; @@ -4235,7 +4220,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()"; #endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; /* needed by VRFY */ struct hs_dr_pio_test_vars_t test_vars = { /* int mpi_size = */ -1, @@ -4305,10 +4289,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, tv_ptr); - /* initialize the local copy of mpi_rank */ - mpi_rank = tv_ptr->mpi_rank; - - /* initialize skips & max_skips */ tv_ptr->skips = *skips_ptr; tv_ptr->max_skips = max_skips; diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 9a4ac4d..fe8a618 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -37,7 +37,7 @@ static void coll_write_test(int chunk_factor); -static void coll_read_test(int chunk_factor); +static void coll_read_test(void); /*------------------------------------------------------------------------- @@ -84,7 +84,7 @@ void coll_irregular_cont_read(void) { - coll_read_test(0); + coll_read_test(); } @@ -133,7 +133,7 @@ void coll_irregular_simple_chunk_read(void) { - coll_read_test(1); + coll_read_test(); } @@ -181,7 +181,7 @@ void coll_irregular_complex_chunk_read(void) { - coll_read_test(4); + coll_read_test(); } @@ -223,7 +223,7 @@ void coll_write_test(int chunk_factor) hsize_t chunk_dims[2]; herr_t ret; - unsigned i; + int i; int fillvalue = 0; /* Fill value for the dataset */ int *matrix_out = NULL; @@ -246,19 +246,19 @@ void coll_write_test(int chunk_factor) * Buffers' initialization. */ - mdim1[0] = MSPACE1_DIM *mpi_size; + mdim1[0] = (hsize_t)(MSPACE1_DIM*mpi_size); mdim[0] = MSPACE_DIM1; - mdim[1] = MSPACE_DIM2*mpi_size; + mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size); fsdim[0] = FSPACE_DIM1; - fsdim[1] = FSPACE_DIM2*mpi_size; + fsdim[1] = (hsize_t)(FSPACE_DIM2*mpi_size); - vector = (int*)HDmalloc(sizeof(int)*mdim1[0]*mpi_size); - matrix_out = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size); - matrix_out1 = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size); + vector = (int*)HDmalloc(sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size); + matrix_out = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size); + matrix_out1 = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size); - HDmemset(vector,0,sizeof(int)*mdim1[0]*mpi_size); + HDmemset(vector,0,sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size); vector[0] = vector[MSPACE1_DIM*mpi_size - 1] = -1; - for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) vector[i] = i; + for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) H5_CHECKED_ASSIGN(vector[i], int, i, unsigned); /* Grab file access property list */ facc_plist = create_faccess_plist(comm, info, facc_type); @@ -280,8 +280,8 @@ void coll_write_test(int chunk_factor) VRFY((ret >= 0),"Fill value creation property list succeeded"); if(chunk_factor != 0) { - chunk_dims[0] = fsdim[0] / chunk_factor; - chunk_dims[1] = fsdim[1] / chunk_factor; + chunk_dims[0] = fsdim[0] / (hsize_t)chunk_factor; + chunk_dims[1] = fsdim[1] / (hsize_t)chunk_factor; ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); } @@ -317,7 +317,7 @@ void coll_write_test(int chunk_factor) */ start[0] = FHSTART0; - start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1; + start[1] = (hsize_t)(FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1); stride[0] = FHSTRIDE0; stride[1] = FHSTRIDE1; count[0] = FHCOUNT0; @@ -338,7 +338,7 @@ void coll_write_test(int chunk_factor) */ start[0] = SHSTART0; - start[1] = SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank; + start[1] = (hsize_t)(SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank); stride[0] = SHSTRIDE0; stride[1] = SHSTRIDE1; count[0] = SHCOUNT0; @@ -476,7 +476,7 @@ void coll_write_test(int chunk_factor) * */ start[0] = RFFHSTART0; - start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1; + start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1); block[0] = RFFHBLOCK0; block[1] = RFFHBLOCK1; stride[0] = RFFHSTRIDE0; @@ -503,7 +503,7 @@ void coll_write_test(int chunk_factor) */ start[0] = RFSHSTART0; - start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank; + start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank); block[0] = RFSHBLOCK0; block[1] = RFSHBLOCK1; stride[0] = RFSHSTRIDE0; @@ -542,7 +542,7 @@ void coll_write_test(int chunk_factor) start[0] = RMFHSTART0; - start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1; + start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1); block[0] = RMFHBLOCK0; block[1] = RMFHBLOCK1; stride[0] = RMFHSTRIDE0; @@ -565,7 +565,7 @@ void coll_write_test(int chunk_factor) * */ start[0] = RMSHSTART0; - start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1; + start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1); block[0] = RMSHBLOCK0; block[1] = RMSHBLOCK1; stride[0] = RMSHSTRIDE0; @@ -580,8 +580,8 @@ void coll_write_test(int chunk_factor) * Initialize data buffer. */ - HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); - HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); + HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); + HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); /* * Read data back to the buffer matrix_out. */ @@ -662,7 +662,7 @@ void coll_write_test(int chunk_factor) *------------------------------------------------------------------------- */ static void -coll_read_test(int chunk_factor) +coll_read_test(void) { const char *filename; @@ -682,7 +682,7 @@ coll_read_test(int chunk_factor) hsize_t block[2]; /* Block sizes */ herr_t ret; - unsigned i; + int i; int *matrix_out; int *matrix_out1; /* Buffer to read from the dataset */ @@ -704,9 +704,9 @@ coll_read_test(int chunk_factor) /* Initialize the buffer */ mdim[0] = MSPACE_DIM1; - mdim[1] = MSPACE_DIM2*mpi_size; - matrix_out =(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); - matrix_out1=(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); + mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size); + matrix_out =(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); + matrix_out1=(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); /*** For testing collective hyperslab selection read ***/ @@ -741,7 +741,7 @@ coll_read_test(int chunk_factor) * */ start[0] = RFFHSTART0; - start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1; + start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1); block[0] = RFFHBLOCK0; block[1] = RFFHBLOCK1; stride[0] = RFFHSTRIDE0; @@ -761,7 +761,7 @@ coll_read_test(int chunk_factor) * */ start[0] = RFSHSTART0; - start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank; + start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank); block[0] = RFSHBLOCK0; block[1] = RFSHBLOCK1; stride[0] = RFSHSTRIDE0; @@ -791,7 +791,7 @@ coll_read_test(int chunk_factor) */ start[0] = RMFHSTART0; - start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1; + start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1); block[0] = RMFHBLOCK0; block[1] = RMFHBLOCK1; stride[0] = RMFHSTRIDE0; @@ -813,7 +813,7 @@ coll_read_test(int chunk_factor) * */ start[0] = RMSHSTART0; - start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1; + start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1); block[0] = RMSHBLOCK0; block[1] = RMSHBLOCK1; stride[0] = RMSHSTRIDE0; @@ -828,8 +828,8 @@ coll_read_test(int chunk_factor) * Initialize data buffer. */ - HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); - HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); + HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); + HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); /* * Read data back to the buffer matrix_out. @@ -923,7 +923,9 @@ coll_read_test(int chunk_factor) ****************************************************************/ #define LDSCT_DS_RANK 5 +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG #define LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK 0 +#endif #define LOWER_DIM_SIZE_COMP_TEST__SELECT_CHECKER_BOARD__DEBUG 0 @@ -1002,9 +1004,9 @@ lower_dim_size_comp_test__select_checker_board( * pre-C99 compilers again. */ - base_count = dims[sel_offset] / (checker_edge_size * 2); + base_count = dims[sel_offset] / (hsize_t)(checker_edge_size * 2); - if ( (dims[sel_rank] % (checker_edge_size * 2)) > 0 ) { + if ( (dims[sel_rank] % (hsize_t)(checker_edge_size * 2)) > 0 ) { base_count++; } @@ -1558,7 +1560,9 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, size_t small_ds_size; size_t small_ds_slice_size; size_t large_ds_size; +#if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG size_t large_ds_slice_size; +#endif uint32_t expected_value; uint32_t * small_ds_buf_0 = NULL; uint32_t * small_ds_buf_1 = NULL; @@ -1612,9 +1616,10 @@ lower_dim_size_comp_test__run_test(const int chunk_edge_size, small_ds_size = (size_t)((mpi_size + 1) * 1 * 1 * 10 * 10); small_ds_slice_size = (size_t) ( 1 * 1 * 10 * 10); large_ds_size = (size_t)((mpi_size + 1) * 10 * 10 * 10 * 10); - large_ds_slice_size = (size_t) (10 * 10 * 10 * 10); #if LOWER_DIM_SIZE_COMP_TEST__RUN_TEST__DEBUG + large_ds_slice_size = (size_t) (10 * 10 * 10 * 10); + if ( mpi_rank == LOWER_DIM_SIZE_COMP_TEST_DEBUG_TARGET_RANK ) { HDfprintf(stdout, "%s:%d: small ds size / slice size = %d / %d.\n", fcnName, mpi_rank, diff --git a/testpar/testpar.h b/testpar/testpar.h index 86677d1..e3d68e0 100644 --- a/testpar/testpar.h +++ b/testpar/testpar.h @@ -44,12 +44,12 @@ * This will allow program to continue and can be used for debugging. * (The "do {...} while(0)" is to group all the statements as one unit.) */ -#define VRFY(val, mesg) do { \ +#define VRFY_IMPL(val, mesg, rankvar) do { \ if (val) { \ MESG(mesg); \ } \ else { \ - HDprintf("Proc %d: ", mpi_rank); \ + HDprintf("Proc %d: ", rankvar); \ HDprintf("*** Parallel ERROR ***\n"); \ HDprintf(" VRFY (%s) failed at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ @@ -62,6 +62,9 @@ } \ } while(0) +#define VRFY_G(val, mesg) VRFY_IMPL(val, mesg, mpi_rank_g) +#define VRFY(val, mesg) VRFY_IMPL(val, mesg, mpi_rank) + /* * Checking for information purpose. * If val is false, print mesg; else nothing. diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 8c434ac..86726b4 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1048,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; @@ -1057,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++) { @@ -1345,8 +1345,8 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end else */ } /* end while */ - for(i = 1; i < g_nTasks; i++) - MPI_Send(NULL, 0, MPI_BYTE, i, MPI_TAG_END, MPI_COMM_WORLD); + for(i = 1; (int)i < g_nTasks; i++) + 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(); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 088e230..6cfe3d2 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -4559,7 +4559,7 @@ static hbool_t equal_double(double value, double expected, diff_opt_t *opts) { return FALSE; } - if (value == expected) + if (H5_DBL_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) @@ -4603,7 +4603,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts) return FALSE; } - if (value == expected) + if (H5_LDBL_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) @@ -4645,7 +4645,7 @@ static hbool_t equal_float(float value, float expected, diff_opt_t *opts) { return FALSE; } - if (value == expected) + if (H5_FLT_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index d6d94a6..3cca910 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -3317,7 +3317,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, if (vmaps) { size_t next; - ssize_t ssize_out; + ssize_t H5_ATTR_NDEBUG_UNUSED ssize_out; ctx->indent_level++; for (next = 0; next < (unsigned) vmaps; next++) { diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 5ba5fb3..c473c8b 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -166,7 +166,7 @@ ph5diff_worker(int nID) { struct diff_mpi_args args; struct diffs_found diffs; - int i; + unsigned i; /* Make certain we've received the filenames and opened the files already */ if(file1_id < 0 || file2_id < 0) diff --git a/tools/src/h5dump/h5dump_xml.c b/tools/src/h5dump/h5dump_xml.c index 7a3ad80..d9f1f67 100644 --- a/tools/src/h5dump/h5dump_xml.c +++ b/tools/src/h5dump/h5dump_xml.c @@ -1798,12 +1798,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t H5_ATTR_UNUSED *sset, hid_t space = H5I_INVALID_HID; hid_t type = H5I_INVALID_HID; hid_t p_type = H5I_INVALID_HID; - hsize_t size[64]; - hsize_t nelmts = 1; - int ndims; - int i; int status = -1; - void *buf = NULL; hsize_t curr_pos = 0; /* total data element position */ h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 81f9a32..00fe7cf 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -4725,15 +4725,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 279a598..f3f9ede 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -1302,7 +1302,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx hid_t new_obj_sid = H5I_INVALID_HID; hsize_t elmt_counter = 0; /*counts the # elements printed. */ size_t ncols = 80; /* available output width */ - size_t i; + int i; hsize_t curr_pos = 0; /* total data element position */ h5tools_str_t buffer; /* string into which to render */ h5tools_context_t datactx; /* print context */ @@ -1312,7 +1312,7 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx datactx = *ctx; /* print context */ /* Assume entire data space to be printed */ if (datactx.ndims > 0) - for (i = 0; i < (size_t)datactx.ndims; i++) + for (i = 0; (unsigned)i < datactx.ndims; i++) datactx.p_min_idx[i] = 0; datactx.need_prefix = TRUE; @@ -1447,13 +1447,13 @@ dump_reference(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx /* Print point information */ H5TOOLS_DEBUG("H5S_SEL_POINTS H5R_DATASET_REGION2"); h5tools_dump_region_data_points(new_obj_sid, new_obj_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); + &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); } else if(region_type == H5S_SEL_HYPERSLABS) { /* Print block information */ H5TOOLS_DEBUG("H5S_SEL_HYPERSLABS H5R_DATASET_REGION2"); h5tools_dump_region_data_blocks(new_obj_sid, new_obj_id, stream, info, &datactx, - &buffer, &curr_pos, ncols, i, elmt_counter); + &buffer, &curr_pos, ncols, (hsize_t)i, elmt_counter); } else H5TOOLS_INFO("invalid region type"); @@ -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); @@ -1695,7 +1695,7 @@ done: *------------------------------------------------------------------------- */ static void -dump_attribute_values(hid_t attr, const char *attr_name) +dump_attribute_values(hid_t attr) { hid_t f_type = H5I_INVALID_HID; hid_t space = H5I_INVALID_HID; @@ -1827,7 +1827,7 @@ dump_attribute_values(hid_t attr, const char *attr_name) 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); @@ -1955,7 +1955,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t H5_ATTR_UNUSED *ain h5tools_str_close(&buffer); if (data_g) - dump_attribute_values(attr, attr_name); + dump_attribute_values(attr); H5Aclose(attr); } else { diff --git a/tools/src/h5repack/h5repack_main.c b/tools/src/h5repack/h5repack_main.c index df8c7ef..ea6b0e1 100644 --- a/tools/src/h5repack/h5repack_main.c +++ b/tools/src/h5repack/h5repack_main.c @@ -280,7 +280,7 @@ int read_info(const char *filename, pack_opt_t *options) char comp_info[1024]; FILE *fp = NULL; char c; - int i, rc = 1; + int i; int ret_value = EXIT_SUCCESS; if (NULL == (fp = HDfopen(filename, "r"))) { 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/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 716b0d2..2a8a575 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -744,9 +744,9 @@ static void Test_Obj_Copy(void) /* Set the FAPL for the type of format */ /* Create source file */ if(new_format) - fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); - else - fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); + else + fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if(fid < 0) { HDfprintf(stderr, "Error: H5Fcreate failed.\n"); goto out; @@ -756,7 +756,7 @@ static void Test_Obj_Copy(void) gent_empty_group(fid); gent_nested_datasets(fid); gent_nested_group(fid); - gent_att_compound_vlstr(fid); + gent_att_compound_vlstr(fid); H5Fclose(fid); fid = (-1); diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 05bad77..98001ff 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -4227,7 +4227,7 @@ static void test_comps_array(const char *fname, const char *dset, const char *at hsize_t sdims_dset[] = { SDIM_DSET }; hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; int i, j; - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for (i = 0; i < SDIM_DSET; i++) { @@ -4336,7 +4336,7 @@ static void test_comps_vlen(const char * fname, const char *dset, const char *at hsize_t sdims_dset[] = { SDIM_DSET }; unsigned i, j; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for (i = 0; i < SDIM_DSET; i++) { @@ -4454,7 +4454,7 @@ static void test_comps_array_vlen(const char * fname, const char *dset, const ch hsize_t sdims_dset[] = { SDIM_DSET }; hsize_t sdims_arry[] = { SDIM_CMPD_ARRAY }; unsigned i, j, k; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write in compound1 */ for (i = 0; i < SDIM_DSET; i++) { @@ -4597,7 +4597,7 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha hsize_t sdims_cmpd_arry[] = { SDIM_CMPD_ARRAY }; unsigned i, j, k; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for (i = 0; i < SDIM_DSET; i++) { @@ -5214,7 +5214,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make hid_t aid = H5I_INVALID_HID; hid_t sid = H5I_INVALID_HID; hid_t tid = H5I_INVALID_HID; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, l, n; float f; @@ -6205,7 +6205,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff hid_t aid = H5I_INVALID_HID; hid_t sid = H5I_INVALID_HID; hid_t tid = H5I_INVALID_HID; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, l, n; float f; @@ -7197,7 +7197,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff hid_t sid = H5I_INVALID_HID; hid_t tid = H5I_INVALID_HID; hid_t dcpl = H5I_INVALID_HID; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, l, n; float f; int fillvalue = 2; @@ -7832,7 +7832,7 @@ void gen_datareg(hid_t fid, int make_diffs /* flag to modify data buffers */) hsize_t start[10]; /* starting location of hyperslab */ hsize_t count[10]; /* element count of hyperslab */ hsize_t coord[5][2]; /* coordinates for point selection */ - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int i; /* allocate the buffer for write the references */ diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index a686660..026ab20 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -1554,7 +1554,7 @@ gent_many(void) dset1_t dset1[6]; hsize_t dim[4]; - herr_t ret; + herr_t H5_ATTR_NDEBUG_UNUSED ret; fid = H5Fcreate(FILE12, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2603,7 +2603,7 @@ static void gent_vldatatypes(void) hid_t file, dset, space, type; hsize_t dims[] = { SPACE1_DIM1 }; int i; - herr_t ret=0; + herr_t H5_ATTR_NDEBUG_UNUSED ret=0; file = H5Fcreate(FILE21, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -2698,7 +2698,7 @@ gent_vldatatypes2(void) hid_t tid1, tid2; /* Datatype IDs */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for(i = 0; i < SPACE1_DIM1; i++) { @@ -2771,7 +2771,7 @@ static void gent_vldatatypes3(void) hid_t tid1, tid2; /* Datatype IDs */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for(i=0; i<SPACE1_DIM1; i++) { @@ -2840,7 +2840,7 @@ static void gent_vldatatypes4(void) hid_t tid1, tid2; /* Datatype IDs */ hsize_t dims1[] = {SPACE1_DIM1}; unsigned i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize VL data to write */ for(i=0; i<SPACE1_DIM1; i++) { @@ -2897,14 +2897,14 @@ static void gent_vldatatypes4(void) /* Generate a variable-length dataset with NULL values in it */ static void gent_vldatatypes5(void) { - hvl_t wdata [SPACE1_DIM1]; - hid_t fid1; - hid_t dataset; - hid_t sid1; - hid_t tid1; - hsize_t dims1[] = {SPACE1_DIM1}; - int i,j; /* counting variable */ - herr_t ret; /* Generic return value */ + hvl_t wdata [SPACE1_DIM1]; + hid_t fid1; + hid_t dataset; + hid_t sid1; + hid_t tid1; + hsize_t dims1[] = {SPACE1_DIM1}; + int i,j; /* counting variable */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* initialize data for dataset */ for(i=0; i<SPACE1_DIM1; i++) { @@ -2966,16 +2966,15 @@ static void gent_vldatatypes5(void) static void gent_array1_big(void) { - int *wdata; /* Information to write */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Datatype ID */ - hsize_t sdims1[] = {SPACE_ARRAY1BIG_DIM}; - hsize_t tdims1[] = {ARRAY1BIG_DIM}; - int i,j; /* counting variables */ - herr_t ret; /* Generic return value */ - + int *wdata; /* Information to write */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Datatype ID */ + hsize_t sdims1[] = {SPACE_ARRAY1BIG_DIM}; + hsize_t tdims1[] = {ARRAY1BIG_DIM}; + int i,j; /* counting variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* for region reference dataset */ hid_t dset2; @@ -3101,15 +3100,15 @@ static void gent_array1(void) static void gent_array2(void) { - int wdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information to write */ - hid_t fid; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid; /* Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3}; - int i,j,k,l; /* counting variables */ - herr_t ret; /* Generic return value */ + int wdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information to write */ + hid_t fid; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid; /* Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims2[] = {ARRAY2_DIM1,ARRAY2_DIM2,ARRAY2_DIM3}; + int i,j,k,l; /* counting variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3147,17 +3146,17 @@ static void gent_array2(void) static void gent_array3(void) { - int wdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information to write */ - hid_t fid; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid; /* Dataspace ID */ - hid_t tid1; /* 1-D array Datatype ID */ - hid_t tid2; /* 2-D array Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2}; - int i,j,k,l; /* counting variables */ - herr_t ret; /* Generic return value */ + int wdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information to write */ + hid_t fid; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid; /* Dataspace ID */ + hid_t tid1; /* 1-D array Datatype ID */ + hid_t tid2; /* 2-D array Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + hsize_t tdims2[] = {ARRAY3_DIM1,ARRAY3_DIM2}; + int i,j,k,l; /* counting variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Allocate and initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3204,16 +3203,16 @@ static void gent_array4(void) int i; float f; } s2_t; - s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* Compound Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int i,j; /* counting variables */ - herr_t ret; /* Generic return value */ + s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* Compound Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int i,j; /* counting variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3270,17 +3269,17 @@ static void gent_array5(void) int i; float f[ARRAY1_DIM1]; } s2_t; - s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* Compound Datatype ID */ - hid_t tid3; /* Nested Array Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + s2_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* Compound Datatype ID */ + hid_t tid3; /* Nested Array Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int i,j,k; /* counting variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3341,16 +3340,16 @@ static void gent_array5(void) static void gent_array6(void) { - hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* VL Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int i,j,k; /* counting variables */ - herr_t ret; /* Generic return value */ + hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* VL Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int i,j,k; /* counting variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3401,17 +3400,17 @@ static void gent_array6(void) static void gent_array7(void) { - hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ - hid_t fid1; /* HDF5 File IDs */ - hid_t dataset; /* Dataset ID */ - hid_t sid1; /* Dataspace ID */ - hid_t tid1; /* Array Datatype ID */ - hid_t tid2; /* VL Datatype ID */ - hid_t tid3; /* Nested Array Datatype ID */ - hsize_t sdims1[] = {SPACE1_DIM1}; - hsize_t tdims1[] = {ARRAY1_DIM1}; - int i,j,k,l; /* Index variables */ - herr_t ret; /* Generic return value */ + hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ + hid_t fid1; /* HDF5 File IDs */ + hid_t dataset; /* Dataset ID */ + hid_t sid1; /* Dataspace ID */ + hid_t tid1; /* Array Datatype ID */ + hid_t tid2; /* VL Datatype ID */ + hid_t tid3; /* Nested Array Datatype ID */ + hsize_t sdims1[] = {SPACE1_DIM1}; + hsize_t tdims1[] = {ARRAY1_DIM1}; + int i,j,k,l; /* Index variables */ + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Generic return value */ /* Initialize array data to write */ for(i=0; i<SPACE1_DIM1; i++) @@ -3475,7 +3474,7 @@ static void gent_array8(void) hid_t filetype = H5I_INVALID_HID; /* Handles */ hid_t space = H5I_INVALID_HID; /* Handles */ hid_t dset = H5I_INVALID_HID; /* Handles */ - herr_t status = -1; + herr_t H5_ATTR_NDEBUG_UNUSED status = -1; hsize_t sdims[] = {F64_DIM0}; hsize_t tdims[] = {F64_DIM1}; int *wdata; /* Write buffer */ @@ -3542,7 +3541,7 @@ static void gent_empty(void) } empty_struct; hid_t file, dset, space, type; hsize_t dims[] = { SPACE1_DIM1 }; - herr_t ret=0; + herr_t H5_ATTR_NDEBUG_UNUSED ret=0; file = H5Fcreate(FILE32, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -3930,7 +3929,7 @@ static void write_attr_in(hid_t loc_id, hid_t aid; hid_t sid; hid_t tid; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, n; float f; @@ -4371,7 +4370,7 @@ static void write_dset_in(hid_t loc_id, hid_t sid; hid_t tid; hid_t plist_id; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; int val, i, j, k, n; float f; int fillvalue=2; @@ -4809,7 +4808,7 @@ static void gent_attr_all(void) hid_t root_id; hid_t sid; hsize_t dims[1] = {2}; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Create a file and a dataset */ fid = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -4967,7 +4966,7 @@ static void gent_compound_complex(void) hid_t array4_tid; /* Array datatype handle */ hid_t datafile, dataset; /* Datafile/dataset handles */ hid_t dataspace; /* Dataspace handle */ - herr_t status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = {F41_LENGTH}; /* Dataspace dimensions */ hsize_t array_dimb[] = {F41_DIMb}; /* Array dimensions */ hsize_t array_dimd[]={F41_ARRAY_DIMd1,F41_ARRAY_DIMd2}; /* Array dimensions */ @@ -5116,7 +5115,7 @@ static void gent_named_dtype_attr(void) hid_t aid; hid_t gid; int data=8; - herr_t ret; + herr_t H5_ATTR_NDEBUG_UNUSED ret; /* Create a file */ fid=H5Fcreate(FILE42, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -5338,7 +5337,7 @@ make_external(hid_t fid) hsize_t cur_size[1]; /*data space current size */ hsize_t max_size[1]; /*data space maximum size */ hsize_t size; /*bytes reserved for data in the external file*/ - int ret; + int H5_ATTR_NDEBUG_UNUSED ret; cur_size[0] = max_size[0] = 100; size = (max_size[0]*sizeof(int)/2); @@ -5386,7 +5385,8 @@ static void gent_filters(void) hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf1[DIM1][DIM2]; - int i, j, n, ret; + int i, j, n; + int H5_ATTR_NDEBUG_UNUSED ret; for(i=n=0; i<DIM1; i++){ for(j=0; j<DIM2; j++){ @@ -5732,8 +5732,7 @@ static void gent_fcontents(void) hid_t tid; /* datatype ID */ hsize_t dims[1]={4}; int buf[4]={1,2,3,4}; - int ret; - + int H5_ATTR_NDEBUG_UNUSED ret; /* create a file */ fid = H5Fcreate(FILE46, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -5866,7 +5865,7 @@ static void gent_fvalues(void) hvl_t fillval3; /* vlen fill value */ hsize_t dimarray[1]={3}; /* array dimension */ int buf4[2][3]= {{1,2,3},{4,5,6}}; /* array */ - int ret; + int H5_ATTR_NDEBUG_UNUSED ret; /* create a file */ fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -6024,9 +6023,9 @@ static void gent_string(void) c_t buf3 = {24, "Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; char buf4[] = {"Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; hsize_t dims1[] = {1}; - hsize_t dims2[] = {SPACE1_DIM1}; - hsize_t dims4[1]; - int ret; + hsize_t dims2[] = {SPACE1_DIM1}; + hsize_t dims4[1]; + int H5_ATTR_NDEBUG_UNUSED ret; dims4[0] = sizeof(buf4); @@ -6121,7 +6120,8 @@ static void gent_aindices(void) int buf2[10][10]; int buf3[2][10][10]; int buf4[2][2][10][10]; - int i, j, k, l, n, ret; + int i, j, k, l, n; + int H5_ATTR_NDEBUG_UNUSED ret; for(i = n = 0; i < 100; i++) buf1[i] = n++; @@ -6188,11 +6188,11 @@ static void gent_aindices(void) */ static void gent_longlinks(void) { - hid_t fid = (-1); /* File ID */ - hid_t gid = (-1); /* Group ID */ - hid_t gid2 = (-1); /* Datatype ID */ - char *objname = NULL; /* Name of object [Long] */ - size_t u; /* Local index variable */ + hid_t fid = (-1); /* File ID */ + hid_t gid = (-1); /* Group ID */ + hid_t H5_ATTR_NDEBUG_UNUSED gid2 = (-1); /* Datatype ID */ + char *objname = NULL; /* Name of object [Long] */ + size_t u; /* Local index variable */ /* Create files */ fid = H5Fcreate(FILE51, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -6369,7 +6369,7 @@ gent_bigdims(void) hsize_t i; char c; size_t nelmts; - int ret; + int H5_ATTR_NDEBUG_UNUSED ret; /* create a file */ fid = H5Fcreate(FILE56, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -6465,7 +6465,8 @@ gent_hyperslab(void) hid_t fid; /* file id */ hsize_t dims[2] = {32,4097}; /* big enough data size to force a second stripmine read */ double *buf; - int i, ret; + int i; + int H5_ATTR_NDEBUG_UNUSED ret; buf = (double*) HDmalloc(32 * 4097 * sizeof(double) ); for(i = 0; i < 32 * 4097; i++) @@ -7091,7 +7092,8 @@ gent_dataset_idx(void) hsize_t dims[2]; hsize_t maxdims[2]; int buf[20][10]; - int i, j, ret; + int i, j; + int H5_ATTR_NDEBUG_UNUSED ret; /* Get a copy of the file aaccess property */ fapl = H5Pcreate(H5P_FILE_ACCESS); @@ -7615,7 +7617,7 @@ static void gent_charsets(void) { hid_t fid, did, sid; - herr_t status; + herr_t H5_ATTR_NDEBUG_UNUSED status; hsize_t dim[] = {1}; /* Dataspace dimensions */ typedef struct CharSetInfo { const char *ascii_p_; @@ -7689,7 +7691,7 @@ static void gent_compound_intsizes(void) { Array1Struct *Array1; hid_t Array1Structid; /* File datatype identifier */ - herr_t status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F70_LENGTH }; /* Dataspace dimensions */ int m, n, o; /* Array init loop vars */ @@ -7962,7 +7964,7 @@ static void gent_compound_attr_intsizes(void) { Array1Struct Array1[F70_LENGTH]; hid_t Array1Structid; /* File datatype identifier */ - herr_t status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F70_LENGTH }; /* Dataspace dimensions */ int m, n, o; /* Array init loop vars */ @@ -8838,7 +8840,7 @@ static void gent_compound_int_array(void) { Cmpd1Struct *Cmpd1; hid_t Cmpd1Structid; /* File datatype identifier */ - herr_t status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F76_LENGTH }; /* Dataspace dimensions */ int m, n; /* Array init loop vars */ @@ -9094,7 +9096,7 @@ static void gent_compound_ints(void) { hid_t Cmpd1Structid; /* File datatype identifier */ hid_t Cmpd2Structid; /* File datatype identifier */ - herr_t status; /* Error checking variable */ + herr_t H5_ATTR_NDEBUG_UNUSED status; /* Error checking variable */ hsize_t dim[] = { F77_LENGTH }; /* Dataspace dimensions */ int m; /* Array init loop vars */ @@ -10396,7 +10398,8 @@ static void gent_udfilter(void) hsize_t dims1[RANK] = {DIM1,DIM2}; hsize_t chunk_dims[RANK] = {CDIM1,CDIM2}; int buf1[DIM1][DIM2]; - int i, j, n, ret; + int i, j, n; + int H5_ATTR_NDEBUG_UNUSED ret; for(i=n=0; i<DIM1; i++){ for(j=0; j<DIM2; j++){ diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index 77fb28a..7604964 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; @@ -231,9 +231,9 @@ generate_int32le_3d(hbool_t external) { /* generate values, alternating positive and negative */ - for (i = 0, n = 0; i < dims[0]; i++) { - for (j = 0; j < dims[1]; j++) { - for (k = 0; k < dims[2]; k++, n++) { + for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) { + for (j = 0; (hsize_t)j < dims[1]; j++) { + for (k = 0; (hsize_t)k < dims[2]; k++, n++) { wdata[n] = (k + j * 512 + i * 4096) * ((n & 1) ? (-1) : (1)); } } @@ -263,9 +263,9 @@ generate_uint8be(hbool_t external) { /* Generate values, ping-pong from ends of range */ - for (i = 0, n = 0; i < dims[0]; i++) { - for (j = 0; j < dims[1]; j++) { - for (k = 0; k < dims[2]; k++, n++) { + for (i = 0, n = 0; (hsize_t)i < dims[0]; i++) { + for (j = 0; (hsize_t)j < dims[1]; j++) { + for (k = 0; (hsize_t)k < dims[2]; k++, n++) { wdata[n] = (uint8_t)((n & 1) ? -n : n); } } @@ -294,9 +294,9 @@ generate_f32le(hbool_t external) { int ret_value = 0; /* 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))); + for (i = 0, k = 0, n = 0; (hsize_t)i < dims[0]; i++) { + for (j = 0; (hsize_t)j < dims[1]; j++, k++, n++) { + wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1)); } } @@ -314,7 +314,6 @@ generate_f32le(hbool_t external) { int main(void) { int i = 0; - int ret_value = 0; for (i = 0; i < 2; i++) { hbool_t external = (i & 1) ? TRUE : FALSE; diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index f32e87c..2654685 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3684,10 +3684,10 @@ make_userblock(void) { hid_t fid = H5I_INVALID_HID; hid_t fcpl = H5I_INVALID_HID; - int fd = -1; /* File descriptor for writing userblock */ - char ub[USERBLOCK_SIZE]; /* User block data */ - ssize_t nwritten; /* # of bytes written */ - size_t u; /* Local index variable */ + int fd = -1; /* File descriptor for writing userblock */ + char ub[USERBLOCK_SIZE]; /* User block data */ + ssize_t H5_ATTR_NDEBUG_UNUSED nwritten; /* # of bytes written */ + size_t u; /* Local index variable */ /* Create file creation property list with userblock set */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) @@ -3749,7 +3749,7 @@ verify_userblock( const char* filename) int fd = -1; /* File descriptor for writing userblock */ char ub[USERBLOCK_SIZE]; /* User block data */ hsize_t ub_size = 0; /* User block size */ - ssize_t nread; /* # of bytes read */ + ssize_t H5_ATTR_NDEBUG_UNUSED nread; /* # of bytes read */ size_t u; /* Local index variable */ /* Open file with userblock */ @@ -3816,7 +3816,7 @@ make_userblock_file(void) { int fd = -1; /* File descriptor for writing userblock */ char ub[USERBLOCK_SIZE]; /* User block data */ - ssize_t nwritten; /* # of bytes written */ + ssize_t H5_ATTR_NDEBUG_UNUSED nwritten; /* # of bytes written */ size_t u; /* Local index variable */ /* initialize userblock data */ 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/iopipe.c b/tools/test/perform/iopipe.c index 57c0d52..bf4728d 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -133,7 +133,7 @@ synchronize (void) #if defined(H5_HAVE_WIN32_API) && ! defined(__CYGWIN__) _flushall(); #else - int status; + int H5_ATTR_NDEBUG_UNUSED status; status = HDsystem("sync"); HDassert(status >= 0); @@ -169,7 +169,6 @@ main (void) unsigned char *the_data = NULL; hid_t file, dset, file_space = H5I_INVALID_HID; - herr_t status; #ifdef H5_HAVE_GETRUSAGE struct rusage r_start, r_stop; #else @@ -178,8 +177,9 @@ main (void) struct timeval t_start, t_stop; int fd; unsigned u; - hssize_t n; - off_t offset; + herr_t H5_ATTR_NDEBUG_UNUSED status; + hssize_t H5_ATTR_NDEBUG_UNUSED n; + off_t H5_ATTR_NDEBUG_UNUSED offset; hsize_t start[2]; hsize_t count[2]; @@ -198,15 +198,15 @@ main (void) /* Open the files */ file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - assert (file>=0); + HDassert (file>=0); fd = HDopen (RAW_FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666); - assert (fd>=0); + HDassert (fd>=0); /* Create the dataset */ file_space = H5Screate_simple (2, size, size); - assert(file_space >= 0); + HDassert(file_space >= 0); dset = H5Dcreate2(file, "dset", H5T_NATIVE_UCHAR, file_space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - assert(dset >= 0); + HDassert(dset >= 0); the_data = (unsigned char *)malloc((size_t)(size[0] * size[1])); /* initial fill for lazy malloc */ @@ -268,7 +268,7 @@ main (void) HDfflush(stderr); status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - assert (status>=0); + HDassert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -306,9 +306,9 @@ main (void) putc (PROGRESS, stderr); HDfflush(stderr); offset = HDlseek (fd, (off_t)0, SEEK_SET); - assert (0==offset); + HDassert (0==offset); n = HDwrite (fd, the_data, (size_t)(size[0]*size[1])); - assert (n>=0 && (size_t)n==size[0]*size[1]); + HDassert (n>=0 && (size_t)n==size[0]*size[1]); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -347,7 +347,7 @@ main (void) HDfflush(stderr); status = H5Dwrite (dset, H5T_NATIVE_UCHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, the_data); - assert (status>=0); + HDassert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -385,9 +385,9 @@ main (void) putc (PROGRESS, stderr); HDfflush(stderr); offset = HDlseek (fd, (off_t)0, SEEK_SET); - assert (0==offset); + HDassert (0==offset); n = HDread (fd, the_data, (size_t)(size[0]*size[1])); - assert (n>=0 && (size_t)n==size[0]*size[1]); + HDassert (n>=0 && (size_t)n==size[0]*size[1]); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -427,7 +427,7 @@ main (void) HDfflush(stderr); status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - assert (status>=0); + HDassert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); @@ -449,11 +449,11 @@ main (void) (size_t)(nread*size[0]*size[1])); /* Read hyperslab */ - assert (size[0]>20 && size[1]>20); + HDassert (size[0]>20 && size[1]>20); start[0] = start[1] = 10; count[0] = count[1] = size[0]-20; status = H5Sselect_hyperslab (file_space, H5S_SELECT_SET, start, NULL, count, NULL); - assert (status>=0); + HDassert (status>=0); synchronize (); #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_start); @@ -471,7 +471,7 @@ main (void) HDfflush(stderr); status = H5Dread (dset, H5T_NATIVE_UCHAR, file_space, file_space, H5P_DEFAULT, the_data); - assert (status>=0); + HDassert (status>=0); } #ifdef H5_HAVE_GETRUSAGE HDgetrusage(RUSAGE_SELF, &r_stop); diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 34b8a2d..364836f 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -110,15 +110,15 @@ const char *FILENAME[] = { /* function prototypes */ static int parse_args(int argc, char **argv); -extern int errno; - +#ifndef H5_HAVE_UNISTD_H /* globals needed for getopt */ extern char *optarg; +#endif int main(int argc, char **argv) { - char *buf, *tmp, *buf2, *tmp2, *check; - int i, j, mynod=0, nprocs=1, err, my_correct = 1, correct, myerrno; + char *buf, *tmp, *buf2 = NULL, *tmp2 = NULL, *check; + int i, j, mynod=0, nprocs=1, my_correct = 1, correct, myerrno; double stim, etim; double write_tim = 0; double read_tim = 0; @@ -127,10 +127,6 @@ int main(int argc, char **argv) double min_read_tim, min_write_tim; double ave_read_tim, ave_write_tim; int64_t iter_jump = 0; - int64_t seek_position = 0; - MPI_File fh; - MPI_Status status; - int nchars; char filename[MAX_PATH]; herr_t ret; /* Generic return value */ @@ -164,7 +160,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; } @@ -172,7 +168,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; } @@ -222,7 +218,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, @@ -230,7 +226,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); @@ -242,7 +238,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); @@ -295,7 +291,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); @@ -326,7 +322,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, @@ -367,8 +363,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); @@ -439,9 +435,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 d000f60..3863550 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -54,24 +54,15 @@ /* sizes of various items. these sizes won't change during program execution */ /* The following three must have the same type */ -#define ELMT_SIZE (sizeof(unsigned char)) /* we're doing bytes */ -#define ELMT_MPI_TYPE MPI_BYTE #define ELMT_H5_TYPE H5T_NATIVE_UCHAR #define GOTOERROR(errcode) { ret_code = errcode; goto done; } -#define GOTODONE { goto done; } #define ERRMSG(mesg) { \ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ } -#define MSG(mesg) { \ - HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ - HDfprintf(stderr, "(%s) at line %4d in %s\n", \ - mesg, (int)__LINE__, __FILE__); \ -} - /* verify: if val is false (0), print mesg. */ #define VRFY(val, mesg) do { \ if (!val) { \ @@ -260,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", @@ -269,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", @@ -371,15 +362,17 @@ done: switch (iot) { case POSIXIO: if (fd.posixfd != -1) - hrc = do_fclose(iot, &fd); + hrc = do_fclose(iot, &fd); break; case MPIO: if (fd.mpifd != MPI_FILE_NULL) - hrc = do_fclose(iot, &fd); + hrc = do_fclose(iot, &fd); break; case PHDF5: if (fd.h5fd != -1) - hrc = do_fclose(iot, &fd); + hrc = do_fclose(iot, &fd); + break; + default: break; } @@ -422,6 +415,8 @@ pio_create_filename(iotype iot, const char *base_name, char *fullname, size_t si case PHDF5: suffix = ".h5"; break; + default: + break; } /* First use the environment variable and then try the constant */ @@ -589,7 +584,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 */ @@ -613,9 +608,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 */ @@ -693,7 +688,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"); @@ -711,7 +706,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"); @@ -738,7 +733,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"); @@ -754,22 +749,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 */ @@ -797,16 +792,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; @@ -815,10 +810,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; @@ -866,6 +861,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end if */ } /* end if */ break; + + default: + break; } /* end switch */ for (ndset = 1; ndset <= ndsets; ++ndset) { @@ -929,6 +927,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, GOTOERROR(FAIL); } break; + + default: + break; } /* The task is to transfer bytes_count bytes, starting at @@ -982,7 +983,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 { @@ -1011,7 +1012,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; @@ -1025,8 +1026,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; @@ -1037,9 +1038,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; @@ -1070,16 +1071,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 */ @@ -1106,7 +1107,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; @@ -1137,7 +1138,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 { @@ -1162,7 +1163,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; @@ -1183,7 +1184,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 { @@ -1202,7 +1203,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 */ @@ -1213,8 +1214,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; @@ -1228,8 +1229,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; @@ -1266,16 +1267,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; @@ -1301,7 +1302,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; @@ -1324,7 +1325,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 */ @@ -1353,22 +1354,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); @@ -1380,11 +1381,14 @@ 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 */ break; + + default: + break; } /* switch (parms->io_type) */ } /* end while */ @@ -1569,7 +1573,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 */ @@ -1591,9 +1595,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 */ @@ -1665,7 +1669,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"); @@ -1683,7 +1687,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"); @@ -1710,7 +1714,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"); @@ -1725,22 +1729,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 */ @@ -1768,16 +1772,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; @@ -1786,10 +1790,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; @@ -1824,19 +1828,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - HDfprintf(stderr, "HDF5 Property List Create failed\n"); - GOTOERROR(FAIL); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); + GOTOERROR(FAIL); } /* Change to collective I/O, if asked */ if(parms->collective) { - hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); - if (hrc < 0) { - HDfprintf(stderr, "HDF5 Property List Set failed\n"); - GOTOERROR(FAIL); - } /* end if */ + hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); + if (hrc < 0) { + HDfprintf(stderr, "HDF5 Property List Set failed\n"); + GOTOERROR(FAIL); + } /* end if */ } /* end if */ break; + + default: + break; } /* end switch */ for (ndset = 1; ndset <= ndsets; ++ndset) { @@ -1847,19 +1854,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, switch (parms->io_type) { case POSIXIO: case MPIO: - /* both posix and mpi io just need dataset offset in file*/ - dset_offset = (ndset - 1) * nbytes; - break; + /* both posix and mpi io just need dataset offset in file*/ + dset_offset = (ndset - 1) * nbytes; + break; case PHDF5: HDsprintf(dname, "Dataset_%ld", ndset); - h5ds_id = H5DOPEN(fd->h5fd, dname); - if (h5ds_id < 0) { - HDfprintf(stderr, "HDF5 Dataset open failed\n"); - GOTOERROR(FAIL); - } + h5ds_id = H5DOPEN(fd->h5fd, dname); + if (h5ds_id < 0) { + HDfprintf(stderr, "HDF5 Dataset open failed\n"); + GOTOERROR(FAIL); + } + break; - break; + default: + break; } /* The task is to transfer bytes_count bytes, starting at @@ -1913,7 +1922,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 { @@ -1942,7 +1951,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; @@ -1956,8 +1965,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; @@ -1968,9 +1977,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; @@ -2001,16 +2010,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 */ @@ -2037,7 +2046,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; @@ -2067,7 +2076,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 { @@ -2092,7 +2101,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; @@ -2113,7 +2122,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 { @@ -2132,7 +2141,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 */ @@ -2143,8 +2152,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; @@ -2158,8 +2167,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; @@ -2196,16 +2205,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; @@ -2231,7 +2240,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; @@ -2254,7 +2263,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 */ @@ -2282,21 +2291,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); @@ -2308,10 +2317,13 @@ 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; + + default: + break; } /* switch (parms->io_type) */ /* Verify raw data, if asked */ @@ -2541,6 +2553,9 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } break; + + default: + break; } done: @@ -2561,38 +2576,41 @@ do_fclose(iotype iot, file_descr *fd /*out*/) int mrc = 0, rc = 0; switch (iot) { - case POSIXIO: - rc = POSIXCLOSE(fd->posixfd); + case POSIXIO: + rc = POSIXCLOSE(fd->posixfd); - if (rc != 0){ - HDfprintf(stderr, "POSIX File Close failed\n"); - GOTOERROR(FAIL); - } + if (rc != 0){ + HDfprintf(stderr, "POSIX File Close failed\n"); + GOTOERROR(FAIL); + } - fd->posixfd = -1; - break; + fd->posixfd = -1; + break; - case MPIO: - mrc = MPI_File_close(&fd->mpifd); + case MPIO: + mrc = MPI_File_close(&fd->mpifd); - if (mrc != MPI_SUCCESS){ - HDfprintf(stderr, "MPI File close failed\n"); - GOTOERROR(FAIL); - } + if (mrc != MPI_SUCCESS){ + HDfprintf(stderr, "MPI File close failed\n"); + GOTOERROR(FAIL); + } - fd->mpifd = MPI_FILE_NULL; - break; + fd->mpifd = MPI_FILE_NULL; + break; - case PHDF5: - hrc = H5Fclose(fd->h5fd); + case PHDF5: + hrc = H5Fclose(fd->h5fd); - if (hrc < 0) { - HDfprintf(stderr, "HDF5 File Close failed\n"); - GOTOERROR(FAIL); - } + if (hrc < 0) { + HDfprintf(stderr, "HDF5 File Close failed\n"); + GOTOERROR(FAIL); + } - fd->h5fd = -1; - break; + fd->h5fd = -1; + break; + + default: + break; } done: @@ -2619,15 +2637,17 @@ do_cleanupfile(iotype iot, char *fname) clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0; if (clean_file_g){ - switch (iot){ - case POSIXIO: - HDremove(fname); - break; - case MPIO: - case PHDF5: - MPI_File_delete(fname, h5_io_info_g); - break; - } + switch (iot){ + case POSIXIO: + HDremove(fname); + break; + case MPIO: + case PHDF5: + MPI_File_delete(fname, h5_io_info_g); + break; + default: + break; + } } } diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 5977731..826e7a9 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -80,8 +80,13 @@ #define PIO_MPI 0x2 #define PIO_HDF5 0x4 +#ifdef STANDALONE +#define DBL_EPSILON 2.2204460492503131e-16 +#define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON) +#endif + /* 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))) +#define MB_PER_SEC(bytes,t) (H5_DBL_ABS_EQUAL((t), 0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) #ifndef TRUE #define TRUE 1 @@ -311,6 +316,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 @@ -393,6 +399,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. @@ -428,8 +440,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; @@ -456,7 +468,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, @@ -558,6 +570,8 @@ run_test(iotype iot, parameters parms, struct options *opts) case PHDF5: output_report("PHDF5 (w/MPI-IO driver)\n"); break; + default: + break; } MPI_Comm_size(pio_comm_g, &comm_size); @@ -879,7 +893,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; @@ -1155,10 +1169,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){ @@ -1322,7 +1336,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 */ @@ -1423,10 +1437,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 '?': @@ -1446,13 +1460,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 */ @@ -1462,15 +1476,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; |