From 89451a2c835044c904c061c1adf197f8141e50e3 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 22:37:38 +0000 Subject: [PATCH] Committing clang-format changes --- src/H5Dchunk.c | 178 ++++++++++++++++++++++++---------------------- src/H5Dcompact.c | 42 +++++------ src/H5Dcontig.c | 63 ++++++++-------- src/H5Defl.c | 26 +++---- src/H5Dint.c | 5 +- src/H5Dio.c | 128 +++++++++++++++++---------------- src/H5Dpkg.h | 24 +++---- src/H5Dscatgath.c | 52 ++++++++------ src/H5Dselect.c | 22 +++--- src/H5Dvirtual.c | 12 ++-- 10 files changed, 290 insertions(+), 262 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index d4a4fadfb6a..bc0f872182f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -272,8 +272,8 @@ static int H5D__get_chunk_info_by_coord_cb(const H5D_chunk_rec_t *chunk_rec, voi static int H5D__chunk_iter_cb(const H5D_chunk_rec_t *chunk_rec, void *udata); /* "Nonexistent" layout operation callback */ -static ssize_t H5D__nonexistent_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t chunk_max_nseq, - size_t *chunk_curr_seq, size_t chunk_len_arr[], +static ssize_t H5D__nonexistent_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); @@ -300,10 +300,10 @@ static htri_t H5D__chunk_may_use_select_io(const H5D_io_info_t *io_info, const H static unsigned H5D__chunk_hash_val(const H5D_shared_t *shared, const hsize_t *scaled); static herr_t H5D__chunk_flush_entry(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t reset); static herr_t H5D__chunk_cache_evict(const H5D_t *dset, H5D_rdcc_ent_t *ent, hbool_t flush); -static void *H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, H5D_chunk_ud_t *udata, hbool_t relax, - hbool_t prev_unfilt_chunk); -static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, const H5D_chunk_ud_t *udata, hbool_t dirty, - void *chunk, uint32_t naccessed); +static void *H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + H5D_chunk_ud_t *udata, hbool_t relax, hbool_t prev_unfilt_chunk); +static herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); static herr_t H5D__chunk_cache_prune(const H5D_t *dset, size_t size); static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk); #ifdef H5_HAVE_PARALLEL @@ -378,8 +378,7 @@ H5FL_EXTERN(H5S_sel_iter_t); *------------------------------------------------------------------------- */ herr_t -H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t data_size, - const void *buf) +H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t data_size, const void *buf) { const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ H5D_chunk_ud_t udata; /* User data for querying chunk info */ @@ -1128,12 +1127,12 @@ H5D__chunk_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) static herr_t H5D__chunk_io_init_selections(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) { - const H5D_t *dataset = dinfo->dset; /* Local pointer to dataset info */ + const H5D_t *dataset = dinfo->dset; /* Local pointer to dataset info */ const H5T_t *mem_type = dinfo->type_info.mem_type; /* Local pointer to memory datatype */ - H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ - H5T_t *file_type = NULL; /* Temporary copy of file datatype for iteration */ - hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ - char bogus; /* "bogus" buffer to pass to selection iterator */ + H5S_t *tmp_mspace = NULL; /* Temporary memory dataspace */ + H5T_t *file_type = NULL; /* Temporary copy of file datatype for iteration */ + hbool_t iter_init = FALSE; /* Selection iteration info has been initialized */ + char bogus; /* "bogus" buffer to pass to selection iterator */ H5D_io_info_wrap_t io_info_wrap; herr_t ret_value = SUCCEED; /* Return value */ @@ -1693,7 +1692,7 @@ H5D__create_piece_file_map_all(H5D_dset_io_info_t *di, const H5D_io_info_t *io_i HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert chunk into skip list") /* Get number of elements selected in chunk */ - chunk_points = H5S_GET_SELECT_NPOINTS(new_piece_info->fspace); + chunk_points = H5S_GET_SELECT_NPOINTS(new_piece_info->fspace); new_piece_info->piece_points = chunk_points; /* Decrement # of points left in file selection */ @@ -1893,7 +1892,7 @@ H5D__create_piece_file_map_hyper(H5D_dset_io_info_t *dinfo, const H5D_io_info_t } /* end if */ /* Get number of elements selected in chunk */ - chunk_points = H5S_GET_SELECT_NPOINTS(new_piece_info->fspace); + chunk_points = H5S_GET_SELECT_NPOINTS(new_piece_info->fspace); new_piece_info->piece_points = chunk_points; /* Decrement # of points left in file selection */ @@ -2575,7 +2574,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) H5MM_memcpy(nonexistent_dset_info, dset_info, sizeof(*nonexistent_dset_info)); nonexistent_dset_info->layout_ops = *H5D_LOPS_NONEXISTENT; nonexistent_io_info.dsets_info = nonexistent_dset_info; - nonexistent_io_info.count = 1; + nonexistent_io_info.count = 1; { const H5O_fill_t *fill = &(dset_info->dset->shared->dcpl_cache.fill); /* Fill value info */ @@ -2667,8 +2666,8 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Perform the actual read operation from the nonexistent chunk */ nonexistent_dset_info->file_space = chunk_info->fspace; - nonexistent_dset_info->mem_space = chunk_info->mspace; - nonexistent_dset_info->nelmts = chunk_info->piece_points; + nonexistent_dset_info->mem_space = chunk_info->mspace; + nonexistent_dset_info->nelmts = chunk_info->piece_points; if ((dset_info->io_ops.single_read)(&nonexistent_io_info, nonexistent_dset_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") } /* end if */ @@ -2713,7 +2712,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) ctg_dset_info->store = &ctg_store; ctg_dset_info->layout_ops = *H5D_LOPS_CONTIG; ctg_io_info.dsets_info = ctg_dset_info; - ctg_io_info.count = 1; + ctg_io_info.count = 1; /* Initialize temporary contiguous storage info */ H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, dset_info->dset->shared->layout.u.chunk.size, @@ -2727,7 +2726,7 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) cpt_dset_info->store = &cpt_store; cpt_dset_info->layout_ops = *H5D_LOPS_COMPACT; cpt_io_info.dsets_info = cpt_dset_info; - cpt_io_info.count = 1; + cpt_io_info.count = 1; /* Initialize temporary compact storage info */ cpt_store.compact.dirty = &cpt_dirty; @@ -2769,7 +2768,8 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(dset_info->type_info.src_type_size, /*From:*/ size_t, /*To:*/ uint32_t); H5_CHECK_OVERFLOW(chunk_info->piece_points, /*From:*/ size_t, /*To:*/ uint32_t); - src_accessed_bytes = (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.src_type_size; + src_accessed_bytes = + (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.src_type_size; /* Lock the chunk into the cache */ if (NULL == (chunk = H5D__chunk_lock(io_info, dset_info, &udata, FALSE, FALSE))) @@ -2796,13 +2796,14 @@ H5D__chunk_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Perform the actual read operation */ HDassert(chk_io_info->count == 1); chk_io_info->dsets_info[0].file_space = chunk_info->fspace; - chk_io_info->dsets_info[0].mem_space = chunk_info->mspace; - chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points; + chk_io_info->dsets_info[0].mem_space = chunk_info->mspace; + chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points; if ((dset_info->io_ops.single_read)(chk_io_info, &chk_io_info->dsets_info[0]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") /* Release the cache lock on the chunk. */ - if (chunk && H5D__chunk_unlock(io_info, dset_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) + if (chunk && + H5D__chunk_unlock(io_info, dset_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ @@ -2895,7 +2896,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) ctg_dset_info->store = &ctg_store; ctg_dset_info->layout_ops = *H5D_LOPS_CONTIG; ctg_io_info.dsets_info = ctg_dset_info; - ctg_io_info.count = 1; + ctg_io_info.count = 1; /* Initialize temporary contiguous storage info */ H5_CHECKED_ASSIGN(ctg_store.contig.dset_size, hsize_t, dset_info->dset->shared->layout.u.chunk.size, @@ -2909,7 +2910,7 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) cpt_dset_info->store = &cpt_store; cpt_dset_info->layout_ops = *H5D_LOPS_COMPACT; cpt_io_info.dsets_info = cpt_dset_info; - cpt_io_info.count = 1; + cpt_io_info.count = 1; /* Initialize temporary compact storage info */ cpt_store.compact.dirty = &cpt_dirty; @@ -2991,11 +2992,13 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(dset_info->type_info.dst_type_size, /*From:*/ size_t, /*To:*/ uint32_t); H5_CHECK_OVERFLOW(chunk_info->piece_points, /*From:*/ size_t, /*To:*/ uint32_t); - dst_accessed_bytes = (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.dst_type_size; + dst_accessed_bytes = + (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.dst_type_size; /* Determine if we will access all the data in the chunk */ if (dst_accessed_bytes != ctg_store.contig.dset_size || - (chunk_info->piece_points * dset_info->type_info.src_type_size) != ctg_store.contig.dset_size || + (chunk_info->piece_points * dset_info->type_info.src_type_size) != + ctg_store.contig.dset_size || dset_info->fsel_type == H5S_SEL_POINTS) entire_chunk = FALSE; @@ -3008,8 +3011,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Perform the actual write operation */ cpt_dset_info->file_space = chunk_info->fspace; - cpt_dset_info->mem_space = chunk_info->mspace; - cpt_dset_info->nelmts = chunk_info->piece_points; + cpt_dset_info->mem_space = chunk_info->mspace; + cpt_dset_info->nelmts = chunk_info->piece_points; if ((dset_info->io_ops.single_write)(&cpt_io_info, cpt_dset_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") @@ -3121,11 +3124,13 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Compute # of bytes accessed in chunk */ H5_CHECK_OVERFLOW(dset_info->type_info.dst_type_size, /*From:*/ size_t, /*To:*/ uint32_t); H5_CHECK_OVERFLOW(chunk_info->piece_points, /*From:*/ size_t, /*To:*/ uint32_t); - dst_accessed_bytes = (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.dst_type_size; + dst_accessed_bytes = + (uint32_t)chunk_info->piece_points * (uint32_t)dset_info->type_info.dst_type_size; /* Determine if we will access all the data in the chunk */ if (dst_accessed_bytes != ctg_store.contig.dset_size || - (chunk_info->piece_points * dset_info->type_info.src_type_size) != ctg_store.contig.dset_size || + (chunk_info->piece_points * dset_info->type_info.src_type_size) != + ctg_store.contig.dset_size || dset_info->fsel_type == H5S_SEL_POINTS) entire_chunk = FALSE; @@ -3178,8 +3183,8 @@ H5D__chunk_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) /* Perform the actual write operation */ HDassert(chk_io_info->count == 1); chk_io_info->dsets_info[0].file_space = chunk_info->fspace; - chk_io_info->dsets_info[0].mem_space = chunk_info->mspace; - chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points; + chk_io_info->dsets_info[0].mem_space = chunk_info->mspace; + chk_io_info->dsets_info[0].nelmts = chunk_info->piece_points; if ((dset_info->io_ops.single_write)(chk_io_info, &chk_io_info->dsets_info[0]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") @@ -4181,18 +4186,19 @@ H5D__chunk_cache_prune(const H5D_t *dset, size_t size) *------------------------------------------------------------------------- */ static void * -H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, H5D_chunk_ud_t *udata, hbool_t relax, hbool_t prev_unfilt_chunk) +H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, H5D_chunk_ud_t *udata, + hbool_t relax, hbool_t prev_unfilt_chunk) { - const H5D_t *dset; /* Convenience pointer to the dataset */ - H5O_pline_t *pline; /* I/O pipeline info - always equal to the pline passed to H5D__chunk_mem_alloc */ - H5O_pline_t *old_pline; /* Old pipeline, i.e. pipeline used to read the chunk */ - const H5O_layout_t *layout; /* Dataset layout */ - const H5O_fill_t *fill; /* Fill value info */ - H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ - hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ - H5D_rdcc_t *rdcc; /*raw data chunk cache*/ - H5D_rdcc_ent_t *ent; /*cache entry */ - size_t chunk_size; /*size of a chunk */ + const H5D_t *dset; /* Convenience pointer to the dataset */ + H5O_pline_t *pline; /* I/O pipeline info - always equal to the pline passed to H5D__chunk_mem_alloc */ + H5O_pline_t *old_pline; /* Old pipeline, i.e. pipeline used to read the chunk */ + const H5O_layout_t *layout; /* Dataset layout */ + const H5O_fill_t *fill; /* Fill value info */ + H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ + hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ + H5D_rdcc_t *rdcc; /*raw data chunk cache*/ + H5D_rdcc_ent_t *ent; /*cache entry */ + size_t chunk_size; /*size of a chunk */ hbool_t disable_filters = FALSE; /* Whether to disable filters (when adding to cache) */ void *chunk = NULL; /*the file chunk */ void *ret_value = NULL; /* Return value */ @@ -4209,7 +4215,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_inf HDassert(!(udata->new_unfilt_chunk && prev_unfilt_chunk)); /* Set convenience pointers */ - pline = &(dset->shared->dcpl_cache .pline); + pline = &(dset->shared->dcpl_cache.pline); old_pline = pline; layout = &(dset->shared->layout); fill = &(dset->shared->dcpl_cache.fill); @@ -4351,10 +4357,9 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_inf } /* end if */ else if (layout->u.chunk.flags & H5O_LAYOUT_CHUNK_DONT_FILTER_PARTIAL_BOUND_CHUNKS) { /* Check if this is an edge chunk */ - if (H5D__chunk_is_partial_edge_chunk( - dset->shared->ndims, layout->u.chunk.dim, - dset_info->store->chunk.scaled, - dset->shared->curr_dims)) { + if (H5D__chunk_is_partial_edge_chunk(dset->shared->ndims, layout->u.chunk.dim, + dset_info->store->chunk.scaled, + dset->shared->curr_dims)) { /* Disable the filters for both writing and reading */ disable_filters = TRUE; old_pline = NULL; @@ -4488,7 +4493,7 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_inf if (ent) { if (H5D__chunk_cache_evict(dset, ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache") - } /* end if */ + } /* end if */ if (H5D__chunk_cache_prune(dset, chunk_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache") @@ -4589,13 +4594,13 @@ H5D__chunk_lock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_inf *------------------------------------------------------------------------- */ static herr_t -H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, - uint32_t naccessed) +H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout; /* Dataset layout */ - const H5D_rdcc_t *rdcc; - const H5D_t *dset; /* Local pointer to the dataset info */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5D_rdcc_t *rdcc; + const H5D_t *dset; /* Local pointer to the dataset info */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -4606,8 +4611,8 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_i /* Set convenience pointers */ layout = &(dset_info->dset->shared->layout); - rdcc = &(dset_info->dset->shared->cache.chunk); - dset = dset_info->dset; + rdcc = &(dset_info->dset->shared->cache.chunk); + dset = dset_info->dset; if (UINT_MAX == udata->idx_hint) { /* @@ -4626,8 +4631,7 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_i /* Check if the chunk is an edge chunk, and disable filters if so */ is_unfiltered_edge_chunk = H5D__chunk_is_partial_edge_chunk(dset->shared->ndims, layout->u.chunk.dim, - dset_info->store->chunk.scaled, - dset->shared->curr_dims); + dset_info->store->chunk.scaled, dset->shared->curr_dims); } /* end if */ if (dirty) { @@ -4652,11 +4656,9 @@ H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_i else { if (chunk) chunk = H5D__chunk_mem_xfree( - chunk, (is_unfiltered_edge_chunk - ? NULL - : &(dset->shared->dcpl_cache.pline))); - } /* end else */ - } /* end if */ + chunk, (is_unfiltered_edge_chunk ? NULL : &(dset->shared->dcpl_cache.pline))); + } /* end else */ + } /* end if */ else { H5D_rdcc_ent_t *ent; /* Chunk's entry in the cache */ @@ -5377,7 +5379,8 @@ H5D__chunk_update_old_edge_chunks(H5D_t *dset, hsize_t old_dim[]) if (H5F_addr_defined(chk_udata.chunk_block.offset) || (UINT_MAX != chk_udata.idx_hint)) { /* Lock the chunk into cache. H5D__chunk_lock will take care of * updating the chunk to no longer be an edge chunk. */ - if (NULL == (chunk = (void *)H5D__chunk_lock(&chk_io_info, chk_dset_info, &chk_udata, FALSE, TRUE))) + if (NULL == + (chunk = (void *)H5D__chunk_lock(&chk_io_info, chk_dset_info, &chk_udata, FALSE, TRUE))) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to lock raw data chunk") /* Unlock the chunk */ @@ -5715,21 +5718,21 @@ H5D__chunk_cmp_coll_fill_info(const void *_entry1, const void *_entry2) static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata, hbool_t new_unfilt_chunk) { - const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ - const H5D_t *dset = udata->dset_info->dset; /* Local pointer to the dataset info */ - const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ - unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ - 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 */ - 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 */ - H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ - uint32_t bytes_accessed; /* Bytes accessed in chunk */ - unsigned u; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ + const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ + const H5D_t *dset = udata->dset_info->dset; /* Local pointer to the dataset info */ + const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset's layout */ + unsigned rank = udata->common.layout->ndims - 1; /* Dataset rank */ + 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 */ + 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 */ + H5D_chunk_ud_t chk_udata; /* User data for locking chunk */ + uint32_t bytes_accessed; /* Bytes accessed in chunk */ + unsigned u; /* Local index variable */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -6012,7 +6015,7 @@ H5D__chunk_prune_by_extent(H5D_t *dset, const hsize_t *old_dim) chk_dset_info->store = &chk_store; chk_dset_info->buf.vp = NULL; chk_io_info.dsets_info = chk_dset_info; - chk_io_info.count = 1; + chk_io_info.count = 1; /* Compose chunked index info struct */ idx_info.f = dset->oloc.file; @@ -6311,8 +6314,8 @@ H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) herr_t H5D__chunk_addrmap(const H5D_t *dset, haddr_t chunk_addr[]) { - H5D_chk_idx_info_t idx_info; /* Chunked index info */ - H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ + H5D_chk_idx_info_t idx_info; /* Chunked index info */ + H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ H5O_storage_chunk_t *sc; herr_t ret_value = SUCCEED; /* Return value */ @@ -7380,9 +7383,10 @@ H5D__nonexistent_readvv_cb(hsize_t H5_ATTR_UNUSED dst_off, hsize_t src_off, size *------------------------------------------------------------------------- */ static ssize_t -H5D__nonexistent_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, - size_t chunk_len_arr[], hsize_t chunk_off_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) +H5D__nonexistent_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], + hsize_t chunk_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_chunk_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ ssize_t ret_value = -1; /* Return value */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index fcdd7602d21..458957f1b91 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -65,12 +65,14 @@ static herr_t H5D__compact_construct(H5F_t *f, H5D_t *dset); static hbool_t H5D__compact_is_space_alloc(const H5O_storage_t *storage); static herr_t H5D__compact_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); static herr_t H5D__compact_iovv_memmanage_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata); -static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); -static ssize_t H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], + hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_size_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], + hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_size_arr[], hsize_t mem_offset_arr[]); static herr_t H5D__compact_flush(H5D_t *dset); static herr_t H5D__compact_dest(H5D_t *dset); @@ -320,9 +322,10 @@ H5D__compact_iovv_memmanage_cb(hsize_t dst_off, hsize_t src_off, size_t len, voi *------------------------------------------------------------------------- */ static ssize_t -H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) +H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, + size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], + hsize_t mem_offset_arr[]) { ssize_t ret_value = -1; /* Return value */ @@ -348,10 +351,9 @@ H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset } else { /* Use the vectorized memory copy routine to do actual work */ - if ((ret_value = - H5VM_memcpyvv(dset_info->buf.vp, mem_max_nseq, mem_curr_seq, mem_size_arr, - mem_offset_arr, dset_info->store->compact.buf, dset_max_nseq, - dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0) + if ((ret_value = H5VM_memcpyvv(dset_info->buf.vp, mem_max_nseq, mem_curr_seq, mem_size_arr, + mem_offset_arr, dset_info->store->compact.buf, dset_max_nseq, + dset_curr_seq, dset_size_arr, dset_offset_arr)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") } @@ -381,9 +383,10 @@ H5D__compact_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset *------------------------------------------------------------------------- */ static ssize_t -H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) +H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, + size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], + hsize_t mem_offset_arr[]) { ssize_t ret_value = -1; /* Return value */ @@ -409,10 +412,9 @@ H5D__compact_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dse } else { /* Use the vectorized memory copy routine to do actual work */ - if ((ret_value = - H5VM_memcpyvv(dset_info->store->compact.buf, dset_max_nseq, dset_curr_seq, - dset_size_arr, dset_offset_arr, dset_info->buf.cvp, mem_max_nseq, - mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0) + if ((ret_value = H5VM_memcpyvv(dset_info->store->compact.buf, dset_max_nseq, dset_curr_seq, + dset_size_arr, dset_offset_arr, dset_info->buf.cvp, mem_max_nseq, + mem_curr_seq, mem_size_arr, mem_offset_arr)) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") } diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 265f88c65ba..0a8d0dde16b 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -92,16 +92,19 @@ typedef struct H5D_contig_writevv_ud_t { static herr_t H5D__contig_construct(H5F_t *f, H5D_t *dset); static herr_t H5D__contig_init(H5F_t *f, const H5D_t *dset, hid_t dapl_id); static herr_t H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -static ssize_t H5D__contig_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dinfo, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static ssize_t H5D__contig_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dinfo, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D__contig_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dinfo, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], + hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_len_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D__contig_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dinfo, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], + hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_len_arr[], hsize_t mem_offset_arr[]); static herr_t H5D__contig_flush(H5D_t *dset); /* Helper routines */ -static herr_t H5D__contig_write_one(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hsize_t offset, size_t size); +static herr_t H5D__contig_write_one(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info, hsize_t offset, + size_t size); static htri_t H5D__contig_may_use_select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, H5D_io_op_type_t op_type); @@ -188,13 +191,13 @@ H5D__contig_alloc(H5F_t *f, H5O_storage_contig_t *storage /*out */) herr_t H5D__contig_fill(H5D_t *dset) { - H5D_io_info_t ioinfo; /* Dataset I/O info */ - H5D_dset_io_info_t *dset_info = NULL; /* Dset info */ - H5D_storage_t store; /* Union of storage info for dataset */ - hssize_t snpoints; /* Number of points in space (for error checking) */ - size_t npoints; /* Number of points in space */ - hsize_t offset; /* Offset of dataset */ - size_t max_temp_buf; /* Maximum size of temporary buffer */ + H5D_io_info_t ioinfo; /* Dataset I/O info */ + H5D_dset_io_info_t *dset_info = NULL; /* Dset info */ + H5D_storage_t store; /* Union of storage info for dataset */ + hssize_t snpoints; /* Number of points in space (for error checking) */ + size_t npoints; /* Number of points in space */ + hsize_t offset; /* Offset of dataset */ + size_t max_temp_buf; /* Maximum size of temporary buffer */ #ifdef H5_HAVE_PARALLEL MPI_Comm mpi_comm = MPI_COMM_NULL; /* MPI communicator for file */ int mpi_rank = (-1); /* This process's rank */ @@ -723,7 +726,7 @@ H5D__contig_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) H5FL_FREE(H5D_piece_info_t, new_piece_info); HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert chunk into skip list") } /* end if */ - } /* end if */ + } /* end if */ /* Check if we're performing selection I/O if it hasn't been disabled * already */ @@ -841,9 +844,10 @@ H5D__contig_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) /* Issue selection I/O call (we can skip the page buffer because we've * already verified it won't be used, and the metadata accumulator * because this is raw data) */ - if (H5F_shared_select_read(H5F_SHARED(dinfo->dset->oloc.file), H5FD_MEM_DRAW, dinfo->nelmts > 0 ? 1 : 0, - &dinfo->mem_space, &dinfo->file_space, &(dinfo->store->contig.dset_addr), - &dst_type_size, &(dinfo->buf.vp)) < 0) + if (H5F_shared_select_read(H5F_SHARED(dinfo->dset->oloc.file), H5FD_MEM_DRAW, + dinfo->nelmts > 0 ? 1 : 0, &dinfo->mem_space, &dinfo->file_space, + &(dinfo->store->contig.dset_addr), &dst_type_size, + &(dinfo->buf.vp)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "contiguous selection read failed") } } /* end if */ @@ -892,9 +896,10 @@ H5D__contig_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo) /* Issue selection I/O call (we can skip the page buffer because we've * already verified it won't be used, and the metadata accumulator * because this is raw data) */ - if (H5F_shared_select_write(H5F_SHARED(dinfo->dset->oloc.file), H5FD_MEM_DRAW, dinfo->nelmts > 0 ? 1 : 0, - &dinfo->mem_space, &dinfo->file_space, &(dinfo->store->contig.dset_addr), - &dst_type_size, &(dinfo->buf.cvp)) < 0) + if (H5F_shared_select_write(H5F_SHARED(dinfo->dset->oloc.file), H5FD_MEM_DRAW, + dinfo->nelmts > 0 ? 1 : 0, &dinfo->mem_space, &dinfo->file_space, + &(dinfo->store->contig.dset_addr), &dst_type_size, + &(dinfo->buf.cvp)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "contiguous selection write failed") } } /* end if */ @@ -1159,11 +1164,11 @@ H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata *------------------------------------------------------------------------- */ static ssize_t -H5D__contig_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, - size_t mem_len_arr[], hsize_t mem_off_arr[]) +H5D__contig_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, + size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, + size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - ssize_t ret_value = -1; /* Return value */ + ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE @@ -1478,11 +1483,11 @@ H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udat *------------------------------------------------------------------------- */ static ssize_t -H5D__contig_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, - size_t mem_len_arr[], hsize_t mem_off_arr[]) +H5D__contig_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, + size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, + size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { - ssize_t ret_value = -1; /* Return value (Size of sequence in bytes) */ + ssize_t ret_value = -1; /* Return value (Size of sequence in bytes) */ FUNC_ENTER_PACKAGE diff --git a/src/H5Defl.c b/src/H5Defl.c index 381183dd2ab..45aea750f85 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -62,12 +62,14 @@ typedef struct H5D_efl_writevv_ud_t { /* Layout operation callbacks */ static herr_t H5D__efl_construct(H5F_t *f, H5D_t *dset); static herr_t H5D__efl_io_init(H5D_io_info_t *io_info, H5D_dset_io_info_t *dinfo); -static ssize_t H5D__efl_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static ssize_t H5D__efl_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, - size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D__efl_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], + hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_len_arr[], hsize_t mem_offset_arr[]); +static ssize_t H5D__efl_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], + hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, + size_t mem_len_arr[], hsize_t mem_offset_arr[]); /* Helper routines */ static herr_t H5D__efl_read(const H5O_efl_t *efl, const H5D_t *dset, haddr_t addr, size_t size, uint8_t *buf); @@ -443,9 +445,9 @@ H5D__efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) *------------------------------------------------------------------------- */ static ssize_t -H5D__efl_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, - size_t mem_len_arr[], hsize_t mem_off_arr[]) +H5D__efl_readvv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, + size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, + size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_efl_readvv_ud_t udata; /* User data for H5VM_opvv() operator */ ssize_t ret_value = -1; /* Return value (Total size of sequence in bytes) */ @@ -524,9 +526,9 @@ H5D__efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) *------------------------------------------------------------------------- */ static ssize_t -H5D__efl_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, - size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, - size_t mem_len_arr[], hsize_t mem_off_arr[]) +H5D__efl_writevv(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, + size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, + size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_efl_writevv_ud_t udata; /* User data for H5VM_opvv() operator */ ssize_t ret_value = -1; /* Return value (Total size of sequence in bytes) */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 98705aa7f8d..c7a6f81bf5f 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2218,8 +2218,7 @@ H5D_nameof(H5D_t *dataset) *------------------------------------------------------------------------- */ herr_t -H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, - hsize_t old_dim[]) +H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) { H5F_t *f; /* The dataset's file pointer */ H5O_layout_t *layout; /* The dataset's layout information */ @@ -2394,7 +2393,7 @@ H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwr static herr_t H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[]) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE diff --git a/src/H5Dio.c b/src/H5Dio.c index b3c5a27dbbf..5cf6ad53176 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -96,7 +96,7 @@ H5D__pre_read(size_t count, H5D_dset_io_info_t *dset_info) HDassert(dset_info); { -#ifdef H5_HAVE_PARALLEL /*!FIXME remove this block? */ +#ifdef H5_HAVE_PARALLEL /*!FIXME remove this block? */ H5FD_mpio_xfer_t xfer_mode; /* Parallel I/O transfer mode */ /* Get the transfer mode */ @@ -214,31 +214,31 @@ H5D__pre_write(size_t count, H5D_dset_io_info_t *dset_info) herr_t H5D__read(size_t count, H5D_dset_io_info_t *dset_info) { - H5D_io_info_t io_info; /* Dataset I/O info for multi dsets */ - size_t type_info_init = 0; /* Number of datatype info structs that have been initialized */ - H5S_t *orig_mem_space_local; /* Local buffer for orig_mem_space */ - H5S_t **orig_mem_space = NULL; /* If not NULL, ptr to an array of dataspaces */ - /* containing the original memory spaces contained */ - /* in dset_info. This is needed in order to */ - /* restore the original state of dset_info if we */ - /* replaced any mem spaces with equivalents */ - /* projected to a rank equal to that of file_space. */ - /* */ - /* This field is only used if */ - /* H5S_select_shape_same() returns TRUE when */ - /* comparing at least one mem_space and data_space, */ - /* and the mem_space has a different rank. */ - /* */ - /* Note that this is a temporary variable - the */ - /* projected memory space is stored in dset_info, */ - /* and will be freed when that structure is */ - /* freed. */ - H5D_storage_t store_local; /* Local buffer for store */ - H5D_storage_t *store = &store_local; /* Union of EFL and chunk pointer in file space */ - size_t io_op_init = 0; /* Number I/O ops that have been initialized */ - size_t i; /* Local index variable */ - char fake_char; /* Temporary variable for NULL buffer pointers */ - herr_t ret_value = SUCCEED; /* Return value */ + H5D_io_info_t io_info; /* Dataset I/O info for multi dsets */ + size_t type_info_init = 0; /* Number of datatype info structs that have been initialized */ + H5S_t *orig_mem_space_local; /* Local buffer for orig_mem_space */ + H5S_t **orig_mem_space = NULL; /* If not NULL, ptr to an array of dataspaces */ + /* containing the original memory spaces contained */ + /* in dset_info. This is needed in order to */ + /* restore the original state of dset_info if we */ + /* replaced any mem spaces with equivalents */ + /* projected to a rank equal to that of file_space. */ + /* */ + /* This field is only used if */ + /* H5S_select_shape_same() returns TRUE when */ + /* comparing at least one mem_space and data_space, */ + /* and the mem_space has a different rank. */ + /* */ + /* Note that this is a temporary variable - the */ + /* projected memory space is stored in dset_info, */ + /* and will be freed when that structure is */ + /* freed. */ + H5D_storage_t store_local; /* Local buffer for store */ + H5D_storage_t *store = &store_local; /* Union of EFL and chunk pointer in file space */ + size_t io_op_init = 0; /* Number I/O ops that have been initialized */ + size_t i; /* Local index variable */ + char fake_char; /* Temporary variable for NULL buffer pointers */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -287,7 +287,8 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init++; - /* Make certain that the number of elements in each selection is the same, and cache nelmts in dset_info */ + /* Make certain that the number of elements in each selection is the same, and cache nelmts in + * dset_info */ dset_info[i].nelmts = H5S_GET_SELECT_NPOINTS(dset_info[i].mem_space); if (dset_info[i].nelmts != H5S_GET_SELECT_NPOINTS(dset_info[i].file_space)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, @@ -325,7 +326,8 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) * Note that in general, this requires us to touch up the memory buffer as * well. */ - if (dset_info[i].nelmts > 0 && TRUE == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && + if (dset_info[i].nelmts > 0 && + TRUE == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && H5S_GET_EXTENT_NDIMS(dset_info[i].mem_space) != H5S_GET_EXTENT_NDIMS(dset_info[i].file_space)) { ptrdiff_t buf_adj = 0; @@ -509,31 +511,31 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info) herr_t H5D__write(size_t count, H5D_dset_io_info_t *dset_info) { - H5D_io_info_t io_info; /* Dataset I/O info for multi dsets */ - size_t type_info_init = 0; /* Number of datatype info structs that have been initialized */ - H5S_t *orig_mem_space_local; /* Local buffer for orig_mem_space */ - H5S_t **orig_mem_space = NULL; /* If not NULL, ptr to an array of dataspaces */ - /* containing the original memory spaces contained */ - /* in dset_info. This is needed in order to */ - /* restore the original state of dset_info if we */ - /* replaced any mem spaces with equivalents */ - /* projected to a rank equal to that of file_space. */ - /* */ - /* This field is only used if */ - /* H5S_select_shape_same() returns TRUE when */ - /* comparing at least one mem_space and data_space, */ - /* and the mem_space has a different rank. */ - /* */ - /* Note that this is a temporary variable - the */ - /* projected memory space is stored in dset_info, */ - /* and will be freed when that structure is */ - /* freed. */ - H5D_storage_t store_local; /* Local buffer for store */ - H5D_storage_t *store = &store_local; /* Union of EFL and chunk pointer in file space */ - size_t io_op_init = 0; /* Number I/O ops that have been initialized */ - size_t i; /* Local index variable */ - char fake_char; /* Temporary variable for NULL buffer pointers */ - herr_t ret_value = SUCCEED; /* Return value */ + H5D_io_info_t io_info; /* Dataset I/O info for multi dsets */ + size_t type_info_init = 0; /* Number of datatype info structs that have been initialized */ + H5S_t *orig_mem_space_local; /* Local buffer for orig_mem_space */ + H5S_t **orig_mem_space = NULL; /* If not NULL, ptr to an array of dataspaces */ + /* containing the original memory spaces contained */ + /* in dset_info. This is needed in order to */ + /* restore the original state of dset_info if we */ + /* replaced any mem spaces with equivalents */ + /* projected to a rank equal to that of file_space. */ + /* */ + /* This field is only used if */ + /* H5S_select_shape_same() returns TRUE when */ + /* comparing at least one mem_space and data_space, */ + /* and the mem_space has a different rank. */ + /* */ + /* Note that this is a temporary variable - the */ + /* projected memory space is stored in dset_info, */ + /* and will be freed when that structure is */ + /* freed. */ + H5D_storage_t store_local; /* Local buffer for store */ + H5D_storage_t *store = &store_local; /* Union of EFL and chunk pointer in file space */ + size_t io_op_init = 0; /* Number I/O ops that have been initialized */ + size_t i; /* Local index variable */ + char fake_char; /* Temporary variable for NULL buffer pointers */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -602,7 +604,8 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) } /* end else */ #endif /*H5_HAVE_PARALLEL*/ - /* Make certain that the number of elements in each selection is the same, and cache nelmts in dset_info */ + /* Make certain that the number of elements in each selection is the same, and cache nelmts in + * dset_info */ dset_info[i].nelmts = H5S_GET_SELECT_NPOINTS(dset_info[i].mem_space); if (dset_info[i].nelmts != H5S_GET_SELECT_NPOINTS(dset_info[i].file_space)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, @@ -640,7 +643,8 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) * Note that in general, this requires us to touch up the memory buffer * as well. */ - if (dset_info[i].nelmts > 0 && TRUE == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && + if (dset_info[i].nelmts > 0 && + TRUE == H5S_SELECT_SHAPE_SAME(dset_info[i].mem_space, dset_info[i].file_space) && H5S_GET_EXTENT_NDIMS(dset_info[i].mem_space) != H5S_GET_EXTENT_NDIMS(dset_info[i].file_space)) { ptrdiff_t buf_adj = 0; @@ -750,8 +754,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) H5AC_tag(dset_info->dset->oloc.addr, &prev_tag); /* Invoke correct "high level" I/O routine */ - if ((*dset_info[i].io_ops.multi_write)( - &io_info, &dset_info[i]) < 0) + if ((*dset_info[i].io_ops.multi_write)(&io_info, &dset_info[i]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") /* Reset metadata tagging */ @@ -834,7 +837,7 @@ H5D__write(size_t count, H5D_dset_io_info_t *dset_info) static herr_t H5D__ioinfo_init(size_t count, H5D_dset_io_info_t *dset_info, H5D_io_info_t *io_info) { - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -845,7 +848,7 @@ H5D__ioinfo_init(size_t count, H5D_dset_io_info_t *dset_info, H5D_io_info_t *io_ HDassert(io_info); /* Set up simple fields */ - io_info->f_sh = count > 0 ? H5F_SHARED(dset_info[0].dset->oloc.file) : NULL; + io_info->f_sh = count > 0 ? H5F_SHARED(dset_info[0].dset->oloc.file) : NULL; io_info->sel_pieces = NULL; io_info->store_faddr = 0; io_info->base_maddr.cvp = NULL; @@ -871,7 +874,8 @@ H5D__ioinfo_init(size_t count, H5D_dset_io_info_t *dset_info, H5D_io_info_t *io_ #ifdef H5_HAVE_PARALLEL /* Determine if the file was opened with an MPI VFD */ - io_info->using_mpi_vfd = count > 0 ? H5F_HAS_FEATURE(dset_info[0].dset->oloc.file, H5FD_FEAT_HAS_MPI) : FALSE; + io_info->using_mpi_vfd = + count > 0 ? H5F_HAS_FEATURE(dset_info[0].dset->oloc.file, H5FD_FEAT_HAS_MPI) : FALSE; #endif /* H5_HAVE_PARALLEL */ done: @@ -1161,7 +1165,9 @@ H5D__ioinfo_adjust(H5D_io_info_t *io_info) * handle collective I/O */ /* Check for selection/vector support in file driver? -NAF */ if (!io_info->use_select_io) { - io_info->md_io_ops.multi_read_md = dset0->shared->layout.ops->par_read; /*!FIXME eliminate par_read/par_write here and just assign H5D__collective_read/write? */ + io_info->md_io_ops.multi_read_md = + dset0->shared->layout.ops->par_read; /*!FIXME eliminate par_read/par_write here and just + assign H5D__collective_read/write? */ io_info->md_io_ops.multi_write_md = dset0->shared->layout.ops->par_write; io_info->md_io_ops.single_read_md = H5D__mpio_select_read; io_info->md_io_ops.single_write_md = H5D__mpio_select_write; diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 33cc460caf3..c1770f2ab9b 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -86,8 +86,7 @@ #define H5D_BT2_MERGE_PERC 40 /* Macro to determine if the layout I/O callback should perform I/O */ -#define H5D_LAYOUT_CB_PERFORM_IO(IO_INFO) \ - (!(io_info)->use_select_io || (io_info)->count == 1) +#define H5D_LAYOUT_CB_PERFORM_IO(IO_INFO) (!(io_info)->use_select_io || (io_info)->count == 1) /****************************/ /* Package Private Typedefs */ @@ -132,12 +131,14 @@ typedef herr_t (*H5D_layout_read_func_t)(struct H5D_io_info_t *io_info, struct H typedef herr_t (*H5D_layout_write_func_t)(struct H5D_io_info_t *io_info, struct H5D_dset_io_info_t *dinfo); typedef herr_t (*H5D_layout_read_md_func_t)(struct H5D_io_info_t *io_info); typedef herr_t (*H5D_layout_write_md_func_t)(struct H5D_io_info_t *io_info); -typedef ssize_t (*H5D_layout_readvv_func_t)(const struct H5D_io_info_t *io_info, const struct H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, +typedef ssize_t (*H5D_layout_readvv_func_t)(const struct H5D_io_info_t *io_info, + const struct H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -typedef ssize_t (*H5D_layout_writevv_func_t)(const struct H5D_io_info_t *io_info, const struct H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, +typedef ssize_t (*H5D_layout_writevv_func_t)(const struct H5D_io_info_t *io_info, + const struct H5D_dset_io_info_t *dset_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], @@ -169,9 +170,9 @@ typedef struct H5D_layout_ops_t { } H5D_layout_ops_t; /* Function pointers for either multiple or single block I/O access */ -typedef herr_t (*H5D_io_single_read_func_t)(const struct H5D_io_info_t *io_info, +typedef herr_t (*H5D_io_single_read_func_t)(const struct H5D_io_info_t *io_info, const struct H5D_dset_io_info_t *dset_info); -typedef herr_t (*H5D_io_single_write_func_t)(const struct H5D_io_info_t *io_info, +typedef herr_t (*H5D_io_single_write_func_t)(const struct H5D_io_info_t *io_info, const struct H5D_dset_io_info_t *dset_info); typedef herr_t (*H5D_io_single_read_md_func_t)(const struct H5D_io_info_t *io_info, hsize_t nelmts, @@ -587,8 +588,8 @@ H5_DLL H5D_t *H5D__open_name(const H5G_loc_t *loc, const char *name, hid_t dapl H5_DLL hid_t H5D__get_space(const H5D_t *dset); H5_DLL hid_t H5D__get_type(const H5D_t *dset); H5_DLL herr_t H5D__get_space_status(const H5D_t *dset, H5D_space_status_t *allocation); -H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, - hbool_t full_overwrite, hsize_t old_dim[]); +H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, + hsize_t old_dim[]); H5_DLL herr_t H5D__get_storage_size(const H5D_t *dset, hsize_t *storage_size); H5_DLL herr_t H5D__get_chunk_storage_size(H5D_t *dset, const hsize_t *offset, hsize_t *storage_size); H5_DLL herr_t H5D__chunk_index_empty(const H5D_t *dset, hbool_t *empty); @@ -663,8 +664,7 @@ H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); H5_DLL hbool_t H5D__chunk_is_data_cached(const H5D_shared_t *shared_dset); H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, const hsize_t *scaled, H5D_chunk_ud_t *udata); H5_DLL herr_t H5D__chunk_allocated(const H5D_t *dset, hsize_t *nbytes); -H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, - const hsize_t old_dim[]); +H5_DLL herr_t H5D__chunk_allocate(const H5D_t *dset, hbool_t full_overwrite, const hsize_t old_dim[]); H5_DLL herr_t H5D__chunk_file_alloc(const H5D_chk_idx_info_t *idx_info, const H5F_block_t *old_chunk, H5F_block_t *new_chunk, hbool_t *need_insert, const hsize_t *scaled); H5_DLL void *H5D__chunk_mem_alloc(size_t size, void *pline); @@ -688,8 +688,8 @@ H5_DLL herr_t H5D__chunk_bh_info(const H5O_loc_t *loc, H5O_t *oh, H5O_layout_t * H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, FILE *stream); H5_DLL herr_t H5D__chunk_delete(H5F_t *f, H5O_t *oh, H5O_storage_t *store); H5_DLL herr_t H5D__chunk_get_offset_copy(const H5D_t *dset, const hsize_t *offset, hsize_t *offset_copy); -H5_DLL herr_t H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, - uint32_t data_size, const void *buf); +H5_DLL herr_t H5D__chunk_direct_write(H5D_t *dset, uint32_t filters, hsize_t *offset, uint32_t data_size, + const void *buf); H5_DLL herr_t H5D__chunk_direct_read(const H5D_t *dset, hsize_t *offset, uint32_t *filters, void *buf); #ifdef H5D_CHUNK_DEBUG H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 4242d3a548f..d3eb438d0f5 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -39,10 +39,10 @@ /********************/ /* Local Prototypes */ /********************/ -static herr_t H5D__scatter_file(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, H5S_sel_iter_t *file_iter, size_t nelmts, - const void *buf); -static size_t H5D__gather_file(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, H5S_sel_iter_t *file_iter, size_t nelmts, - void *buf); +static herr_t H5D__scatter_file(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + H5S_sel_iter_t *file_iter, size_t nelmts, const void *buf); +static size_t H5D__gather_file(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + H5S_sel_iter_t *file_iter, size_t nelmts, void *buf); static herr_t H5D__compound_opt_read(size_t nelmts, H5S_sel_iter_t *iter, const H5D_type_info_t *type_info, void *user_buf /*out*/); static herr_t H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info); @@ -81,7 +81,8 @@ H5FL_SEQ_EXTERN(hsize_t); *------------------------------------------------------------------------- */ static herr_t -H5D__scatter_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_info, H5S_sel_iter_t *iter, size_t nelmts, const void *_buf) +H5D__scatter_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_info, H5S_sel_iter_t *iter, + size_t nelmts, const void *_buf) { H5D_io_info_t tmp_io_info; /* Temporary I/O info object */ H5D_dset_io_info_t *tmp_dset_info = NULL; /* Temporary I/O info object */ @@ -143,8 +144,8 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset mem_off = 0; /* Write sequence list out */ - if ((*tmp_dset_info->layout_ops.writevv)(&tmp_io_info, tmp_dset_info, nseq, &dset_curr_seq, len, off, (size_t)1, - &mem_curr_seq, &mem_len, &mem_off) < 0) + if ((*tmp_dset_info->layout_ops.writevv)(&tmp_io_info, tmp_dset_info, nseq, &dset_curr_seq, len, off, + (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") /* Update buffer */ @@ -188,7 +189,8 @@ H5D__scatter_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset *------------------------------------------------------------------------- */ static size_t -H5D__gather_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_info, H5S_sel_iter_t *iter, size_t nelmts, void *_buf /*out*/) +H5D__gather_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_info, H5S_sel_iter_t *iter, + size_t nelmts, void *_buf /*out*/) { H5D_io_info_t tmp_io_info; /* Temporary I/O info object */ H5D_dset_io_info_t *tmp_dset_info = NULL; /* Temporary I/O info object */ @@ -250,8 +252,8 @@ H5D__gather_file(const H5D_io_info_t *_io_info, const H5D_dset_io_info_t *_dset_ mem_off = 0; /* Read sequence list in */ - if ((*tmp_dset_info->layout_ops.readvv)(&tmp_io_info, tmp_dset_info, nseq, &dset_curr_seq, len, off, (size_t)1, - &mem_curr_seq, &mem_len, &mem_off) < 0) + if ((*tmp_dset_info->layout_ops.readvv)(&tmp_io_info, tmp_dset_info, nseq, &dset_curr_seq, len, off, + (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, 0, "read error") /* Update buffer */ @@ -520,7 +522,8 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ /* * Gather data */ - n = H5D__gather_file(io_info, dset_info, file_iter, smine_nelmts, dset_info->type_info.tconv_buf /*out*/); + n = H5D__gather_file(io_info, dset_info, file_iter, smine_nelmts, + dset_info->type_info.tconv_buf /*out*/); if (n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") @@ -528,7 +531,8 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ * and no conversion is needed, copy the data directly into user's buffer and * bypass the rest of steps. */ - if (dset_info->type_info.cmpd_subset && H5T_SUBSET_FALSE != dset_info->type_info.cmpd_subset->subset) { + if (dset_info->type_info.cmpd_subset && + H5T_SUBSET_FALSE != dset_info->type_info.cmpd_subset->subset) { if (H5D__compound_opt_read(smine_nelmts, mem_iter, &dset_info->type_info, buf /*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ @@ -542,8 +546,9 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ /* * Perform datatype conversion. */ - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, dset_info->type_info.dst_type_id, smine_nelmts, - (size_t)0, (size_t)0, dset_info->type_info.tconv_buf, dset_info->type_info.bkg_buf) < 0) + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, + dset_info->type_info.dst_type_id, smine_nelmts, (size_t)0, (size_t)0, + dset_info->type_info.tconv_buf, dset_info->type_info.bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") /* Do the data transform after the conversion (since we're using type mem_type) */ @@ -554,8 +559,8 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ if (H5CX_get_data_transform(&data_transform) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") - if (H5Z_xform_eval(data_transform, dset_info->type_info.tconv_buf, smine_nelmts, dset_info->type_info.mem_type) < - 0) + if (H5Z_xform_eval(data_transform, dset_info->type_info.tconv_buf, smine_nelmts, + dset_info->type_info.mem_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Error performing data transform") } @@ -676,7 +681,8 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset } /* end if */ else { if (H5T_BKG_YES == dset_info->type_info.need_bkg) { - n = H5D__gather_file(io_info, dset_info, bkg_iter, smine_nelmts, dset_info->type_info.bkg_buf /*out*/); + n = H5D__gather_file(io_info, dset_info, bkg_iter, smine_nelmts, + dset_info->type_info.bkg_buf /*out*/); if (n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") } /* end if */ @@ -690,23 +696,25 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset if (H5CX_get_data_transform(&data_transform) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data transform info") - if (H5Z_xform_eval(data_transform, dset_info->type_info.tconv_buf, smine_nelmts, dset_info->type_info.mem_type) < - 0) + if (H5Z_xform_eval(data_transform, dset_info->type_info.tconv_buf, smine_nelmts, + dset_info->type_info.mem_type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADVALUE, FAIL, "Error performing data transform") } /* * Perform datatype conversion. */ - if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, dset_info->type_info.dst_type_id, smine_nelmts, - (size_t)0, (size_t)0, dset_info->type_info.tconv_buf, dset_info->type_info.bkg_buf) < 0) + if (H5T_convert(dset_info->type_info.tpath, dset_info->type_info.src_type_id, + dset_info->type_info.dst_type_id, smine_nelmts, (size_t)0, (size_t)0, + dset_info->type_info.tconv_buf, dset_info->type_info.bkg_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "datatype conversion failed") } /* end else */ /* * Scatter the data out to the file. */ - if (H5D__scatter_file(io_info, dset_info, file_iter, smine_nelmts, dset_info->type_info.tconv_buf) < 0) + if (H5D__scatter_file(io_info, dset_info, file_iter, smine_nelmts, dset_info->type_info.tconv_buf) < + 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") } /* end for */ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 23f673f0a71..1244dc66151 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -44,7 +44,8 @@ /* Local Prototypes */ /********************/ -static herr_t H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, size_t elmt_size); +static herr_t H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info, + size_t elmt_size); /*********************/ /* Package Variables */ @@ -133,15 +134,15 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info /* Perform I/O on memory and file sequences */ if (io_info->op_type == H5D_IO_OP_READ) { if ((tmp_file_len = (*io_info->dsets_info[0].layout_ops.readvv)( - io_info, dset_info, file_nseq, &curr_file_seq, &single_file_len, &single_file_off, mem_nseq, - &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) + io_info, dset_info, file_nseq, &curr_file_seq, &single_file_len, &single_file_off, + mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { HDassert(io_info->op_type == H5D_IO_OP_WRITE); if ((tmp_file_len = (*io_info->dsets_info[0].layout_ops.writevv)( - io_info, dset_info, file_nseq, &curr_file_seq, &single_file_len, &single_file_off, mem_nseq, - &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) + io_info, dset_info, file_nseq, &curr_file_seq, &single_file_len, &single_file_off, + mem_nseq, &curr_mem_seq, &single_mem_len, &single_mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") } /* end else */ @@ -177,7 +178,8 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate file iterator") /* Initialize file iterator */ - if (H5S_select_iter_init(file_iter, dset_info->file_space, elmt_size, H5S_SEL_ITER_GET_SEQ_LIST_SORTED) < 0) + if (H5S_select_iter_init(file_iter, dset_info->file_space, elmt_size, + H5S_SEL_ITER_GET_SEQ_LIST_SORTED) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator") file_iter_init = 1; /* File selection iteration info has been initialized */ @@ -217,15 +219,15 @@ H5D__select_io(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_info /* Perform I/O on memory and file sequences */ if (io_info->op_type == H5D_IO_OP_READ) { if ((tmp_file_len = (*io_info->dsets_info[0].layout_ops.readvv)( - io_info, dset_info, file_nseq, &curr_file_seq, file_len, file_off, mem_nseq, &curr_mem_seq, - mem_len, mem_off)) < 0) + io_info, dset_info, file_nseq, &curr_file_seq, file_len, file_off, mem_nseq, + &curr_mem_seq, mem_len, mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") } /* end if */ else { HDassert(io_info->op_type == H5D_IO_OP_WRITE); if ((tmp_file_len = (*io_info->dsets_info[0].layout_ops.writevv)( - io_info, dset_info, file_nseq, &curr_file_seq, file_len, file_off, mem_nseq, &curr_mem_seq, - mem_len, mem_off)) < 0) + io_info, dset_info, file_nseq, &curr_file_seq, file_len, file_off, mem_nseq, + &curr_mem_seq, mem_len, mem_off)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") } /* end else */ diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index 58e14f0d086..4a0f45a51a1 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -105,8 +105,10 @@ static herr_t H5D__virtual_init_all(const H5D_t *dset); static herr_t H5D__virtual_pre_io(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_t *storage, H5S_t *file_space, H5S_t *mem_space, hsize_t *tot_nelmts); static herr_t H5D__virtual_post_io(H5O_storage_virtual_t *storage); -static herr_t H5D__virtual_read_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdset_t *source_dset); -static herr_t H5D__virtual_write_one(H5D_dset_io_info_t *dset_info, H5O_storage_virtual_srcdset_t *source_dset); +static herr_t H5D__virtual_read_one(H5D_dset_io_info_t *dset_info, + H5O_storage_virtual_srcdset_t *source_dset); +static herr_t H5D__virtual_write_one(H5D_dset_io_info_t *dset_info, + H5O_storage_virtual_srcdset_t *source_dset); /*********************/ /* Package Variables */ @@ -2834,8 +2836,7 @@ H5D__virtual_read(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) if (storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) { /* Iterate over sub-source dsets */ for (j = storage->list[i].sub_dset_io_start; j < storage->list[i].sub_dset_io_end; j++) - if (H5D__virtual_read_one(dset_info, &storage->list[i].sub_dset[j]) < - 0) + if (H5D__virtual_read_one(dset_info, &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to read source dataset") } /* end if */ else @@ -3048,8 +3049,7 @@ H5D__virtual_write(H5D_io_info_t *io_info, H5D_dset_io_info_t *dset_info) if (storage->list[i].psfn_nsubs || storage->list[i].psdn_nsubs) { /* Iterate over sub-source dsets */ for (j = storage->list[i].sub_dset_io_start; j < storage->list[i].sub_dset_io_end; j++) - if (H5D__virtual_write_one(dset_info, &storage->list[i].sub_dset[j]) < - 0) + if (H5D__virtual_write_one(dset_info, &storage->list[i].sub_dset[j]) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write to source dataset") } /* end if */ else