summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-07-27 15:42:52 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-07-27 15:42:52 (GMT)
commit7bc9c34c55f1c21b521d20b4ec01092fee73ff90 (patch)
tree7ffd67721a4ede622ad2e7c5afb93d5fb4796372
parent21f8fa203a153bb9d3d26f73c9e56d22fd9671f2 (diff)
downloadhdf5-7bc9c34c55f1c21b521d20b4ec01092fee73ff90.zip
hdf5-7bc9c34c55f1c21b521d20b4ec01092fee73ff90.tar.gz
hdf5-7bc9c34c55f1c21b521d20b4ec01092fee73ff90.tar.bz2
[svn-r17240] Description:
Interim checkin, before switching to use layout index message for storing layout message v4 chunk index addresses. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.7 (amazon) in debug mode Mac OS X/32 10.5.7 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
-rw-r--r--src/H5Dearray.c22
-rw-r--r--src/H5Dfarray.c6
-rw-r--r--src/H5Dpkg.h12
-rw-r--r--src/H5Dpublic.h4
-rw-r--r--src/H5Oalloc.c5
-rw-r--r--src/H5Olayout.c169
-rw-r--r--src/H5Oprivate.h16
7 files changed, 179 insertions, 55 deletions
diff --git a/src/H5Dearray.c b/src/H5Dearray.c
index 76e0775..5006223 100644
--- a/src/H5Dearray.c
+++ b/src/H5Dearray.c
@@ -50,13 +50,6 @@
#define H5D_EARRAY_FILL HADDR_UNDEF
#define H5D_EARRAY_FILT_FILL {HADDR_UNDEF, 0, 0}
-/* Extensible array creation values */
-#define H5D_EARRAY_MAX_NELMTS_BITS 32 /* i.e. 4 giga-elements */
-#define H5D_EARRAY_IDX_BLK_ELMTS 4
-#define H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS 4
-#define H5D_EARRAY_DATA_BLK_MIN_ELMTS 16
-#define H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */
-
/******************/
/* Local Typedefs */
@@ -885,11 +878,16 @@ H5D_earray_idx_create(const H5D_chk_idx_info_t *idx_info)
cparam.cls = H5EA_CLS_CHUNK;
cparam.raw_elmt_size = (uint8_t)H5F_SIZEOF_ADDR(idx_info->f);
} /* end else */
- cparam.max_nelmts_bits = H5D_EARRAY_MAX_NELMTS_BITS;
- cparam.idx_blk_elmts = H5D_EARRAY_IDX_BLK_ELMTS;
- cparam.sup_blk_min_data_ptrs = H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS;
- cparam.data_blk_min_elmts = H5D_EARRAY_DATA_BLK_MIN_ELMTS;
- cparam.max_dblk_page_nelmts_bits = H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS;
+ cparam.max_nelmts_bits = idx_info->layout->u.chunk.u.earray.cparam.max_nelmts_bits;
+ HDassert(cparam.max_nelmts_bits > 0);
+ cparam.idx_blk_elmts = idx_info->layout->u.chunk.u.earray.cparam.idx_blk_elmts;
+ HDassert(cparam.idx_blk_elmts > 0);
+ cparam.sup_blk_min_data_ptrs = idx_info->layout->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs;
+ HDassert(cparam.sup_blk_min_data_ptrs > 0);
+ cparam.data_blk_min_elmts = idx_info->layout->u.chunk.u.earray.cparam.data_blk_min_elmts;
+ HDassert(cparam.data_blk_min_elmts > 0);
+ cparam.max_dblk_page_nelmts_bits = idx_info->layout->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits;
+ HDassert(cparam.max_dblk_page_nelmts_bits > 0);
/* Set up the user data */
udata.f = idx_info->f;
diff --git a/src/H5Dfarray.c b/src/H5Dfarray.c
index ba0d64e..b9c5017 100644
--- a/src/H5Dfarray.c
+++ b/src/H5Dfarray.c
@@ -49,9 +49,6 @@
#define H5D_FARRAY_FILL HADDR_UNDEF
#define H5D_FARRAY_FILT_FILL {HADDR_UNDEF, 0, 0}
-/* Fixed array creation values */
-#define H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */
-
/******************/
/* Local Typedefs */
@@ -704,7 +701,8 @@ H5D_farray_idx_create(const H5D_chk_idx_info_t *idx_info)
cparam.cls = H5FA_CLS_CHUNK;
cparam.raw_elmt_size = (uint8_t)H5F_SIZEOF_ADDR(idx_info->f);
} /* end else */
- cparam.max_dblk_page_nelmts_bits = H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS;
+ cparam.max_dblk_page_nelmts_bits = idx_info->layout->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits;
+ HDassert(cparam.max_dblk_page_nelmts_bits > 0);
cparam.nelmts = idx_info->layout->u.chunk.nchunks;
/* Set up the user data */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 4479dd0..fb2d642 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -64,6 +64,18 @@
#define H5D_CHUNK_HASH(D, ADDR) H5F_addr_hash(ADDR, (D)->cache.chunk.nslots)
+/* Default creation parameters for chunk index data structures */
+
+/* Fixed array creation values */
+#define H5D_FARRAY_MAX_DBLK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */
+
+/* Extensible array creation values */
+#define H5D_EARRAY_MAX_NELMTS_BITS 32 /* i.e. 4 giga-elements */
+#define H5D_EARRAY_IDX_BLK_ELMTS 4
+#define H5D_EARRAY_SUP_BLK_MIN_DATA_PTRS 4
+#define H5D_EARRAY_DATA_BLK_MIN_ELMTS 16
+#define H5D_EARRAY_MAX_DBLOCK_PAGE_NELMTS_BITS 10 /* i.e. 1024 elements per data block page */
+
/****************************/
/* Package Private Typedefs */
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index 1eaa705..056346e 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -51,8 +51,8 @@ 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_EARRAY = 1, /* Extensible array (for 1 unlimited dim) */
- H5D_CHUNK_IDX_FARRAY = 2, /* Fixed array (for 0 unlimited dims) */
+ 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_NTYPES /*this one must be last! */
} H5D_chunk_index_t;
diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c
index b2d38da..6eac264 100644
--- a/src/H5Oalloc.c
+++ b/src/H5Oalloc.c
@@ -1028,7 +1028,10 @@ H5O_alloc(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_msg_class_t *type,
HDassert(mesg);
/* Compute the size needed to store the message in the object header */
- if((raw_size = (type->raw_size)(f, FALSE, mesg)) >= H5O_MESG_MAX_SIZE)
+ raw_size = (type->raw_size)(f, FALSE, mesg);
+ if(0 == raw_size)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, UFAIL, "can't compute object header message size")
+ if(raw_size >= H5O_MESG_MAX_SIZE)
HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, UFAIL, "object header message is too large")
aligned_size = H5O_ALIGN_OH(oh, raw_size);
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 96cb9b9..a3e7352 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -33,6 +33,29 @@
#include "H5Sprivate.h" /* Dataspaces */
+/* Local macros */
+
+/* Flags for layout flag encoding */
+#ifdef NOT_YET
+#define H5O_LAYOUT_STORE_ELEM_PHASE_CHANGE 0x01
+#define H5O_LAYOUT_STORE_CHUNK_PHASE_CHANGE 0x02
+#define H5O_LAYOUT_STORE_ELEM_CHUNK_TRANS 0x04
+#define H5O_LAYOUT_ABBREVIATE_PARTIAL_BOUND_CHUNKS 0x08
+#define H5O_LAYOUT_APPLY_FILTER_TO_PARTIAL_BOUND_CHUNKS 0x10
+#define H5O_LAYOUT_TRACK_ELEM_WRITTEN 0x20
+#define H5O_LAYOUT_ALL_FLAGS ( \
+ H5O_LAYOUT_STORE_ELEM_PHASE_CHANGE \
+ | H5O_LAYOUT_STORE_CHUNK_PHASE_CHANGE \
+ | H5O_LAYOUT_STORE_ELEM_CHUNK_TRANS \
+ | H5O_LAYOUT_ABBREVIATE_PARTIAL_BOUND_CHUNKS \
+ | H5O_LAYOUT_APPLY_FILTER_TO_PARTIAL_BOUND_CHUNKS \
+ | H5O_LAYOUT_TRACK_ELEM_WRITTEN \
+ )
+#else /* NOT_YET */
+#define H5O_LAYOUT_ALL_FLAGS 0
+#endif /* NOT_YET */
+
+
/* PRIVATE PROTOTYPES */
static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh,
unsigned mesg_flags, unsigned *ioflags, const uint8_t *p);
@@ -187,6 +210,18 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
} /* end if */
} /* end if */
else {
+ /* Check for version with flag byte */
+ if(H5O_LAYOUT_VERSION_4 == mesg->version) {
+ unsigned char flags; /* Flags for encoding group info */
+
+ /* Get the layout flags */
+ flags = *p++;
+
+ /* Check for valid flags */
+ if(flags & ~H5O_LAYOUT_ALL_FLAGS)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad flag value for message")
+ } /* end if */
+
/* Layout class */
mesg->type = (H5D_layout_t)*p++;
@@ -237,16 +272,16 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
mesg->u.chunk.ops = H5D_COPS_BTREE;
} /* end if */
else {
- /* Encoded # of bytes for each chunk dimension */
- mesg->u.chunk.enc_bytes_per_dim = *p++;
- if(mesg->u.chunk.enc_bytes_per_dim == 0 || mesg->u.chunk.enc_bytes_per_dim > 8)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "encoded chunk dimension size is too large")
-
/* Dimensionality */
mesg->u.chunk.ndims = *p++;
if(mesg->u.chunk.ndims > H5O_LAYOUT_NDIMS)
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "dimensionality is too large")
+ /* Encoded # of bytes for each chunk dimension */
+ mesg->u.chunk.enc_bytes_per_dim = *p++;
+ if(mesg->u.chunk.enc_bytes_per_dim == 0 || mesg->u.chunk.enc_bytes_per_dim > 8)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "encoded chunk dimension size is too large")
+
/* Chunk dimensions */
for(u = 0; u < mesg->u.chunk.ndims; u++)
UINT64DECODE_VAR(p, mesg->u.chunk.dim[u], mesg->u.chunk.enc_bytes_per_dim);
@@ -261,7 +296,7 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "unknown chunk index type")
switch(mesg->u.chunk.idx_type) {
- case H5D_CHUNK_IDX_BTREE:
+ case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */
/* B-tree address */
H5F_addr_decode(f, &p, &(mesg->u.chunk.u.btree.addr));
@@ -269,20 +304,42 @@ H5O_layout_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh,
mesg->u.chunk.ops = H5D_COPS_BTREE;
break;
- case H5D_CHUNK_IDX_EARRAY:
- /* Extensible array address */
- H5F_addr_decode(f, &p, &(mesg->u.chunk.u.earray.addr));
+ case H5D_CHUNK_IDX_FARRAY:
+ /* Fixed array creation parameters */
+ mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits = *p++;
+ if(0 == mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid fixed array creation parameter")
+
+ /* Fixed array header address */
+ H5F_addr_decode(f, &p, &(mesg->u.chunk.u.farray.addr));
/* Set the chunk operations */
- mesg->u.chunk.ops = H5D_COPS_EARRAY;
+ mesg->u.chunk.ops = H5D_COPS_FARRAY;
break;
- case H5D_CHUNK_IDX_FARRAY:
- /* Fixed Array Header address */
- H5F_addr_decode(f, &p, &(mesg->u.chunk.u.farray.addr));
+ case H5D_CHUNK_IDX_EARRAY:
+ /* Extensible array creation parameters */
+ mesg->u.chunk.u.earray.cparam.max_nelmts_bits = *p++;
+ if(0 == mesg->u.chunk.u.earray.cparam.max_nelmts_bits)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid extensible array creation parameter")
+ mesg->u.chunk.u.earray.cparam.idx_blk_elmts = *p++;
+ if(0 == mesg->u.chunk.u.earray.cparam.idx_blk_elmts)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid extensible array creation parameter")
+ mesg->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs = *p++;
+ if(0 == mesg->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid extensible array creation parameter")
+ mesg->u.chunk.u.earray.cparam.data_blk_min_elmts = *p++;
+ if(0 == mesg->u.chunk.u.earray.cparam.data_blk_min_elmts)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid extensible array creation parameter")
+ mesg->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits = *p++;
+ if(0 == mesg->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "invalid extensible array creation parameter")
+
+ /* Extensible array header address */
+ H5F_addr_decode(f, &p, &(mesg->u.chunk.u.earray.addr));
/* Set the chunk operations */
- mesg->u.chunk.ops = H5D_COPS_FARRAY;
+ mesg->u.chunk.ops = H5D_COPS_EARRAY;
break;
default:
@@ -363,6 +420,10 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
*p++ = (uint8_t)((mesg->version < H5O_LAYOUT_VERSION_3) ?
H5O_LAYOUT_VERSION_3 : mesg->version);
+ /* Check for version with flag byte */
+ if(H5O_LAYOUT_VERSION_4 == mesg->version)
+ *p++ = 0; /* (flags not supported yet) */
+
/* Layout class */
*p++ = mesg->type;
@@ -401,14 +462,14 @@ H5O_layout_encode(H5F_t *f, hbool_t UNUSED disable_shared, uint8_t *p, const voi
UINT32ENCODE(p, mesg->u.chunk.dim[u]);
} /* end if */
else {
- /* Encoded # of bytes for each chunk dimension */
- HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8);
- *p++ = (uint8_t)mesg->u.chunk.enc_bytes_per_dim;
-
/* Number of dimensions */
HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
*p++ = (uint8_t)mesg->u.chunk.ndims;
+ /* Encoded # of bytes for each chunk dimension */
+ HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8);
+ *p++ = (uint8_t)mesg->u.chunk.enc_bytes_per_dim;
+
/* Dimension sizes */
for(u = 0; u < mesg->u.chunk.ndims; u++)
UINT64ENCODE_VAR(p, mesg->u.chunk.dim[u], mesg->u.chunk.enc_bytes_per_dim);
@@ -417,21 +478,31 @@ 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_BTREE:
+ case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */
/* B-tree address */
H5F_addr_encode(f, &p, mesg->u.chunk.u.btree.addr);
break;
- case H5D_CHUNK_IDX_EARRAY:
- /* Extensible array address */
- H5F_addr_encode(f, &p, mesg->u.chunk.u.earray.addr);
- break;
-
case H5D_CHUNK_IDX_FARRAY:
- /* Fixed Array Header address */
+ /* Fixed array creation parameters */
+ *p++ = mesg->u.chunk.u.farray.cparam.max_dblk_page_nelmts_bits;
+
+ /* Fixed array header address */
H5F_addr_encode(f, &p, mesg->u.chunk.u.farray.addr);
break;
+ case H5D_CHUNK_IDX_EARRAY:
+ /* Extensible array creation parameters */
+ *p++ = mesg->u.chunk.u.earray.cparam.max_nelmts_bits;
+ *p++ = mesg->u.chunk.u.earray.cparam.idx_blk_elmts;
+ *p++ = mesg->u.chunk.u.earray.cparam.sup_blk_min_data_ptrs;
+ *p++ = mesg->u.chunk.u.earray.cparam.data_blk_min_elmts;
+ *p++ = mesg->u.chunk.u.earray.cparam.max_dblk_page_nelmts_bits;
+
+ /* Extensible array header address */
+ H5F_addr_encode(f, &p, mesg->u.chunk.u.earray.addr);
+ break;
+
default:
HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "Invalid chunk index type")
} /* end switch */
@@ -894,6 +965,7 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg)
HDassert(mesg);
ret_value = 1 + /* Version number */
+ ((H5O_LAYOUT_VERSION_4 == mesg->version) ? 1 : 0) + /* [possibly] flags */
1; /* layout class type */
switch(mesg->type) {
@@ -920,14 +992,14 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg)
ret_value += mesg->u.chunk.ndims * 4;
} /* end if */
else {
- /* Encoded # of bytes for each chunk dimension */
- HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8);
- ret_value++;
-
/* Number of dimensions (1 byte) */
HDassert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
ret_value++;
+ /* Encoded # of bytes for each chunk dimension */
+ HDassert(mesg->u.chunk.enc_bytes_per_dim > 0 && mesg->u.chunk.enc_bytes_per_dim <= 8);
+ ret_value++;
+
/* Dimension sizes */
ret_value += mesg->u.chunk.ndims * mesg->u.chunk.enc_bytes_per_dim;
@@ -935,18 +1007,24 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg)
ret_value++;
switch(mesg->u.chunk.idx_type) {
- case H5D_CHUNK_IDX_BTREE:
+ case H5D_CHUNK_IDX_BTREE: /* Remove this when v2 B-tree indices added */
/* B-tree address */
ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */
break;
- case H5D_CHUNK_IDX_EARRAY:
- /* Extensible Array address */
+ case H5D_CHUNK_IDX_FARRAY:
+ /* Fixed array creation parameters */
+ ret_value += 1;
+
+ /* Fixed array header address */
ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */
break;
- case H5D_CHUNK_IDX_FARRAY:
- /* Fixed Array address */
+ case H5D_CHUNK_IDX_EARRAY:
+ /* Extensible array creation parameters */
+ ret_value += 5;
+
+ /* Extensible array header address */
ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */
break;
@@ -1027,14 +1105,33 @@ H5O_layout_set_latest_version(H5O_layout_t *layout, const H5S_t *space)
/* If we have only 1 unlimited dimension, we can use extensible array index */
if(1 == unlim_count) {
- /* Set the chunk index type */
+ /* Set the chunk index type to an extensible array */
layout->u.chunk.idx_type = H5D_CHUNK_IDX_EARRAY;
+
+ /* Set the extensible 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.earray.cparam.max_nelmts_bits = H5D_EARRAY_MAX_NELMTS_BITS;
+ layout->u.chunk.u.earray.cparam.idx_blk_elmts = H5D_EARRAY_IDX_BLK_ELMTS;
+ 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;
} /* end if */
/* Chunked datasets with fixed dimensions */
else if(layout->type == H5D_CHUNKED && fixed) {
- /* Set the chunk index type */
+ /* Set the chunk index type to a fixed array */
layout->u.chunk.idx_type = H5D_CHUNK_IDX_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 */
+ else {
+ /* Add setup for v2 B-tree indices here */
+ } /* end else */
} /* end if */
done:
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index 408a490..43e9f75 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -366,6 +366,15 @@ typedef struct H5O_layout_chunk_btree_t {
struct H5EA_t; /* Defined in H5EAprivate.h */
typedef struct H5O_layout_chunk_earray_t {
+ /* Creation parameters for extensible array data structure */
+ struct {
+ uint8_t max_nelmts_bits; /* Log2(Max. # of elements in array) - i.e. # of bits needed to store max. # of elements */
+ uint8_t idx_blk_elmts; /* # of elements to store in index block */
+ uint8_t data_blk_min_elmts; /* Min. # of elements per data block */
+ uint8_t sup_blk_min_data_ptrs; /* Min. # of data block pointers for a super block */
+ uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in data block page) - i.e. # of bits needed to store max. # of elements in data block page */
+ } cparam;
+
haddr_t addr; /* File address of extensible array */
haddr_t dset_ohdr_addr; /* File address dataset's object header */
unsigned unlim_dim; /* Rank of unlimited dimension for dataset */
@@ -377,6 +386,13 @@ typedef struct H5O_layout_chunk_earray_t {
struct H5FA_t; /* Defined in H5FAprivate.h */
typedef struct H5O_layout_chunk_farray_t {
+ /* Creation parameters for fixed array data structure */
+ struct {
+ uint8_t max_dblk_page_nelmts_bits; /* Log2(Max. # of elements in a data block page) -
+ i.e. # of bits needed to store max. # of elements
+ in a data block page */
+ } cparam;
+
haddr_t addr; /* File address of fixed index array */
struct H5FA_t *fa; /* Pointer to fixed index array struct */
} H5O_layout_chunk_farray_t;