diff options
-rw-r--r-- | src/H5Dchunk.c | 95 | ||||
-rw-r--r-- | src/H5Dcompact.c | 43 | ||||
-rw-r--r-- | src/H5Dcontig.c | 35 | ||||
-rw-r--r-- | src/H5Dearray.c | 10 | ||||
-rw-r--r-- | src/H5Dint.c | 14 | ||||
-rw-r--r-- | src/H5Dio.c | 6 | ||||
-rw-r--r-- | src/H5Dlayout.c | 4 | ||||
-rw-r--r-- | src/H5Doh.c | 2 | ||||
-rw-r--r-- | src/H5Dpkg.h | 23 | ||||
-rw-r--r-- | src/H5Dprivate.h | 7 | ||||
-rw-r--r-- | src/H5Odtype.c | 1 | ||||
-rw-r--r-- | src/H5Olayout.c | 31 | ||||
-rw-r--r-- | src/H5Opkg.h | 7 | ||||
-rw-r--r-- | src/H5Opline.c | 1 | ||||
-rw-r--r-- | src/H5Osdspace.c | 1 | ||||
-rw-r--r-- | src/H5Pdcpl.c | 21 |
16 files changed, 158 insertions, 143 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 05f1ecc..9a8701f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -191,7 +191,7 @@ H5D_nonexistent_readvv(const H5D_io_info_t *io_info, 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_chunk_set_info_real(H5O_layout_t *layout, unsigned ndims, +static herr_t H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims); static void *H5D_chunk_alloc(size_t size, const H5O_pline_t *pline); static void *H5D_chunk_xfree(void *chk, const H5O_pline_t *pline); @@ -285,8 +285,8 @@ H5FL_DEFINE_STATIC(H5D_chunk_prune_stack_t); * *------------------------------------------------------------------------- */ -herr_t -H5D_chunk_set_info_real(H5O_layout_t *layout, unsigned ndims, const hsize_t *curr_dims) +static herr_t +H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -299,16 +299,16 @@ H5D_chunk_set_info_real(H5O_layout_t *layout, unsigned ndims, const hsize_t *cur HDassert(curr_dims); /* Compute the # of chunks in dataset dimensions */ - for(u = 0, layout->u.chunk.nchunks = 1; u < ndims; u++) { + for(u = 0, layout->nchunks = 1; u < ndims; u++) { /* Round up to the next integer # of chunks, to accomodate partial chunks */ - layout->u.chunk.chunks[u] = ((curr_dims[u] + layout->u.chunk.dim[u]) - 1) / layout->u.chunk.dim[u]; + layout->chunks[u] = ((curr_dims[u] + layout->dim[u]) - 1) / layout->dim[u]; /* Accumulate the # of chunks */ - layout->u.chunk.nchunks *= layout->u.chunk.chunks[u]; + layout->nchunks *= layout->chunks[u]; } /* end for */ /* Get the "down" sizes for each dimension */ - if(H5V_array_down(ndims, layout->u.chunk.chunks, layout->u.chunk.down_chunks) < 0) + if(H5V_array_down(ndims, layout->chunks, layout->down_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute 'down' chunk size value") done: @@ -347,7 +347,7 @@ H5D_chunk_set_info(const H5D_t *dset) H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); /* Set the base layout information */ - if(H5D_chunk_set_info_real(&dset->shared->layout, ndims, curr_dims) < 0) + if(H5D_chunk_set_info_real(&dset->shared->layout.u.chunk, ndims, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") /* Call the index's "resize" callback */ @@ -540,23 +540,23 @@ done: *------------------------------------------------------------------------- */ hbool_t -H5D_chunk_is_space_alloc(const H5O_layout_t *layout) +H5D_chunk_is_space_alloc(const H5O_storage_t *storage) { hbool_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOFUNC(H5D_chunk_is_space_alloc) /* Sanity checks */ - HDassert(layout); - HDassert((H5D_CHUNK_IDX_EARRAY == layout->storage.u.chunk.idx_type && - H5D_COPS_EARRAY == layout->storage.u.chunk.ops) || - (H5D_CHUNK_IDX_FARRAY == layout->storage.u.chunk.idx_type && - H5D_COPS_FARRAY == layout->storage.u.chunk.ops) || - (H5D_CHUNK_IDX_BTREE == layout->storage.u.chunk.idx_type && - H5D_COPS_BTREE == layout->storage.u.chunk.ops)); + HDassert(storage); + HDassert((H5D_CHUNK_IDX_EARRAY == storage->u.chunk.idx_type && + H5D_COPS_EARRAY == storage->u.chunk.ops) || + (H5D_CHUNK_IDX_FARRAY == storage->u.chunk.idx_type && + H5D_COPS_FARRAY == storage->u.chunk.ops) || + (H5D_CHUNK_IDX_BTREE == storage->u.chunk.idx_type && + H5D_COPS_BTREE == storage->u.chunk.ops)); /* Query index layer */ - ret_value = (layout->storage.u.chunk.ops->is_space_alloc)(&layout->storage.u.chunk); + ret_value = (storage->u.chunk.ops->is_space_alloc)(&storage->u.chunk); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_chunk_is_space_alloc() */ @@ -4395,8 +4395,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, - H5O_layout_t *layout_dst, const H5S_extent_t *ds_extent_src, +H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, + H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, + H5O_layout_chunk_t *layout_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id) { @@ -4425,21 +4426,23 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, /* Check args */ HDassert(f_src); + HDassert(layout_src); + HDassert(storage_src); + HDassert((H5D_CHUNK_IDX_EARRAY == storage_src->idx_type && + H5D_COPS_EARRAY == storage_src->ops) || + (H5D_CHUNK_IDX_FARRAY == storage_src->idx_type && + H5D_COPS_FARRAY == storage_src->ops) || + (H5D_CHUNK_IDX_BTREE == storage_src->idx_type && + H5D_COPS_BTREE == storage_src->ops)); HDassert(f_dst); - HDassert(layout_src && H5D_CHUNKED == layout_src->type); - HDassert((H5D_CHUNK_IDX_EARRAY == layout_src->storage.u.chunk.idx_type && - H5D_COPS_EARRAY == layout_src->storage.u.chunk.ops) || - (H5D_CHUNK_IDX_FARRAY == layout_src->storage.u.chunk.idx_type && - H5D_COPS_FARRAY == layout_src->storage.u.chunk.ops) || - (H5D_CHUNK_IDX_BTREE == layout_src->storage.u.chunk.idx_type && - H5D_COPS_BTREE == layout_src->storage.u.chunk.ops)); - HDassert(layout_dst && H5D_CHUNKED == layout_dst->type); - HDassert((H5D_CHUNK_IDX_EARRAY == layout_dst->storage.u.chunk.idx_type && - H5D_COPS_EARRAY == layout_dst->storage.u.chunk.ops) || - (H5D_CHUNK_IDX_FARRAY == layout_dst->storage.u.chunk.idx_type && - H5D_COPS_FARRAY == layout_dst->storage.u.chunk.ops) || - (H5D_CHUNK_IDX_BTREE == layout_dst->storage.u.chunk.idx_type && - H5D_COPS_BTREE == layout_dst->storage.u.chunk.ops)); + HDassert(layout_dst); + HDassert(storage_dst); + HDassert((H5D_CHUNK_IDX_EARRAY == storage_dst->idx_type && + H5D_COPS_EARRAY == storage_dst->ops) || + (H5D_CHUNK_IDX_FARRAY == storage_dst->idx_type && + H5D_COPS_FARRAY == storage_dst->ops) || + (H5D_CHUNK_IDX_BTREE == storage_dst->idx_type && + H5D_COPS_BTREE == storage_dst->ops)); HDassert(ds_extent_src); HDassert(dt_src); @@ -4452,7 +4455,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, pline = pline_src; /* Layout is not created in the destination file, reset index address */ - if(H5D_chunk_idx_reset(&layout_dst->storage.u.chunk, TRUE) < 0) + if(H5D_chunk_idx_reset(storage_dst, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to reset chunked storage index in dest") /* Initialize layout information */ @@ -4479,17 +4482,17 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, idx_info_src.f = f_src; idx_info_src.dxpl_id = dxpl_id; idx_info_src.pline = pline; - idx_info_src.layout = &layout_src->u.chunk; - idx_info_src.storage = &layout_src->storage.u.chunk; + idx_info_src.layout = layout_src; + idx_info_src.storage = storage_src; idx_info_dst.f = f_dst; idx_info_dst.dxpl_id = dxpl_id; idx_info_dst.pline = pline; /* Use same I/O filter pipeline for dest. */ - idx_info_dst.layout = &layout_dst->u.chunk; - idx_info_dst.storage = &layout_dst->storage.u.chunk; + idx_info_dst.layout = layout_dst; + idx_info_dst.storage = storage_dst; /* Call the index-specific "copy setup" routine */ - if((layout_src->storage.u.chunk.ops->copy_setup)(&idx_info_src, &idx_info_dst) < 0) + if((storage_src->ops->copy_setup)(&idx_info_src, &idx_info_dst) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up index-specific chunk copying information") copy_setup_done = TRUE; @@ -4539,8 +4542,8 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, /* Compute the number of elements per chunk */ nelmts = 1; - for(u = 0; u < (layout_src->u.chunk.ndims - 1); u++) - nelmts *= layout_src->u.chunk.dim[u]; + for(u = 0; u < (layout_src->ndims - 1); u++) + nelmts *= layout_src->dim[u]; /* Create the space and set the initial extent */ buf_dim = nelmts; @@ -4570,7 +4573,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, do_convert = TRUE; } /* end if */ - H5_ASSIGN_OVERFLOW(buf_size, layout_src->u.chunk.size, uint32_t, size_t); + H5_ASSIGN_OVERFLOW(buf_size, layout_src->size, uint32_t, size_t); reclaim_buf_size = 0; } /* end else */ @@ -4593,8 +4596,8 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, /* Initialize the callback structure for the source */ HDmemset(&udata, 0, sizeof udata); - udata.common.layout = &layout_src->u.chunk; - udata.common.storage = &layout_src->storage.u.chunk; + udata.common.layout = layout_src; + udata.common.storage = storage_src; udata.file_src = f_src; udata.idx_info_dst = &idx_info_dst; udata.buf = buf; @@ -4615,7 +4618,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, udata.cpy_info = cpy_info; /* Iterate over chunks to copy data */ - if((layout_src->storage.u.chunk.ops->iterate)(&idx_info_src, H5D_chunk_copy_cb, &udata) < 0) + if((storage_src->ops->iterate)(&idx_info_src, H5D_chunk_copy_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to copy data") /* I/O buffers may have been re-allocated */ @@ -4643,7 +4646,7 @@ done: /* Clean up any index information */ if(copy_setup_done) - if((layout_src->storage.u.chunk.ops->copy_shutdown)(&layout_src->storage.u.chunk, &layout_dst->storage.u.chunk, dxpl_id) < 0) + if((storage_src->ops->copy_shutdown)(storage_src, storage_dst, dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to shut down index copying info") FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index ae6a72e..831ab13 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -38,6 +38,7 @@ #include "H5FDprivate.h" /* File drivers */ #include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Oprivate.h" /* Object headers */ #include "H5Vprivate.h" /* Vector and array functions */ @@ -58,7 +59,7 @@ /* Layout operation callbacks */ static herr_t H5D_compact_construct(H5F_t *f, H5D_t *dset); -static hbool_t H5D_compact_is_space_alloc(const H5O_layout_t *layout); +static hbool_t H5D_compact_is_space_alloc(const H5O_storage_t *storage); static herr_t H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); @@ -213,12 +214,12 @@ done: *------------------------------------------------------------------------- */ static hbool_t -H5D_compact_is_space_alloc(const H5O_layout_t UNUSED *layout) +H5D_compact_is_space_alloc(const H5O_storage_t UNUSED *storage) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_compact_is_space_alloc) /* Sanity checks */ - HDassert(layout); + HDassert(storage); /* Compact storage is currently always allocated */ FUNC_LEAVE_NOAPI(TRUE) @@ -380,8 +381,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, - H5O_layout_t *layout_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, hid_t dxpl_id) +H5D_compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, + H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, + hid_t dxpl_id) { hid_t tid_src = -1; /* Datatype ID for source datatype */ hid_t tid_dst = -1; /* Datatype ID for destination datatype */ @@ -395,15 +397,19 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, FUNC_ENTER_NOAPI(H5D_compact_copy, FAIL) /* Check args */ - HDassert(layout_src && H5D_COMPACT == layout_src->type); HDassert(f_src); + HDassert(storage_src); HDassert(f_dst); - HDassert(layout_dst && H5D_COMPACT == layout_dst->type); + HDassert(storage_dst); HDassert(dt_src); + /* Allocate space for destination data */ + if(NULL == (storage_dst->buf = H5MM_malloc(storage_src->size))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "unable to allocate memory for compact dataset") + /* Create datatype ID for src datatype, so it gets freed */ if((tid_src = H5I_register(H5I_DATATYPE, dt_src, FALSE)) < 0) - HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register source file datatype") + HGOTO_ERROR(H5E_DATASET, H5E_CANTREGISTER, FAIL, "unable to register source file datatype") /* If there's a VLEN source datatype, do type conversion information */ if(H5T_detect_class(dt_src, H5T_VLEN) > 0) { @@ -449,7 +455,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, max_dt_size = MAX(max_dt_size, tmp_dt_size); /* Set number of whole elements that fit in buffer */ - if(0 == (nelmts = layout_src->storage.u.compact.size / src_dt_size)) + if(0 == (nelmts = storage_src->size / src_dt_size)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "element size too large") /* Set up number of bytes to copy, and initial buffer size */ @@ -476,7 +482,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, if(NULL == (buf = H5FL_BLK_MALLOC(type_conv, buf_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") - HDmemcpy(buf, layout_src->storage.u.compact.buf, layout_src->storage.u.compact.size); + HDmemcpy(buf, storage_src->buf, storage_src->size); /* Convert from source file to memory */ if(H5T_convert(tpath_src_mem, tid_src, tid_mem, nelmts, (size_t)0, (size_t)0, buf, NULL, dxpl_id) < 0) @@ -492,7 +498,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, if(H5T_convert(tpath_mem_dst, tid_mem, tid_dst, nelmts, (size_t)0, (size_t)0, buf, bkg, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "datatype conversion failed") - HDmemcpy(layout_dst->storage.u.compact.buf, buf, layout_dst->storage.u.compact.size); + HDmemcpy(storage_dst->buf, buf, storage_dst->size); if(H5D_vlen_reclaim(tid_mem, buf_space, H5P_DATASET_XFER_DEFAULT, reclaim_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to reclaim variable-length data") @@ -504,24 +510,27 @@ H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, H5F_t *f_dst, size_t ref_count; /* Determine # of reference elements to copy */ - ref_count = layout_src->storage.u.compact.size / H5T_get_size(dt_src); + ref_count = storage_src->size / H5T_get_size(dt_src); /* Copy objects referenced in source buffer to destination file and set destination elements */ - if(H5O_copy_expand_ref(f_src, layout_src->storage.u.compact.buf, dxpl_id, f_dst, - layout_dst->storage.u.compact.buf, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) + if(H5O_copy_expand_ref(f_src, storage_src->buf, dxpl_id, f_dst, + storage_dst->buf, ref_count, H5T_get_ref_type(dt_src), cpy_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "unable to copy reference attribute") } /* end if */ else /* Reset value to zero */ - HDmemset(layout_dst->storage.u.compact.buf, 0, layout_src->storage.u.compact.size); + HDmemset(storage_dst->buf, 0, storage_src->size); } /* end if */ else /* Type conversion not necessary */ - HDmemcpy(layout_dst->storage.u.compact.buf, layout_src->storage.u.compact.buf, layout_src->storage.u.compact.size); + HDmemcpy(storage_dst->buf, storage_src->buf, storage_src->size); } /* end if */ else /* Type conversion not necessary */ - HDmemcpy(layout_dst->storage.u.compact.buf, layout_src->storage.u.compact.buf, layout_src->storage.u.compact.size); + HDmemcpy(storage_dst->buf, storage_src->buf, storage_src->size); + + /* Mark destination buffer as dirty */ + storage_dst->dirty = TRUE; done: if(buf_sid > 0 && H5I_dec_ref(buf_sid, FALSE) < 0) diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 62b63a5..712b17c 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -62,7 +62,6 @@ /* Layout operation callbacks */ static herr_t H5D_contig_construct(H5F_t *f, H5D_t *dset); -static hbool_t H5D_contig_is_space_alloc(const H5O_layout_t *layout); static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); @@ -121,7 +120,7 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ ) +H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ ) { herr_t ret_value = SUCCEED; /* Return value */ @@ -129,10 +128,10 @@ H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ ) /* check args */ HDassert(f); - HDassert(layout); + HDassert(storage); /* Allocate space for the contiguous data */ - if(HADDR_UNDEF == (layout->storage.u.contig.addr = H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, layout->storage.u.contig.size))) + if(HADDR_UNDEF == (storage->addr = H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, storage->size))) HGOTO_ERROR(H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space") done: @@ -445,18 +444,18 @@ done: * *------------------------------------------------------------------------- */ -static hbool_t -H5D_contig_is_space_alloc(const H5O_layout_t *layout) +hbool_t +H5D_contig_is_space_alloc(const H5O_storage_t *storage) { hbool_t ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_contig_is_space_alloc) /* Sanity checks */ - HDassert(layout); + HDassert(storage); /* Set return value */ - ret_value = (hbool_t)H5F_addr_defined(layout->storage.u.contig.addr); + ret_value = (hbool_t)H5F_addr_defined(storage->u.contig.addr); FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_contig_is_space_alloc() */ @@ -1215,14 +1214,12 @@ done: * Programmer: Quincey Koziol * Monday, November 21, 2005 * - * Modifier: Peter Cao - * Saturday, January 07, 2006 - * Add case to deal with compressed variable length datasets *------------------------------------------------------------------------- */ herr_t -H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, - H5O_layout_t *layout_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, hid_t dxpl_id) +H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, + H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *dt_src, + H5O_copy_t *cpy_info, hid_t dxpl_id) { haddr_t addr_src; /* File offset in source dataset */ haddr_t addr_dst; /* File offset in destination dataset */ @@ -1256,18 +1253,18 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, /* Check args */ HDassert(f_src); - HDassert(layout_src && H5D_CONTIGUOUS == layout_src->type); + HDassert(storage_src); HDassert(f_dst); - HDassert(layout_dst && H5D_CONTIGUOUS == layout_dst->type); + HDassert(storage_dst); HDassert(dt_src); /* Allocate space for destination raw data */ - if(H5D_contig_alloc(f_dst, dxpl_id, layout_dst) < 0) + if(H5D_contig_alloc(f_dst, dxpl_id, storage_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to allocate contiguous storage") /* Set up number of bytes to copy, and initial buffer size */ /* (actually use the destination size, which has been fixed up, if necessary) */ - total_src_nbytes = layout_dst->storage.u.contig.size; + total_src_nbytes = storage_dst->size; H5_CHECK_OVERFLOW(total_src_nbytes, hsize_t, size_t); buf_size = MIN(H5D_TEMP_BUF_SIZE, (size_t)total_src_nbytes); @@ -1365,8 +1362,8 @@ H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, } /* end if */ /* Loop over copying data */ - addr_src = layout_src->storage.u.contig.addr; - addr_dst = layout_dst->storage.u.contig.addr; + addr_src = storage_src->addr; + addr_dst = storage_dst->addr; while(total_src_nbytes > 0) { /* Check if we should reduce the number of bytes to transfer */ if(total_src_nbytes < src_nbytes) { diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 9dddf12..b8cb580 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -132,7 +132,7 @@ static herr_t H5D_earray_idx_support(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata, H5AC_info_t *child_entry); static herr_t H5D_earray_idx_unsupport(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata, H5AC_info_t *child_entry); -static herr_t H5D_earray_idx_dump(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D_earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); static herr_t H5D_earray_idx_dest(const H5D_chk_idx_info_t *idx_info); @@ -1889,17 +1889,15 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_earray_idx_dump(const H5D_chk_idx_info_t *idx_info, FILE *stream) +H5D_earray_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_earray_idx_dump) /* Check args */ - HDassert(idx_info); - HDassert(idx_info->f); - HDassert(idx_info->storage); + HDassert(storage); HDassert(stream); - HDfprintf(stream, " Address: %a\n", idx_info->storage->idx_addr); + HDfprintf(stream, " Address: %a\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5D_earray_idx_dump() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index faaeb80..6709628 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -1303,7 +1303,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) * be fully allocated before I/O can happen. */ if((H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR) - && !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout) + && !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) && IS_H5FD_MPI(dataset->oloc.file)) { if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage") @@ -1584,9 +1584,9 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al switch(layout->type) { case H5D_CONTIGUOUS: - if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout)) { + if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Reserve space in the file for the entire array */ - if(H5D_contig_alloc(f, dxpl_id, layout/*out*/) < 0) + if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") /* Indicate that we set the storage addr */ @@ -1598,7 +1598,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al break; case H5D_CHUNKED: - if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout)) { + if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Create the root of the B-tree that describes chunked storage */ if(H5D_chunk_create(dset /*in,out*/, dxpl_id) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") @@ -1777,7 +1777,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) switch(dset->shared->layout.type) { case H5D_CHUNKED: - if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout)) { + if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { if(H5D_chunk_allocated(dset, dxpl_id, &ret_value) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve chunked dataset allocated size") } /* end if */ @@ -1787,7 +1787,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) case H5D_CONTIGUOUS: /* Datasets which are not allocated yet are using no space on disk */ - if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout)) + if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) ret_value = dset->shared->layout.storage.u.contig.size; else ret_value = 0; @@ -2168,7 +2168,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) *------------------------------------------------------------------------- */ if(shrink && H5D_CHUNKED == dset->shared->layout.type && - (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout)) { + (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Remove excess chunks */ if(H5D_chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks ") diff --git a/src/H5Dio.c b/src/H5Dio.c index cc75981..463c56e 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -350,7 +350,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, * has been overwritten. So just proceed in reading. */ if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 && - !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout)) { + !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage)) { H5D_fill_value_t fill_status; /* Whether/How the fill value is defined */ /* Retrieve dataset's fill-value properties */ @@ -384,7 +384,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Sanity check that space is allocated, if there are elements */ if(nelmts > 0) - HDassert((*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout) + HDassert((*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) || dataset->shared->dcpl_cache.efl.nused > 0 || dataset->shared->layout.type == H5D_COMPACT); @@ -534,7 +534,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Allocate data space and initialize it if it hasn't been. */ if(nelmts > 0 && dataset->shared->dcpl_cache.efl.nused == 0 && - !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout)) { + !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage)) { hssize_t file_nelmts; /* Number of elements in file dataset's dataspace */ hbool_t full_overwrite; /* Whether we are over-writing all the elements */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 853f902..7f2fe1f 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -301,6 +301,8 @@ H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space) if(1 == unlim_count) { /* Set the chunk index type to an extensible array */ layout->u.chunk.idx_type = H5D_CHUNK_IDX_EARRAY; + layout->storage.u.chunk.idx_type = H5D_CHUNK_IDX_EARRAY; + layout->storage.u.chunk.ops = H5D_COPS_EARRAY;; /* Set the extensible array creation parameters */ /* (use hard-coded defaults for now, until we give applications @@ -316,6 +318,8 @@ H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space) else if(layout->type == H5D_CHUNKED && fixed) { /* Set the chunk index type to a fixed array */ layout->u.chunk.idx_type = H5D_CHUNK_IDX_FARRAY; + layout->storage.u.chunk.idx_type = H5D_CHUNK_IDX_FARRAY; + layout->storage.u.chunk.ops = H5D_COPS_FARRAY;; /* Set the fixed array creation parameters */ /* (use hard-coded defaults for now, until we give applications diff --git a/src/H5Doh.c b/src/H5Doh.c index 93fd21a..d2649f7 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -376,7 +376,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't find layout message") /* Check for chunked dataset storage */ - if(layout.type == H5D_CHUNKED && H5D_chunk_is_space_alloc(&layout)) { + if(layout.type == H5D_CHUNKED && H5D_chunk_is_space_alloc(&layout.storage)) { H5O_pline_t pline; /* I/O pipeline message */ htri_t exists; /* Flag if header message of interest exists */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 67d6cd8..b1deb96 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -113,7 +113,7 @@ struct H5D_chunk_map_t; typedef herr_t (*H5D_layout_construct_func_t)(H5F_t *f, H5D_t *dset); typedef herr_t (*H5D_layout_init_func_t)(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); -typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_layout_t *layout); +typedef hbool_t (*H5D_layout_is_space_alloc_func_t)(const H5O_storage_t *storage); typedef herr_t (*H5D_layout_io_init_func_t)(const struct H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, @@ -604,7 +604,9 @@ H5_DLL herr_t H5D_layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_flags); /* Functions that operate on contiguous storage */ -H5_DLL herr_t H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout); +H5_DLL herr_t H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, + H5O_storage_contig_t *storage); +H5_DLL hbool_t H5D_contig_is_space_alloc(const H5O_storage_t *storage); H5_DLL herr_t H5D_contig_fill(H5D_t *dset, hid_t dxpl_id); H5_DLL haddr_t H5D_contig_get_addr(const H5D_t *dset); H5_DLL herr_t H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, @@ -619,8 +621,9 @@ H5_DLL ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info, H5_DLL ssize_t H5D_contig_writevv(const H5D_io_info_t *io_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[]); -H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_layout_t *layout_src, H5F_t *f_dst, - H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); +H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, + H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, + H5O_copy_t *cpy_info, hid_t dxpl_id); /* Functions that operate on chunked dataset storage */ H5_DLL htri_t H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, @@ -630,7 +633,7 @@ H5_DLL herr_t H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); H5_DLL herr_t H5D_chunk_set_info(const H5D_t *dset); H5_DLL herr_t H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); -H5_DLL hbool_t H5D_chunk_is_space_alloc(const H5O_layout_t *layout); +H5_DLL hbool_t H5D_chunk_is_space_alloc(const H5O_storage_t *storage); H5_DLL herr_t H5D_chunk_get_info(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, H5D_chunk_ud_t *udata); H5_DLL void *H5D_chunk_lock(const H5D_io_info_t *io_info, @@ -648,8 +651,9 @@ H5_DLL herr_t H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, H5_DLL herr_t H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]); #endif /* H5_HAVE_PARALLEL */ H5_DLL herr_t H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id); -H5_DLL herr_t H5D_chunk_copy(H5F_t *f_src, H5O_layout_t *layout_src, - H5F_t *f_dst, H5O_layout_t *layout_dst, const H5S_extent_t *ds_extent_src, +H5_DLL herr_t H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, + H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, + H5O_layout_chunk_t *layout_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id); H5_DLL herr_t H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, @@ -662,8 +666,9 @@ H5_DLL herr_t H5D_chunk_stats(const H5D_t *dset, hbool_t headers); /* Functions that operate on compact dataset storage */ H5_DLL herr_t H5D_compact_fill(H5D_t *dset, hid_t dxpl_id); -H5_DLL herr_t H5D_compact_copy(H5F_t *f_src, H5O_layout_t *layout_src, - H5F_t *f_dst, H5O_layout_t *layout_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); +H5_DLL herr_t H5D_compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, + H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *src_dtype, + H5O_copy_t *cpy_info, hid_t dxpl_id); /* Functions that perform fill value operations on datasets */ H5_DLL herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 277b87a..4c6ed79 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -139,6 +139,13 @@ typedef struct H5D_dcpl_cache_t { H5O_efl_t efl; /* External file list info (H5D_CRT_EXT_FILE_LIST_NAME) */ } H5D_dcpl_cache_t; +/* Callback information for copying dataset */ +typedef struct H5D_copy_file_ud_t { + struct H5S_extent_t *src_space_extent; /* Copy of dataspace extent for dataset */ + H5T_t *src_dtype; /* Copy of datatype for dataset */ + H5O_pline_t *src_pline; /* Copy of filter pipeline for dataet */ +} H5D_copy_file_ud_t; + /*****************************/ /* Library Private Variables */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 63b2aaf..83dbabc 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -17,6 +17,7 @@ #define H5T_PACKAGE /*prevent warning from including H5Tpkg */ #include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Fprivate.h" /* Files */ #include "H5FLprivate.h" /* Free Lists */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index c95a3e9..daec063 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -537,7 +537,7 @@ H5O_layout_copy(const void *_mesg, void *_dest) /* check args */ HDassert(mesg); if(!dest && NULL == (dest = H5FL_MALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "memory allocation failed") /* copy */ *dest = *mesg; @@ -546,7 +546,7 @@ H5O_layout_copy(const void *_mesg, void *_dest) if(mesg->type == H5D_COMPACT && mesg->storage.u.compact.size > 0) { /* Allocate memory for the raw data */ if(NULL == (dest->storage.u.compact.buf = H5MM_malloc(dest->storage.u.compact.size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") + HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") /* Copy over the raw data */ HDmemcpy(dest->storage.u.compact.buf, mesg->storage.u.compact.buf, dest->storage.u.compact.size); @@ -754,23 +754,18 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, /* Allocate space for the destination layout */ if(NULL == (layout_dst = H5FL_MALLOC(H5O_layout_t))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") + HGOTO_ERROR(H5E_OHDR, H5E_CANTALLOC, NULL, "memory allocation failed") /* Copy the "top level" information */ - HDmemcpy(layout_dst, layout_src, sizeof(H5O_layout_t)); + *layout_dst = *layout_src; /* Copy the layout type specific information */ switch(layout_src->type) { case H5D_COMPACT: if(layout_src->storage.u.compact.buf) { - if(NULL == (layout_dst->storage.u.compact.buf = H5MM_malloc(layout_src->storage.u.compact.size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for compact dataset") - /* copy compact raw data */ - if(H5D_compact_copy(file_src, layout_src, file_dst, layout_dst, udata->src_dtype, cpy_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to copy chunked storage") - - layout_dst->storage.u.compact.dirty = TRUE; + if(H5D_compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") } /* end if */ break; @@ -783,18 +778,18 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, layout_dst->storage.u.contig.size = H5S_extent_nelem(udata->src_space_extent) * H5T_get_size(udata->src_dtype); - if(H5F_addr_defined(layout_src->storage.u.contig.addr)) { - /* create contig layout */ - if(H5D_contig_copy(file_src, layout_src, file_dst, layout_dst, udata->src_dtype, cpy_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to copy contiguous storage") + if(H5D_contig_is_space_alloc(&layout_src->storage)) { + /* copy contiguous raw data */ + if(H5D_contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage") } /* end if */ break; case H5D_CHUNKED: - if(H5D_chunk_is_space_alloc(layout_src)) { + if(H5D_chunk_is_space_alloc(&layout_src->storage)) { /* Create chunked layout */ - if(H5D_chunk_copy(file_src, layout_src, file_dst, layout_dst, udata->src_space_extent, udata->src_dtype, udata->src_pline, cpy_info, dxpl_id) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to copy chunked storage") + if(H5D_chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, &layout_dst->u.chunk, udata->src_space_extent, udata->src_dtype, udata->src_pline, cpy_info, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") } /* end if */ break; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index 8569119..c2e58dd 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -310,13 +310,6 @@ struct H5O_t { H5O_chunk_t *chunk; /*array of chunks */ }; -/* Callback information for copying dataset */ -typedef struct H5D_copy_file_ud_t { - struct H5S_extent_t *src_space_extent; /* Copy of dataspace extent for dataset */ - H5T_t *src_dtype; /* Copy of datatype for dataset */ - H5O_pline_t *src_pline; /* Copy of filter pipeline for dataet */ -} H5D_copy_file_ud_t; - /* Class for types of objects in file */ typedef struct H5O_obj_class_t { H5O_type_t type; /*object type on disk */ diff --git a/src/H5Opline.c b/src/H5Opline.c index 070ab87..cc00996 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -24,6 +24,7 @@ #define H5Z_PACKAGE /*suppress error about including H5Zpkg */ #include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free Lists */ #include "H5MMprivate.h" /* Memory management */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 23af101..d7dccbd 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -17,6 +17,7 @@ #define H5S_PACKAGE /*prevent warning from including H5Spkg.h */ #include "H5private.h" /* Generic Functions */ +#include "H5Dprivate.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Gprivate.h" /* Groups */ diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 84ca255..fb4578f 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -27,6 +27,7 @@ /****************/ /* Module Setup */ /****************/ +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ #define H5P_PACKAGE /*suppress error about including H5Ppkg */ #define H5Z_PACKAGE /*suppress error about including H5Zpkg */ @@ -35,7 +36,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5Dprivate.h" /* Datasets */ +#include "H5Dpkg.h" /* Datasets */ #include "H5Eprivate.h" /* Error handling */ #include "H5Iprivate.h" /* IDs */ #include "H5MMprivate.h" /* Memory management */ @@ -51,24 +52,24 @@ /* Define default layout information */ #define H5D_DEF_STORAGE_COMPACT_INIT {(hbool_t)FALSE, (size_t)0, NULL} #define H5D_DEF_STORAGE_CONTIG_INIT {HADDR_UNDEF, (hsize_t)0} -#define H5D_DEF_STORAGE_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, HADDR_UNDEF, NULL, {{NULL}}} -#define H5D_DEF_LAYOUT_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, (unsigned)1, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {{(uint8_t)0}}, {{NULL}}} +#define H5D_DEF_STORAGE_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, HADDR_UNDEF, H5D_COPS_BTREE, {{NULL}}} +#define H5D_DEF_LAYOUT_CHUNK_INIT {H5D_CHUNK_IDX_BTREE, (unsigned)1, {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}, (unsigned)0, (uint32_t)0, (hsize_t)0, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, {{{(uint8_t)0}}}} #ifdef H5_HAVE_C99_DESIGNATED_INITIALIZER #define H5D_DEF_STORAGE_COMPACT {H5D_COMPACT, { .compact = H5D_DEF_STORAGE_COMPACT_INIT }} #define H5D_DEF_STORAGE_CONTIG {H5D_CONTIGUOUS, { .contig = H5D_DEF_STORAGE_CONTIG_INIT }} #define H5D_DEF_STORAGE_CHUNK {H5D_CHUNKED, { .chunk = H5D_DEF_STORAGE_CHUNK_INIT }} -#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CHUNK_INIT}, H5D_DEF_STORAGE_COMPACT} -#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CHUNK_INIT}, H5D_DEF_STORAGE_CONTIG} -#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CHUNK_INIT}, H5D_DEF_STORAGE_CHUNK} +#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, H5D_LOPS_COMPACT, {H5D_DEF_LAYOUT_CHUNK_INIT}, H5D_DEF_STORAGE_COMPACT} +#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, H5D_LOPS_CONTIG, {H5D_DEF_LAYOUT_CHUNK_INIT}, H5D_DEF_STORAGE_CONTIG} +#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, H5D_LOPS_CHUNK, {H5D_DEF_LAYOUT_CHUNK_INIT}, H5D_DEF_STORAGE_CHUNK} #else /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ /* Note that the compact & chunked layout initialization values are using the * contiguous layout initialization in the union, because the contiguous * layout is first in the union. These values are overridden in the * H5P_init_def_layout() routine. -QAK */ -#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CHUNK_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} -#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CHUNK_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} -#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, NULL, {H5D_DEF_LAYOUT_CHUNK_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} +#define H5D_DEF_LAYOUT_COMPACT {H5D_COMPACT, H5O_LAYOUT_VERSION_3, H5D_LOPS_COMPACT, {H5D_DEF_LAYOUT_CHUNK_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} +#define H5D_DEF_LAYOUT_CONTIG {H5D_CONTIGUOUS, H5O_LAYOUT_VERSION_3, H5D_LOPS_CONTIG, {H5D_DEF_LAYOUT_CHUNK_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} +#define H5D_DEF_LAYOUT_CHUNK {H5D_CHUNKED, H5O_LAYOUT_VERSION_3, H5D_LOPS_CHUNK, {H5D_DEF_LAYOUT_CHUNK_INIT}, {H5D_CONTIGUOUS, H5D_DEF_STORAGE_CONTIG}} #endif /* H5_HAVE_C99_DESIGNATED_INITIALIZER */ /* ======== Dataset creation properties ======== */ @@ -782,7 +783,7 @@ H5P_init_def_layout(void) H5D_def_layout_compact_g.u.compact = def_layout_compact; H5D_def_layout_compact_g.storage.u.compact = def_store_compact; H5D_def_layout_chunk_g.u.chunk = def_chunk; - H5D_def_layout_compact_g.storage.u.chunk = def_store_chunk; + H5D_def_layout_chunk_g.storage.u.chunk = def_store_chunk; /* Note that we've initialized the default values */ H5P_dcrt_def_layout_init_g = TRUE; |