summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-11-24 15:56:09 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-11-24 15:56:09 (GMT)
commit8205a888cb60bfa0e62b632ca3f8a828248146f4 (patch)
tree50019c4553013143ac8bf7241f43eca651bd765e /src
parent1b8033b5946e43613c98f40fb23282bdc4b49d0a (diff)
downloadhdf5-8205a888cb60bfa0e62b632ca3f8a828248146f4.zip
hdf5-8205a888cb60bfa0e62b632ca3f8a828248146f4.tar.gz
hdf5-8205a888cb60bfa0e62b632ca3f8a828248146f4.tar.bz2
[svn-r19840] Description:
Check in Vailin's "implicit" chunk indexing code. Tested on: Mac OS X/32 10.6.5 (amazon) w/debug & production (further testing upcoming shortly)
Diffstat (limited to 'src')
-rw-r--r--src/H5Dchunk.c76
-rw-r--r--src/H5Dint.c4
-rw-r--r--src/H5Dlayout.c64
-rw-r--r--src/H5Dnone.c551
-rw-r--r--src/H5Dpkg.h5
-rw-r--r--src/H5Dpublic.h7
-rw-r--r--src/H5Olayout.c11
-rw-r--r--src/H5Ostorage.c24
-rwxr-xr-xsrc/Makefile.am2
-rw-r--r--src/Makefile.in50
10 files changed, 717 insertions, 77 deletions
diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c
index c0ce03d..17775bb 100644
--- a/src/H5Dchunk.c
+++ b/src/H5Dchunk.c
@@ -493,7 +493,9 @@ H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id)
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
if(NULL == (dapl = (H5P_genplist_t *)H5I_object(dapl_id)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for fapl ID");
@@ -574,7 +576,9 @@ H5D_chunk_is_space_alloc(const H5O_storage_t *storage)
(H5D_CHUNK_IDX_BT2 == storage->u.chunk.idx_type &&
H5D_COPS_BT2 == storage->u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == storage->u.chunk.idx_type &&
- H5D_COPS_BTREE == storage->u.chunk.ops));
+ H5D_COPS_BTREE == storage->u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == storage->u.chunk.idx_type &&
+ H5D_COPS_NONE == storage->u.chunk.ops));
/* Query index layer */
ret_value = (storage->u.chunk.ops->is_space_alloc)(&storage->u.chunk);
@@ -2070,7 +2074,9 @@ H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
(H5D_CHUNK_IDX_BT2 == storage->idx_type &&
H5D_COPS_BT2 == storage->ops) ||
(H5D_CHUNK_IDX_BTREE == storage->idx_type &&
- H5D_COPS_BTREE == storage->ops));
+ H5D_COPS_BTREE == storage->ops) ||
+ (H5D_CHUNK_IDX_NONE == storage->idx_type &&
+ H5D_COPS_NONE == storage->ops));
/* Reset index structures */
if((storage->ops->reset)(storage, reset_addr) < 0)
@@ -2231,7 +2237,9 @@ H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id)
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
#ifndef NDEBUG
{
unsigned u; /* Local index variable */
@@ -2290,7 +2298,9 @@ H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset,
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
HDassert(chunk_offset);
HDassert(udata);
@@ -2386,7 +2396,9 @@ H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
HDassert(dxpl_cache);
HDassert(ent);
HDassert(!ent->locked);
@@ -3320,7 +3332,9 @@ H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes)
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
/* Fill the DXPL cache values for later use */
if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
@@ -3421,7 +3435,9 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
(H5D_CHUNK_IDX_BT2 == layout->storage.u.chunk.idx_type &&
H5D_COPS_BT2 == layout->storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == layout->storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == layout->storage.u.chunk.ops));
+ H5D_COPS_BTREE == layout->storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == layout->storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == layout->storage.u.chunk.ops));
HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER));
/* Retrieve the dataset dimensions */
@@ -3637,7 +3653,8 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite,
&udata) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address")
- HDassert(!H5F_addr_defined(udata.addr));
+ if(H5D_CHUNK_IDX_NONE != layout->storage.u.chunk.idx_type)
+ HDassert(!H5F_addr_defined(udata.addr));
} /* end block */
/* Make sure the chunk is really in the dataset and outside the
@@ -3871,7 +3888,9 @@ H5D_chunk_update_old_edge_chunks(H5D_t *dset, hid_t dxpl_id, hsize_t old_dim[])
(H5D_CHUNK_IDX_BT2 == layout->storage.u.chunk.idx_type &&
H5D_COPS_BT2 == layout->storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == layout->storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == layout->storage.u.chunk.ops));
+ H5D_COPS_BTREE == layout->storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == layout->storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == layout->storage.u.chunk.ops));
HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER));
HDassert(pline->nused > 0);
HDassert(layout->u.chunk.flags
@@ -4291,7 +4310,9 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim)
(H5D_CHUNK_IDX_BT2 == layout->storage.u.chunk.idx_type &&
H5D_COPS_BT2 == layout->storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == layout->storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == layout->storage.u.chunk.ops));
+ H5D_COPS_BTREE == layout->storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == layout->storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == layout->storage.u.chunk.ops));
HDassert(dxpl_cache);
/* Fill the DXPL cache values for later use */
@@ -4677,7 +4698,9 @@ H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[])
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
HDassert(chunk_addr);
/* Set up user data for B-tree callback */
@@ -4741,7 +4764,9 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage)
(H5D_CHUNK_IDX_BT2 == storage->u.chunk.idx_type &&
H5D_COPS_BT2 == storage->u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == storage->u.chunk.idx_type &&
- H5D_COPS_BTREE == storage->u.chunk.ops));
+ H5D_COPS_BTREE == storage->u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == storage->u.chunk.idx_type &&
+ H5D_COPS_NONE == storage->u.chunk.ops));
/* Check for I/O pipeline message */
if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0)
@@ -5129,7 +5154,9 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src,
(H5D_CHUNK_IDX_BT2 == storage_src->idx_type &&
H5D_COPS_BT2 == storage_src->ops) ||
(H5D_CHUNK_IDX_BTREE == storage_src->idx_type &&
- H5D_COPS_BTREE == storage_src->ops));
+ H5D_COPS_BTREE == storage_src->ops) ||
+ (H5D_CHUNK_IDX_NONE == storage_src->idx_type &&
+ H5D_COPS_NONE == storage_src->ops));
HDassert(layout_src);
HDassert(f_dst);
HDassert(storage_dst);
@@ -5140,7 +5167,9 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src,
(H5D_CHUNK_IDX_BT2 == storage_dst->idx_type &&
H5D_COPS_BT2 == storage_dst->ops) ||
(H5D_CHUNK_IDX_BTREE == storage_dst->idx_type &&
- H5D_COPS_BTREE == storage_dst->ops));
+ H5D_COPS_BTREE == storage_dst->ops) ||
+ (H5D_CHUNK_IDX_NONE == storage_dst->idx_type &&
+ H5D_COPS_NONE == storage_dst->ops));
HDassert(ds_extent_src);
HDassert(dt_src);
@@ -5344,7 +5373,7 @@ done:
/* Clean up any index information */
if(copy_setup_done)
- if((storage_src->ops->copy_shutdown)(storage_src, storage_dst, dxpl_id) < 0)
+ if(storage_src->ops->copy_shutdown && (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)
@@ -5383,7 +5412,9 @@ H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout,
(H5D_CHUNK_IDX_BT2 == layout->storage.u.chunk.idx_type &&
H5D_COPS_BT2 == layout->storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == layout->storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == layout->storage.u.chunk.ops));
+ H5D_COPS_BTREE == layout->storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == layout->storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == layout->storage.u.chunk.ops));
HDassert(pline);
HDassert(index_size);
@@ -5479,7 +5510,9 @@ H5D_chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream)
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
/* Only display info if stream is defined */
if(stream) {
@@ -5547,7 +5580,9 @@ H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset)
(H5D_CHUNK_IDX_BT2 == dset->shared->layout.storage.u.chunk.idx_type &&
H5D_COPS_BT2 == dset->shared->layout.storage.u.chunk.ops) ||
(H5D_CHUNK_IDX_BTREE == dset->shared->layout.storage.u.chunk.idx_type &&
- H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops));
+ H5D_COPS_BTREE == dset->shared->layout.storage.u.chunk.ops) ||
+ (H5D_CHUNK_IDX_NONE == dset->shared->layout.storage.u.chunk.idx_type &&
+ H5D_COPS_NONE == dset->shared->layout.storage.u.chunk.ops));
/* Fill the DXPL cache values for later use */
if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0)
@@ -5577,7 +5612,8 @@ H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset)
idx_info.storage = &dset->shared->layout.storage.u.chunk;
/* Free any index structures */
- if((dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
+ if(dset->shared->layout.storage.u.chunk.ops->dest &&
+ (dset->shared->layout.storage.u.chunk.ops->dest)(&idx_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "unable to release chunk index info")
done:
diff --git a/src/H5Dint.c b/src/H5Dint.c
index 2b2715b..3120b86 100644
--- a/src/H5Dint.c
+++ b/src/H5Dint.c
@@ -1127,12 +1127,12 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of fill value")
/* Set the latest version for the layout message */
- if(H5D_layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space) < 0)
+ if(H5D_layout_set_latest_version(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest version of layout")
} /* end if */
else if(new_dset->shared->layout.version >= H5O_LAYOUT_VERSION_4) {
/* Use latest indexing type for layout message version >= 4 */
- if(H5D_layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space) < 0)
+ if(H5D_layout_set_latest_indexing(&new_dset->shared->layout, new_dset->shared->space, &new_dset->shared->dcpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set latest indexing")
} /* end if */
diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c
index 2c222a9..10fc9c9 100644
--- a/src/H5Dlayout.c
+++ b/src/H5Dlayout.c
@@ -101,6 +101,10 @@ H5D_layout_set_io_ops(const H5D_t *dataset)
dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_BTREE;
break;
+ case H5D_CHUNK_IDX_NONE:
+ dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_NONE;
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
dataset->shared->layout.storage.u.chunk.ops = H5D_COPS_FARRAY;
break;
@@ -213,6 +217,10 @@ H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include
ret_value++;
switch(layout->u.chunk.idx_type) {
+ case H5D_CHUNK_IDX_NONE:
+ /* nothing */
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
/* Fixed array creation parameters */
ret_value += H5D_FARRAY_CREATE_PARAM_SIZE;
@@ -260,7 +268,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space)
+H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space,
+ const H5D_dcpl_cache_t *dcpl_cache)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -268,12 +277,14 @@ H5D_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space)
/* Sanity check */
HDassert(layout);
+ HDassert(space);
+ HDassert(dcpl_cache);
/* Set encoding of layout to latest version */
layout->version = H5O_LAYOUT_VERSION_LATEST;
/* Set the latest indexing type for the layout message */
- if(H5D_layout_set_latest_indexing(layout, space) < 0)
+ if(H5D_layout_set_latest_indexing(layout, space, dcpl_cache) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set latest indexing type")
done:
@@ -295,7 +306,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space)
+H5D_layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space,
+ const H5D_dcpl_cache_t *dcpl_cache)
{
int sndims; /* Rank of dataspace */
unsigned ndims; /* Rank of dataspace */
@@ -305,6 +317,8 @@ H5D_layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space)
/* Sanity check */
HDassert(layout);
+ HDassert(space);
+ HDassert(dcpl_cache);
/* Query the dimensionality of the dataspace */
if((sndims = H5S_GET_EXTENT_NDIMS(space)) < 0)
@@ -347,7 +361,8 @@ H5D_layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space)
layout->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs = H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS;
layout->u.chunk.u.earray.cparam.data_blk_min_elmts = H5D_EARRAY_DATA_BLK_MIN_ELMTS;
layout->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits = H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS;
- } else { /* Chunked dataset with > 1 unlimited dimensions */
+ } /* end if */
+ else { /* Chunked dataset with > 1 unlimited dimensions */
/* Set the chunk index type to v2 B-tree */
layout->u.chunk.idx_type = H5D_CHUNK_IDX_BT2;
layout->storage.u.chunk.idx_type = H5D_CHUNK_IDX_BT2;
@@ -357,20 +372,33 @@ H5D_layout_set_latest_indexing(H5O_layout_t *layout, const H5S_t *space)
layout->u.chunk.u.btree2.cparam.node_size = H5D_BT2_NODE_SIZE;
layout->u.chunk.u.btree2.cparam.split_percent = H5D_BT2_SPLIT_PERC;
layout->u.chunk.u.btree2.cparam.merge_percent = H5D_BT2_MERGE_PERC;
- }
- } else if(layout->type == H5D_CHUNKED) {
- /* Chunked dataset with fixed dimensions (with or without max. dimension setting) */
- /* Set the chunk index type to 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
- * control over this with a property list - QAK)
- */
- layout->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS;
- } /* end if */
+ } /* end else */
+ } /* end if */
+ else
+ /* Chunked dataset with fixed dimensions */
+ if(layout->type == H5D_CHUNKED) {
+ /* Check for correct condition for using "implicit" chunk index */
+ if(!dcpl_cache->pline.nused &&
+ dcpl_cache->fill.alloc_time == H5D_ALLOC_TIME_EARLY) {
+
+ /* Set the chunk index type to Non Index */
+ layout->u.chunk.idx_type = H5D_CHUNK_IDX_NONE;
+ layout->storage.u.chunk.idx_type = H5D_CHUNK_IDX_NONE;
+ layout->storage.u.chunk.ops = H5D_COPS_NONE;
+ } /* end if */
+ else { /* Used Fixed Array */
+ /* Set the chunk index type to 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
+ * control over this with a property list - QAK)
+ */
+ layout->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS;
+ } /* end else */
+ } /* end if */
} /* end if */
done:
diff --git a/src/H5Dnone.c b/src/H5Dnone.c
new file mode 100644
index 0000000..723ab45
--- /dev/null
+++ b/src/H5Dnone.c
@@ -0,0 +1,551 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Programmer: Vailin Choi <vchoi@hdfgroup.org>
+ * September 2010
+ *
+ * Purpose: Non Index chunked I/O functions.
+ * This is used when the dataset is:
+ * extendible but with fixed max. dims
+ * with early allocation
+ * without filter
+ * The chunk coordinate is mapped into the actual disk addresses
+ * for the chunk without indexing.
+ *
+ */
+
+/****************/
+/* Module Setup */
+/****************/
+
+#define H5D_PACKAGE /*suppress error about including H5Dpkg */
+
+
+/***********/
+/* Headers */
+/***********/
+#include "H5private.h" /* Generic Functions */
+#include "H5Dpkg.h" /* Datasets */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5MFprivate.h" /* File space management */
+#include "H5Vprivate.h" /* Vector functions */
+
+
+/****************/
+/* Local Macros */
+/****************/
+
+/******************/
+/* Local Typedefs */
+/******************/
+
+/********************/
+/* Local Prototypes */
+/********************/
+
+/* Non Index chunking I/O ops */
+static herr_t H5D_none_create(const H5D_chk_idx_info_t *idx_info);
+static hbool_t H5D_none_is_space_alloc(const H5O_storage_chunk_t *storage);
+static herr_t H5D_none_insert(const H5D_chk_idx_info_t *idx_info,
+ H5D_chunk_ud_t *udata);
+static herr_t H5D_none_get_addr(const H5D_chk_idx_info_t *idx_info,
+ H5D_chunk_ud_t *udata);
+static int H5D_none_iterate(const H5D_chk_idx_info_t *idx_info,
+ H5D_chunk_cb_func_t chunk_cb, void *chunk_udata);
+static herr_t H5D_none_remove(const H5D_chk_idx_info_t *idx_info,
+ H5D_chunk_common_ud_t *udata);
+static herr_t H5D_none_delete(const H5D_chk_idx_info_t *idx_info);
+static herr_t H5D_none_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+ const H5D_chk_idx_info_t *idx_info_dst);
+static herr_t H5D_none_size(const H5D_chk_idx_info_t *idx_info,
+ hsize_t *size);
+static herr_t H5D_none_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr);
+static herr_t H5D_none_dump(const H5O_storage_chunk_t *storage, FILE *stream);
+
+/*********************/
+/* Package Variables */
+/*********************/
+
+/* Non Index chunk I/O ops */
+const H5D_chunk_ops_t H5D_COPS_NONE[1] = {{
+ FALSE, /* Non-indexed chunking don't current support SWMR access */
+ NULL, /* init */
+ H5D_none_create, /* create */
+ H5D_none_is_space_alloc, /* is_space_alloc */
+ H5D_none_insert, /* insert */
+ H5D_none_get_addr, /* get_addr */
+ NULL, /* resize */
+ H5D_none_iterate, /* iterate */
+ H5D_none_remove, /* remove */
+ H5D_none_delete, /* delete */
+ H5D_none_copy_setup, /* copy_setup */
+ NULL, /* copy_shutdown */
+ H5D_none_size, /* size */
+ H5D_none_reset, /* reset */
+ NULL, /* support */
+ NULL, /* unsupport */
+ H5D_none_dump, /* dump */
+ NULL /* dest */
+}};
+
+/*****************************/
+/* Library Private Variables */
+/*****************************/
+
+
+/*******************/
+/* Local Variables */
+/*******************/
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_create
+ *
+ * Purpose: Allocate memory for the maximum # of chunks in the dataset.
+ *
+ * Return: Non-negative on success
+ * Negative on failure.
+ *
+ * Programmer: Vailin Choi; September 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_create(const H5D_chk_idx_info_t *idx_info)
+{
+ hsize_t nbytes; /* Total size of dataset chunks */
+ haddr_t addr; /* The address of dataset chunks */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_none_create)
+
+ /* Check args */
+ HDassert(idx_info);
+ HDassert(idx_info->f);
+ HDassert(idx_info->pline);
+ HDassert(idx_info->pline->nused == 0); /* Shouldn't have filter defined on entering here */
+ HDassert(idx_info->layout);
+ HDassert(idx_info->storage);
+ HDassert(idx_info->layout->max_nchunks);
+ HDassert(!H5F_addr_defined(idx_info->storage->idx_addr)); /* address of data shouldn't be defined */
+
+ /* Calculate size of max dataset chunks */
+ nbytes = idx_info->layout->max_nchunks * idx_info->layout->size;
+
+ /* Allocate space for max dataset chunks */
+ addr = H5MF_alloc(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, nbytes);
+ if(!H5F_addr_defined(addr))
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "file allocation failed")
+
+ /* This is the address of the dataset chunks */
+ idx_info->storage->idx_addr = addr;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_none_create() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_is_space_alloc
+ *
+ * Purpose: Query if space for the dataset chunks is allocated
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; September 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static hbool_t
+H5D_none_is_space_alloc(const H5O_storage_chunk_t *storage)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_is_space_alloc)
+
+ /* Check args */
+ HDassert(storage);
+
+ FUNC_LEAVE_NOAPI((hbool_t)H5F_addr_defined(storage->idx_addr))
+} /* end H5D_none_is_space_alloc() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_insert
+ *
+ * Purpose: Calculate the address of the chunk
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
+{
+ hsize_t idx; /* Array index of chunk */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_none_insert)
+
+ HDassert(idx_info);
+ HDassert(idx_info->f);
+ HDassert(idx_info->pline);
+ HDassert(idx_info->pline->nused == 0);
+ HDassert(idx_info->layout);
+ HDassert(idx_info->storage);
+ HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
+ HDassert(udata);
+
+ /* Calculate the index of this chunk */
+ if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
+
+ HDassert(!H5F_addr_defined(udata->addr));
+ HDassert(udata->nbytes == idx_info->layout->size);
+
+ /* Storage is already allocated, just calculate the file address of the chunk */
+ H5_CHECK_OVERFLOW(udata->nbytes, /*From: */uint32_t, /*To: */hsize_t);
+ udata->addr = idx_info->storage->idx_addr + idx * udata->nbytes;
+
+ HDassert(H5F_addr_defined(udata->addr));
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5D_none_insert() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_get_addr
+ *
+ * Purpose: Get the file address of a chunk.
+ * Save the retrieved information in the udata supplied.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata)
+{
+ hsize_t idx; /* Array index of chunk */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_none_get_addr)
+
+ HDassert(idx_info);
+ HDassert(idx_info->f);
+ HDassert(idx_info->pline);
+ HDassert(idx_info->pline->nused == 0);
+ HDassert(idx_info->layout);
+ HDassert(idx_info->storage);
+ HDassert(udata);
+ HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
+
+ /* Calculate the index of this chunk */
+ if(H5V_chunk_index((idx_info->layout->ndims - 1), udata->common.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
+
+ /* Calculate the address of the chunk */
+ udata->addr = idx_info->storage->idx_addr + idx * idx_info->layout->size;
+
+ /* Update the other (constant) information for the chunk */
+ udata->nbytes = idx_info->layout->size;
+ udata->filter_mask = 0;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5D_none_get_addr() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_iterate
+ *
+ * Purpose: Iterate over the chunks in an index, making a callback
+ * for each one.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; September 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+H5D_none_iterate(const H5D_chk_idx_info_t *idx_info,
+ H5D_chunk_cb_func_t chunk_cb, void *chunk_udata)
+{
+ H5D_chunk_rec_t chunk_rec; /* generic chunk record */
+ hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset for the chunk */
+ unsigned ndims; /* Rank of chunk */
+ unsigned u; /* Local index variable */
+ int curr_dim; /* Current rank */
+ hsize_t idx; /* Array index of chunk */
+ int ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_none_iterate)
+
+ HDassert(idx_info);
+ HDassert(idx_info->f);
+ HDassert(idx_info->pline);
+ HDassert(!idx_info->pline->nused);
+ HDassert(idx_info->layout);
+ HDassert(idx_info->storage);
+ HDassert(chunk_cb);
+ HDassert(chunk_udata);
+ HDassert(H5F_addr_defined(idx_info->storage->idx_addr));
+
+ /* Initialize generic chunk record */
+ HDmemset(&chunk_rec, 0, sizeof(chunk_rec));
+ chunk_rec.nbytes = idx_info->layout->size;
+ chunk_rec.filter_mask = 0;
+
+ HDmemset(&chunk_offset, 0, sizeof(chunk_offset));
+
+ ndims = idx_info->layout->ndims - 1;
+ HDassert(ndims > 0);
+
+ /* Iterate over all the chunks in the dataset's dataspace */
+ for(u = 0; u < idx_info->layout->nchunks; u++) {
+ /* Calculate the index of this chunk */
+ if(H5V_chunk_index(ndims, chunk_rec.offset, idx_info->layout->dim, idx_info->layout->max_down_chunks, &idx) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
+
+ /* Calculate the address of the chunk */
+ chunk_rec.chunk_addr = idx_info->storage->idx_addr + idx * idx_info->layout->size;
+
+ /* Make "generic chunk" callback */
+ if((ret_value = (*chunk_cb)(&chunk_rec, chunk_udata)) < 0)
+ HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback");
+
+ /* Update coordinates of chunk in dataset */
+ curr_dim = (int)(ndims - 1);
+ while(curr_dim >= 0) {
+ /* Increment coordinate in current dimension */
+ chunk_offset[curr_dim]++;
+ chunk_rec.offset[curr_dim] += idx_info->layout->dim[curr_dim];
+
+ /* Check if we went off the end of the current dimension */
+ if(chunk_offset[curr_dim] >= idx_info->layout->chunks[curr_dim]) {
+ /* Reset coordinate & move to next faster dimension */
+ chunk_offset[curr_dim] = 0;
+ chunk_rec.offset[curr_dim] = 0;
+ curr_dim--;
+ } /* end if */
+ else
+ break;
+ } /* end while */
+ } /* end for */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_none_iterate() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_remove
+ *
+ * Purpose: Remove chunk from index.
+ *
+ * Note: Chunks can't be removed (or added) to datasets with this
+ * form of index - all the space for all the chunks is always
+ * allocated in the file.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_remove(const H5D_chk_idx_info_t UNUSED *idx_info, H5D_chunk_common_ud_t UNUSED *udata)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_remove)
+
+ /* NO OP */
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* H5D_none_remove() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_delete
+ *
+ * Purpose: Delete raw data storage for entire dataset (i.e. all chunks)
+ *
+ * Return: Success: Non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_delete(const H5D_chk_idx_info_t *idx_info)
+{
+ hsize_t nbytes; /* Size of all chunks */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_none_delete)
+
+ HDassert(idx_info);
+ HDassert(idx_info->f);
+ HDassert(idx_info->pline);
+ HDassert(!idx_info->pline->nused); /* Shouldn't have filter defined on entering here */
+ HDassert(idx_info->layout);
+ HDassert(idx_info->storage);
+ HDassert(H5F_addr_defined(idx_info->storage->idx_addr)); /* should be defined */
+
+ /* chunk size * max # of chunks */
+ nbytes = idx_info->layout->max_nchunks * idx_info->layout->size;
+ if(H5MF_xfree(idx_info->f, H5FD_MEM_DRAW, idx_info->dxpl_id, idx_info->storage->idx_addr, nbytes) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTFREE, H5_ITER_ERROR, "unable to free dataset chunks")
+
+ idx_info->storage->idx_addr = HADDR_UNDEF;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_none_delete() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_copy_setup
+ *
+ * Purpose: Set up any necessary information for copying chunks
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_copy_setup(const H5D_chk_idx_info_t *idx_info_src,
+ const H5D_chk_idx_info_t *idx_info_dst)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_none_copy_setup)
+
+ /* Check args */
+ HDassert(idx_info_src);
+ HDassert(idx_info_src->f);
+ HDassert(idx_info_src->pline);
+ HDassert(!idx_info_src->pline->nused);
+ HDassert(idx_info_src->layout);
+ HDassert(idx_info_src->storage);
+ HDassert(H5F_addr_defined(idx_info_src->storage->idx_addr));
+
+ HDassert(idx_info_dst);
+ HDassert(idx_info_dst->f);
+ HDassert(idx_info_dst->pline);
+ HDassert(!idx_info_dst->pline->nused);
+ HDassert(idx_info_dst->layout);
+ HDassert(idx_info_dst->storage);
+
+ /* Set copied metadata tag */
+ H5_BEGIN_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL);
+
+ /* Allocate dataset chunks in the dest. file */
+ if(H5D_none_create(idx_info_dst) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize chunked storage")
+
+ /* Reset metadata tag */
+ H5_END_TAG(FAIL);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5D_none_copy_setup() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_size
+ *
+ * Purpose: Retrieve the amount of index storage for chunked dataset
+ *
+ * Return: Success: Non-negative
+ * Failure: negative
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_size(const H5D_chk_idx_info_t UNUSED *idx_info, hsize_t *index_size)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_size)
+
+ /* Check args */
+ HDassert(index_size);
+
+ *index_size = 0;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5D_none_size() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_reset
+ *
+ * Purpose: Reset indexing information.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; Sept 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_reset)
+
+ /* Check args */
+ HDassert(storage);
+
+ /* Reset index info */
+ if(reset_addr)
+ storage->idx_addr = HADDR_UNDEF;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5D_none_reset() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_none_dump
+ *
+ * Purpose: Dump
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Vailin Choi; September 2010
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5D_none_dump(const H5O_storage_chunk_t *storage, FILE *stream)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_none_dump)
+
+ /* Check args */
+ HDassert(storage);
+ HDassert(stream);
+
+ HDfprintf(stream, " Address: %a\n", storage->idx_addr);
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5D_none_dump() */
+
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 673dac3..5dc728f 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -564,6 +564,7 @@ H5_DLLVAR const H5D_layout_ops_t H5D_LOPS_CHUNK[1];
/* Chunked layout operations */
H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BTREE[1];
+H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_NONE[1];
H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_EARRAY[1];
H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_FARRAY[1];
H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BT2[1];
@@ -623,9 +624,9 @@ H5_DLL herr_t H5D_layout_set_io_ops(const H5D_t *dataset);
H5_DLL size_t H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout,
hbool_t include_compact_data);
H5_DLL herr_t H5D_layout_set_latest_version(H5O_layout_t *layout,
- const H5S_t *space);
+ const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache);
H5_DLL herr_t H5D_layout_set_latest_indexing(H5O_layout_t *layout,
- const H5S_t *space);
+ const H5S_t *space, const H5D_dcpl_cache_t *dcpl_cache);
H5_DLL herr_t H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh,
H5D_t *dset, hid_t dapl_id);
H5_DLL herr_t H5D_layout_oh_read(H5D_t *dset, hid_t dxpl_id, hid_t dapl_id,
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index 900046a..a96755a 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -54,9 +54,10 @@ typedef enum H5D_layout_t {
/* Types of chunk index data structures */
typedef enum H5D_chunk_index_t {
H5D_CHUNK_IDX_BTREE = 0, /* v1 B-tree index (default) */
- H5D_CHUNK_IDX_FARRAY = 1, /* Fixed array (for 0 unlimited dims) */
- H5D_CHUNK_IDX_EARRAY = 2, /* Extensible array (for 1 unlimited dim) */
- H5D_CHUNK_IDX_BT2 = 3, /* v2 B-tree index (for >1 unlimited dims) */
+ H5D_CHUNK_IDX_NONE = 1, /* No Index (H5D_ALLOC_TIME_EARLY, non-filtered, fixed dims) */
+ H5D_CHUNK_IDX_FARRAY = 2, /* Fixed array (for 0 unlimited dims) */
+ H5D_CHUNK_IDX_EARRAY = 3, /* Extensible array (for 1 unlimited dim) */
+ H5D_CHUNK_IDX_BT2 = 4, /* v2 B-tree index (for >1 unlimited dims) */
H5D_CHUNK_IDX_NTYPES /*this one must be last! */
} H5D_chunk_index_t;
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 32a9809..aec3c0a 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -306,6 +306,9 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
mesg->storage.u.chunk.idx_type = mesg->u.chunk.idx_type;
switch(mesg->u.chunk.idx_type) {
+ case H5D_CHUNK_IDX_NONE: /* Non Index */
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
/* Fixed array creation parameters */
mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = *p++;
@@ -482,6 +485,9 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
*p++ = (uint8_t)mesg->u.chunk.idx_type;
switch(mesg->u.chunk.idx_type) {
+ case H5D_CHUNK_IDX_NONE: /* Non Index */
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
/* Fixed array creation parameters */
*p++ = mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits;
@@ -931,6 +937,11 @@ H5O_layout_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Index Type:", "v1 B-tree");
break;
+ case H5D_CHUNK_IDX_NONE:
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Index Type:", "None");
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Index Type:", "Fixed Array");
diff --git a/src/H5Ostorage.c b/src/H5Ostorage.c
index 38de1c4..41b16bc 100644
--- a/src/H5Ostorage.c
+++ b/src/H5Ostorage.c
@@ -170,9 +170,14 @@ H5O_storage_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
/* Check for chunk index */
if(flags & H5O_STORAGE_CHUNK_HAVE_CHUNK_INDEX) {
- /* Chunk index type */
- mesg->u.chunk.idx_type = (H5D_chunk_index_t)*p++;
+ /* Chunk index type */
+ mesg->u.chunk.idx_type = (H5D_chunk_index_t)*p++;
switch(mesg->u.chunk.idx_type) {
+ case H5D_CHUNK_IDX_NONE:
+ /* Set the chunk operations */
+ mesg->u.chunk.ops = H5D_COPS_NONE;
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
/* Set the chunk operations */
mesg->u.chunk.ops = H5D_COPS_FARRAY;
@@ -272,11 +277,11 @@ H5O_storage_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p,
case H5D_CHUNKED:
{
- /* Chunk feature flags */
- *p++ = (uint8_t)H5O_STORAGE_CHUNK_HAVE_CHUNK_INDEX;
+ /* Chunk feature flags */
+ *p++ = (uint8_t)H5O_STORAGE_CHUNK_HAVE_CHUNK_INDEX;
- /* Chunk index type */
- *p++ = (uint8_t)mesg->u.chunk.idx_type;
+ /* Chunk index type */
+ *p++ = (uint8_t)mesg->u.chunk.idx_type;
/* Chunk index address */
H5F_addr_encode(f, &p, mesg->u.chunk.idx_addr);
@@ -634,6 +639,11 @@ H5O_storage_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg,
"Index Type:", "v1 B-tree");
break;
+ case H5D_CHUNK_IDX_NONE:
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Index Type:", "None");
+ break;
+
case H5D_CHUNK_IDX_FARRAY:
HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Index Type:", "Fixed Array");
@@ -730,7 +740,7 @@ H5O_storage_meta_size(const H5F_t *f, const H5O_storage_t *storage,
case H5D_CHUNKED:
ret_value += 1 + /* Chunk feature flags */
1; /* Chunk index type */
- ret_value += H5F_SIZEOF_ADDR(f); /* Chunk index address */
+ ret_value += H5F_SIZEOF_ADDR(f); /* Chunk index address or data address */
break;
default:
diff --git a/src/Makefile.am b/src/Makefile.am
index b55c6eb..b6acdd6 100755
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -48,7 +48,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5C.c H5CS.c \
H5D.c H5Dbtree.c H5Dbtree2.c H5Dchunk.c H5Dcompact.c H5Dcontig.c H5Ddbg.c \
H5Ddeprec.c H5Dearray.c H5Defl.c H5Dfarray.c H5Dfill.c H5Dint.c \
- H5Dio.c H5Dlayout.c H5Dmpio.c H5Doh.c H5Dproxy.c H5Dscatgath.c \
+ H5Dio.c H5Dlayout.c H5Dmpio.c H5Dnone.c H5Doh.c H5Dproxy.c H5Dscatgath.c \
H5Dselect.c H5Dtest.c \
H5E.c H5Edeprec.c H5Eint.c \
H5EA.c H5EAcache.c H5EAdbg.c H5EAdblkpage.c H5EAdblock.c H5EAhdr.c \
diff --git a/src/Makefile.in b/src/Makefile.in
index 74f5927..1c757d3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -104,29 +104,30 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
H5Dcontig.lo H5Ddbg.lo H5Ddeprec.lo H5Dearray.lo H5Defl.lo \
H5Dfarray.lo H5Dfill.lo H5Dint.lo H5Dio.lo H5Dlayout.lo \
H5Dmpio.lo H5Doh.lo H5Dproxy.lo H5Dscatgath.lo H5Dselect.lo \
- H5Dtest.lo H5E.lo H5Edeprec.lo H5Eint.lo H5EA.lo H5EAcache.lo \
- H5EAdbg.lo H5EAdblkpage.lo H5EAdblock.lo H5EAhdr.lo \
- H5EAiblock.lo H5EAint.lo H5EAsblock.lo H5EAstat.lo H5EAtest.lo \
- H5F.lo H5Faccum.lo H5Fdbg.lo H5Fdeprec.lo H5Ffake.lo H5Fio.lo \
- H5Fmount.lo H5Fmpi.lo H5Fquery.lo H5Fsfile.lo H5Fsuper.lo \
- H5Fsuper_cache.lo H5Ftest.lo H5FA.lo H5FAcache.lo H5FAdbg.lo \
- H5FAdblock.lo H5FAdblkpage.lo H5FAhdr.lo H5FAstat.lo \
- H5FAtest.lo H5FD.lo H5FDcore.lo H5FDdirect.lo H5FDfamily.lo \
- H5FDint.lo H5FDlog.lo H5FDmpi.lo H5FDmpio.lo H5FDmpiposix.lo \
- H5FDmulti.lo H5FDsec2.lo H5FDspace.lo H5FDstdio.lo H5FL.lo \
- H5FO.lo H5FS.lo H5FScache.lo H5FSdbg.lo H5FSsection.lo \
- H5FSstat.lo H5FStest.lo H5G.lo H5Gbtree2.lo H5Gcache.lo \
- H5Gcompact.lo H5Gdense.lo H5Gdeprec.lo H5Gent.lo H5Gint.lo \
- H5Glink.lo H5Gloc.lo H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo \
- H5Groot.lo H5Gstab.lo H5Gtest.lo H5Gtraverse.lo H5HF.lo \
- H5HFbtree2.lo H5HFcache.lo H5HFdbg.lo H5HFdblock.lo \
- H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo H5HFiblock.lo H5HFiter.lo \
- H5HFman.lo H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo \
- H5HFtiny.lo H5HG.lo H5HGcache.lo H5HGdbg.lo H5HL.lo \
- H5HLcache.lo H5HLdbg.lo H5HLint.lo H5HP.lo H5I.lo H5Itest.lo \
- H5L.lo H5Lexternal.lo H5lib_settings.lo H5MF.lo H5MFaggr.lo \
- H5MFdbg.lo H5MFsection.lo H5MM.lo H5MP.lo H5MPtest.lo H5O.lo \
- H5Oainfo.lo H5Oalloc.lo H5Oattr.lo H5Oattribute.lo H5Obogus.lo \
+ H5Dtest.lo H5Dnone.lo H5E.lo H5Edeprec.lo H5Eint.lo H5EA.lo \
+ H5EAcache.lo H5EAdbg.lo H5EAdblkpage.lo H5EAdblock.lo \
+ H5EAhdr.lo H5EAiblock.lo H5EAint.lo H5EAsblock.lo H5EAstat.lo \
+ H5EAtest.lo H5F.lo H5Faccum.lo H5Fdbg.lo H5Fdeprec.lo \
+ H5Ffake.lo H5Fio.lo H5Fmount.lo H5Fmpi.lo H5Fquery.lo \
+ H5Fsfile.lo H5Fsuper.lo H5Fsuper_cache.lo H5Ftest.lo H5FA.lo \
+ H5FAcache.lo H5FAdbg.lo H5FAdblock.lo H5FAdblkpage.lo \
+ H5FAhdr.lo H5FAstat.lo H5FAtest.lo H5FD.lo H5FDcore.lo \
+ H5FDdirect.lo H5FDfamily.lo H5FDint.lo H5FDlog.lo H5FDmpi.lo \
+ H5FDmpio.lo H5FDmpiposix.lo H5FDmulti.lo H5FDsec2.lo \
+ H5FDspace.lo H5FDstdio.lo H5FL.lo H5FO.lo H5FS.lo H5FScache.lo \
+ H5FSdbg.lo H5FSsection.lo H5FSstat.lo H5FStest.lo H5G.lo \
+ H5Gbtree2.lo H5Gcache.lo H5Gcompact.lo H5Gdense.lo \
+ H5Gdeprec.lo H5Gent.lo H5Gint.lo H5Glink.lo H5Gloc.lo \
+ H5Gname.lo H5Gnode.lo H5Gobj.lo H5Goh.lo H5Groot.lo H5Gstab.lo \
+ H5Gtest.lo H5Gtraverse.lo H5HF.lo H5HFbtree2.lo H5HFcache.lo \
+ H5HFdbg.lo H5HFdblock.lo H5HFdtable.lo H5HFhdr.lo H5HFhuge.lo \
+ H5HFiblock.lo H5HFiter.lo H5HFman.lo H5HFsection.lo \
+ H5HFspace.lo H5HFstat.lo H5HFtest.lo H5HFtiny.lo H5HG.lo \
+ H5HGcache.lo H5HGdbg.lo H5HL.lo H5HLcache.lo H5HLdbg.lo \
+ H5HLint.lo H5HP.lo H5I.lo H5Itest.lo H5L.lo H5Lexternal.lo \
+ H5lib_settings.lo H5MF.lo H5MFaggr.lo H5MFdbg.lo \
+ H5MFsection.lo H5MM.lo H5MP.lo H5MPtest.lo H5O.lo H5Oainfo.lo \
+ H5Oalloc.lo H5Oattr.lo H5Oattribute.lo H5Obogus.lo \
H5Obtreek.lo H5Ocache.lo H5Ochunk.lo H5Ocont.lo H5Ocopy.lo \
H5Odbg.lo H5Odrvinfo.lo H5Odtype.lo H5Oefl.lo H5Ofill.lo \
H5Oflush.lo H5Ofsinfo.lo H5Oginfo.lo H5Olayout.lo H5Olinfo.lo \
@@ -481,7 +482,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5D.c H5Dbtree.c H5Dbtree2.c H5Dchunk.c H5Dcompact.c H5Dcontig.c H5Ddbg.c \
H5Ddeprec.c H5Dearray.c H5Defl.c H5Dfarray.c H5Dfill.c H5Dint.c \
H5Dio.c H5Dlayout.c H5Dmpio.c H5Doh.c H5Dproxy.c H5Dscatgath.c \
- H5Dselect.c H5Dtest.c \
+ H5Dselect.c H5Dtest.c H5Dnone.c \
H5E.c H5Edeprec.c H5Eint.c \
H5EA.c H5EAcache.c H5EAdbg.c H5EAdblkpage.c H5EAdblock.c H5EAhdr.c \
H5EAiblock.c H5EAint.c H5EAsblock.c H5EAstat.c H5EAtest.c \
@@ -718,6 +719,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dio.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dlayout.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dmpio.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dnone.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Doh.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dproxy.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5Dscatgath.Plo@am__quote@