From 066b874e5a6eb828afea655b6ea5c2ac70abb9e8 Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Wed, 22 Jan 2020 19:46:53 -0600 Subject: Merge pull request #2094 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/unused to develop * commit '145ef3ceee20c28a443bd11507c58858bea3f889': more cleanup change it back pick up missing piece fix unused related warnings removed unused parameter more fix and address comments remove unsed var,function,macro, etc --- bin/trace | 1 + src/H5ACmpio.c | 2 +- src/H5Aint.c | 2 +- src/H5B.c | 4 +- src/H5B2dbg.c | 6 +- src/H5B2internal.c | 4 +- src/H5B2leaf.c | 3 +- src/H5C.c | 10 +- src/H5CX.c | 4 +- src/H5Clog_json.c | 2 +- src/H5Dbtree.c | 4 +- src/H5Dchunk.c | 2 +- src/H5Dint.c | 7 +- src/H5Dnone.c | 2 +- src/H5Dsingle.c | 2 +- src/H5EAcache.c | 4 +- src/H5EAtest.c | 2 +- src/H5FAcache.c | 6 +- src/H5FS.c | 3 +- src/H5FScache.c | 53 ++++---- src/H5FSprivate.h | 2 +- src/H5Fsuper_cache.c | 10 +- src/H5Gnode.c | 5 +- src/H5HFcache.c | 18 +-- src/H5HFsection.c | 12 +- src/H5HFspace.c | 2 +- src/H5HGcache.c | 4 +- src/H5HLcache.c | 12 +- src/H5MF.c | 2 +- src/H5Oainfo.c | 6 +- src/H5Oalloc.c | 2 +- src/H5Ocache.c | 6 +- src/H5Omessage.c | 9 +- src/H5Oshared.c | 4 +- src/H5Oshared.h | 2 +- src/H5Pfapl.c | 8 +- src/H5Pint.c | 15 +-- src/H5Plapl.c | 2 +- src/H5SL.c | 2 +- src/H5SMcache.c | 12 +- src/H5Tconv.c | 2 +- src/H5Tref.c | 8 +- src/H5mpi.c | 2 +- src/H5private.h | 27 ++-- test/cache_common.c | 67 ++++------ test/cache_tagging.c | 3 +- test/dsets.c | 8 +- test/dtypes.c | 2 +- test/mf.c | 8 +- test/page_buffer.c | 23 ++-- test/tfile.c | 9 +- test/tmisc.c | 10 +- test/tselect.c | 3 +- test/vds_swmr.h | 10 +- testpar/t_2Gio.c | 2 - testpar/t_bigio.c | 1 - testpar/t_cache.c | 17 +-- testpar/t_coll_chunk.c | 1 - testpar/t_coll_md_read.c | 1 - testpar/t_dset.c | 8 +- testpar/t_filter_read.c | 2 + testpar/t_mdset.c | 2 +- testpar/t_shapesame.c | 15 --- testpar/t_span_tree.c | 17 ++- tools/lib/h5tools_dump.c | 2 +- tools/src/h5dump/h5dump_xml.c | 5 - tools/src/h5ls/h5ls.c | 4 +- tools/src/h5repack/h5repack_main.c | 2 +- tools/test/h5diff/h5diffgentest.c | 16 +-- tools/test/h5dump/h5dumpgentest.c | 233 +++++++++++++++++----------------- tools/test/h5repack/h5repackgentest.c | 1 - tools/test/h5repack/h5repacktst.c | 12 +- tools/test/perform/iopipe.c | 36 +++--- tools/test/perform/perf.c | 6 +- tools/test/perform/pio_engine.c | 9 -- 75 files changed, 398 insertions(+), 434 deletions(-) diff --git a/bin/trace b/bin/trace index 9e5730b..0256da6 100755 --- a/bin/trace +++ b/bin/trace @@ -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 */ diff --git a/src/H5B.c b/src/H5B.c index 2a34fae..4c1abfd 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -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/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); diff --git a/src/H5C.c b/src/H5C.c index 3e0cf95..2a90bd1 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -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() */ diff --git a/src/H5CX.c b/src/H5CX.c index 649bd8f..160aa84 100644 --- a/src/H5CX.c +++ b/src/H5CX.c @@ -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/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..fe98516 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -2131,7 +2131,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 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/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 */ diff --git a/src/H5FS.c b/src/H5FS.c index dbcb6b5..1bd56b8 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -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/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 */ diff --git a/src/H5MF.c b/src/H5MF.c index c100637..df1c88a 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -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/H5SL.c b/src/H5SL.c index 5f00fb8..ff8edb8 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -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/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/H5mpi.c b/src/H5mpi.c index b25f744..42d6ba8 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; } diff --git a/src/H5private.h b/src/H5private.h index f46a3a8..11765d9 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 */ 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..f6f7f4a 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -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"); 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); diff --git a/test/mf.c b/test/mf.c index 3c33163..141f5ec 100644 --- a/test/mf.c +++ b/test/mf.c @@ -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/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/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/vds_swmr.h b/test/vds_swmr.h index eb2dcf4..43c78a4 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -84,7 +84,7 @@ #define N_PLANES_TO_WRITE 25 /* Planes */ -static hsize_t PLANES[N_SOURCES][RANK] = { +H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK] = { {1, SM_HEIGHT, WIDTH}, {1, LG_HEIGHT, WIDTH}, {1, SM_HEIGHT, WIDTH}, @@ -94,7 +94,7 @@ static hsize_t PLANES[N_SOURCES][RANK] = { }; /* File names for source datasets */ -static char FILE_NAMES[N_SOURCES][NAME_LEN] = { +H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN] = { {"vds_swmr_src_a.h5"}, {"vds_swmr_src_b.h5"}, {"vds_swmr_src_c.h5"}, @@ -104,11 +104,11 @@ static 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] = "vds_swmr.h5"; /* 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] = "/source_dset"; +H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN] = "vds_dset"; /* Fill values */ #endif /* VDS_SWMR_H */ diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 252e1ee..aebf9cf 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -3868,8 +3868,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) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index c6a1178..1bc66b5 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -27,7 +27,6 @@ const char *FILENAME[3]={ "bigio_test.h5", #define DATASET2 "DSET2" #define DATASET3 "DSET3" #define DATASET4 "DSET4" -#define DATASET5 "DSET5" #define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ #define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ #define DXFER_BIGCOUNT (1 < 29) diff --git a/testpar/t_cache.c b/testpar/t_cache.c index cde19fe..d1dc820 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; @@ -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); diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 40cc1ca..2d758ba 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); diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c index 912388c..c0fe04b 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 diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 832a47f..87782d0 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -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; @@ -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 */ @@ -3470,8 +3468,9 @@ actual_io_mode_tests(void) { * Programmer: Jonathan Kim * Date: Aug, 2012 */ +#ifdef LATER #define DSET_NOCOLCAUSE "nocolcause" -#define NELM 2 +#endif #define FILE_EXTERNAL "nocolcause_extern.data" static void test_no_collective_cause_mode(int selection_mode) @@ -3482,7 +3481,6 @@ test_no_collective_cause_mode(int selection_mode) uint32_t no_collective_cause_global_write = 0; uint32_t no_collective_cause_global_read = 0; uint32_t no_collective_cause_global_expected = 0; - hsize_t coord[NELM][RANK]; const char * filename; const char * test_name; @@ -3797,6 +3795,7 @@ test_no_collective_cause_mode(int selection_mode) * Programmer: Jonathan Kim * Date: Aug, 2012 */ +#ifdef LATER static void test_no_collective_cause_mode_filter(int selection_mode) { @@ -4008,6 +4007,7 @@ test_no_collective_cause_mode_filter(int selection_mode) HDfree(buffer); return; } +#endif /* Function: no_collective_cause_tests * diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index 28baed5..cabb51e 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -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..a0b3253 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -1959,7 +1959,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; diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index abbfbb3..c12cf5a 100644 --- a/testpar/t_shapesame.c +++ b/testpar/t_shapesame.c @@ -1981,7 +1981,6 @@ contig_hs_dr_pio_test__run_test(const int test_num, #if CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "contig_hs_dr_pio_test__run_test()"; #endif /* CONTIG_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; struct hs_dr_pio_test_vars_t test_vars = { /* int mpi_size = */ -1, @@ -2049,9 +2048,6 @@ contig_hs_dr_pio_test__run_test(const int test_num, small_rank, large_rank, use_collective_io, dset_type, express_test, tv_ptr); - /* initialize the local copy of mpi_rank */ - mpi_rank = tv_ptr->mpi_rank; - /* initialize skips & max_skips */ tv_ptr->skips = *skips_ptr; tv_ptr->max_skips = max_skips; @@ -3520,7 +3516,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_l2s()"; #endif /* CHECKER_BOARD_HS_DR_PIO_TEST__M2D_L2S__DEBUG */ hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; int i, j, k, l; size_t u; size_t start_index; @@ -3768,8 +3763,6 @@ ckrbrd_hs_dr_pio_test__m2d_l2s(struct hs_dr_pio_test_vars_t * tv_ptr) /* verify that expected data is retrieved */ - mis_match = FALSE; - expected_value = (uint32_t)( (i * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size * tv_ptr->edge_size) + @@ -3878,7 +3871,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) const char *fcnName = "ckrbrd_hs_dr_pio_test__m2d_s2l()"; #endif /* CONTIG_HS_DR_PIO_TEST__M2D_S2L__DEBUG */ hbool_t data_ok = FALSE; - hbool_t mis_match = FALSE; int i, j, k, l; size_t u; size_t start_index; @@ -4138,8 +4130,6 @@ ckrbrd_hs_dr_pio_test__m2d_s2l(struct hs_dr_pio_test_vars_t * tv_ptr) HDassert( stop_index < tv_ptr->large_ds_size ); - mis_match = FALSE; - data_ok = TRUE; ptr_1 = tv_ptr->large_ds_buf_1; @@ -4235,7 +4225,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, #if CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG const char *fcnName = "ckrbrd_hs_dr_pio_test__run_test()"; #endif /* CKRBRD_HS_DR_PIO_TEST__RUN_TEST__DEBUG */ - int mpi_rank; /* needed by VRFY */ struct hs_dr_pio_test_vars_t test_vars = { /* int mpi_size = */ -1, @@ -4305,10 +4294,6 @@ ckrbrd_hs_dr_pio_test__run_test(const int test_num, tv_ptr); - /* initialize the local copy of mpi_rank */ - mpi_rank = tv_ptr->mpi_rank; - - /* initialize skips & max_skips */ tv_ptr->skips = *skips_ptr; tv_ptr->max_skips = max_skips; diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 9a4ac4d..c3cc7b5 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(); } @@ -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; @@ -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 @@ -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/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/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/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 279a598..80ae814 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -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; @@ -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/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= 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..fd7d9de 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -118,7 +118,7 @@ extern char *optarg; 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; + 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 */ diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index d000f60..f3cb3ec 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) { \ -- cgit v0.12 From 2cd1e08d7007b6669418c0c85278876d81946660 Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Wed, 22 Jan 2020 20:58:42 -0600 Subject: Merge pull request #2292 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/prototype to develop * commit '9f80ffa1f1908975b3100814b2529bf779521e13': fix missing prototype warning --- src/H5Pmapl.c | 3 ++- tools/test/perform/perf.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) 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/tools/test/perform/perf.c b/tools/test/perform/perf.c index fd7d9de..2b23653 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -110,8 +110,6 @@ const char *FILENAME[] = { /* function prototypes */ static int parse_args(int argc, char **argv); -extern int errno; - /* globals needed for getopt */ extern char *optarg; -- cgit v0.12 From a4f163c7c6b562509f403f602a8fb09f7b1124ec Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Wed, 22 Jan 2020 20:59:49 -0600 Subject: Merge pull request #2295 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/float to develop * commit '9afaf94bef740f89958a1a8aae369d5f607845f4': not use hdf5 private header fix float type cmp warning fix float type cmp warning --- testpar/t_mdset.c | 9 +++++---- tools/lib/h5diff_array.c | 6 +++--- tools/test/perform/pio_perf.c | 4 ++++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index a0b3253..ee868ee 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 @@ -332,7 +333,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]); @@ -2477,7 +2478,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 +2541,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 +2593,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/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 088e230..d19c3c1 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_DBL_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/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 5977731..1a40f44 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -80,8 +80,12 @@ #define PIO_MPI 0x2 #define PIO_HDF5 0x4 +#define DBL_EPSILON 2.2204460492503131e-16 +#define H5_DBL_ABS_EQUAL(X,Y) (fabsf((X)-(Y)) < DBL_EPSILON) + /* report 0.0 in case t is zero too */ #define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) +#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 -- cgit v0.12 From b87a4362a12428613c2b8bd3ba2aa33828b4d5af Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Wed, 22 Jan 2020 21:34:17 -0600 Subject: Merge pull request #2291 in HDFFV/hdf5 from ~KMU/hdf5:bugfix/uninitialized to develop * commit '2de0ce0d8ba2fb58fadefc5d718a3c0fedab25c8': fix uninitizlized warning --- src/H5Fint.c | 4 ++-- testpar/t_cache.c | 6 +++--- tools/test/perform/perf.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) 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/testpar/t_cache.c b/testpar/t_cache.c index d1dc820..058cde6 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -1762,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; @@ -4609,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 ) { @@ -4716,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 ) { diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 2b23653..8926d14 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -115,7 +115,7 @@ extern char *optarg; int main(int argc, char **argv) { - char *buf, *tmp, *buf2, *tmp2, *check; + 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; -- cgit v0.12 From fe75e8f66f79c16d083d80ccdca303f267e96745 Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Thu, 23 Jan 2020 16:21:06 -0600 Subject: Merge pull request #2300 in HDFFV/hdf5 from ~KMU/hdf5:squashed_cast to develop * commit 'af5c33afabdae2e39bb45eb1b3e9c8366da01145': remove unnecessary stuff squash cast warning fix --- src/H5B2cache.c | 4 +- src/H5Cmpio.c | 37 +++--- src/H5Dchunk.c | 31 +++-- src/H5Dfill.c | 5 +- src/H5Dio.c | 22 ++-- src/H5Dmpio.c | 36 +++--- src/H5Rint.c | 3 +- src/H5Smpio.c | 37 ++++-- src/H5Ztrans.c | 2 +- src/H5mpi.c | 6 +- src/H5overflow.txt | 1 + test/dsets.c | 24 ++-- test/swmr_common.c | 24 +++- test/trefer.c | 6 +- test/use_disable_mdc_flushes.c | 21 ++-- test/vds_swmr.h | 24 +--- test/vds_swmr_gen.c | 6 +- test/vds_swmr_reader.c | 6 +- testpar/t_2Gio.c | 210 ++++++++++++++++---------------- testpar/t_bigio.c | 62 +++++----- testpar/t_cache.c | 35 +++--- testpar/t_chunk_alloc.c | 14 +-- testpar/t_coll_chunk.c | 30 ++--- testpar/t_coll_md_read.c | 14 +-- testpar/t_dset.c | 220 +++++++++++++++++----------------- testpar/t_file.c | 16 +-- testpar/t_filter_read.c | 4 +- testpar/t_mdset.c | 39 +++--- testpar/t_mpi.c | 10 +- testpar/t_prestart.c | 6 +- testpar/t_prop.c | 2 +- testpar/t_pshutdown.c | 8 +- testpar/t_span_tree.c | 58 ++++----- tools/lib/h5diff.c | 6 +- tools/lib/h5diff_array.c | 2 +- tools/src/h5import/h5import.c | 8 +- tools/src/h5ls/h5ls.c | 4 +- tools/src/h5repack/h5repack_parse.c | 2 +- tools/src/misc/h5clear.c | 2 +- tools/test/h5repack/h5repackgentest.c | 4 +- tools/test/perform/chunk_cache.c | 11 +- tools/test/perform/perf.c | 22 ++-- tools/test/perform/pio_engine.c | 200 +++++++++++++++---------------- tools/test/perform/pio_perf.c | 49 ++++---- 44 files changed, 682 insertions(+), 651 deletions(-) diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 65286e6..80cb6c5 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -654,6 +654,7 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, uint32_t stored_chksum; /* Stored metadata checksum value */ unsigned u; /* Local index variable */ H5B2_internal_t *ret_value = NULL; /* Return value */ + int node_nrec = 0; FUNC_ENTER_STATIC @@ -716,7 +717,8 @@ H5B2__cache_int_deserialize(const void *_image, size_t H5_ATTR_UNUSED len, for(u = 0; u < (unsigned)(internal->nrec + 1); u++) { /* Decode node pointer */ H5F_addr_decode(udata->f, (const uint8_t **)&image, &(int_node_ptr->addr)); - UINT64DECODE_VAR(image, int_node_ptr->node_nrec, udata->hdr->max_nrec_size); + UINT64DECODE_VAR(image, node_nrec, udata->hdr->max_nrec_size); + H5_CHECKED_ASSIGN(int_node_ptr->node_nrec, uint16_t, node_nrec, int); if(udata->depth > 1) UINT64DECODE_VAR(image, int_node_ptr->all_nrec, udata->hdr->node_info[udata->depth - 1].cum_max_nrec_size) else diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index e784487..2c176e4 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -174,13 +174,13 @@ H5C_apply_candidate_list(H5F_t * f, int mpi_size) { int i; - int m; - int n; - unsigned first_entry_to_flush; - unsigned last_entry_to_flush; - unsigned total_entries_to_clear = 0; - unsigned total_entries_to_flush = 0; - int * candidate_assignment_table = NULL; + int m; + unsigned n; + unsigned first_entry_to_flush; + unsigned last_entry_to_flush; + unsigned total_entries_to_clear = 0; + unsigned total_entries_to_flush = 0; + unsigned * candidate_assignment_table = NULL; unsigned entries_to_flush[H5C_RING_NTYPES]; unsigned entries_to_clear[H5C_RING_NTYPES]; haddr_t addr; @@ -231,17 +231,18 @@ H5C_apply_candidate_list(H5F_t * f, HGOTO_ERROR(H5E_DATASET, H5E_CANTCREATE, FAIL, "can't create skip list for entries") } /* end if */ - n = num_candidates / mpi_size; - m = num_candidates % mpi_size; - HDassert(n >= 0); - if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1)))) + n = num_candidates / (unsigned)mpi_size; + if(num_candidates % (unsigned)mpi_size > INT_MAX) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "m overflow") + m = (int)(num_candidates % (unsigned)mpi_size); + + if(NULL == (candidate_assignment_table = (unsigned *)H5MM_malloc(sizeof(unsigned) * (size_t)(mpi_size + 1)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table") candidate_assignment_table[0] = 0; candidate_assignment_table[mpi_size] = num_candidates; if(m == 0) { /* mpi_size is an even divisor of num_candidates */ - HDassert(n > 0); for(i = 1; i < mpi_size; i++) candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n; } /* end if */ @@ -249,7 +250,7 @@ H5C_apply_candidate_list(H5F_t * f, for(i = 1; i <= m; i++) candidate_assignment_table[i] = candidate_assignment_table[i - 1] + n + 1; - if(num_candidates < mpi_size) { + if(num_candidates < (unsigned)mpi_size) { for(i = m + 1; i < mpi_size; i++) candidate_assignment_table[i] = num_candidates; } /* end if */ @@ -263,7 +264,7 @@ H5C_apply_candidate_list(H5F_t * f, #if H5C_DO_SANITY_CHECKS /* Verify that the candidate assignment table has the expected form */ for(i = 1; i < mpi_size - 1; i++) { - int a, b; + unsigned a, b; a = candidate_assignment_table[i] - candidate_assignment_table[i - 1]; b = candidate_assignment_table[i + 1] - candidate_assignment_table[i]; @@ -282,7 +283,7 @@ H5C_apply_candidate_list(H5F_t * f, tbl_buf[i] = '\0'; HDsprintf(&(tbl_buf[0]), "candidate assignment table = "); for(i = 0; i <= mpi_size; i++) - HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %d", candidate_assignment_table[i]); + HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " %u", candidate_assignment_table[i]); HDsprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n"); HDfprintf(stdout, "%s", tbl_buf); @@ -359,11 +360,11 @@ H5C_apply_candidate_list(H5F_t * f, n = 0; for(i = 0; i < H5C_RING_NTYPES; i++) { m += (int)entries_to_flush[i]; - n += (int)entries_to_clear[i]; + n += entries_to_clear[i]; } /* end if */ HDassert((unsigned)m == total_entries_to_flush); - HDassert((unsigned)n == total_entries_to_clear); + HDassert(n == total_entries_to_clear); #endif /* H5C_DO_SANITY_CHECKS */ #if H5C_APPLY_CANDIDATE_LIST__DEBUG @@ -397,7 +398,7 @@ H5C_apply_candidate_list(H5F_t * f, done: if(candidate_assignment_table != NULL) - candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table); + candidate_assignment_table = (unsigned *)H5MM_xfree((void *)candidate_assignment_table); if(cache_ptr->coll_write_list) { if(H5SL_close(cache_ptr->coll_write_list) < 0) HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list") diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index fe98516..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) @@ -4983,12 +4981,12 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, /* Distribute evenly the number of blocks between processes. */ if(mpi_size == 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Resulted in division by zero") - num_blocks = chunk_info->num_io / mpi_size; /* value should be the same on all procs */ + num_blocks = (size_t)(chunk_info->num_io / (size_t)mpi_size); /* value should be the same on all procs */ /* after evenly distributing the blocks between processes, are there any leftover blocks for each individual process (round-robin) */ - leftover_blocks = chunk_info->num_io % mpi_size; + leftover_blocks = (size_t)(chunk_info->num_io % (size_t)mpi_size); /* Cast values to types needed by MPI */ H5_CHECKED_ASSIGN(blocks, int, num_blocks, size_t); @@ -4997,9 +4995,9 @@ H5D__chunk_collective_fill(const H5D_t *dset, H5D_chunk_coll_info_t *chunk_info, /* Allocate buffers */ /* (MSC - should not need block_lens if MPI_type_create_hindexed_block is working) */ - if(NULL == (block_lens = (int *)H5MM_malloc((blocks + 1) * sizeof(int)))) + if(NULL == (block_lens = (int *)H5MM_malloc((size_t)(blocks + 1) * sizeof(int)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk lengths buffer") - if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((blocks + 1) * sizeof(MPI_Aint)))) + if(NULL == (chunk_disp_array = (MPI_Aint *)H5MM_malloc((size_t)(blocks + 1) * sizeof(MPI_Aint)))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate chunk file displacement buffer") for(i = 0 ; i < blocks ; i++) { @@ -5104,7 +5102,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) const hsize_t *scaled = udata->common.scaled; /* Scaled chunk offset */ H5S_sel_iter_t *chunk_iter = NULL; /* Memory selection iteration info */ hbool_t chunk_iter_init = FALSE; /* Whether the chunk iterator has been initialized */ - hssize_t sel_nelmts; /* Number of elements in selection */ + hsize_t sel_nelmts; /* Number of elements in selection */ hsize_t count[H5O_LAYOUT_NDIMS]; /* Element count of hyperslab */ size_t chunk_size; /*size of a chunk */ void *chunk; /* The file chunk */ @@ -5165,8 +5163,7 @@ H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) /* Get the number of elements in the selection */ sel_nelmts = H5S_GET_SELECT_NPOINTS(udata->chunk_space); - HDassert(sel_nelmts >= 0); - H5_CHECK_OVERFLOW(sel_nelmts, hssize_t, size_t); + H5_CHECK_OVERFLOW(sel_nelmts, hsize_t, size_t); /* Check for VL datatype & non-default fill value */ if(udata->fb_info.has_vlen_fill_type) diff --git a/src/H5Dfill.c b/src/H5Dfill.c index 3ccee90..f5a5238 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -249,12 +249,11 @@ H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, * of the VL data. */ if(TRUE == H5T_detect_class(fill_type, H5T_VLEN, FALSE)) { - hssize_t nelmts; /* Number of data elements */ + hsize_t nelmts; /* Number of data elements */ /* Get the number of elements in the selection */ nelmts = H5S_GET_SELECT_NPOINTS(space); - HDassert(nelmts >= 0); - H5_CHECK_OVERFLOW(nelmts, hssize_t, size_t); + H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); /* Allocate a temporary buffer */ if(NULL == (tmp_buf = H5FL_BLK_MALLOC(type_conv, (size_t)nelmts * buf_size))) diff --git a/src/H5Dio.c b/src/H5Dio.c index 6b02b68..0f4e703 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -409,9 +409,8 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Note that if this variable is used, the */ /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ - H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hssize_t snelmts; /*total number of elmts (signed) */ - hsize_t nelmts; /*total number of elmts */ + H5D_storage_t store; /* union of EFL and chunk pointer in file space */ + hsize_t nelmts; /* total number of elmts */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ @@ -425,9 +424,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, file_space = dataset->shared->space; if(!mem_space) mem_space = file_space; - if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dst dataspace has invalid selection") - H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); + nelmts = H5S_GET_SELECT_NPOINTS(mem_space); /* Set up datatype info for operation */ if(H5D__typeinfo_init(dataset, mem_type_id, FALSE, &type_info) < 0) @@ -450,7 +447,7 @@ H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #endif /*H5_HAVE_PARALLEL*/ /* Make certain that the number of elements in each selection is the same */ - if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) + if(nelmts != H5S_GET_SELECT_NPOINTS(file_space)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected") /* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */ @@ -623,9 +620,8 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Note that if this variable is used, the */ /* projected mem space must be discarded at the */ /* end of the function to avoid a memory leak. */ - H5D_storage_t store; /*union of EFL and chunk pointer in file space */ - hssize_t snelmts; /*total number of elmts (signed) */ - hsize_t nelmts; /*total number of elmts */ + H5D_storage_t store; /* union of EFL and chunk pointer in file space */ + hsize_t nelmts; /* total number of elmts */ hbool_t io_op_init = FALSE; /* Whether the I/O op has been initialized */ char fake_char; /* Temporary variable for NULL buffer pointers */ herr_t ret_value = SUCCEED; /* Return value */ @@ -680,12 +676,10 @@ H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if(!mem_space) mem_space = file_space; - if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space)) < 0) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") - H5_CHECKED_ASSIGN(nelmts, hsize_t, snelmts, hssize_t); + nelmts = H5S_GET_SELECT_NPOINTS(mem_space); /* Make certain that the number of elements in each selection is the same */ - if(nelmts != (hsize_t)H5S_GET_SELECT_NPOINTS(file_space)) + if(nelmts != H5S_GET_SELECT_NPOINTS(file_space)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "src and dest dataspaces have different number of elements selected") /* Check for a NULL buffer, after the H5S_ALL dataspace selection has been handled */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 0dbbe9f..91557c3 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -2524,7 +2524,9 @@ H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, } /* end if */ /* Broadcasting the MPI_IO option info. and chunk address info. */ - if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, ((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm))) + if((sizeof(haddr_t) + 1) * total_chunks > INT_MAX) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow") + if(MPI_SUCCESS != (mpi_code = MPI_Bcast(mergebuf, (int)((sizeof(haddr_t) + 1) * total_chunks), MPI_BYTE, root, comm))) HMPI_GOTO_ERROR(FAIL, "MPI_BCast failed", mpi_code) H5MM_memcpy(assign_io_mode, mergebuf, total_chunks); @@ -2606,7 +2608,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5D_chunk_info_t *chunk_info; H5D_chunk_ud_t udata; H5SL_node_t *chunk_node; - hssize_t select_npoints; + hsize_t select_npoints; hssize_t chunk_npoints; if(NULL == (local_info_array = (H5D_filtered_collective_io_info_t *) H5MM_malloc(num_chunks_selected * sizeof(H5D_filtered_collective_io_info_t)))) @@ -2632,8 +2634,7 @@ H5D__construct_filtered_io_info_list(const H5D_io_info_t *io_info, const H5D_typ H5MM_memcpy(local_info_array[i].scaled, chunk_info->scaled, sizeof(chunk_info->scaled)); - if ((select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + select_npoints = H5S_GET_SELECT_NPOINTS(chunk_info->mspace); local_info_array[i].io_size = (size_t) select_npoints * type_info->src_type_size; /* Currently the full overwrite status of a chunk is only obtained on a per-process @@ -2841,7 +2842,7 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty if (mpi_rank != chunk_entry->owners.new_owner) { H5D_chunk_info_t *chunk_info = NULL; unsigned char *mod_data_p = NULL; - hssize_t iter_nelmts; + hsize_t iter_nelmts; size_t mod_data_size; /* Look up the chunk and get its file and memory dataspaces */ @@ -2854,9 +2855,9 @@ H5D__chunk_redistribute_shared_chunks(const H5D_io_info_t *io_info, const H5D_ty if(H5S_encode(chunk_info->fspace, &mod_data_p, &mod_data_size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "unable to get encoded dataspace size") - if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace); + H5_CHECK_OVERFLOW(iter_nelmts, hsize_t, size_t); mod_data_size += (size_t) iter_nelmts * type_info->src_type_size; if(NULL == (mod_data[num_send_requests] = (unsigned char *) H5MM_malloc(mod_data_size))) @@ -3088,7 +3089,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk H5Z_EDC_t err_detect; /* Error detection info */ H5Z_cb_t filter_cb; /* I/O filter callback function */ unsigned filter_mask = 0; - hssize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ + hsize_t iter_nelmts; /* Number of points to iterate over for the chunk IO operation */ hssize_t extent_npoints; hsize_t true_chunk_size; hbool_t mem_iter_init = FALSE; @@ -3193,17 +3194,15 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") file_iter_init = TRUE; - if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace); - if(NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size))) + if(NULL == (tmp_gath_buf = H5MM_malloc(iter_nelmts * type_info->src_type_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer") if(!H5D__gather_mem(chunk_entry->buf, file_iter, (size_t) iter_nelmts, tmp_gath_buf)) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't gather from chunk buffer") - if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace); if(H5D__scatter_mem(tmp_gath_buf, mem_iter, (size_t) iter_nelmts, io_info->u.rbuf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "couldn't scatter to read buffer") @@ -3211,10 +3210,9 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk break; case H5D_IO_OP_WRITE: - if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->mspace); - if(NULL == (tmp_gath_buf = H5MM_malloc((hsize_t) iter_nelmts * type_info->src_type_size))) + if(NULL == (tmp_gath_buf = H5MM_malloc(iter_nelmts * type_info->src_type_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate temporary gather buffer") /* Gather modification data from the application write buffer into a temporary buffer */ @@ -3230,8 +3228,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file selection information") mem_iter_init = TRUE; - if((iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + iter_nelmts = H5S_GET_SELECT_NPOINTS(chunk_info->fspace); /* Scatter the owner's modification data into the chunk data buffer according to * the file space. @@ -3262,8 +3259,7 @@ H5D__filtered_collective_chunk_entry_io(H5D_filtered_collective_io_info_t *chunk HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") mem_iter_init = TRUE; - if((iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOUNT, FAIL, "dataspace is invalid") + iter_nelmts = H5S_GET_SELECT_NPOINTS(dataspace); /* Update the chunk data with the received modification data */ if(H5D__scatter_mem(mod_data_p, mem_iter, (size_t) iter_nelmts, chunk_entry->buf) < 0) diff --git a/src/H5Rint.c b/src/H5Rint.c index 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) diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 800913f..6397f4b 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -293,8 +293,8 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, for(i = 0; i < num_big_types; i++) { #if MPI_VERSION >= 3 - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(bigio_count, - 1, &disp[i*bigio_count], elmt_type, &inner_types[i]))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)bigio_count, + 1, &disp[(hsize_t)i*bigio_count], elmt_type, &inner_types[i]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code) #else if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)bigio_count, @@ -308,7 +308,7 @@ H5S__mpio_create_point_datatype(size_t elmt_size, hsize_t num_points, if(remaining_points) { #if MPI_VERSION >= 3 if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block(remaining_points, - 1, &disp[num_big_types*bigio_count], elmt_type, &inner_types[num_big_types]))) + 1, &disp[(hsize_t)num_big_types*bigio_count], elmt_type, &inner_types[num_big_types]))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed_block failed", mpi_code) #else if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)remaining_points, @@ -403,8 +403,11 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ curr = space->select.sel_info.pnt_lst->head; for(u = 0 ; u < num_points ; u++) { /* Calculate the displacement of the current point */ - disp[u] = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt); - disp[u] *= elmt_size; + hsize_t disp_tmp = H5VM_array_offset(space->extent.rank, space->extent.size, curr->pnt); + if(disp_tmp > LONG_MAX) /* Maximum value of type long */ + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "disp overflow") + disp[u] = (MPI_Aint)disp_tmp; + disp[u] *= (MPI_Aint)elmt_size; /* This is a File Space used to set the file view, so adjust the displacements * to have them monotonically non-decreasing. @@ -423,7 +426,7 @@ H5S__mpio_point_type(const H5S_t *space, size_t elmt_size, MPI_Datatype *new_typ */ if(do_permute) { if(u > 0 && disp[u] < disp[u - 1]) { - unsigned s = 0, l = u, m = u / 2; + hsize_t s = 0, l = u, m = u / 2; *is_permuted = TRUE; do { @@ -565,7 +568,9 @@ H5S__mpio_permute_type(const H5S_t *space, size_t elmt_size, hsize_t **permute, /* Loop, while bytes left in sequence */ while(curr_len > 0) { /* Set the displacement of the current point */ - disp[u] = curr_off; + if(curr_off > LONG_MAX) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "curr_off overflow") + disp[u] = (MPI_Aint)curr_off; /* This is a memory displacement, so for each point selected, * apply the map that was generated by the file selection */ @@ -893,8 +898,14 @@ if(H5DEBUG(S)) ****************************************/ /* Calculate start and extent values of this dimension */ - start_disp = d[i].start * offset[i] * elmt_size; - new_extent = (MPI_Aint)elmt_size * max_xtent[i]; + /* Check if value overflow to cast to type MPI_Aint */ + if(d[i].start > LONG_MAX || offset[i] > LONG_MAX || elmt_size > LONG_MAX) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "result overflow") + start_disp = (MPI_Aint)d[i].start * (MPI_Aint)offset[i] * (MPI_Aint)elmt_size; + + if(max_xtent[i] > LONG_MAX) + HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "max_xtent overflow") + new_extent = (MPI_Aint)elmt_size * (MPI_Aint)max_xtent[i]; if(MPI_SUCCESS != (mpi_code = MPI_Type_get_extent(outer_type, &lb, &extent_len))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_get_extent failed", mpi_code) @@ -1161,7 +1172,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, nelmts = (span->high - span->low) + 1; /* Store displacement & block length */ - disp[outercount] = (MPI_Aint)elmt_size * span->low; + disp[outercount] = (MPI_Aint)elmt_size * (MPI_Aint)span->low; H5_CHECK_OVERFLOW(nelmts, hsize_t, int) blocklen[outercount] = (int)nelmts; @@ -1183,7 +1194,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, /* create the block type from elmt_type while checking the 32 bit int limit */ if((hsize_t)(blocklen[u]) > bigio_count) { - if(H5_mpio_create_large_type(blocklen[u], 0, *elmt_type, &temp_type) < 0) + if(H5_mpio_create_large_type((hsize_t)blocklen[u], 0, *elmt_type, &temp_type) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL, "couldn't create a large element datatype in span_hyper selection") } /* end if */ else @@ -1219,7 +1230,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of inner MPI datatypes") /* Calculate the total bytes of the lower dimension */ - stride = (*down) * elmt_size; + stride = (MPI_Aint)(*down) * (MPI_Aint)elmt_size; /* Loop over span nodes */ outercount = 0; @@ -1251,7 +1262,7 @@ H5S__obtain_datatype(H5S_hyper_span_info_t *spans, const hsize_t *down, /* Displacement should be in byte and should have dimension information */ /* First using MPI Type vector to build derived data type for this span only */ /* Need to calculate the disp in byte for this dimension. */ - disp[outercount] = span->low * stride; + disp[outercount] = (MPI_Aint)span->low * stride; blocklen[outercount] = 1; /* Generate MPI datatype for next dimension down */ diff --git a/src/H5Ztrans.c b/src/H5Ztrans.c index 2245bd3..6d07513 100644 --- a/src/H5Ztrans.c +++ b/src/H5Ztrans.c @@ -324,7 +324,7 @@ static void H5Z_print(H5Z_node *tree, FILE *stream); #define H5Z_XFORM_DO_OP5(TYPE, SIZE) \ { \ - TYPE val = (TYPE)((tree->type == H5Z_XFORM_INTEGER) ? tree->value.int_val : tree->value.float_val); \ + TYPE val = ((tree->type == H5Z_XFORM_INTEGER) ? (TYPE)tree->value.int_val : (TYPE)tree->value.float_val); \ H5VM_array_fill(array, &val, sizeof(TYPE), (SIZE)); \ } diff --git a/src/H5mpi.c b/src/H5mpi.c index 42d6ba8..d9f161c 100644 --- a/src/H5mpi.c +++ b/src/H5mpi.c @@ -482,7 +482,7 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, /* Calculate how many Big MPI datatypes are needed to represent the buffer */ num_big_types = (int)(num_elements/bigio_count); - leftover = num_elements - num_big_types * (hsize_t)bigio_count; + leftover = (hsize_t)num_elements - (hsize_t)num_big_types * bigio_count; H5_CHECKED_ASSIGN(remaining_bytes, int, leftover, hsize_t); /* Create a contiguous datatype of size equal to the largest @@ -491,11 +491,11 @@ H5_mpio_create_large_type(hsize_t num_elements, MPI_Aint stride_bytes, * use type_hvector to create the type with the displacement provided */ if (0 == stride_bytes) { - if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous(bigio_count, old_type, &inner_type))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)bigio_count, old_type, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) } /* end if */ else - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector(bigio_count, 1, stride_bytes, old_type, &inner_type))) + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hvector((int)bigio_count, 1, stride_bytes, old_type, &inner_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hvector failed", mpi_code) /* Create a contiguous datatype of the buffer (minus the remaining < 2GB part) diff --git a/src/H5overflow.txt b/src/H5overflow.txt index ed71b98..9fb3b89 100644 --- a/src/H5overflow.txt +++ b/src/H5overflow.txt @@ -31,6 +31,7 @@ unsigned, UNSIGNED; int8_t, SIGNED; int, SIGNED; +long, SIGNED; int64_t, SIGNED; uint8_t, UNSIGNED; uint16_t, UNSIGNED; diff --git a/test/dsets.c b/test/dsets.c index f6f7f4a..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 SHRT_MAX) { + HDfprintf(stderr, "rank(%d) of dataset overflow\n", rank); + return -1; + } + *bufptr++ = (short)i; + } /* extend the dataset by one for new plane */ dims[0]=i+1; diff --git a/test/vds_swmr.h b/test/vds_swmr.h index 43c78a4..edb01bc 100644 --- a/test/vds_swmr.h +++ b/test/vds_swmr.h @@ -84,31 +84,17 @@ #define N_PLANES_TO_WRITE 25 /* Planes */ -H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK] = { - {1, SM_HEIGHT, WIDTH}, - {1, LG_HEIGHT, WIDTH}, - {1, SM_HEIGHT, WIDTH}, - {1, LG_HEIGHT, WIDTH}, - {1, SM_HEIGHT, WIDTH}, - {1, LG_HEIGHT, WIDTH} -}; +H5TEST_DLLVAR hsize_t PLANES[N_SOURCES][RANK]; /* File names for source datasets */ -H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN] = { - {"vds_swmr_src_a.h5"}, - {"vds_swmr_src_b.h5"}, - {"vds_swmr_src_c.h5"}, - {"vds_swmr_src_d.h5"}, - {"vds_swmr_src_e.h5"}, - {"vds_swmr_src_f.h5"} -}; +H5TEST_DLLVAR char FILE_NAMES[N_SOURCES][NAME_LEN]; /* VDS file name */ -H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN] = "vds_swmr.h5"; +H5TEST_DLLVAR char VDS_FILE_NAME[NAME_LEN]; /* Dataset names */ -H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN] = "/source_dset"; -H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN] = "vds_dset"; +H5TEST_DLLVAR char SOURCE_DSET_PATH[NAME_LEN]; +H5TEST_DLLVAR char VDS_DSET_NAME[NAME_LEN]; /* Fill values */ #endif /* VDS_SWMR_H */ diff --git a/test/vds_swmr_gen.c b/test/vds_swmr_gen.c index 2589653..b14ecc2 100644 --- a/test/vds_swmr_gen.c +++ b/test/vds_swmr_gen.c @@ -145,11 +145,13 @@ main(void) if(H5Sselect_hyperslab(src_sid, H5S_SELECT_SET, start, NULL, MAX_DIMS[i], NULL) < 0) TEST_ERROR - start[1] = map_start; + start[1] = (hsize_t)map_start; if(H5Sselect_hyperslab(vds_sid, H5S_SELECT_SET, start, NULL, MAX_DIMS[i], NULL) < 0) TEST_ERROR - map_start += PLANES[i][1]; + if(PLANES[i][1] > INT_MAX) + TEST_ERROR + map_start += (int)PLANES[i][1]; /* Add VDS mapping */ if(H5Pset_virtual(vds_dcplid, vds_sid, FILE_NAMES[i], diff --git a/test/vds_swmr_reader.c b/test/vds_swmr_reader.c index eb9a82b..1ee65a0 100644 --- a/test/vds_swmr_reader.c +++ b/test/vds_swmr_reader.c @@ -45,8 +45,10 @@ main(void) TEST_ERROR /* Create the read buffer */ - n_elements = VDS_PLANE[1] * VDS_PLANE[2]; - size = n_elements * sizeof(int); + if(VDS_PLANE[1] * VDS_PLANE[2] > INT_MAX) + TEST_ERROR + n_elements = (int)(VDS_PLANE[1] * VDS_PLANE[2]); + size = (size_t)n_elements * sizeof(int); if(NULL == (buffer = (int *)HDmalloc(size))) TEST_ERROR diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index aebf9cf..e833a0a 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; @@ -732,8 +732,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 +853,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 +984,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 +1013,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 +1315,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 +1371,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 +1409,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 +1515,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 +1700,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 +1761,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 +1806,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 +1816,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= 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 +1927,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 +2018,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 +2078,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"); @@ -2240,7 +2240,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 +2315,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 +2498,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 +2589,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 +2672,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 +2745,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 +2917,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 +2945,7 @@ compress_readAll(void) /* Initialize data buffers */ for(u=0; u 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 +3160,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"); @@ -3438,8 +3438,8 @@ test_actual_io_mode(int selection_mode) { VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (MAX_RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3450,7 +3450,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 +3516,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 +3554,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 +3637,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; @@ -3964,8 +3964,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"); @@ -3987,7 +3987,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"); @@ -4068,10 +4068,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; @@ -4497,10 +4497,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 */ @@ -4516,8 +4516,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"); @@ -4655,10 +4655,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= 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= 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 1bc66b5..45396de 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -249,7 +249,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; @@ -258,11 +258,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; @@ -276,7 +276,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; @@ -287,14 +287,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: @@ -302,7 +302,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; @@ -313,7 +313,7 @@ ccslab_set(int mpi_rank, default: /* Unknown mode. Set it to cover the whole dataset. */ - block[0] = space_dim1*mpi_size; + block[0] = space_dim1*(hsize_t)mpi_size; block[1] = space_dim2; stride[0] = block[0]; stride[1] = block[1]; @@ -521,7 +521,7 @@ dataset_big_write(void) HDprintf("\nTesting Dataset1 write by ROW\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -529,13 +529,13 @@ dataset_big_write(void) VRFY((dataset >= 0), "H5Dcreate2 succeeded"); H5Sclose(sid); - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; /* create a file dataspace independently */ @@ -584,7 +584,7 @@ dataset_big_write(void) HDprintf("\nTesting Dataset2 write by COL\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -593,13 +593,13 @@ dataset_big_write(void) H5Sclose(sid); block[0] = dims[0]; - block[1] = dims[1]/mpi_size; + block[1] = dims[1]/(hsize_t)mpi_size; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank*block[1]; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); @@ -710,7 +710,7 @@ dataset_big_write(void) HDprintf("\nTesting Dataset4 write point selection\n"); /* Create a large dataset */ dims[0] = bigcount; - dims[1] = mpi_size * 4; + dims[1] = (hsize_t)(mpi_size * 4); sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -725,7 +725,7 @@ dataset_big_write(void) count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = dims[1]/mpi_size * mpi_rank; + start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank; num_points = bigcount; @@ -838,16 +838,16 @@ dataset_big_read(void) VRFY((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size; /* Each process takes a slabs of cols. */ block[0] = dims[0]; - block[1] = dims[1]/mpi_size; + block[1] = dims[1]/(hsize_t)mpi_size; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank*block[1]; /* create a file dataspace independently */ file_dataspace = H5Dget_space (dataset); @@ -900,15 +900,15 @@ dataset_big_read(void) VRFY((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = mpi_size; + dims[1] = (hsize_t)mpi_size; /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; /* create a file dataspace independently */ @@ -1024,7 +1024,7 @@ dataset_big_read(void) VRFY((dataset >= 0), "H5Dopen2 succeeded"); dims[0] = bigcount; - dims[1] = mpi_size * 4; + dims[1] = (hsize_t)(mpi_size * 4); block[0] = dims[0]/2; block[1] = 2; @@ -1033,7 +1033,7 @@ dataset_big_read(void) count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = dims[1]/mpi_size * mpi_rank; + start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)mpi_rank; fill_datasets(start, block, wdata); MESG("data_array initialized"); @@ -1463,7 +1463,7 @@ coll_chunktest(const char* filename, VRFY((status >= 0),""); /* setup dimensionality object */ - dims[0] = space_dim1*mpi_size; + dims[0] = space_dim1*(hsize_t)mpi_size; dims[1] = space_dim2; /* allocate memory for data buffer */ @@ -1501,7 +1501,7 @@ coll_chunktest(const char* filename, VRFY((crp_plist >= 0),""); /* Set up chunk information. */ - chunk_dims[0] = dims[0]/chunk_factor; + chunk_dims[0] = dims[0]/(hsize_t)chunk_factor; /* to decrease the testing time, maintain bigger chunk size */ (chunk_factor == 1) ? (chunk_dims[1] = space_dim2) : (chunk_dims[1] = space_dim2/2); diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 058cde6..09d2ecc 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -1619,9 +1619,9 @@ serve_read_request(struct mssg_t * mssg_ptr) reply.dest = mssg_ptr->src; reply.mssg_num = -1; /* set by send function */ reply.base_addr = data[target_index].base_addr; - reply.len = data[target_index].len; + H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t); reply.ver = data[target_index].ver; - reply.count = 0; + reply.count = 0; reply.magic = MSSG_MAGIC; /* and update the counters */ @@ -1841,7 +1841,7 @@ serve_write_request(struct mssg_t * mssg_ptr) reply.dest = mssg_ptr->src; reply.mssg_num = -1; /* set by send function */ reply.base_addr = data[target_index].base_addr; - reply.len = data[target_index].len; + H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t); reply.ver = data[target_index].ver; reply.count = 0; reply.magic = MSSG_MAGIC; @@ -1927,7 +1927,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr) reply.base_addr = 0; reply.len = 0; reply.ver = 0; - reply.count = total_writes; + reply.count = (unsigned)total_writes; reply.magic = MSSG_MAGIC; } @@ -2006,7 +2006,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr) reply.base_addr = 0; reply.len = 0; reply.ver = 0; - reply.count = total_reads; + reply.count = (unsigned)total_reads; reply.magic = MSSG_MAGIC; } @@ -2100,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = data[target_index].writes; + reply.count = (unsigned)data[target_index].writes; reply.magic = MSSG_MAGIC; } } @@ -2197,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr) reply.base_addr = target_addr; reply.len = 0; reply.ver = 0; - reply.count = (long)(data[target_index].reads); + reply.count = (unsigned)(data[target_index].reads); reply.magic = MSSG_MAGIC; } } @@ -2633,7 +2633,7 @@ datum_notify(H5C_notify_action_t action, void *thing) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t); mssg.ver = 0; /* bogus -- should be corrected by server */ mssg.count = 0; /* not used */ mssg.magic = MSSG_MAGIC; @@ -2789,7 +2789,7 @@ datum_notify(H5C_notify_action_t action, void *thing) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = entry_ptr->base_addr; - mssg.len = entry_ptr->len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t); mssg.ver = entry_ptr->ver; mssg.count = 0; mssg.magic = MSSG_MAGIC; @@ -4667,7 +4667,7 @@ verify_entry_reads(haddr_t addr, } } else { - reported_entry_reads = mssg.count; + H5_CHECKED_ASSIGN(reported_entry_reads, int, mssg.count, unsigned); } } @@ -4774,7 +4774,7 @@ verify_entry_writes(haddr_t addr, } } else { - reported_entry_writes = mssg.count; + H5_CHECKED_ASSIGN(reported_entry_writes, int, mssg.count, unsigned); } } @@ -5230,7 +5230,7 @@ server_smoke_check(void) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = data[world_mpi_rank].base_addr; - mssg.len = data[world_mpi_rank].len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t); mssg.ver = ++(data[world_mpi_rank].ver); mssg.count = 0; mssg.magic = MSSG_MAGIC; @@ -5335,7 +5335,7 @@ server_smoke_check(void) mssg.dest = world_server_mpi_rank; mssg.mssg_num = -1; /* set by send function */ mssg.base_addr = data[world_mpi_rank].base_addr; - mssg.len = data[world_mpi_rank].len; + H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t); mssg.ver = 0; /* bogus -- should be corrected by server */ mssg.count = 0; mssg.magic = MSSG_MAGIC; @@ -7265,7 +7265,8 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + H5_CHECK_OVERFLOW(cache_ptr->max_cache_size, size_t, double); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } /* insert the other half independently */ @@ -7286,7 +7287,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } /* flush the file */ @@ -7316,7 +7317,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } /* protect the other half independently */ @@ -7337,7 +7338,7 @@ smoke_check_6(int metadata_write_strategy) } /* Make sure coll entries do not cross the 80% threshold */ - HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); + HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size); } for ( i = 0; i < (virt_num_data_entries); i++ ) diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index bfa0bfe..e6df2d8 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -95,7 +95,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_ /* Only MAINPROCESS should create the file. Others just wait. */ if (MAINPROCESS){ nchunks=chunk_factor*mpi_size; - dims[0]=nchunks*CHUNK_SIZE; + dims[0]=(hsize_t)(nchunks*CHUNK_SIZE); /* Create the data space with unlimited dimensions. */ dataspace = H5Screate_simple (1, dims, maxdims); VRFY((dataspace >= 0), ""); @@ -127,7 +127,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_ count[0] = 1; stride[0] = 1; block[0] = chunk_dims[0]; - offset[0] = (nchunks-2)*chunk_dims[0]; + offset[0] = (hsize_t)(nchunks-2)*chunk_dims[0]; hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); VRFY((hrc >= 0), ""); @@ -157,7 +157,7 @@ create_chunked_dataset(const char *filename, int chunk_factor, write_type write_ /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks * CHUNK_SIZE * sizeof(unsigned char); + est_filesize = (MPI_Offset)nchunks * (MPI_Offset)CHUNK_SIZE * (MPI_Offset)sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); } @@ -233,7 +233,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti dataspace = H5Dget_space(*dataset); VRFY((dataspace >= 0), ""); - size[0] = nchunks*CHUNK_SIZE; + size[0] = (hsize_t)nchunks*CHUNK_SIZE; switch (action) { @@ -245,7 +245,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti stride[0] = 1; block[0] = chunk_dims[0]; for (i=0; i= 0), ""); @@ -294,7 +294,7 @@ parallel_access_dataset(const char *filename, int chunk_factor, access_type acti /* verify file size */ filesize = get_filesize(filename); - est_filesize = nchunks*CHUNK_SIZE*sizeof(unsigned char); + est_filesize = (MPI_Offset)nchunks*(MPI_Offset)CHUNK_SIZE*(MPI_Offset)sizeof(unsigned char); VRFY((filesize >= est_filesize), "file size check"); /* Can close some plists */ @@ -374,7 +374,7 @@ verify_data(const char *filename, int chunk_factor, write_type write_pattern, in /* reset buffer values */ HDmemset(buffer, -1, CHUNK_SIZE); - offset[0] = i*chunk_dims[0]; + offset[0] = (hsize_t)i*chunk_dims[0]; hrc = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, stride, count, block); VRFY((hrc >= 0), ""); diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 2d758ba..e950015 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -637,7 +637,7 @@ coll_chunktest(const char* filename, VRFY((status >= 0),""); /* setup dimensionality object */ - dims[0] = SPACE_DIM1*mpi_size; + dims[0] = (hsize_t)(SPACE_DIM1*mpi_size); dims[1] = SPACE_DIM2; /* allocate memory for data buffer */ @@ -670,7 +670,7 @@ coll_chunktest(const char* filename, VRFY((crp_plist >= 0),""); /* Set up chunk information. */ - chunk_dims[0] = dims[0]/chunk_factor; + chunk_dims[0] = dims[0]/(hsize_t)chunk_factor; /* to decrease the testing time, maintain bigger chunk size */ (chunk_factor == 1) ? (chunk_dims[1] = SPACE_DIM2) : (chunk_dims[1] = SPACE_DIM2/2); @@ -1057,7 +1057,7 @@ ccslab_set(int mpi_rank, stride[1] = 1; count[0] = SPACE_DIM1; count[1] = SPACE_DIM2; - start[0] = mpi_rank*count[0]; + start[0] = (hsize_t)mpi_rank*count[0]; start[1] = 0; break; @@ -1066,11 +1066,11 @@ ccslab_set(int mpi_rank, /* Each process takes several disjoint blocks. */ block[0] = 1; block[1] = 1; - stride[0] = 3; - stride[1] = 3; - count[0] = SPACE_DIM1/(stride[0]*block[0]); - count[1] = (SPACE_DIM2)/(stride[1]*block[1]); - start[0] = SPACE_DIM1*mpi_rank; + stride[0] = 3; + stride[1] = 3; + count[0] = SPACE_DIM1/(stride[0]*block[0]); + count[1] = (SPACE_DIM2)/(stride[1]*block[1]); + start[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_rank; start[1] = 0; break; @@ -1084,7 +1084,7 @@ ccslab_set(int mpi_rank, stride[1] = 1; count[0] = ((mpi_rank >= MAX(1,(mpi_size-2)))?0:SPACE_DIM1); count[1] = SPACE_DIM2; - start[0] = mpi_rank*count[0]; + start[0] = (hsize_t)mpi_rank*count[0]; start[1] = 0; break; @@ -1095,14 +1095,14 @@ ccslab_set(int mpi_rank, half of the domain. */ block[0] = 1; - count[0] = 2; - stride[0] = SPACE_DIM1*mpi_size/4+1; + count[0] = 2; + stride[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size/4+1; block[1] = SPACE_DIM2; count[1] = 1; start[1] = 0; stride[1] = 1; - if((mpi_rank *3)<(mpi_size*2)) start[0] = mpi_rank; - else start[0] = 1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3); + if((mpi_rank *3)<(mpi_size*2)) start[0] = (hsize_t)mpi_rank; + else start[0] = (hsize_t)(1 + SPACE_DIM1*mpi_size/2 + (mpi_rank-2*mpi_size/3)); break; case BYROW_SELECTINCHUNK: @@ -1110,7 +1110,7 @@ ccslab_set(int mpi_rank, block[0] = 1; count[0] = 1; - start[0] = mpi_rank*SPACE_DIM1; + start[0] = (hsize_t)(mpi_rank*SPACE_DIM1); stride[0]= 1; block[1] = SPACE_DIM2; count[1] = 1; @@ -1121,7 +1121,7 @@ ccslab_set(int mpi_rank, default: /* Unknown mode. Set it to cover the whole dataset. */ - block[0] = SPACE_DIM1*mpi_size; + block[0] = (hsize_t)SPACE_DIM1*(hsize_t)mpi_size; block[1] = SPACE_DIM2; stride[0] = block[0]; stride[1] = block[1]; diff --git a/testpar/t_coll_md_read.c b/testpar/t_coll_md_read.c index c0fe04b..d4b2106 100644 --- a/testpar/t_coll_md_read.c +++ b/testpar/t_coll_md_read.c @@ -96,8 +96,8 @@ void test_partial_no_selection_coll_md_read(void) dataset_dims = HDmalloc(PARTIAL_NO_SELECTION_DATASET_NDIMS * sizeof(*dataset_dims)); VRFY((dataset_dims != NULL), "malloc succeeded"); - dataset_dims[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_size; - dataset_dims[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE * mpi_size; + dataset_dims[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_size; + dataset_dims[1] = (hsize_t)PARTIAL_NO_SELECTION_X_DIM_SCALE * (hsize_t)mpi_size; max_dataset_dims[0] = H5S_UNLIMITED; max_dataset_dims[1] = H5S_UNLIMITED; @@ -120,12 +120,12 @@ void test_partial_no_selection_coll_md_read(void) * * The ranks will write rows across the dataset. */ - start[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE * mpi_rank; + start[0] = (hsize_t)PARTIAL_NO_SELECTION_Y_DIM_SCALE * (hsize_t)mpi_rank; start[1] = 0; stride[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE; stride[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE; count[0] = 1; - count[1] = mpi_size; + count[1] = (hsize_t)mpi_size; block[0] = PARTIAL_NO_SELECTION_Y_DIM_SCALE; block[1] = PARTIAL_NO_SELECTION_X_DIM_SCALE; @@ -405,7 +405,7 @@ void test_link_chunk_io_sort_chunk_issue(void) dataset_dims = HDmalloc(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS * sizeof(*dataset_dims)); VRFY((dataset_dims != NULL), "malloc succeeded"); - dataset_dims[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * mpi_size * LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE; + dataset_dims[0] = (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE * (hsize_t)mpi_size * (hsize_t)LINK_CHUNK_IO_SORT_CHUNK_ISSUE_Y_DIM_SCALE; max_dataset_dims[0] = H5S_UNLIMITED; fspace_id = H5Screate_simple(LINK_CHUNK_IO_SORT_CHUNK_ISSUE_DIMS, dataset_dims, max_dataset_dims); @@ -428,8 +428,8 @@ void test_link_chunk_io_sort_chunk_issue(void) * The ranks will write rows across the dataset. */ stride[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE; - count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / mpi_size; - start[0] = count[0] * mpi_rank; + count[0] = (dataset_dims[0] / LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE) / (hsize_t)mpi_size; + start[0] = count[0] * (hsize_t)mpi_rank; block[0] = LINK_CHUNK_IO_SORT_CHUNK_ISSUE_CHUNK_SIZE; VRFY((H5Sselect_hyperslab(fspace_id, H5S_SELECT_SET, start, stride, count, block) >= 0), "H5Sselect_hyperslab succeeded"); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 87782d0..05baf3f 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -48,61 +48,61 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], switch (mode) { case BYROW: /* Each process takes a slabs of rows. */ - block[0] = dim0 / mpi_size; - block[1] = dim1; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)dim1; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank * block[0]; + start[0] = (hsize_t)mpi_rank * block[0]; start[1] = 0; if (VERBOSE_MED) HDprintf("slab_set BYROW\n"); break; case BYCOL: /* Each process takes a block of columns. */ - block[0] = dim0; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)(dim1 / mpi_size); stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = mpi_rank * block[1]; + start[1] = (hsize_t)mpi_rank * block[1]; if (VERBOSE_MED) HDprintf("slab_set BYCOL\n"); break; case ZROW: /* Similar to BYROW except process 0 gets 0 row */ - block[0] = (mpi_rank ? dim0 / mpi_size : 0); - block[1] = dim1; + block[0] = (hsize_t)(mpi_rank ? dim0 / mpi_size : 0); + block[1] = (hsize_t)dim1; stride[0] = (mpi_rank ? block[0] : 1); /* avoid setting stride to 0 */ stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = (mpi_rank ? mpi_rank * block[0] : 0); + start[0] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[0] : 0); start[1] = 0; if (VERBOSE_MED) HDprintf("slab_set ZROW\n"); break; case ZCOL: /* Similar to BYCOL except process 0 gets 0 column */ - block[0] = dim0; - block[1] = (mpi_rank ? dim1 / mpi_size : 0); + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)(mpi_rank ? dim1 / mpi_size : 0); stride[0] = block[0]; stride[1] = (mpi_rank ? block[1] : 1); /* avoid setting stride to 0 */ count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = (mpi_rank ? mpi_rank * block[1] : 0); + start[1] = (hsize_t)(mpi_rank ? (hsize_t)mpi_rank * block[1] : 0); if (VERBOSE_MED) HDprintf("slab_set ZCOL\n"); break; default: /* Unknown mode. Set it to cover the whole dataset. */ HDprintf("unknown slab_set mode (%d)\n", mode); - block[0] = dim0; - block[1] = dim1; + block[0] = (hsize_t)dim0; + block[1] = (hsize_t)dim1; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; @@ -308,7 +308,7 @@ dataset_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ---------------------------------------- @@ -332,8 +332,8 @@ dataset_writeInd(void) * and the slabs local to the MPI process. * ------------------------------------------- */ /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -453,9 +453,9 @@ dataset_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* setup file access template */ @@ -583,12 +583,12 @@ dataset_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* set up the coords array selection */ - num_points = dim1; - coords = (hsize_t *)HDmalloc(dim1 * RANK * sizeof(hsize_t)); + num_points = (size_t)dim1; + coords = (hsize_t *)HDmalloc((size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -612,8 +612,8 @@ dataset_writeAll(void) * and create the dataset * ------------------------- */ /* setup 2-D dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -914,16 +914,16 @@ dataset_writeAll(void) if(data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); block[0] = 1; - block[1] = dim1; + block[1] = (hsize_t)dim1; stride[0] = 1; - stride[1] = dim1; + stride[1] = (hsize_t)dim1; count[0] = 1; count[1] = 1; - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; dataset_fill(start, block, data_array1); @@ -970,7 +970,7 @@ dataset_writeAll(void) /* Dataset6: point selection in File - Point selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; point_set (start, count, stride, block, num_points, coords, OUT_OF_ORDER); file_dataspace = H5Dget_space (dataset6); @@ -1008,7 +1008,7 @@ dataset_writeAll(void) /* Dataset7: point selection in File - All selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; point_set (start, count, stride, block, num_points, coords, IN_ORDER); file_dataspace = H5Dget_space (dataset7); @@ -1114,14 +1114,14 @@ dataset_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* set up the coords array selection */ - num_points = dim1; - coords = (hsize_t *)HDmalloc(dim0 * dim1 * RANK * sizeof(hsize_t)); + num_points = (size_t)dim1; + coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); VRFY((coords != NULL), "coords malloc succeeded"); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -1299,18 +1299,18 @@ dataset_readAll(void) if(data_array1) free(data_array1); if(data_origin1) free(data_origin1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); block[0] = 1; - block[1] = dim1; + block[1] = (hsize_t)dim1; stride[0] = 1; - stride[1] = dim1; + stride[1] = (hsize_t)dim1; count[0] = 1; count[1] = 1; - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; dataset_fill(start, block, data_origin1); @@ -1361,12 +1361,12 @@ dataset_readAll(void) if(data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset6: point selection in File - Point selection in Memory*/ /* create a file dataspace independently */ - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; point_set (start, count, stride, block, num_points, coords, IN_ORDER); file_dataspace = H5Dget_space (dataset6); @@ -1406,7 +1406,7 @@ dataset_readAll(void) H5Pclose(xfer_plist); if(data_array1) free(data_array1); - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 malloc succeeded"); /* Dataset7: point selection in memory - All selection in file*/ @@ -1416,12 +1416,12 @@ dataset_readAll(void) ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_all succeeded"); - num_points = dim0 * dim1; + H5_CHECKED_ASSIGN(num_points, size_t, dim0 * dim1, int); k=0; for (i=0 ; i= 0), "H5Dread dataset7 succeeded"); - start[0] = dim0/mpi_size * mpi_rank; + start[0] = (hsize_t)(dim0/mpi_size * mpi_rank); start[1] = 0; ret = dataset_vrfy(start, count, stride, block, data_array1+(dim0/mpi_size * dim1 * mpi_rank), data_origin1); if(ret) nerrors++; @@ -1527,11 +1527,11 @@ extend_writeInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -1618,8 +1618,8 @@ extend_writeInd(void) VRFY((mem_dataspace >= 0), ""); /* Extend its current dim sizes before writing */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset1, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -1678,8 +1678,8 @@ extend_writeInd(void) H5Sclose(file_dataspace); /* Extend dataset2 and try again. Should succeed. */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset2, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -1840,7 +1840,7 @@ extend_writeInd2(void) * Write to the second half of the dataset * -------------------------*/ for (i=0; i<(int)orig_size; i++) - written[i] = orig_size + i; + written[i] = (int)orig_size + i; MESG("data array re-initialized"); if(VERBOSE_MED) { MESG("writing at offset 10: "); @@ -1915,11 +1915,11 @@ extend_readInd(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -2098,11 +2098,11 @@ extend_writeAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* setup chunk-size. Make sure sizes are > 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); /* ------------------- @@ -2189,8 +2189,8 @@ extend_writeAll(void) VRFY((mem_dataspace >= 0), ""); /* Extend its current dim sizes before writing */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset1, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -2272,8 +2272,8 @@ extend_writeAll(void) H5Sclose(file_dataspace); /* Extend dataset2 and try again. Should succeed. */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; ret = H5Dset_extent(dataset2, dims); VRFY((ret >= 0), "H5Dset_extent succeeded"); @@ -2345,11 +2345,11 @@ extend_readAll(void) MPI_Comm_rank(MPI_COMM_WORLD,&mpi_rank); /* allocate memory for data buffer */ - data_array1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array1 != NULL), "data_array1 HDmalloc succeeded"); - data_array2 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_array2 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_array2 != NULL), "data_array2 HDmalloc succeeded"); - data_origin1 = (DATATYPE *)HDmalloc(dim0*dim1*sizeof(DATATYPE)); + data_origin1 = (DATATYPE *)HDmalloc((size_t)dim0*(size_t)dim1*sizeof(DATATYPE)); VRFY((data_origin1 != NULL), "data_origin1 HDmalloc succeeded"); /* ------------------- @@ -2517,7 +2517,7 @@ compress_readAll(void) hid_t dataspace; /* Dataspace ID */ hid_t dataset; /* Dataset ID */ int rank=1; /* Dataspace rank */ - hsize_t dim=dim0; /* Dataspace dimensions */ + hsize_t dim=(hsize_t)dim0; /* Dataspace dimensions */ unsigned u; /* Local index variable */ unsigned chunk_opts; /* Chunk options */ unsigned disable_partial_chunk_filters; /* Whether filters are disabled on partial chunks */ @@ -2545,7 +2545,7 @@ compress_readAll(void) /* Initialize data buffers */ for(u=0; u 0 */ - chunk_dims[0] = chunkdim0; - chunk_dims[1] = chunkdim1; + chunk_dims[0] = (hsize_t)chunkdim0; + chunk_dims[1] = (hsize_t)chunkdim1; /* ------------------- * START AN HDF5 FILE @@ -2760,8 +2760,8 @@ none_selection_chunk(void) VRFY((ret >= 0), "H5Pset_chunk succeeded"); /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3038,8 +3038,8 @@ test_actual_io_mode(int selection_mode) { VRFY((fid >= 0), "H5Fcreate succeeded"); /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3050,7 +3050,7 @@ test_actual_io_mode(int selection_mode) { /* If we are not testing contiguous datasets */ if(is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0]/mpi_size; + chunk_dims[0] = dims[0]/(hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); @@ -3116,14 +3116,14 @@ test_actual_io_mode(int selection_mode) { slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); } else { /* Select the first and the nth chunk in the nth column */ - block[0] = dim0 / mpi_size; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)(dim1 / mpi_size); count[0] = 2; count[1] = 1; - stride[0] = mpi_rank * block[0]; + stride[0] = (hsize_t)mpi_rank * block[0]; stride[1] = 1; start[0] = 0; - start[1] = mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank*block[1]; } test_name = "Multi Chunk - Mixed"; @@ -3154,17 +3154,17 @@ test_actual_io_mode(int selection_mode) { if(mpi_rank == 0) { /* Select the first chunk in the first column */ slab_set(mpi_rank, mpi_size, start, count, stride, block, BYCOL); - block[0] = block[0] / mpi_size; + block[0] = block[0] / (hsize_t)mpi_size; } else { /* Select the first and the nth chunk in the nth column */ - block[0] = dim0 / mpi_size; - block[1] = dim1 / mpi_size; + block[0] = (hsize_t)(dim0 / mpi_size); + block[1] = (hsize_t)(dim1 / mpi_size); count[0] = 2; count[1] = 1; - stride[0] = mpi_rank * block[0]; + stride[0] = (hsize_t)mpi_rank * block[0]; stride[1] = 1; start[0] = 0; - start[1] = mpi_rank*block[1]; + start[1] = (hsize_t)mpi_rank*block[1]; } /* If the testname was not already set by the RESET case */ @@ -3237,7 +3237,7 @@ test_actual_io_mode(int selection_mode) { length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3566,8 +3566,8 @@ test_no_collective_cause_mode(int selection_mode) dims[1] = COL_FACTOR * 6; } else { - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; } sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3589,7 +3589,7 @@ test_no_collective_cause_mode(int selection_mode) /* If we are not testing contiguous datasets */ if(is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0]/mpi_size; + chunk_dims[0] = dims[0]/(hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); @@ -3670,10 +3670,10 @@ test_no_collective_cause_mode(int selection_mode) } /* Get the number of elements in the selection */ - length = dims[0] * dims[1]; + H5_CHECKED_ASSIGN(length, int, dims[0] * dims[1], uint64_t); /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -3864,8 +3864,8 @@ test_no_collective_cause_mode_filter(int selection_mode) } /* Create the basic Space */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -3883,7 +3883,7 @@ test_no_collective_cause_mode_filter(int selection_mode) /* If we are not testing contiguous datasets */ if(is_chunked) { /* Set up chunk information. */ - chunk_dims[0] = dims[0]/mpi_size; + chunk_dims[0] = dims[0]/(hsize_t)mpi_size; chunk_dims[1] = dims[1]; ret = H5Pset_chunk(dcpl, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); @@ -3913,7 +3913,7 @@ test_no_collective_cause_mode_filter(int selection_mode) length = dim0 * dim1; /* Allocate and initialize the buffer */ - buffer = (int *)HDmalloc(sizeof(int) * length); + buffer = (int *)HDmalloc(sizeof(int) * (size_t)length); VRFY((buffer != NULL), "HDmalloc of buffer succeeded"); for(i = 0; i < length; i++) buffer[i] = i; @@ -4099,10 +4099,10 @@ dataset_atomicity(void) buf_size = dim0 * dim1; /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc(buf_size, sizeof(int)); + write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc(buf_size, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); /* setup file access template */ @@ -4118,8 +4118,8 @@ dataset_atomicity(void) VRFY((ret >= 0), "H5Pclose succeeded"); /* setup dimensionality object */ - dims[0] = dim0; - dims[1] = dim1; + dims[0] = (hsize_t)dim0; + dims[1] = (hsize_t)dim1; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -4257,10 +4257,10 @@ dataset_atomicity(void) VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); /* allocate memory for data buffer */ - write_buf = (int *)HDcalloc(buf_size, sizeof(int)); + write_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((write_buf != NULL), "write_buf HDcalloc succeeded"); /* allocate memory for data buffer */ - read_buf = (int *)HDcalloc(buf_size, sizeof(int)); + read_buf = (int *)HDcalloc((size_t)buf_size, sizeof(int)); VRFY((read_buf != NULL), "read_buf HDcalloc succeeded"); for (i=0 ; i= 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= mpi_rank*(block[1]+1)) { - k += dim1 - mpi_rank*(block[1]+1); + if ((hsize_t)j >= (hsize_t)mpi_rank*(block[1]+1)) { + H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank*(block[1]+1), hsize_t); break; } - if ((j+1)%(block[1]+1)==0) { + if (((hsize_t)j+1)%(block[1]+1)==0) { k++; continue; } diff --git a/testpar/t_file.c b/testpar/t_file.c index 99ac189..6183b8d 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -471,19 +471,19 @@ create_file(const char *filename, hid_t fcpl, hid_t fapl, int metadata_write_str grp_id = H5Gcreate2(file_id, "GROUP", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); VRFY((grp_id >= 0), ""); - dims[0] = ROW_FACTOR*mpi_size; - dims[1] = COL_FACTOR*mpi_size; + dims[0] = (hsize_t)(ROW_FACTOR*mpi_size); + dims[1] = (hsize_t)(COL_FACTOR*mpi_size); sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; num_elements = block[0] * block[1]; @@ -632,17 +632,17 @@ open_file(const char *filename, hid_t fapl, int metadata_write_strategy, grp_id = H5Gopen2(file_id, "GROUP", H5P_DEFAULT); VRFY((grp_id >= 0), ""); - dims[0] = ROW_FACTOR*mpi_size; - dims[1] = COL_FACTOR*mpi_size; + dims[0] = (hsize_t)(ROW_FACTOR*mpi_size); + dims[1] = (hsize_t)(COL_FACTOR*mpi_size); /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; num_elements = block[0] * block[1]; diff --git a/testpar/t_filter_read.c b/testpar/t_filter_read.c index cabb51e..7b0e677 100644 --- a/testpar/t_filter_read.c +++ b/testpar/t_filter_read.c @@ -74,10 +74,10 @@ filter_read_internal(const char *filename, hid_t dcpl, hs_size[0] = size[0] = HS_DIM1; hs_size[1] = HS_DIM2; - size[1] = hs_size[1] * mpi_size; + size[1] = hs_size[1] * (hsize_t)mpi_size; hs_offset[0] = 0; - hs_offset[1] = hs_size[1] * mpi_rank; + hs_offset[1] = hs_size[1] * (hsize_t)mpi_rank; /* Create the data space */ sid = H5Screate_simple(2, size, NULL); diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index ee868ee..6cdb0af7 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -157,11 +157,12 @@ void multiple_dset_write(void) ndatasets = pt->count; size = get_size(); + H5_CHECK_OVERFLOW(size, int, size_t); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - outme = HDmalloc((size_t)(size * size * sizeof(double))); + outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); VRFY((outme != NULL), "HDmalloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); @@ -238,15 +239,15 @@ void compact_dataset(void) size = get_size(); for(i = 0; i < DIM; i++ ) - file_dims[i] = size; + file_dims[i] = (hsize_t)size; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - outme = HDmalloc((size_t)(size * size * sizeof(double))); + outme = HDmalloc((size_t)((size_t)size * (size_t)size * sizeof(double))); VRFY((outme != NULL), "HDmalloc succeeded for outme"); - inme = HDmalloc((size_t)(size * size * sizeof(double))); + inme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); VRFY((outme != NULL), "HDmalloc succeeded for inme"); filename = GetTestParameters(); @@ -363,7 +364,7 @@ void null_dataset(void) hid_t iof, plist, dxpl, dataset, attr, sid; unsigned uval=2; /* Buffer for writing to dataset */ int val=1; /* Buffer for writing to attribute */ - int nelem; + hssize_t nelem; char dname[]="dataset"; char attr_name[]="attribute"; herr_t ret; @@ -627,7 +628,7 @@ void dataset_fillvalue(void) /* Set the dataset dimension to be one row more than number of processes */ /* and calculate the actual dataset size. */ - dset_dims[0]=mpi_size+1; + dset_dims[0]=(hsize_t)(mpi_size+1); dset_size=dset_dims[0]*dset_dims[1]*dset_dims[2]*dset_dims[3]; /* Allocate space for the buffers */ @@ -720,7 +721,7 @@ void dataset_fillvalue(void) * Each process writes 1 row of data. Thus last row is not written. */ /* Create hyperslabs in memory and file dataspaces */ - req_start[0]=mpi_rank; + req_start[0]=(hsize_t)mpi_rank; ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); VRFY((ret >= 0), "H5Sselect_hyperslab succeeded on memory dataspace"); ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, req_start, NULL, req_count, NULL); @@ -878,7 +879,7 @@ void collective_group_write(void) chunk_size[0] =(hsize_t)(size / 2); chunk_size[1] =(hsize_t)(size / 2); - outme = HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outme = HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((outme != NULL), "HDmalloc succeeded for outme"); plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); @@ -1002,10 +1003,10 @@ group_dataset_read(hid_t fid, int mpi_rank, int m) size = get_size(); - indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); /* open every group under root group. */ @@ -1173,7 +1174,7 @@ write_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - outme = HDmalloc((size_t)(size * size * sizeof(double))); + outme = HDmalloc((size_t)size * (size_t)size * sizeof(double)); VRFY((outme != NULL), "HDmalloc succeeded for outme"); for(n = 0; n < NDATASET; n++) { @@ -1333,10 +1334,10 @@ read_dataset(hid_t memspace, hid_t filespace, hid_t gid) size = get_size(); - indata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + indata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((indata != NULL), "HDmalloc succeeded for indata"); - outdata =(DATATYPE*)HDmalloc((size_t)(size * size * sizeof(DATATYPE))); + outdata =(DATATYPE*)HDmalloc((size_t)size * (size_t)size * sizeof(DATATYPE)); VRFY((outdata != NULL), "HDmalloc succeeded for outdata"); for(n=0; n= 0), "H5Gcreate succeeded"); - dims[0] = ROW_FACTOR*mpi_size; - dims[1] = COL_FACTOR*mpi_size; + dims[0] = (hsize_t)ROW_FACTOR*(hsize_t)mpi_size; + dims[1] = (hsize_t)COL_FACTOR*(hsize_t)mpi_size; sid = H5Screate_simple (RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded"); @@ -81,13 +81,13 @@ main (int argc, char **argv) VRFY((data_array != NULL), "data_array HDmalloc succeeded"); /* Each process takes a slabs of rows. */ - block[0] = dims[0]/mpi_size; + block[0] = dims[0]/(hsize_t)mpi_size; block[1] = dims[1]; stride[0] = block[0]; stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = mpi_rank*block[0]; + start[0] = (hsize_t)mpi_rank*block[0]; start[1] = 0; /* put some trivial data in the data_array */ diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index c3cc7b5..e1a86a1 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -246,19 +246,19 @@ void coll_write_test(int chunk_factor) * Buffers' initialization. */ - mdim1[0] = MSPACE1_DIM *mpi_size; + mdim1[0] = (hsize_t)(MSPACE1_DIM*mpi_size); mdim[0] = MSPACE_DIM1; - mdim[1] = MSPACE_DIM2*mpi_size; + mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size); fsdim[0] = FSPACE_DIM1; - fsdim[1] = FSPACE_DIM2*mpi_size; + fsdim[1] = (hsize_t)(FSPACE_DIM2*mpi_size); - vector = (int*)HDmalloc(sizeof(int)*mdim1[0]*mpi_size); - matrix_out = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size); - matrix_out1 = (int*)HDmalloc(sizeof(int)*mdim[0]*mdim[1]*mpi_size); + vector = (int*)HDmalloc(sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size); + matrix_out = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size); + matrix_out1 = (int*)HDmalloc(sizeof(int)*(size_t)mdim[0]*(size_t)mdim[1]*(size_t)mpi_size); - HDmemset(vector,0,sizeof(int)*mdim1[0]*mpi_size); + HDmemset(vector,0,sizeof(int)*(size_t)mdim1[0]*(size_t)mpi_size); vector[0] = vector[MSPACE1_DIM*mpi_size - 1] = -1; - for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) vector[i] = i; + for (i = 1; i < MSPACE1_DIM*mpi_size - 1; i++) H5_CHECKED_ASSIGN(vector[i], int, i, unsigned); /* Grab file access property list */ facc_plist = create_faccess_plist(comm, info, facc_type); @@ -280,8 +280,8 @@ void coll_write_test(int chunk_factor) VRFY((ret >= 0),"Fill value creation property list succeeded"); if(chunk_factor != 0) { - chunk_dims[0] = fsdim[0] / chunk_factor; - chunk_dims[1] = fsdim[1] / chunk_factor; + chunk_dims[0] = fsdim[0] / (hsize_t)chunk_factor; + chunk_dims[1] = fsdim[1] / (hsize_t)chunk_factor; ret = H5Pset_chunk(dcrt_plist, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); } @@ -317,7 +317,7 @@ void coll_write_test(int chunk_factor) */ start[0] = FHSTART0; - start[1] = FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1; + start[1] = (hsize_t)(FHSTART1 + mpi_rank * FHSTRIDE1 * FHCOUNT1); stride[0] = FHSTRIDE0; stride[1] = FHSTRIDE1; count[0] = FHCOUNT0; @@ -338,7 +338,7 @@ void coll_write_test(int chunk_factor) */ start[0] = SHSTART0; - start[1] = SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank; + start[1] = (hsize_t)(SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank); stride[0] = SHSTRIDE0; stride[1] = SHSTRIDE1; count[0] = SHCOUNT0; @@ -476,7 +476,7 @@ void coll_write_test(int chunk_factor) * */ start[0] = RFFHSTART0; - start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1; + start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1); block[0] = RFFHBLOCK0; block[1] = RFFHBLOCK1; stride[0] = RFFHSTRIDE0; @@ -503,7 +503,7 @@ void coll_write_test(int chunk_factor) */ start[0] = RFSHSTART0; - start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank; + start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank); block[0] = RFSHBLOCK0; block[1] = RFSHBLOCK1; stride[0] = RFSHSTRIDE0; @@ -542,7 +542,7 @@ void coll_write_test(int chunk_factor) start[0] = RMFHSTART0; - start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1; + start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1); block[0] = RMFHBLOCK0; block[1] = RMFHBLOCK1; stride[0] = RMFHSTRIDE0; @@ -565,7 +565,7 @@ void coll_write_test(int chunk_factor) * */ start[0] = RMSHSTART0; - start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1; + start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1); block[0] = RMSHBLOCK0; block[1] = RMSHBLOCK1; stride[0] = RMSHSTRIDE0; @@ -580,8 +580,8 @@ void coll_write_test(int chunk_factor) * Initialize data buffer. */ - HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); - HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); + HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); + HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); /* * Read data back to the buffer matrix_out. */ @@ -704,9 +704,9 @@ coll_read_test(void) /* Initialize the buffer */ mdim[0] = MSPACE_DIM1; - mdim[1] = MSPACE_DIM2*mpi_size; - matrix_out =(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); - matrix_out1=(int*)HDmalloc(sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); + mdim[1] = (hsize_t)(MSPACE_DIM2*mpi_size); + matrix_out =(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); + matrix_out1=(int*)HDmalloc(sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); /*** For testing collective hyperslab selection read ***/ @@ -741,7 +741,7 @@ coll_read_test(void) * */ start[0] = RFFHSTART0; - start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1; + start[1] = (hsize_t)(RFFHSTART1+mpi_rank*RFFHCOUNT1); block[0] = RFFHBLOCK0; block[1] = RFFHBLOCK1; stride[0] = RFFHSTRIDE0; @@ -761,7 +761,7 @@ coll_read_test(void) * */ start[0] = RFSHSTART0; - start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank; + start[1] = (hsize_t)(RFSHSTART1+RFSHCOUNT1*mpi_rank); block[0] = RFSHBLOCK0; block[1] = RFSHBLOCK1; stride[0] = RFSHSTRIDE0; @@ -791,7 +791,7 @@ coll_read_test(void) */ start[0] = RMFHSTART0; - start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1; + start[1] = (hsize_t)(RMFHSTART1+mpi_rank*RMFHCOUNT1); block[0] = RMFHBLOCK0; block[1] = RMFHBLOCK1; stride[0] = RMFHSTRIDE0; @@ -813,7 +813,7 @@ coll_read_test(void) * */ start[0] = RMSHSTART0; - start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1; + start[1] = (hsize_t)(RMSHSTART1+mpi_rank*RMSHCOUNT1); block[0] = RMSHBLOCK0; block[1] = RMSHBLOCK1; stride[0] = RMSHSTRIDE0; @@ -828,8 +828,8 @@ coll_read_test(void) * Initialize data buffer. */ - HDmemset(matrix_out,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); - HDmemset(matrix_out1,0,sizeof(int)*MSPACE_DIM1*MSPACE_DIM2*mpi_size); + HDmemset(matrix_out,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); + HDmemset(matrix_out1,0,sizeof(int)*(size_t)MSPACE_DIM1*(size_t)MSPACE_DIM2*(size_t)mpi_size); /* * Read data back to the buffer matrix_out. @@ -1004,9 +1004,9 @@ lower_dim_size_comp_test__select_checker_board( * pre-C99 compilers again. */ - base_count = dims[sel_offset] / (checker_edge_size * 2); + base_count = dims[sel_offset] / (hsize_t)(checker_edge_size * 2); - if ( (dims[sel_rank] % (checker_edge_size * 2)) > 0 ) { + if ( (dims[sel_rank] % (hsize_t)(checker_edge_size * 2)) > 0 ) { base_count++; } diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 8c434ac..7830e25 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++) { @@ -1346,7 +1346,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end while */ for(i = 1; i < g_nTasks; i++) - MPI_Send(NULL, 0, MPI_BYTE, i, MPI_TAG_END, MPI_COMM_WORLD); + MPI_Send(NULL, 0, MPI_BYTE, (int)i, MPI_TAG_END, MPI_COMM_WORLD); /* Print any final data waiting in our queue */ print_incoming_data(); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index d19c3c1..6cfe3d2 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -4603,7 +4603,7 @@ hbool_t equal_ldouble(long double value, long double expected, diff_opt_t *opts) return FALSE; } - if (H5_DBL_ABS_EQUAL(value, expected)) + if (H5_LDBL_ABS_EQUAL(value, expected)) return TRUE; if (opts->use_system_epsilon) diff --git a/tools/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 80ae814..3dfbb49 100644 --- a/tools/src/h5ls/h5ls.c +++ b/tools/src/h5ls/h5ls.c @@ -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); @@ -1827,7 +1827,7 @@ dump_attribute_values(hid_t attr) init_acc_pos(&ctx, total_size); ctx.need_prefix = TRUE; - if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), ndims))) { + if (NULL != (ref_buf = (H5R_ref_t *)HDcalloc(MAX(sizeof(unsigned), sizeof(H5R_ref_t)), (size_t)ndims))) { H5TOOLS_DEBUG("H5Aread reference read"); if(H5Aread(attr, H5T_STD_REF, ref_buf) < 0) { HDfree(ref_buf); diff --git a/tools/src/h5repack/h5repack_parse.c b/tools/src/h5repack/h5repack_parse.c index 03fcf0e..95cacc1 100644 --- a/tools/src/h5repack/h5repack_parse.c +++ b/tools/src/h5repack/h5repack_parse.c @@ -228,7 +228,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt, l = 0; } else if (f == -1) { - filt->filt_flag = HDstrtoul(stype, NULL, 0); + filt->filt_flag = (unsigned)HDstrtoul(stype, NULL, 0); f = 0; } else if (p == -1) { diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c index 927167b..38fa6a2 100644 --- a/tools/src/misc/h5clear.c +++ b/tools/src/misc/h5clear.c @@ -175,7 +175,7 @@ parse_command_line(int argc, const char **argv) usage(h5tools_getprogname()); goto done; } - increment = HDatoi(opt_arg); + increment = (hsize_t)HDatoi(opt_arg); } break; diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index 7c0e7f1..a61d8d7 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -147,7 +147,7 @@ __make_file(const char *basename, struct external_def *ext, H5REPACKGENTEST_OOPS; } - space_id = H5Screate_simple(rank, dims, NULL); + space_id = H5Screate_simple((int)rank, dims, NULL); if (space_id == H5I_INVALID_HID) H5REPACKGENTEST_OOPS; @@ -296,7 +296,7 @@ generate_f32le(hbool_t external) { /* Generate values */ for (i = 0, k = 0, n = 0; i < dims[0]; i++) { for (j = 0; j < dims[1]; j++, k++, n++) { - wdata[k] = (float)(n * 801.1 * ((k % 5 == 1) ? (-1) : (1))); + wdata[k] = n * 801.1f * ((k % 5 == 1) ? (-1) : (1)); } } diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c index 1d2e791..5557558 100644 --- a/tools/test/perform/chunk_cache.c +++ b/tools/test/perform/chunk_cache.c @@ -247,7 +247,8 @@ static int check_partial_chunks_perf(hid_t file) dataset = H5Dopen2 (file, DSET1_NAME, dapl); - memspace = H5Screate_simple(row_rank, row_dim, NULL); + H5_CHECK_OVERFLOW(row_rank, hsize_t, int); + memspace = H5Screate_simple((int)row_rank, row_dim, NULL); filespace = H5Dget_space(dataset); nbytes_global = 0; @@ -256,7 +257,7 @@ static int check_partial_chunks_perf(hid_t file) /* Read the data row by row */ for(i = 0; i < DSET1_DIM1; i++) { - start[0] = i; + start[0] = (hsize_t)i; if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto error; @@ -318,7 +319,9 @@ static int check_hash_value_perf(hid_t file) if((dataset = H5Dopen2 (file, DSET2_NAME, dapl)) < 0) goto error; - if((memspace = H5Screate_simple(column_rank, column_dim, NULL)) < 0) + + H5_CHECK_OVERFLOW(column_rank, hsize_t, int); + if((memspace = H5Screate_simple((int)column_rank, column_dim, NULL)) < 0) goto error; if((filespace = H5Dget_space(dataset)) < 0) goto error; @@ -329,7 +332,7 @@ static int check_hash_value_perf(hid_t file) /* Read the data column by column */ for(i = 0; i < DSET2_DIM2; i++) { - start[1] = i; + start[1] = (hsize_t)i; if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, count, NULL) < 0) goto error; diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 8926d14..3f56d8b 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -158,7 +158,7 @@ int main(int argc, char **argv) iter_jump = nprocs * opt_block; /* setup a buffer of data to write */ - if (!(tmp = (char *) malloc(opt_block + 256))) { + if (!(tmp = (char *) malloc((size_t)opt_block + 256))) { perror("malloc"); goto die_jar_jar_die; } @@ -166,7 +166,7 @@ int main(int argc, char **argv) if (opt_correct) { /* do the same buffer setup for verifiable data */ - if (!(tmp2 = (char *) malloc(opt_block + 256))) { + if (!(tmp2 = (char *) malloc((size_t)opt_block + 256))) { perror("malloc2"); goto die_jar_jar_die; } @@ -216,7 +216,7 @@ int main(int argc, char **argv) VRFY((fid >= 0), "H5Fcreate succeeded", H5FATAL); /* define a contiquous dataset of opt_iter*nprocs*opt_block chars */ - dims[0] = opt_iter * nprocs * opt_block; + dims[0] = (hsize_t)opt_iter * (hsize_t)nprocs * (hsize_t)opt_block; sid = H5Screate_simple(RANK, dims, NULL); VRFY((sid >= 0), "H5Screate_simple succeeded", H5FATAL); dataset = H5Dcreate2(fid, "Dataset1", H5T_NATIVE_CHAR, sid, @@ -224,7 +224,7 @@ int main(int argc, char **argv) VRFY((dataset >= 0), "H5Dcreate2 succeeded", H5FATAL); /* create the memory dataspace and the file dataspace */ - dims[0] = opt_block; + dims[0] = (hsize_t)opt_block; mem_dataspace = H5Screate_simple(RANK, dims, NULL); VRFY((mem_dataspace >= 0), "", H5FATAL); file_dataspace = H5Dget_space(dataset); @@ -236,7 +236,7 @@ int main(int argc, char **argv) for(j=0; j < opt_iter; j++) { /* setup a file dataspace selection */ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block)); - stride[0] = block[0] = opt_block; + stride[0] = block[0] = (hsize_t)opt_block; count[0]= 1; ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL); @@ -289,7 +289,7 @@ int main(int argc, char **argv) for (j=0; j < opt_iter; j++) { /* setup a file dataspace selection */ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block)); - stride[0] = block[0] = opt_block; + stride[0] = block[0] = (hsize_t)opt_block; count[0]= 1; ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL); @@ -320,7 +320,7 @@ int main(int argc, char **argv) /* if the user wanted to check correctness, compare the write * buffer to the read buffer */ - if (opt_correct && memcmp(buf, buf2, opt_block)) { + if (opt_correct && memcmp(buf, buf2, (size_t)opt_block)) { HDfprintf(stderr, "node %d, correctness test failed\n", mynod); my_correct = 0; MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN, @@ -361,8 +361,8 @@ int main(int argc, char **argv) /* print out the results on one node */ if (mynod == 0) { - read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); - write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); + read_bw = (double)((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); + write_bw = (double)((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, opt_iter, (long)opt_block); @@ -433,9 +433,9 @@ parse_args(int argc, char **argv) { char *p; - opt_alignment = HDatoi(optarg); + opt_alignment = (hsize_t)HDatoi(optarg); if(NULL != (p = (char*)HDstrchr(optarg, '/'))) - opt_threshold = HDatoi(p + 1); + opt_threshold = (hsize_t)HDatoi(p + 1); } HDfprintf(stdout, "alignment/threshold=%Hu/%Hu\n", diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index f3cb3ec..8bc522f 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -251,7 +251,7 @@ do_pio(parameters param) } if (!param.dim2d){ - if(((snbytes/pio_mpi_nprocs_g)%buf_size)!=0) { + if(((size_t)(snbytes/pio_mpi_nprocs_g)%buf_size)!=0) { HDfprintf(stderr, "Dataset size/process (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the " "trasfer buffer size (%zu)\n", @@ -260,7 +260,7 @@ do_pio(parameters param) } } else { - if((snbytes%buf_size)!=0) { + if(((size_t)snbytes%buf_size)!=0) { HDfprintf(stderr, "Dataset side size (%" H5_PRINTF_LL_WIDTH "d) must be a multiple of the " "trasfer buffer size (%zu)\n", @@ -580,7 +580,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end if */ /* Interleaved Pattern: */ else { - bytes_begin[0] = (off_t)(blk_size*pio_mpi_rank_g); + bytes_begin[0] = (off_t)(blk_size*(size_t)pio_mpi_rank_g); } /* end else */ /* Prepare buffer for verifying data */ @@ -604,9 +604,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, bytes_begin[0] = 0; if(!parms->h5_use_chunks || parms->io_type==PHDF5) - bytes_begin[1] = (off_t)(blk_size*pio_mpi_rank_g); + bytes_begin[1] = (off_t)(blk_size*(size_t)pio_mpi_rank_g); else - bytes_begin[1] = (off_t)(blk_size*blk_size*pio_mpi_rank_g); + bytes_begin[1] = (off_t)(blk_size*blk_size*(size_t)pio_mpi_rank_g); } /* end else */ /* Prepare buffer for verifying data */ @@ -684,7 +684,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT"); /* Build contiguous file's derived type */ - mrc = MPI_Type_vector((int)blk_size, (int)1, (int)(snbytes/buf_size), + mrc = MPI_Type_vector((int)blk_size, (int)1, (int)((size_t)snbytes/buf_size), mpi_partial_buffer_cont, &mpi_cont_type); VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE"); @@ -702,7 +702,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT"); /* Build interleaved file's derived type */ - mrc = MPI_Type_vector((int)buf_size, (int)1, (int)(snbytes/blk_size), + mrc = MPI_Type_vector((int)buf_size, (int)1, (int)((size_t)snbytes/blk_size), mpi_partial_buffer_inter, &mpi_inter_type); VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE"); @@ -729,7 +729,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT"); /* Build chunk interleaved file's derived type */ - mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)(snbytes/blk_size), + mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)((size_t)snbytes/blk_size), mpi_full_chunk, &mpi_chunk_inter_type); VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE"); @@ -745,22 +745,22 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, if (!parms->dim2d){ if(nbytes>0) { /* define a contiguous dataset of nbytes native bytes */ - h5dims[0] = nbytes; + h5dims[0] = (hsize_t)nbytes; h5dset_space_id = H5Screate_simple(1, h5dims, NULL); VRFY((h5dset_space_id >= 0), "H5Screate_simple"); /* Set up the file dset space id to select the pattern to access */ if (!parms->interleaved){ /* Contiguous pattern */ - h5start[0] = bytes_begin[0]; + h5start[0] = (hsize_t)bytes_begin[0]; h5stride[0] = h5block[0] = blk_size; h5count[0] = buf_size/blk_size; } /* end if */ else { /* Interleaved access pattern */ /* Skip offset over blocks of other processes */ - h5start[0] = bytes_begin[0]; - h5stride[0] = blk_size*pio_mpi_nprocs_g; + h5start[0] = (hsize_t)bytes_begin[0]; + h5stride[0] = blk_size*(size_t)pio_mpi_nprocs_g; h5block[0] = blk_size; h5count[0] = buf_size/blk_size; } /* end else */ @@ -788,16 +788,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, else { if(nbytes>0) { /* define a contiguous dataset of nbytes native bytes */ - h5dims[0] = snbytes; - h5dims[1] = snbytes; + h5dims[0] = (hsize_t)snbytes; + h5dims[1] = (hsize_t)snbytes; h5dset_space_id = H5Screate_simple(2, h5dims, NULL); VRFY((h5dset_space_id >= 0), "H5Screate_simple"); /* Set up the file dset space id to select the pattern to access */ if (!parms->interleaved){ /* Contiguous pattern */ - h5start[0] = bytes_begin[0]; - h5start[1] = bytes_begin[1]; + h5start[0] = (hsize_t)bytes_begin[0]; + h5start[1] = (hsize_t)bytes_begin[1]; h5stride[0] = 1; h5stride[1] = h5block[0] = h5block[1] = blk_size; h5count[0] = 1; @@ -806,10 +806,10 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, else { /* Interleaved access pattern */ /* Skip offset over blocks of other processes */ - h5start[0] = bytes_begin[0]; - h5start[1] = bytes_begin[1]; + h5start[0] = (hsize_t)bytes_begin[0]; + h5start[1] = (hsize_t)bytes_begin[1]; h5stride[0] = blk_size; - h5stride[1] = blk_size*pio_mpi_nprocs_g; + h5stride[1] = blk_size*(size_t)pio_mpi_nprocs_g; h5block[0] = h5block[1] = blk_size; h5count[0] = buf_size/blk_size; h5count[1] = 1; @@ -973,7 +973,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((rc != 0), "POSIXWRITE"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(ssize_t)buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -1002,7 +1002,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=blk_size; /* Advance global offset in dataset */ - nbytes_xfer+=blk_size; + nbytes_xfer+=(ssize_t)blk_size; /* Decrement number of bytes left this time */ nbytes_toxfer-=blk_size; @@ -1016,8 +1016,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Contiguous access pattern */ if (!parms->interleaved) { /* Compute file offset */ - file_offset=posix_file_offset+(off_t)(((nbytes_xfer/blk_size) - /snbytes)*(blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes)); + file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/blk_size) + /(size_t)snbytes)*(blk_size*(size_t)snbytes)+(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes)); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = buf_size; @@ -1028,9 +1028,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Interleaved access pattern */ else { /* Compute file offset */ - file_offset=posix_file_offset+(off_t)((((nbytes_xfer/buf_size) - *pio_mpi_nprocs_g)/snbytes)*(buf_size*snbytes) - +((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes); + file_offset=posix_file_offset+(off_t)(((((size_t)nbytes_xfer/buf_size) + *(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*(buf_size*(size_t)snbytes) + +(((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size; @@ -1061,16 +1061,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, *snbytes/blk_size*(blk_size*blk_size))+((nbytes_xfer/(buf_size/blk_size)) *pio_mpi_nprocs_g)%(snbytes/blk_size*(blk_size*blk_size))); */ - file_offset=posix_file_offset+(off_t)(((nbytes_xfer/(buf_size/blk_size) - *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)+((nbytes_xfer/(buf_size/blk_size)) - *pio_mpi_nprocs_g)%(snbytes*blk_size)); + file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/(buf_size/blk_size) + *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)+(((size_t)nbytes_xfer/(buf_size/blk_size)) + *(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size)); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size * blk_size; /* Global offset advance after each I/O operation */ /* file_offset_advance = (off_t)(snbytes/blk_size*(blk_size*blk_size)); */ - file_offset_advance = (off_t)(snbytes*blk_size); + file_offset_advance = (off_t)snbytes*(off_t)blk_size; } /* end else */ } /* end else */ @@ -1097,7 +1097,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=nbytes_xfer_advance; /* Advance global offset in dataset */ - nbytes_xfer+=nbytes_xfer_advance; + nbytes_xfer+=(ssize_t)nbytes_xfer_advance; /* Decrement number of bytes left this time */ nbytes_toxfer-=nbytes_xfer_advance; @@ -1128,7 +1128,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(ssize_t)buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -1153,7 +1153,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=blk_size; /* Advance global offset in dataset */ - nbytes_xfer+=blk_size; + nbytes_xfer+=(ssize_t)blk_size; /* Decrement number of bytes left this time */ nbytes_toxfer-=blk_size; @@ -1174,7 +1174,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(ssize_t)buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -1193,7 +1193,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(ssize_t)buf_size; } /* end else */ } /* end else */ } /* end if */ @@ -1204,8 +1204,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Contiguous access pattern */ if (!parms->interleaved) { /* Compute offset in file */ - mpi_offset=mpi_file_offset+((nbytes_xfer/blk_size)/snbytes)* - (blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes); + mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/blk_size)/(size_t)snbytes)* + (blk_size*(size_t)snbytes))+(MPI_Offset)(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = buf_size; @@ -1219,8 +1219,8 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Interleaved access pattern */ else { /* Compute offset in file */ - mpi_offset=mpi_file_offset+(((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)/snbytes)* - (buf_size*snbytes)+((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes; + mpi_offset=mpi_file_offset+(MPI_Offset)(((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)* + (buf_size*(size_t)snbytes))+(MPI_Offset)((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size; @@ -1257,16 +1257,16 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, (buf_size/blk_size*snbytes/blk_size*(blk_size*blk_size))+ ((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes /blk_size*(blk_size*blk_size)); */ - mpi_offset=mpi_file_offset+((nbytes_xfer/(buf_size/blk_size) - *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes) - +((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes*blk_size); + mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size) + *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)) + +(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size))*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size)); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size * blk_size; /* Global offset advance after each I/O operation */ /* mpi_offset_advance = (MPI_Offset)(snbytes/blk_size*(blk_size*blk_size)); */ - mpi_offset_advance = (MPI_Offset)(snbytes*blk_size); + mpi_offset_advance = (MPI_Offset)((size_t)snbytes*blk_size); /* MPI type to be used for collective access */ mpi_collective_type = mpi_chunk_inter_type; @@ -1292,7 +1292,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=nbytes_xfer_advance; /* Advance global offset in dataset */ - nbytes_xfer+=nbytes_xfer_advance; + nbytes_xfer+=(ssize_t)nbytes_xfer_advance; /* Decrement number of bytes left this time */ nbytes_toxfer-=nbytes_xfer_advance; @@ -1315,7 +1315,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_WRITE"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size*blk_size; + nbytes_xfer+=(off_t)buf_size*(off_t)blk_size; } /* end else */ } /* end else */ @@ -1344,22 +1344,22 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((hrc >= 0), "H5Dwrite"); /* Increment number of bytes transferred */ - nbytes_xfer += buf_size; + nbytes_xfer += (ssize_t)buf_size; } /* end if */ /* 2D dataspace */ else { /* Set up the file dset space id to move the selection to process */ if (!parms->interleaved){ /* Contiguous pattern */ - h5offset[0] = (nbytes_xfer/(snbytes*blk_size))*blk_size; - h5offset[1] = (nbytes_xfer%(snbytes*blk_size))/blk_size; + h5offset[0] = (hssize_t)(((size_t)nbytes_xfer/((size_t)snbytes*blk_size))*blk_size); + h5offset[1] = (hssize_t)(((size_t)nbytes_xfer%((size_t)snbytes*blk_size))/blk_size); } /* end if */ else { /* Interleaved access pattern */ /* Skip offset over blocks of other processes */ - h5offset[0] = ((nbytes_xfer*pio_mpi_nprocs_g)/(snbytes*buf_size))*buf_size; - h5offset[1] = ((nbytes_xfer*pio_mpi_nprocs_g)%(snbytes*buf_size))/buf_size; + h5offset[0] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*buf_size))*buf_size); + h5offset[1] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*buf_size))/buf_size); } /* end else */ hrc = H5Soffset_simple(h5dset_space_id, h5offset); @@ -1371,7 +1371,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((hrc >= 0), "H5Dwrite"); /* Increment number of bytes transferred */ - nbytes_xfer += buf_size*blk_size; + nbytes_xfer += (off_t)buf_size*(off_t)blk_size; } /* end else */ @@ -1560,7 +1560,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end if */ /* Interleaved Pattern: */ else { - bytes_begin[0] = (off_t)(blk_size*pio_mpi_rank_g); + bytes_begin[0] = (off_t)blk_size*(off_t)pio_mpi_rank_g; } /* end else */ }/* end if */ /* 2D dataspace */ @@ -1582,9 +1582,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, bytes_begin[0] = 0; if (!parms->h5_use_chunks || parms->io_type==PHDF5) - bytes_begin[1] = (off_t)(blk_size*pio_mpi_rank_g); + bytes_begin[1] = (off_t)blk_size*(off_t)pio_mpi_rank_g; else - bytes_begin[1] = (off_t)(blk_size*blk_size*pio_mpi_rank_g); + bytes_begin[1] = (off_t)blk_size*(off_t)blk_size*(off_t)pio_mpi_rank_g; } /* end else */ } /* end else */ @@ -1656,7 +1656,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT"); /* Build contiguous file's derived type */ - mrc = MPI_Type_vector((int)blk_size, (int)1, (int)(snbytes/buf_size), + mrc = MPI_Type_vector((int)blk_size, (int)1, (int)((size_t)snbytes/buf_size), mpi_partial_buffer_cont, &mpi_cont_type); VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE"); @@ -1674,7 +1674,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT"); /* Build interleaved file's derived type */ - mrc = MPI_Type_vector((int)buf_size, (int)1, (int)(snbytes/blk_size), + mrc = MPI_Type_vector((int)buf_size, (int)1, (int)((size_t)snbytes/blk_size), mpi_partial_buffer_inter, &mpi_inter_type); VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE"); @@ -1701,7 +1701,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_COMMIT"); /* Build chunk interleaved file's derived type */ - mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)(snbytes/blk_size), + mrc = MPI_Type_vector((int)(buf_size/blk_size), (int)1, (int)((size_t)snbytes/blk_size), mpi_full_chunk, &mpi_chunk_inter_type); VRFY((mrc==MPI_SUCCESS), "MPIO_TYPE_CREATE"); @@ -1716,22 +1716,22 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, if (!parms->dim2d){ if(nbytes>0) { /* define a contiguous dataset of nbytes native bytes */ - h5dims[0] = nbytes; + h5dims[0] = (hsize_t)nbytes; h5dset_space_id = H5Screate_simple(1, h5dims, NULL); VRFY((h5dset_space_id >= 0), "H5Screate_simple"); /* Set up the file dset space id to select the pattern to access */ if (!parms->interleaved){ /* Contiguous pattern */ - h5start[0] = bytes_begin[0]; + h5start[0] = (hsize_t)bytes_begin[0]; h5stride[0] = h5block[0] = blk_size; h5count[0] = buf_size/blk_size; } /* end if */ else { /* Interleaved access pattern */ /* Skip offset over blocks of other processes */ - h5start[0] = bytes_begin[0]; - h5stride[0] = blk_size*pio_mpi_nprocs_g; + h5start[0] = (hsize_t)bytes_begin[0]; + h5stride[0] = blk_size*(size_t)pio_mpi_nprocs_g; h5block[0] = blk_size; h5count[0] = buf_size/blk_size; } /* end else */ @@ -1759,16 +1759,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, else { if(nbytes>0) { /* define a contiguous dataset of nbytes native bytes */ - h5dims[0] = snbytes; - h5dims[1] = snbytes; + h5dims[0] = (hsize_t)snbytes; + h5dims[1] = (hsize_t)snbytes; h5dset_space_id = H5Screate_simple(2, h5dims, NULL); VRFY((h5dset_space_id >= 0), "H5Screate_simple"); /* Set up the file dset space id to select the pattern to access */ if (!parms->interleaved){ /* Contiguous pattern */ - h5start[0] = bytes_begin[0]; - h5start[1] = bytes_begin[1]; + h5start[0] = (hsize_t)bytes_begin[0]; + h5start[1] = (hsize_t)bytes_begin[1]; h5stride[0] = 1; h5stride[1] = h5block[0] = h5block[1] = blk_size; h5count[0] = 1; @@ -1777,10 +1777,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, else { /* Interleaved access pattern */ /* Skip offset over blocks of other processes */ - h5start[0] = bytes_begin[0]; - h5start[1] = bytes_begin[1]; + h5start[0] = (hsize_t)bytes_begin[0]; + h5start[1] = (hsize_t)bytes_begin[1]; h5stride[0] = blk_size; - h5stride[1] = blk_size*pio_mpi_nprocs_g; + h5stride[1] = blk_size*(size_t)pio_mpi_nprocs_g; h5block[0] = h5block[1] = blk_size; h5count[0] = buf_size/blk_size; h5count[1] = 1; @@ -1904,7 +1904,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((rc != 0), "POSIXREAD"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(off_t)buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -1933,7 +1933,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=blk_size; /* Advance global offset in dataset */ - nbytes_xfer+=blk_size; + nbytes_xfer+=(off_t)blk_size; /* Decrement number of bytes left this time */ nbytes_toxfer-=blk_size; @@ -1947,8 +1947,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Contiguous access pattern */ if (!parms->interleaved) { /* Compute file offset */ - file_offset=posix_file_offset+(off_t)(((nbytes_xfer/blk_size) - /snbytes)*(blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes)); + file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/blk_size) + /(size_t)snbytes)*(blk_size*(size_t)snbytes)+(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes)); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = buf_size; @@ -1959,9 +1959,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Interleaved access pattern */ else { /* Compute file offset */ - file_offset=posix_file_offset+(off_t)((((nbytes_xfer/buf_size) - *pio_mpi_nprocs_g)/snbytes)*(buf_size*snbytes) - +((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes); + file_offset=posix_file_offset+(off_t)(((((size_t)nbytes_xfer/buf_size) + *(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)*(buf_size*(size_t)snbytes) + +(((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size; @@ -1992,16 +1992,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, *snbytes/blk_size*(blk_size*blk_size))+((nbytes_xfer/(buf_size/blk_size)) *pio_mpi_nprocs_g)%(snbytes/blk_size*(blk_size*blk_size))); */ - file_offset=posix_file_offset+(off_t)(((nbytes_xfer/(buf_size/blk_size) - *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes)+((nbytes_xfer/(buf_size/blk_size)) - *pio_mpi_nprocs_g)%(snbytes*blk_size)); + file_offset=posix_file_offset+(off_t)((((size_t)nbytes_xfer/(buf_size/blk_size) + *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)+(((size_t)nbytes_xfer/(buf_size/blk_size)) + *(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size)); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size * blk_size; /* Global offset advance after each I/O operation */ /* file_offset_advance = (off_t)(snbytes/blk_size*(blk_size*blk_size)); */ - file_offset_advance = (off_t)(snbytes*blk_size); + file_offset_advance = (off_t)((size_t)snbytes*blk_size); } /* end else */ } /* end else */ @@ -2028,7 +2028,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=nbytes_xfer_advance; /* Advance global offset in dataset */ - nbytes_xfer+=nbytes_xfer_advance; + nbytes_xfer+=(off_t)nbytes_xfer_advance; /* Decrement number of bytes left this time */ nbytes_toxfer-=nbytes_xfer_advance; @@ -2058,7 +2058,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_READ"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(off_t)buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -2083,7 +2083,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=blk_size; /* Advance global offset in dataset */ - nbytes_xfer+=blk_size; + nbytes_xfer+=(off_t)blk_size; /* Decrement number of bytes left this time */ nbytes_toxfer-=blk_size; @@ -2104,7 +2104,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_READ"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(off_t)buf_size; } /* end if */ /* Interleaved access pattern */ else { @@ -2123,7 +2123,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_READ"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size; + nbytes_xfer+=(off_t)buf_size; } /* end else */ } /* end else */ } /* end if */ @@ -2134,8 +2134,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Contiguous access pattern */ if (!parms->interleaved) { /* Compute offset in file */ - mpi_offset=mpi_file_offset+((nbytes_xfer/blk_size)/snbytes)* - (blk_size*snbytes)+((nbytes_xfer/blk_size)%snbytes); + mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/blk_size)/(size_t)snbytes)* + (blk_size*(size_t)snbytes))+(MPI_Offset)(((size_t)nbytes_xfer/blk_size)%(size_t)snbytes); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = buf_size; @@ -2149,8 +2149,8 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Interleaved access pattern */ else { /* Compute offset in file */ - mpi_offset=mpi_file_offset+(((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)/snbytes)* - (buf_size*snbytes)+((nbytes_xfer/buf_size)*pio_mpi_nprocs_g)%snbytes; + mpi_offset=mpi_file_offset+(MPI_Offset)(((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)/(size_t)snbytes)* + (buf_size*(size_t)snbytes))+(MPI_Offset)((((size_t)nbytes_xfer/buf_size)*(size_t)pio_mpi_nprocs_g)%(size_t)snbytes); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size; @@ -2187,16 +2187,16 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, (buf_size/blk_size*snbytes/blk_size*(blk_size*blk_size))+ ((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes /blk_size*(blk_size*blk_size)); */ - mpi_offset=mpi_file_offset+((nbytes_xfer/(buf_size/blk_size) - *pio_mpi_nprocs_g)/(snbytes*blk_size))*(buf_size*snbytes) - +((nbytes_xfer/(buf_size/blk_size))*pio_mpi_nprocs_g)%(snbytes*blk_size); + mpi_offset=mpi_file_offset+(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size) + *(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*blk_size))*(buf_size*(size_t)snbytes)) + +(MPI_Offset)((((size_t)nbytes_xfer/(buf_size/blk_size))*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*blk_size)); /* Number of bytes to be transferred per I/O operation */ nbytes_xfer_advance = blk_size * blk_size; /* Global offset advance after each I/O operation */ /* mpi_offset_advance = (MPI_Offset)(snbytes/blk_size*(blk_size*blk_size)); */ - mpi_offset_advance = (MPI_Offset)(snbytes*blk_size); + mpi_offset_advance = (MPI_Offset)((size_t)snbytes*blk_size); /* MPI type to be used for collective access */ mpi_collective_type = mpi_chunk_inter_type; @@ -2222,7 +2222,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, buf_p+=nbytes_xfer_advance; /* Advance global offset in dataset */ - nbytes_xfer+=nbytes_xfer_advance; + nbytes_xfer+=(off_t)nbytes_xfer_advance; /* Decrement number of bytes left this time */ nbytes_toxfer-=nbytes_xfer_advance; @@ -2245,7 +2245,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((mrc==MPI_SUCCESS), "MPIO_READ"); /* Advance global offset in dataset */ - nbytes_xfer+=buf_size*blk_size; + nbytes_xfer+=(off_t)buf_size*(off_t)blk_size; } /* end else */ } /* end else */ @@ -2273,21 +2273,21 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((hrc >= 0), "H5Dread"); /* Increment number of bytes transferred */ - nbytes_xfer += buf_size; + nbytes_xfer += (off_t)buf_size; } /* end if */ /* 2D dataspace */ else { /* Set up the file dset space id to move the selection to process */ if (!parms->interleaved){ /* Contiguous pattern */ - h5offset[0] = (nbytes_xfer/(snbytes*blk_size))*blk_size; - h5offset[1] = (nbytes_xfer%(snbytes*blk_size))/blk_size; + h5offset[0] = (hssize_t)(((size_t)nbytes_xfer/((size_t)snbytes*blk_size))*blk_size); + h5offset[1] = (hssize_t)(((size_t)nbytes_xfer%((size_t)snbytes*blk_size))/blk_size); } /* end if */ else { /* Interleaved access pattern */ /* Skip offset over blocks of other processes */ - h5offset[0] = ((nbytes_xfer*pio_mpi_nprocs_g)/(snbytes*buf_size))*buf_size; - h5offset[1] = ((nbytes_xfer*pio_mpi_nprocs_g)%(snbytes*buf_size))/buf_size; + h5offset[0] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)/((size_t)snbytes*buf_size))*buf_size); + h5offset[1] = (hssize_t)((((size_t)nbytes_xfer*(size_t)pio_mpi_nprocs_g)%((size_t)snbytes*buf_size))/buf_size); } /* end else */ hrc = H5Soffset_simple(h5dset_space_id, h5offset); @@ -2299,7 +2299,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, VRFY((hrc >= 0), "H5Dread"); /* Increment number of bytes transferred */ - nbytes_xfer += buf_size*blk_size; + nbytes_xfer += (off_t)buf_size*(off_t)blk_size; } /* end else */ break; diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 1a40f44..4c0ec5e 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -81,7 +81,7 @@ #define PIO_HDF5 0x4 #define DBL_EPSILON 2.2204460492503131e-16 -#define H5_DBL_ABS_EQUAL(X,Y) (fabsf((X)-(Y)) < DBL_EPSILON) +#define H5_DBL_ABS_EQUAL(X,Y) (fabs((X)-(Y)) < DBL_EPSILON) /* report 0.0 in case t is zero too */ #define MB_PER_SEC(bytes,t) (((t)==0.0) ? 0.0 : ((((double)bytes) / ONE_MB) / (t))) @@ -315,6 +315,7 @@ static void output_report(const char *fmt, ...); static void print_indent(register int indent); static void usage(const char *prog); static void report_parameters(struct options *opts); +static off_t squareo(off_t); /* * Function: main @@ -397,6 +398,12 @@ finish: return exit_value; } +off_t +squareo(off_t x) +{ + return x * x; +} + /* * Function: run_test_loop * Purpose: Run the I/O tests. Write the results to OUTPUT. @@ -432,8 +439,8 @@ run_test_loop(struct options *opts) parms.interleaved = opts->interleaved; parms.collective = opts->collective; parms.dim2d = opts->dim2d; - parms.h5_align = opts->h5_alignment; - parms.h5_thresh = opts->h5_threshold; + parms.h5_align = (hsize_t)opts->h5_alignment; + parms.h5_thresh = (hsize_t)opts->h5_threshold; parms.h5_use_chunks = opts->h5_use_chunks; parms.h5_write_only = opts->h5_write_only; parms.verify = opts->verify; @@ -460,7 +467,7 @@ run_test_loop(struct options *opts) parms.buf_size = buf_size; if (parms.dim2d){ - parms.num_bytes = (off_t)pow((double)(opts->num_bpp*parms.num_procs),2); + parms.num_bytes = squareo(opts->num_bpp * parms.num_procs); if (parms.interleaved) output_report("Transfer Buffer Size: %ldx%ld bytes, File size: %.2f MB\n", buf_size, opts->blk_size, @@ -883,7 +890,7 @@ accumulate_minmax_stuff(minmax *mm, int count) int i; minmax total_mm; - total_mm.sum = 0.0; + total_mm.sum = 0.0f; total_mm.max = -DBL_MAX; total_mm.min = DBL_MAX; total_mm.num = count; @@ -1159,10 +1166,10 @@ report_parameters(struct options *opts) recover_size_and_print((long long)(opts->num_bpp * opts->max_num_procs), "\n"); HDfprintf(output, "rank %d: File size=", rank); - recover_size_and_print((long long)(pow((double)(opts->num_bpp * opts->min_num_procs),2) - * opts->num_dsets), ":"); - recover_size_and_print((long long)(pow((double)(opts->num_bpp * opts->max_num_procs),2) - * opts->num_dsets), "\n"); + recover_size_and_print((long long)(squareo(opts->num_bpp * opts->min_num_procs) + * opts->num_dsets), ":"); + recover_size_and_print((long long)(squareo(opts->num_bpp * opts->max_num_procs) + * opts->num_dsets), "\n"); HDfprintf(output, "rank %d: Transfer buffer size=", rank); if(opts->interleaved){ @@ -1326,7 +1333,7 @@ parse_command_line(int argc, char *argv[]) break; #endif /* 0 */ case 'B': - cl_opts->blk_size = parse_size_directive(opt_arg); + cl_opts->blk_size = (size_t)parse_size_directive(opt_arg); break; case 'c': /* Turn on chunked HDF5 dataset creation */ @@ -1427,10 +1434,10 @@ parse_command_line(int argc, char *argv[]) cl_opts->h5_write_only = TRUE; break; case 'x': - cl_opts->min_xfer_size = parse_size_directive(opt_arg); + cl_opts->min_xfer_size = (size_t)parse_size_directive(opt_arg); break; case 'X': - cl_opts->max_xfer_size = parse_size_directive(opt_arg); + cl_opts->max_xfer_size = (size_t)parse_size_directive(opt_arg); break; case 'h': case '?': @@ -1450,13 +1457,13 @@ parse_command_line(int argc, char *argv[]) } if (cl_opts->max_xfer_size == 0) - cl_opts->max_xfer_size = cl_opts->num_bpp; + cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp; if (cl_opts->min_xfer_size == 0) - cl_opts->min_xfer_size = (cl_opts->num_bpp)/2; + cl_opts->min_xfer_size = (size_t)(cl_opts->num_bpp)/2; if (cl_opts->blk_size == 0) - cl_opts->blk_size = (cl_opts->num_bpp)/2; + cl_opts->blk_size = (size_t)(cl_opts->num_bpp)/2; /* set default if none specified yet */ @@ -1466,15 +1473,15 @@ parse_command_line(int argc, char *argv[]) /* verify parameters sanity. Adjust if needed. */ /* cap xfer_size with bytes per process */ if (!cl_opts->dim2d) { - if (cl_opts->min_xfer_size > cl_opts->num_bpp) - cl_opts->min_xfer_size = cl_opts->num_bpp; - if (cl_opts->max_xfer_size > cl_opts->num_bpp) - cl_opts->max_xfer_size = cl_opts->num_bpp; + if (cl_opts->min_xfer_size > (size_t)cl_opts->num_bpp) + cl_opts->min_xfer_size = (size_t)cl_opts->num_bpp; + if (cl_opts->max_xfer_size > (size_t)cl_opts->num_bpp) + cl_opts->max_xfer_size = (size_t)cl_opts->num_bpp; } if (cl_opts->min_xfer_size > cl_opts->max_xfer_size) cl_opts->min_xfer_size = cl_opts->max_xfer_size; - if (cl_opts->blk_size > cl_opts->num_bpp ) - cl_opts->blk_size = cl_opts->num_bpp; + if (cl_opts->blk_size > (size_t)cl_opts->num_bpp ) + cl_opts->blk_size = (size_t)cl_opts->num_bpp; /* check range of number of processes */ if (cl_opts->min_num_procs <= 0) cl_opts->min_num_procs = 1; -- cgit v0.12 From 96fbea89e79493db7e8f2ee040de21adfec84506 Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Fri, 24 Jan 2020 12:31:45 -0600 Subject: Merge pull request #2306 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop * commit 'a152ffafb322551033adb594112f53836f7eb240': fix assert fail --- testpar/t_mpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 064fb57..2dbb4d2 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -303,7 +303,7 @@ static int test_mpio_gb_file(char *filename) { mpi_rank, mpi_off, mpi_off); /* set data to some trivial pattern for easy verification */ for (j = 0; j < MB; j++) - H5_CHECKED_ASSIGN(*(buf + j), int8_t, i * mpi_size + mpi_rank, int); + *(buf + j) = (int8_t)(i * mpi_size + mpi_rank); if (VERBOSE_MED) HDfprintf(stdout, "proc %d: writing %d bytes at offset %lld\n", -- cgit v0.12 From 3509872fe410c5bcf57a642ad79d98f4d07c7c7f Mon Sep 17 00:00:00 2001 From: kmu Date: Mon, 27 Jan 2020 21:15:19 -0600 Subject: prototype issue --- src/H5private.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5private.h b/src/H5private.h index 11765d9..c3375df 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2684,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); -- cgit v0.12 From ccae67aefc31d3f30be183c78f040abdead159d3 Mon Sep 17 00:00:00 2001 From: kmu Date: Tue, 28 Jan 2020 14:37:46 -0600 Subject: missing prototype warning --- testpar/t_2Gio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index e833a0a..1d6f87c 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -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 -- cgit v0.12 From 68c54e69a4f4a6a40dff7ca0c1d48ef004a4adda Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Tue, 28 Jan 2020 13:25:09 -0600 Subject: Merge pull request #2315 in HDFFV/hdf5 from ~KMU/hdf5:develop to develop * commit '3177c89c5b0749ef1294ec60e124bf402246feba': fix issues from test fail --- testpar/t_dset.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 05baf3f..13f9e89 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -80,7 +80,7 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], stride[1] = block[1]; count[0] = 1; count[1] = 1; - start[0] = (hsize_t)(mpi_rank ? (hsize_t)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"); @@ -90,11 +90,11 @@ slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[], 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] = (hsize_t)(mpi_rank ? (hsize_t)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; @@ -1115,7 +1115,7 @@ dataset_readAll(void) /* set up the coords array selection */ num_points = (size_t)dim1; - coords = (hsize_t *)HDmalloc((size_t)dim0 * (size_t)dim1 * (size_t)RANK * sizeof(hsize_t)); + 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 */ @@ -1416,7 +1416,7 @@ dataset_readAll(void) ret = H5Sselect_all(file_dataspace); VRFY((ret >= 0), "H5Sselect_all succeeded"); - H5_CHECKED_ASSIGN(num_points, size_t, dim0 * dim1, int); + num_points = (size_t)(dim0 * dim1); k=0; for (i=0 ; i= (hsize_t)mpi_rank*(block[0]+1)) { + if (i >= mpi_rank*((int)block[0]+1)) { break; } - if (((hsize_t)i+1)%(block[0]+1)==0) { + if ((i+1)%((int)block[0]+1)==0) { k += dim1; continue; } for (j=0 ; 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); + if (j >= mpi_rank*((int)block[1]+1)) { + k += dim1 - mpi_rank*((int)block[1]+1); break; } - if (((hsize_t)j+1)%(block[1]+1)==0) { + if ((j+1)%((int)block[1]+1)==0) { k++; continue; } -- cgit v0.12 From d4dedac70f84be791869e37d28aef73f3d72c1e4 Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Tue, 28 Jan 2020 13:28:26 -0600 Subject: Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop * commit '406330addf45529ecdd088f4d22e9aab9a03661d': rename macro change condition pick up from Dave's fix leave Wswitch-default for later fix fix Wredundant-decls, Wswitch-default, Wdeclaration-after-statement, Wsign-compare, Wmisleading-indentation, Wshadow --- src/H5private.h | 2 +- test/use_common.c | 38 +-- testpar/t_2Gio.c | 32 +-- testpar/t_bigio.c | 493 +++++++++++++++++----------------- testpar/t_chunk_alloc.c | 20 +- testpar/t_mdset.c | 8 +- testpar/t_prestart.c | 9 +- testpar/t_shapesame.c | 7 +- testpar/t_span_tree.c | 4 +- testpar/testpar.h | 7 +- tools/lib/h5diff.c | 2 +- tools/src/h5diff/ph5diff_main.c | 2 +- tools/src/h5ls/h5ls.c | 8 +- tools/test/h5copy/h5copygentest.c | 8 +- tools/test/h5repack/h5repackgentest.c | 16 +- tools/test/perform/perf.c | 2 + tools/test/perform/pio_engine.c | 133 +++++---- tools/test/perform/pio_perf.c | 5 +- 18 files changed, 416 insertions(+), 380 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index c3375df..74fab79 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1616,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; \ } 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= 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"); @@ -3379,7 +3379,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,11 +3430,11 @@ 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 */ @@ -3766,7 +3766,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); @@ -3895,7 +3895,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; @@ -3976,11 +3976,11 @@ 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"); @@ -4147,8 +4147,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) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 45396de..ad5f2d8 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 @@ -43,14 +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); @@ -293,8 +292,8 @@ ccslab_set(int mpi_rank, count[1] = 1; start[1] = 0; stride[1] = 1; - 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); + 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: @@ -302,12 +301,12 @@ ccslab_set(int mpi_rank, block[0] = 1; count[0] = 1; - start[0] = (hsize_t)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; @@ -500,53 +499,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] = (hsize_t)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]/(hsize_t)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] = (hsize_t)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); @@ -558,17 +557,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); @@ -576,40 +575,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] = (hsize_t)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]/(hsize_t)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] = (hsize_t)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); @@ -621,17 +620,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); @@ -639,51 +638,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 */ @@ -695,7 +694,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); @@ -703,19 +702,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] = (hsize_t)(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; @@ -725,19 +724,19 @@ dataset_big_write(void) count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)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); @@ -754,21 +753,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); @@ -776,7 +775,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); @@ -812,52 +811,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] = (hsize_t)mpi_size; + dims[1] = (hsize_t)mpi_size_g; /* Each process takes a slabs of cols. */ block[0] = dims[0]; - block[1] = dims[1]/(hsize_t)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] = (hsize_t)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); @@ -868,18 +867,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); @@ -890,36 +889,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] = (hsize_t)mpi_size; + dims[1] = (hsize_t)mpi_size_g; /* Each process takes a slabs of rows. */ - block[0] = dims[0]/(hsize_t)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] = (hsize_t)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); @@ -930,18 +929,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); @@ -952,35 +951,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 */ @@ -992,20 +991,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);} @@ -1016,15 +1015,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] = (hsize_t)(mpi_size * 4); + dims[1] = (hsize_t)(mpi_size_g * 4); block[0] = dims[0]/2; block[1] = 2; @@ -1033,7 +1032,7 @@ dataset_big_read(void) count[0] = 1; count[1] = 1; start[0] = 0; - start[1] = dims[1]/(hsize_t)mpi_size * (hsize_t)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"); @@ -1045,14 +1044,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); @@ -1062,22 +1061,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);} @@ -1087,7 +1086,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); @@ -1108,7 +1107,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); @@ -1121,10 +1120,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; @@ -1134,14 +1133,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. @@ -1149,18 +1148,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); @@ -1190,7 +1189,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); @@ -1198,11 +1197,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); } @@ -1210,17 +1209,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); } @@ -1269,7 +1268,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); @@ -1323,7 +1322,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); @@ -1378,18 +1377,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); } @@ -1454,29 +1453,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*(hsize_t)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 @@ -1484,21 +1483,21 @@ 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]/(hsize_t)chunk_factor; @@ -1506,14 +1505,14 @@ coll_chunktest(const char* filename, /* 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); @@ -1523,93 +1522,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: @@ -1623,42 +1622,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: @@ -1670,45 +1669,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: @@ -1718,20 +1717,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); @@ -1739,35 +1738,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 @@ -1776,92 +1775,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); @@ -1939,8 +1938,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 @@ -1954,7 +1953,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); @@ -1963,7 +1962,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 { @@ -1979,7 +1978,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_chunk_alloc.c b/testpar/t_chunk_alloc.c index e6df2d8..e716f41 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -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_mdset.c b/testpar/t_mdset.c index 6cdb0af7..db0d059 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -235,6 +235,9 @@ 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(); @@ -314,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); @@ -620,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); @@ -664,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); diff --git a/testpar/t_prestart.c b/testpar/t_prestart.c index fc9d475..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,8 +74,8 @@ 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)); diff --git a/testpar/t_shapesame.c b/testpar/t_shapesame.c index c12cf5a..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); diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index e1a86a1..fe8a618 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -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; @@ -682,7 +682,7 @@ coll_read_test(void) 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 */ 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 7830e25..86726b4 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1345,7 +1345,7 @@ diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } /* end else */ } /* end while */ - for(i = 1; i < g_nTasks; i++) + 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 */ 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/h5ls/h5ls.c b/tools/src/h5ls/h5ls.c index 3dfbb49..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"); 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/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c index a61d8d7..7604964 100644 --- a/tools/test/h5repack/h5repackgentest.c +++ b/tools/test/h5repack/h5repackgentest.c @@ -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,8 +294,8 @@ 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++) { + 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)); } } diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 3f56d8b..364836f 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -110,8 +110,10 @@ const char *FILENAME[] = { /* function prototypes */ static int parse_args(int argc, char **argv); +#ifndef H5_HAVE_UNISTD_H /* globals needed for getopt */ extern char *optarg; +#endif int main(int argc, char **argv) { diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index 8bc522f..3863550 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -362,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; } @@ -413,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 */ @@ -857,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) { @@ -920,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 @@ -1376,6 +1386,9 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ break; + + default: + break; } /* switch (parms->io_type) */ } /* end while */ @@ -1815,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) { @@ -1838,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 @@ -2303,6 +2321,9 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ break; + + default: + break; } /* switch (parms->io_type) */ /* Verify raw data, if asked */ @@ -2532,6 +2553,9 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } break; + + default: + break; } done: @@ -2552,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: @@ -2610,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 4c0ec5e..826e7a9 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -80,11 +80,12 @@ #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 @@ -569,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); -- cgit v0.12 From f1cc5cfd7e7a898da0764392d0df8f10a02f205d Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Tue, 28 Jan 2020 13:28:26 -0600 Subject: Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop * commit '406330addf45529ecdd088f4d22e9aab9a03661d': rename macro change condition pick up from Dave's fix leave Wswitch-default for later fix fix Wredundant-decls, Wswitch-default, Wdeclaration-after-statement, Wsign-compare, Wmisleading-indentation, Wshadow --- testpar/t_2Gio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 6939585..e955269 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -539,6 +539,9 @@ static int MpioTest2G( MPI_Comm comm, int mpi_rank ) hid_t filespace; /* file and memory dataspace identifiers */ int *data; /* pointer to data buffer to write */ + hsize_t chunk[3]; + hsize_t h5_counts[3]; + hsize_t h5_offsets[3]; 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); -- cgit v0.12 From 46f76d06d74e75bd3edea68328826506dd06a1b9 Mon Sep 17 00:00:00 2001 From: kmu Date: Tue, 28 Jan 2020 16:01:52 -0600 Subject: remove redundent definition --- testpar/t_bigio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index ad5f2d8..ada832c 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -51,8 +51,6 @@ 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); -hsize_t H5_mpi_set_bigio_count(hsize_t new_count); - /* * Setup the coordinates for point selection. */ -- cgit v0.12 From 63d8c003c62f0f97ec5ea83788da6ff9f19e790d Mon Sep 17 00:00:00 2001 From: Kimmy Mu Date: Tue, 28 Jan 2020 13:28:26 -0600 Subject: Merge pull request #2311 in HDFFV/hdf5 from ~KMU/hdf5:misc to develop * commit '406330addf45529ecdd088f4d22e9aab9a03661d': rename macro change condition pick up from Dave's fix leave Wswitch-default for later fix fix Wredundant-decls, Wswitch-default, Wdeclaration-after-statement, Wsign-compare, Wmisleading-indentation, Wshadow --- testpar/t_2Gio.c | 1 - 1 file changed, 1 deletion(-) diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index e955269..513d00d 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -538,7 +538,6 @@ static 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 chunk[3]; hsize_t h5_counts[3]; hsize_t h5_offsets[3]; -- cgit v0.12 From 781fa57f6ee816e037dd12fff02d37ff7ec9c2b1 Mon Sep 17 00:00:00 2001 From: kmu Date: Wed, 29 Jan 2020 13:01:30 -0600 Subject: pick up missing piece from merge --- testpar/t_2Gio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index 513d00d..6b9aaeb 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -538,15 +538,12 @@ static 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 chunk[3]; - hsize_t h5_counts[3]; - hsize_t h5_offsets[3]; 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}; /* -- cgit v0.12