diff options
-rw-r--r-- | src/H5Cmpio.c | 6 | ||||
-rw-r--r-- | src/H5Dchunk.c | 7 | ||||
-rw-r--r-- | src/H5Dcontig.c | 12 | ||||
-rw-r--r-- | src/H5Dmpio.c | 10 | ||||
-rw-r--r-- | src/H5FD.c | 6 | ||||
-rw-r--r-- | src/H5FDmpio.c | 2 | ||||
-rw-r--r-- | src/H5FDsec2.c | 10 | ||||
-rw-r--r-- | src/H5Oint.c | 2 | ||||
-rw-r--r-- | src/H5Pfapl.c | 2 | ||||
-rw-r--r-- | src/H5Tref.c | 4 | ||||
-rw-r--r-- | test/cache_image.c | 2 | ||||
-rw-r--r-- | test/dt_arith.c | 6 | ||||
-rw-r--r-- | test/vfd.c | 187 | ||||
-rw-r--r-- | testpar/t_bigio.c | 4 | ||||
-rw-r--r-- | testpar/t_filters_parallel.c | 6 | ||||
-rw-r--r-- | testpar/t_vfd.c | 53 | ||||
-rw-r--r-- | tools/src/h5diff/ph5diff_main.c | 2 |
17 files changed, 169 insertions, 152 deletions
diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index ba6ff56..a0cc6bb 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -898,7 +898,11 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) H5C_cache_entry_t *entry_ptr = NULL; herr_t ret_value = SUCCEED; +#if H5C_DO_SANITY_CHECKS FUNC_ENTER_NOAPI_NOINIT +#else + FUNC_ENTER_NOAPI_NOINIT_NOERR +#endif entry_ptr = cache_ptr->coll_tail_ptr; clear_cnt = (partial ? cache_ptr->coll_list_len / 2 : cache_ptr->coll_list_len); @@ -919,7 +923,7 @@ H5C_clear_coll_entries(H5C_t *cache_ptr, hbool_t partial) entry_ptr = prev_ptr; } /* end while */ -#ifdef H5C_DO_SANITY_CHECKS +#if H5C_DO_SANITY_CHECKS done: #endif /* H5C_DO_SANITY_CHECKS */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 9167085..eac48a9 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -8124,8 +8124,8 @@ H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data) /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; idx_info.pline = &dset->shared->dcpl_cache.pline; - idx_info.layout = &dset->shared->layout.u.chunk; - idx_info.storage = &dset->shared->layout.storage.u.chunk; + idx_info.layout = &layout->u.chunk; + idx_info.storage = &layout->storage.u.chunk; /* If the dataset is not written, return without errors */ if (H5F_addr_defined(idx_info.storage->idx_addr)) { @@ -8136,8 +8136,7 @@ H5D__chunk_iter(const H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data) ud.op_data = op_data; /* Iterate over the allocated chunks calling the iterator callback */ - if ((ret_value = - (dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_iter_cb, &ud)) < 0) + if ((ret_value = (layout->storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_iter_cb, &ud)) < 0) HERROR(H5E_DATASET, H5E_CANTNEXT, "chunk iteration failed"); } /* end if H5F_addr_defined */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index e02d91a..b03ad47 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -605,23 +605,25 @@ done: static htri_t H5D__contig_may_use_select_io(const H5D_io_info_t *io_info, H5D_io_op_type_t op_type) { - const H5D_t *dataset = io_info->dset; /* Local pointer to dataset info */ - htri_t ret_value = FAIL; /* Return value */ + const H5D_t *dataset = NULL; /* Local pointer to dataset info */ + htri_t ret_value = FAIL; /* Return value */ FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(io_info); - HDassert(dataset); + HDassert(io_info->dset); HDassert(op_type == H5D_IO_OP_READ || op_type == H5D_IO_OP_WRITE); + dataset = io_info->dset; + /* Don't use selection I/O if it's globally disabled, if there is a type * conversion, or if it's not a contiguous dataset, or if the sieve buffer * exists (write) or is dirty (read) */ if (!H5_use_selection_io_g || io_info->io_ops.single_read != H5D__select_read || io_info->layout_ops.readvv != H5D__contig_readvv || - (op_type == H5D_IO_OP_READ && io_info->dset->shared->cache.contig.sieve_dirty) || - (op_type == H5D_IO_OP_WRITE && io_info->dset->shared->cache.contig.sieve_buf)) + (op_type == H5D_IO_OP_READ && dataset->shared->cache.contig.sieve_dirty) || + (op_type == H5D_IO_OP_WRITE && dataset->shared->cache.contig.sieve_buf)) ret_value = FALSE; else { hbool_t page_buf_enabled; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index cb6f5c3..a7908fe 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -3467,8 +3467,9 @@ done: static herr_t H5D__mpio_redistribute_shared_chunks_int(H5D_filtered_collective_io_info_t *chunk_list, size_t *num_chunks_assigned_map, hbool_t all_ranks_involved, - const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, - int mpi_rank, int mpi_size) + const H5D_io_info_t * io_info, + const H5D_chunk_map_t H5_ATTR_NDEBUG_UNUSED *fm, int mpi_rank, + int mpi_size) { MPI_Datatype struct_type; MPI_Datatype packed_type; @@ -3797,7 +3798,8 @@ done: static herr_t H5D__mpio_share_chunk_modification_data(H5D_filtered_collective_io_info_t *chunk_list, size_t *chunk_list_num_entries, H5D_io_info_t *io_info, - const H5D_type_info_t *type_info, int mpi_rank, int mpi_size, + const H5D_type_info_t *type_info, int mpi_rank, + int H5_ATTR_NDEBUG_UNUSED mpi_size, H5D_filtered_collective_io_info_t **chunk_hash_table, unsigned char ***chunk_msg_bufs, int *chunk_msg_bufs_len) { @@ -4547,7 +4549,7 @@ H5D__mpio_collective_filtered_chunk_update(H5D_filtered_collective_io_info_t *ch H5D_filtered_collective_io_info_t *chunk_hash_table, unsigned char **chunk_msg_bufs, int chunk_msg_bufs_len, const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, - int mpi_rank, int mpi_size) + int H5_ATTR_NDEBUG_UNUSED mpi_rank, int mpi_size) { H5D_fill_buf_info_t fb_info; H5D_chunk_info_t * chunk_info = NULL; @@ -2261,8 +2261,10 @@ H5FDget_vfd_handle(H5FD_t *file, hid_t fapl_id, void **file_handle /*out*/) HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get file handle for file driver") done: - if (FAIL == ret_value) - *file_handle = NULL; + if (FAIL == ret_value) { + if (file_handle) + *file_handle = NULL; + } FUNC_LEAVE_API(ret_value) } /* end H5FDget_vfd_handle() */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index fe9a3c2..1be4779 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1914,7 +1914,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ if (!sub_types) { HDassert(!sub_types_created); - if (NULL == (sub_types = (int *)HDmalloc((size_t)count * sizeof(MPI_Datatype)))) + if (NULL == (sub_types = HDmalloc((size_t)count * sizeof(MPI_Datatype)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types array") if (NULL == (sub_types_created = (uint8_t *)HDcalloc((size_t)count, 1))) { H5MM_free(sub_types); diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 01c1179..aabee0f 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -1075,17 +1075,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__sec2_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void H5_ATTR_UNUSED *input, - void H5_ATTR_UNUSED **output) +H5FD__sec2_ctl(H5FD_t H5_ATTR_UNUSED *_file, uint64_t op_code, uint64_t flags, + const void H5_ATTR_UNUSED *input, void H5_ATTR_UNUSED **output) { - H5FD_sec2_t *file = (H5FD_sec2_t *)_file; - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_PACKAGE - /* Sanity checks */ - HDassert(file); - switch (op_code) { /* Unknown op code */ default: diff --git a/src/H5Oint.c b/src/H5Oint.c index 93501a2..70661ad 100644 --- a/src/H5Oint.c +++ b/src/H5Oint.c @@ -3014,7 +3014,7 @@ H5O_get_proxy(const H5O_t *oh) *------------------------------------------------------------------------- */ herr_t -H5O__free(H5O_t *oh, hbool_t force) +H5O__free(H5O_t *oh, hbool_t H5_ATTR_NDEBUG_UNUSED force) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index a3ce2f7..d8221a3 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1636,7 +1636,7 @@ H5Pget_driver_config_str(hid_t fapl_id, char *config_buf, size_t buf_size) size_t config_str_len = HDstrlen(config_str); if (config_buf) { - HDstrncpy(config_buf, config_str, MIN(config_str_len + 1, buf_size)); + HDstrncpy(config_buf, config_str, buf_size); if (config_str_len >= buf_size) config_buf[buf_size - 1] = '\0'; } diff --git a/src/H5Tref.c b/src/H5Tref.c index 967f48d..b6b26ce 100644 --- a/src/H5Tref.c +++ b/src/H5Tref.c @@ -638,8 +638,8 @@ done: */ static herr_t H5T__ref_mem_write(H5VL_object_t *src_file, const void *src_buf, size_t src_size, H5R_type_t src_type, - H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, size_t dst_size, - void H5_ATTR_UNUSED *bg_buf) + H5VL_object_t H5_ATTR_UNUSED *dst_file, void *dst_buf, + size_t H5_ATTR_NDEBUG_UNUSED dst_size, void H5_ATTR_UNUSED *bg_buf) { H5F_t * src_f = NULL; hid_t file_id = H5I_INVALID_HID; diff --git a/test/cache_image.c b/test/cache_image.c index 419eb58..9a4b6b7 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -7510,7 +7510,7 @@ get_free_sections_test(hbool_t single_file_vfd) *------------------------------------------------------------------------- */ static unsigned -evict_on_close_test(hbool_t single_file_vfd) +evict_on_close_test(hbool_t H5_ATTR_PARALLEL_UNUSED single_file_vfd) { #ifndef H5_HAVE_PARALLEL const char *fcn_name = "evict_on_close_test()"; diff --git a/test/dt_arith.c b/test/dt_arith.c index 993048a..d73dc4e 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -2694,18 +2694,18 @@ my_isnan(dtype_t type, void *val) if (FLT_FLOAT == type) { float x = 0.0; HDmemcpy(&x, val, sizeof(float)); - retval = (x != x); + retval = !H5_FLT_ABS_EQUAL(x, x); } else if (FLT_DOUBLE == type) { double x = 0.0; HDmemcpy(&x, val, sizeof(double)); - retval = (x != x); + retval = !H5_DBL_ABS_EQUAL(x, x); #if H5_SIZEOF_LONG_DOUBLE != H5_SIZEOF_DOUBLE } else if (FLT_LDOUBLE == type) { long double x = 0.0L; HDmemcpy(&x, val, sizeof(long double)); - retval = (x != x); + retval = !H5_LDBL_ABS_EQUAL(x, x); #endif } else { @@ -4053,10 +4053,11 @@ error: static hbool_t test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], - void *write_bufs[], void *read_bufs[], char base_fill_char) + const void *write_bufs[], void *read_bufs[], char base_fill_char) { hbool_t result = TRUE; /* will set to FALSE on failure */ char fill_char = base_fill_char; + void * temp_buf = NULL; uint32_t i; uint32_t j; H5FD_mem_t mem_types[6] = {H5FD_MEM_SUPER, H5FD_MEM_BTREE, H5FD_MEM_DRAW, @@ -4072,17 +4073,16 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz } for (i = 0; i < count; i++) { - types[i] = mem_types[i % 6]; addrs[i] = HADDR_UNDEF; sizes[i] = (size_t)((rand() & 1023) + 1); - write_bufs[i] = HDmalloc(sizes[i] + 1); - read_bufs[i] = HDmalloc(sizes[i] + 1); + temp_buf = HDmalloc(sizes[i] + 1); + read_bufs[i] = HDmalloc(sizes[i] + 1); - if ((NULL == write_bufs[i]) || (NULL == read_bufs[i])) { + if ((NULL == temp_buf) || (NULL == read_bufs[i])) { HDfprintf(stderr, "%s: can't malloc read / write bufs.\n", __func__); result = FALSE; @@ -4091,23 +4091,28 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz for (j = 0; j < sizes[i]; j++) { - ((char *)(write_bufs[i]))[j] = fill_char; - ((char *)(read_bufs[i]))[j] = '\0'; + ((char *)temp_buf)[j] = fill_char; + ((char *)(read_bufs[i]))[j] = '\0'; } - ((char *)(write_bufs[i]))[sizes[i]] = '\0'; - ((char *)(read_bufs[i]))[sizes[i]] = '\0'; + ((char *)temp_buf)[sizes[i]] = '\0'; + ((char *)(read_bufs[i]))[sizes[i]] = '\0'; + + write_bufs[i] = (const void *)temp_buf; + temp_buf = NULL; fill_char++; } if (!result) { /* free buffers */ + HDfree(temp_buf); + for (i = 0; i < count; i++) { if (write_bufs[i]) { - HDfree(write_bufs[i]); + HDfree((void *)write_bufs[i]); write_bufs[i] = NULL; } @@ -4154,10 +4159,11 @@ test_vector_io__setup_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], siz static hbool_t test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], - void *write_bufs[], void *read_bufs[], char base_fill_char) + const void *write_bufs[], void *read_bufs[], char base_fill_char) { hbool_t result = TRUE; /* will set to FALSE on failure */ char fill_char = base_fill_char; + void * temp_buf = NULL; uint32_t fix_point; uint32_t i; uint32_t j; @@ -4197,8 +4203,8 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a sizes[i] = (size_t)((rand() & 1023) + 1); - write_bufs[i] = HDmalloc(sizes[i] + 1); - read_bufs[i] = HDmalloc(sizes[i] + 1); + temp_buf = HDmalloc(sizes[i] + 1); + read_bufs[i] = HDmalloc(sizes[i] + 1); } else { @@ -4213,11 +4219,11 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a addrs[i] = HADDR_UNDEF; - write_bufs[i] = HDmalloc(sizes[fix_point] + 1); - read_bufs[i] = HDmalloc(sizes[fix_point] + 1); + temp_buf = HDmalloc(sizes[fix_point] + 1); + read_bufs[i] = HDmalloc(sizes[fix_point] + 1); } - if ((NULL == write_bufs[i]) || (NULL == read_bufs[i])) { + if ((NULL == temp_buf) || (NULL == read_bufs[i])) { HDfprintf(stderr, "%s: can't malloc read / write bufs.\n", __func__); result = FALSE; @@ -4229,23 +4235,28 @@ test_vector_io__setup_fixed_size_v(uint32_t count, H5FD_mem_t types[], haddr_t a for (j = 0; j < sizes[k]; j++) { - ((char *)(write_bufs[i]))[j] = fill_char; - ((char *)(read_bufs[i]))[j] = '\0'; + ((char *)temp_buf)[j] = fill_char; + ((char *)(read_bufs[i]))[j] = '\0'; } - ((char *)(write_bufs[i]))[sizes[k]] = '\0'; - ((char *)(read_bufs[i]))[sizes[k]] = '\0'; + ((char *)temp_buf)[sizes[k]] = '\0'; + ((char *)(read_bufs[i]))[sizes[k]] = '\0'; + + write_bufs[i] = (const void *)temp_buf; + temp_buf = NULL; fill_char++; } if (!result) { /* free buffers */ + HDfree(temp_buf); + for (i = 0; i < count; i++) { if (write_bufs[i]) { - HDfree(write_bufs[i]); + HDfree((void *)write_bufs[i]); write_bufs[i] = NULL; } @@ -4340,7 +4351,7 @@ test_vector_io__read_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], had static hbool_t test_vector_io__write_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], - void *write_bufs[]) + const void *write_bufs[]) { hbool_t size_fixed = FALSE; hbool_t type_fixed = FALSE; @@ -4390,7 +4401,7 @@ test_vector_io__write_v_indiv(H5FD_t *lf, uint32_t count, H5FD_mem_t types[], ha */ static hbool_t -test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], void *write_bufs[], +test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], const void *write_bufs[], void *read_bufs[], const char *name) { hbool_t size_fixed = FALSE; @@ -4399,7 +4410,7 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi hbool_t verbose = TRUE; uint32_t i; size_t j; - char * w_buf; + const char *w_buf; char * r_buf; const char *mem_type_names[7] = {"H5FD_MEM_DEFAULT", "H5FD_MEM_SUPER", "H5FD_MEM_BTREE", "H5FD_MEM_DRAW", "H5FD_MEM_GHEAP", "H5FD_MEM_LHEAP", "H5FD_MEM_OHDR"}; @@ -4414,7 +4425,7 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi SET_TYPE(type_fixed, types, type, i); - w_buf = (char *)(write_bufs[i]); + w_buf = (const char *)(write_bufs[i]); r_buf = (char *)(read_bufs[i]); j = 0; @@ -4462,7 +4473,7 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi static void test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], - void *write_bufs[], void *read_bufs[], const char *name) + const void *write_bufs[], void *read_bufs[], const char *name) { hbool_t size_fixed = FALSE; hbool_t type_fixed = FALSE; @@ -4472,8 +4483,8 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad size_t size = SIZE_MAX; H5FD_mem_t type = H5FD_MEM_NTYPES; - char *w_buf; - char *r_buf; + const char *w_buf; + char * r_buf; HDfprintf(stdout, "\n\nDumping test vector \"%s\" of length %d\n\n", name, count); @@ -4485,7 +4496,7 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad HDassert((H5FD_MEM_DEFAULT <= type) && (type <= H5FD_MEM_OHDR)); - w_buf = (char *)(write_bufs[i]); + w_buf = (const char *)(write_bufs[i]); if (read_bufs) { @@ -4540,59 +4551,59 @@ test_vector_io__dump_test_vectors(uint32_t count, H5FD_mem_t types[], haddr_t ad static herr_t test_vector_io(const char *vfd_name) { - char test_title[80]; - hbool_t size_fixed_0 = FALSE; /* whether remaining entry */ - hbool_t size_fixed_1 = FALSE; /* sizes in vector are fixed. */ - hbool_t size_fixed_2 = FALSE; /* */ - hbool_t type_fixed_0 = FALSE; /* whether remaining entry */ - hbool_t type_fixed_1 = FALSE; /* types in vector are fixed. */ - hbool_t type_fixed_2 = FALSE; /* */ - hbool_t verbose = FALSE; - hid_t fapl_id = -1; /* file access property list ID */ - haddr_t eoa; /* file eoa */ - char filename[1024]; /* filename */ - char * buf; /* tmp ptr to buf */ - unsigned flags = 0; /* file open flags */ - H5FD_t * lf; /* VFD struct ptr */ - uint32_t i; /* index */ - uint32_t j; /* index */ - uint32_t count = VECTOR_LEN; /* length of vectors */ - H5FD_mem_t types_0[VECTOR_LEN]; /* types vector */ - H5FD_mem_t types_1[VECTOR_LEN]; /* types vector */ - H5FD_mem_t types_2[VECTOR_LEN]; /* types vector */ - H5FD_mem_t f_types_0[VECTOR_LEN]; /* fixed types vector */ - H5FD_mem_t f_types_1[VECTOR_LEN]; /* fixed types vector */ - H5FD_mem_t f_types_2[VECTOR_LEN]; /* fixed types vector */ - H5FD_mem_t f_type_0 = H5FD_MEM_NTYPES; /* current type for f vector 0 */ - H5FD_mem_t f_type_1 = H5FD_MEM_NTYPES; /* current type for f vector 1 */ - H5FD_mem_t f_type_2 = H5FD_MEM_NTYPES; /* current type for f vector 2 */ - haddr_t addrs_0[VECTOR_LEN]; /* addresses vector */ - haddr_t addrs_1[VECTOR_LEN]; /* addresses vector */ - haddr_t addrs_2[VECTOR_LEN]; /* addresses vector */ - haddr_t f_addrs_0[VECTOR_LEN]; /* fixed addresses vector */ - haddr_t f_addrs_1[VECTOR_LEN]; /* fixed addresses vector */ - haddr_t f_addrs_2[VECTOR_LEN]; /* fixed addresses vector */ - size_t sizes_0[VECTOR_LEN]; /* sizes vector */ - size_t sizes_1[VECTOR_LEN]; /* sizes vector */ - size_t sizes_2[VECTOR_LEN]; /* sizes vector */ - size_t f_sizes_0[VECTOR_LEN]; /* fixed sizes vector */ - size_t f_sizes_1[VECTOR_LEN]; /* fixed sizes vector */ - size_t f_sizes_2[VECTOR_LEN]; /* fixed sizes vector */ - size_t f_size_0 = 0; /* current size for f vector 0 */ - size_t f_size_1 = 0; /* current size for f vector 1 */ - size_t f_size_2 = 0; /* current size for f vector 2 */ - void * write_bufs_0[VECTOR_LEN]; /* write bufs vector */ - void * write_bufs_1[VECTOR_LEN]; /* write bufs vector */ - void * write_bufs_2[VECTOR_LEN]; /* write bufs vector */ - void * f_write_bufs_0[VECTOR_LEN]; /* fixed write bufs vector */ - void * f_write_bufs_1[VECTOR_LEN]; /* fixed write bufs vector */ - void * f_write_bufs_2[VECTOR_LEN]; /* fixed write bufs vector */ - void * read_bufs_0[VECTOR_LEN]; /* read bufs vector */ - void * read_bufs_1[VECTOR_LEN]; /* read bufs vector */ - void * read_bufs_2[VECTOR_LEN]; /* read bufs vector */ - void * f_read_bufs_0[VECTOR_LEN]; /* fixed read bufs vector */ - void * f_read_bufs_1[VECTOR_LEN]; /* fixed read bufs vector */ - void * f_read_bufs_2[VECTOR_LEN]; /* fixed read bufs vector */ + char test_title[80]; + hbool_t size_fixed_0 = FALSE; /* whether remaining entry */ + hbool_t size_fixed_1 = FALSE; /* sizes in vector are fixed. */ + hbool_t size_fixed_2 = FALSE; /* */ + hbool_t type_fixed_0 = FALSE; /* whether remaining entry */ + hbool_t type_fixed_1 = FALSE; /* types in vector are fixed. */ + hbool_t type_fixed_2 = FALSE; /* */ + hbool_t verbose = FALSE; + hid_t fapl_id = -1; /* file access property list ID */ + haddr_t eoa; /* file eoa */ + char filename[1024]; /* filename */ + char * buf; /* tmp ptr to buf */ + unsigned flags = 0; /* file open flags */ + H5FD_t * lf; /* VFD struct ptr */ + uint32_t i; /* index */ + uint32_t j; /* index */ + uint32_t count = VECTOR_LEN; /* length of vectors */ + H5FD_mem_t types_0[VECTOR_LEN]; /* types vector */ + H5FD_mem_t types_1[VECTOR_LEN]; /* types vector */ + H5FD_mem_t types_2[VECTOR_LEN]; /* types vector */ + H5FD_mem_t f_types_0[VECTOR_LEN]; /* fixed types vector */ + H5FD_mem_t f_types_1[VECTOR_LEN]; /* fixed types vector */ + H5FD_mem_t f_types_2[VECTOR_LEN]; /* fixed types vector */ + H5FD_mem_t f_type_0 = H5FD_MEM_NTYPES; /* current type for f vector 0 */ + H5FD_mem_t f_type_1 = H5FD_MEM_NTYPES; /* current type for f vector 1 */ + H5FD_mem_t f_type_2 = H5FD_MEM_NTYPES; /* current type for f vector 2 */ + haddr_t addrs_0[VECTOR_LEN]; /* addresses vector */ + haddr_t addrs_1[VECTOR_LEN]; /* addresses vector */ + haddr_t addrs_2[VECTOR_LEN]; /* addresses vector */ + haddr_t f_addrs_0[VECTOR_LEN]; /* fixed addresses vector */ + haddr_t f_addrs_1[VECTOR_LEN]; /* fixed addresses vector */ + haddr_t f_addrs_2[VECTOR_LEN]; /* fixed addresses vector */ + size_t sizes_0[VECTOR_LEN]; /* sizes vector */ + size_t sizes_1[VECTOR_LEN]; /* sizes vector */ + size_t sizes_2[VECTOR_LEN]; /* sizes vector */ + size_t f_sizes_0[VECTOR_LEN]; /* fixed sizes vector */ + size_t f_sizes_1[VECTOR_LEN]; /* fixed sizes vector */ + size_t f_sizes_2[VECTOR_LEN]; /* fixed sizes vector */ + size_t f_size_0 = 0; /* current size for f vector 0 */ + size_t f_size_1 = 0; /* current size for f vector 1 */ + size_t f_size_2 = 0; /* current size for f vector 2 */ + const void *write_bufs_0[VECTOR_LEN]; /* write bufs vector */ + const void *write_bufs_1[VECTOR_LEN]; /* write bufs vector */ + const void *write_bufs_2[VECTOR_LEN]; /* write bufs vector */ + const void *f_write_bufs_0[VECTOR_LEN]; /* fixed write bufs vector */ + const void *f_write_bufs_1[VECTOR_LEN]; /* fixed write bufs vector */ + const void *f_write_bufs_2[VECTOR_LEN]; /* fixed write bufs vector */ + void * read_bufs_0[VECTOR_LEN]; /* read bufs vector */ + void * read_bufs_1[VECTOR_LEN]; /* read bufs vector */ + void * read_bufs_2[VECTOR_LEN]; /* read bufs vector */ + void * f_read_bufs_0[VECTOR_LEN]; /* fixed read bufs vector */ + void * f_read_bufs_1[VECTOR_LEN]; /* fixed read bufs vector */ + void * f_read_bufs_2[VECTOR_LEN]; /* fixed read bufs vector */ HDsnprintf(test_title, sizeof(test_title), "vector I/O with %s VFD", vfd_name); @@ -4911,13 +4922,13 @@ test_vector_io(const char *vfd_name) for (i = 0; i < count; i++) { - HDfree(write_bufs_0[i]); + HDfree((void *)write_bufs_0[i]); write_bufs_0[i] = NULL; - HDfree(write_bufs_1[i]); + HDfree((void *)write_bufs_1[i]); write_bufs_1[i] = NULL; - HDfree(write_bufs_2[i]); + HDfree((void *)write_bufs_2[i]); write_bufs_2[i] = NULL; HDfree(read_bufs_0[i]); @@ -4929,13 +4940,13 @@ test_vector_io(const char *vfd_name) HDfree(read_bufs_2[i]); read_bufs_2[i] = NULL; - HDfree(f_write_bufs_0[i]); + HDfree((void *)f_write_bufs_0[i]); f_write_bufs_0[i] = NULL; - HDfree(f_write_bufs_1[i]); + HDfree((void *)f_write_bufs_1[i]); f_write_bufs_1[i] = NULL; - HDfree(f_write_bufs_2[i]); + HDfree((void *)f_write_bufs_2[i]); f_write_bufs_2[i] = NULL; HDfree(f_read_bufs_0[i]); diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c index 0a971c5..406e7bf 100644 --- a/testpar/t_bigio.c +++ b/testpar/t_bigio.c @@ -1151,14 +1151,14 @@ single_rank_independent_io(void) VRFY_G((mspace_id >= 0), "H5Screate_simple mspace_id succeeded"); /* Write data */ - H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); + ret = H5Dwrite(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); VRFY_G((ret >= 0), "H5Dwrite succeeded"); /* Wipe buffer */ HDmemset(data, 0, LARGE_DIM * sizeof(int)); /* Read data back */ - H5Dread(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); + ret = H5Dread(dset_id, H5T_NATIVE_INT, mspace_id, fspace_id, H5P_DEFAULT, data); VRFY_G((ret >= 0), "H5Dread succeeded"); /* Verify data */ diff --git a/testpar/t_filters_parallel.c b/testpar/t_filters_parallel.c index 8a55519..01f309a 100644 --- a/testpar/t_filters_parallel.c +++ b/testpar/t_filters_parallel.c @@ -7815,8 +7815,10 @@ test_edge_chunks_overlap(const char *parent_group, H5Z_filter_t filter_id, hid_t * edge chunk and writes to just a portion of the edge chunk. */ static void -test_edge_chunks_partial_write(const char *parent_group, H5Z_filter_t filter_id, hid_t fapl_id, hid_t dcpl_id, - hid_t dxpl_id) +test_edge_chunks_partial_write(const char H5_ATTR_PARALLEL_UNUSED * parent_group, + H5Z_filter_t H5_ATTR_PARALLEL_UNUSED filter_id, + hid_t H5_ATTR_PARALLEL_UNUSED fapl_id, hid_t H5_ATTR_PARALLEL_UNUSED dcpl_id, + hid_t H5_ATTR_PARALLEL_UNUSED dxpl_id) { /* TODO */ } diff --git a/testpar/t_vfd.c b/testpar/t_vfd.c index 2072afe..81e4983 100644 --- a/testpar/t_vfd.c +++ b/testpar/t_vfd.c @@ -2196,7 +2196,7 @@ vector_write_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer H5FD_mem_t types[1]; haddr_t addrs[1]; size_t sizes[1]; - void * bufs[1]; + const void *bufs[1]; pass = TRUE; @@ -2248,7 +2248,7 @@ vector_write_test_1(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = (haddr_t)mpi_rank * (haddr_t)INTS_PER_RANK * (haddr_t)(sizeof(int32_t)); sizes[0] = (size_t)INTS_PER_RANK * sizeof(int32_t); - bufs[0] = (void *)(&(increasing_fi_buf[mpi_rank * INTS_PER_RANK])); + bufs[0] = (const void *)(&(increasing_fi_buf[mpi_rank * INTS_PER_RANK])); if (H5FDwrite_vector(lf, dxpl_id, count, types, addrs, sizes, bufs) < 0) { @@ -2395,7 +2395,7 @@ vector_write_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer H5FD_mem_t types[1]; haddr_t addrs[1]; size_t sizes[1]; - void * bufs[1]; + const void *bufs[1]; pass = TRUE; @@ -2452,7 +2452,7 @@ vector_write_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = (haddr_t)mpi_rank * (haddr_t)INTS_PER_RANK * (haddr_t)(sizeof(int32_t)); sizes[0] = (size_t)INTS_PER_RANK * sizeof(int32_t); - bufs[0] = (void *)(&(increasing_fi_buf[mpi_rank * INTS_PER_RANK])); + bufs[0] = (const void *)(&(increasing_fi_buf[mpi_rank * INTS_PER_RANK])); if (H5FDwrite_vector(lf, dxpl_id, count, types, addrs, sizes, bufs) < 0) { @@ -2493,7 +2493,7 @@ vector_write_test_2(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = (haddr_t)mpi_rank * (haddr_t)INTS_PER_RANK * (haddr_t)(sizeof(int32_t)); sizes[0] = (size_t)INTS_PER_RANK * sizeof(int32_t); - bufs[0] = (void *)(&(negative_fi_buf[mpi_rank * INTS_PER_RANK])); + bufs[0] = (const void *)(&(negative_fi_buf[mpi_rank * INTS_PER_RANK])); if (H5FDwrite_vector(lf, dxpl_id, count, types, addrs, sizes, bufs) < 0) { @@ -2660,7 +2660,7 @@ vector_write_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer H5FD_mem_t types[4]; haddr_t addrs[4]; size_t sizes[4]; - void * bufs[4]; + const void *bufs[4]; pass = TRUE; @@ -2720,22 +2720,22 @@ vector_write_test_3(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = base_addr; sizes[0] = bytes_per_write; - bufs[0] = (void *)(&(increasing_fi_buf[mpi_rank * INTS_PER_RANK])); + bufs[0] = (const void *)(&(increasing_fi_buf[mpi_rank * INTS_PER_RANK])); types[1] = H5FD_MEM_DRAW; addrs[1] = addrs[0] + (haddr_t)(bytes_per_write); sizes[1] = bytes_per_write; - bufs[1] = (void *)(&(decreasing_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 4)])); + bufs[1] = (const void *)(&(decreasing_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 4)])); types[2] = H5FD_MEM_DRAW; addrs[2] = addrs[1] + (haddr_t)(bytes_per_write); sizes[2] = bytes_per_write; - bufs[2] = (void *)(&(negative_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 2)])); + bufs[2] = (const void *)(&(negative_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 2)])); types[3] = H5FD_MEM_DRAW; addrs[3] = addrs[2] + (haddr_t)(bytes_per_write); sizes[3] = bytes_per_write; - bufs[3] = (void *)(&(zero_fi_buf[(mpi_rank * INTS_PER_RANK) + (3 * (INTS_PER_RANK / 4))])); + bufs[3] = (const void *)(&(zero_fi_buf[(mpi_rank * INTS_PER_RANK) + (3 * (INTS_PER_RANK / 4))])); #if 0 /* JRM */ HDfprintf(stdout, "addrs = { %lld, %lld, %lld, %lld}\n", @@ -2942,7 +2942,7 @@ vector_write_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer H5FD_mem_t types[4]; haddr_t addrs[4]; size_t sizes[4]; - void * bufs[4]; + const void *bufs[4]; pass = TRUE; @@ -3002,22 +3002,23 @@ vector_write_test_4(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = base_addr; sizes[0] = bytes_per_write; - bufs[0] = (void *)(&(zero_fi_buf[mpi_rank * INTS_PER_RANK])); + bufs[0] = (const void *)(&(zero_fi_buf[mpi_rank * INTS_PER_RANK])); types[1] = H5FD_MEM_DRAW; addrs[1] = addrs[0] + (haddr_t)(bytes_per_write); sizes[1] = bytes_per_write; - bufs[1] = (void *)(&(negative_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 4)])); + bufs[1] = (const void *)(&(negative_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 4)])); types[2] = H5FD_MEM_DRAW; addrs[2] = addrs[1] + (haddr_t)(bytes_per_write); sizes[2] = bytes_per_write; - bufs[2] = (void *)(&(decreasing_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 2)])); + bufs[2] = (const void *)(&(decreasing_fi_buf[(mpi_rank * INTS_PER_RANK) + (INTS_PER_RANK / 2)])); types[3] = H5FD_MEM_DRAW; addrs[3] = addrs[2] + (haddr_t)(bytes_per_write); sizes[3] = bytes_per_write; - bufs[3] = (void *)(&(increasing_fi_buf[(mpi_rank * INTS_PER_RANK) + (3 * (INTS_PER_RANK / 4))])); + bufs[3] = + (const void *)(&(increasing_fi_buf[(mpi_rank * INTS_PER_RANK) + (3 * (INTS_PER_RANK / 4))])); #if 0 /* JRM */ HDfprintf(stdout, "addrs = { %lld, %lld, %lld, %lld}\n", @@ -3260,7 +3261,7 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer H5FD_mem_t types[4]; haddr_t addrs[4]; size_t sizes[4]; - void * bufs[4]; + const void *bufs[4]; pass = TRUE; @@ -3311,7 +3312,7 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = (haddr_t)mpi_rank * (haddr_t)INTS_PER_RANK * (haddr_t)(sizeof(int32_t)); sizes[0] = (size_t)INTS_PER_RANK * sizeof(int32_t); - bufs[0] = (void *)(&(zero_fi_buf[mpi_rank * INTS_PER_RANK])); + bufs[0] = (const void *)(&(zero_fi_buf[mpi_rank * INTS_PER_RANK])); if (H5FDwrite_vector(lf, dxpl_id, count, types, addrs, sizes, bufs) < 0) { @@ -3374,17 +3375,17 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = base_addr + (haddr_t)((size_t)(INTS_PER_RANK / 2) * sizeof(int32_t)); sizes[0] = (size_t)(INTS_PER_RANK / 4) * sizeof(int32_t); - bufs[0] = (void *)(&(negative_fi_buf[base_index + (INTS_PER_RANK / 2)])); + bufs[0] = (const void *)(&(negative_fi_buf[base_index + (INTS_PER_RANK / 2)])); types[1] = H5FD_MEM_DRAW; addrs[1] = base_addr + (haddr_t)((size_t)(INTS_PER_RANK / 4) * sizeof(int32_t)); sizes[1] = (size_t)(INTS_PER_RANK / 8) * sizeof(int32_t); - bufs[1] = (void *)(&(decreasing_fi_buf[base_index + (INTS_PER_RANK / 4)])); + bufs[1] = (const void *)(&(decreasing_fi_buf[base_index + (INTS_PER_RANK / 4)])); types[2] = H5FD_MEM_DRAW; addrs[2] = base_addr + (haddr_t)((size_t)(INTS_PER_RANK / 16) * sizeof(int32_t)); sizes[2] = (size_t)(INTS_PER_RANK / 16) * sizeof(int32_t); - bufs[2] = (void *)(&(increasing_fi_buf[base_index + (INTS_PER_RANK / 16)])); + bufs[2] = (const void *)(&(increasing_fi_buf[base_index + (INTS_PER_RANK / 16)])); } else if ((mpi_rank % 4) == 1) { @@ -3404,12 +3405,12 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = base_addr + (haddr_t)(sizeof(int32_t)); sizes[0] = (size_t)((INTS_PER_RANK / 2) - 2) * sizeof(int32_t); - bufs[0] = (void *)(&(increasing_fi_buf[base_index + 1])); + bufs[0] = (const void *)(&(increasing_fi_buf[base_index + 1])); types[1] = H5FD_MEM_DRAW; addrs[1] = base_addr + (haddr_t)((size_t)((INTS_PER_RANK / 2) + 1) * sizeof(int32_t)); sizes[1] = (size_t)((INTS_PER_RANK / 2) - 2) * sizeof(int32_t); - bufs[1] = (void *)(&(decreasing_fi_buf[base_index + (INTS_PER_RANK / 2) + 1])); + bufs[1] = (const void *)(&(decreasing_fi_buf[base_index + (INTS_PER_RANK / 2) + 1])); } else if ((mpi_rank % 4) == 2) { @@ -3425,7 +3426,7 @@ vector_write_test_5(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[0] = H5FD_MEM_DRAW; addrs[0] = base_addr + (haddr_t)((size_t)(INTS_PER_RANK / 2) * sizeof(int32_t)); sizes[0] = sizeof(int32_t); - bufs[0] = (void *)(&(negative_fi_buf[base_index + (INTS_PER_RANK / 2)])); + bufs[0] = (const void *)(&(negative_fi_buf[base_index + (INTS_PER_RANK / 2)])); } else if ((mpi_rank % 4) == 3) { @@ -3692,7 +3693,7 @@ vector_write_test_6(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer H5FD_mem_t types[(INTS_PER_RANK / 16) + 1]; haddr_t addrs[(INTS_PER_RANK / 16) + 1]; size_t sizes[2]; - void * bufs[(INTS_PER_RANK / 16) + 1]; + const void *bufs[(INTS_PER_RANK / 16) + 1]; pass = TRUE; @@ -3791,7 +3792,7 @@ vector_write_test_6(int file_name_id, int mpi_rank, int mpi_size, H5FD_mpio_xfer types[i] = H5FD_MEM_DRAW; addrs[i] = base_addr + ((haddr_t)(16 * i) * (haddr_t)sizeof(int32_t)); - bufs[i] = (void *)(&(increasing_fi_buf[base_index + (i * 16)])); + bufs[i] = (const void *)(&(increasing_fi_buf[base_index + (i * 16)])); } if (H5FDwrite_vector(lf, dxpl_id, count, types, addrs, sizes, bufs) < 0) { @@ -3914,8 +3915,6 @@ int main(int argc, char **argv) { unsigned nerrs = 0; - MPI_Comm comm = MPI_COMM_WORLD; - MPI_Info info = MPI_INFO_NULL; int mpi_size; int mpi_rank; diff --git a/tools/src/h5diff/ph5diff_main.c b/tools/src/h5diff/ph5diff_main.c index 8e5c3e8..75fb9a4 100644 --- a/tools/src/h5diff/ph5diff_main.c +++ b/tools/src/h5diff/ph5diff_main.c @@ -312,5 +312,5 @@ h5diff_exit(int status) /* Always exit(0), since MPI implementations do weird stuff when they * receive a non-zero exit value. - QAK */ - HDexit(0); + HDexit(status); } |