summaryrefslogtreecommitdiffstats
path: root/src/H5EAhdr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-25 23:14:43 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-25 23:14:43 (GMT)
commitf9f71a001ba65fbc515b440bf5cbace452947800 (patch)
tree22affd8e35a5bedb34827439b029214f58d8a851 /src/H5EAhdr.c
parent6a1614de3ea33c98e8fe6d11b8ac0a590f4d445a (diff)
downloadhdf5-f9f71a001ba65fbc515b440bf5cbace452947800.zip
hdf5-f9f71a001ba65fbc515b440bf5cbace452947800.tar.gz
hdf5-f9f71a001ba65fbc515b440bf5cbace452947800.tar.bz2
[svn-r15703] Description:
Further progress on extensible array implementation - add support for more data blocks from index block. Tested on: Mac OS X/32 10.5.4 (amazon) in debug mode Mac OS X/32 10.5.4 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) 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 production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5EAhdr.c')
-rw-r--r--src/H5EAhdr.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/H5EAhdr.c b/src/H5EAhdr.c
index 5fcf2be..3dc5d50 100644
--- a/src/H5EAhdr.c
+++ b/src/H5EAhdr.c
@@ -131,7 +131,7 @@ H5EA__hdr_alloc(H5F_t *f, const H5EA_class_t *cls))
hdr->sizeof_size = H5F_SIZEOF_SIZE(f);
/* Set the class of the array */
- hdr->cls = cls;
+ hdr->cparam.cls = cls;
/* Set the return value */
ret_value = hdr;
@@ -191,12 +191,12 @@ H5EA__hdr_init(H5EA_hdr_t *hdr))
/* Sanity check */
HDassert(hdr);
- HDassert(hdr->max_nelmts_bits);
- HDassert(hdr->data_blk_min_elmts);
- HDassert(hdr->sup_blk_min_data_ptrs);
+ HDassert(hdr->cparam.max_nelmts_bits);
+ HDassert(hdr->cparam.data_blk_min_elmts);
+ HDassert(hdr->cparam.sup_blk_min_data_ptrs);
/* Compute general information */
- hdr->nsblks = 1 + (hdr->max_nelmts_bits - H5V_log2_of2(hdr->data_blk_min_elmts));
+ hdr->nsblks = 1 + (hdr->cparam.max_nelmts_bits - H5V_log2_of2(hdr->cparam.data_blk_min_elmts));
#ifdef QAK
HDfprintf(stderr, "%s: hdr->nsblks = %Zu\n", FUNC, hdr->nsblks);
#endif /* QAK */
@@ -210,7 +210,7 @@ HDfprintf(stderr, "%s: hdr->nsblks = %Zu\n", FUNC, hdr->nsblks);
start_dblk = 0;
for(u = 0; u < hdr->nsblks; u++) {
hdr->sblk_info[u].ndblks = (hsize_t)H5_EXP2(u / 2);
- hdr->sblk_info[u].dblk_nelmts = (size_t)H5_EXP2((u + 1) / 2) * hdr->data_blk_min_elmts;
+ hdr->sblk_info[u].dblk_nelmts = (size_t)H5_EXP2((u + 1) / 2) * hdr->cparam.data_blk_min_elmts;
hdr->sblk_info[u].start_idx = start_idx;
hdr->sblk_info[u].start_dblk = start_dblk;
#ifdef QAK
@@ -257,7 +257,7 @@ H5EA__hdr_alloc_elmts(H5EA_hdr_t *hdr, size_t nelmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->data_blk_min_elmts);
+ idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
#ifdef QAK
HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
#endif /* QAK */
@@ -281,7 +281,7 @@ HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n",
/* Check for un-initialized factory at index */
if(NULL == hdr->elmt_fac.fac[idx]) {
- if(NULL == (hdr->elmt_fac.fac[idx] = H5FL_fac_init(nelmts * (size_t)hdr->cls->nat_elmt_size)))
+ if(NULL == (hdr->elmt_fac.fac[idx] = H5FL_fac_init(nelmts * (size_t)hdr->cparam.cls->nat_elmt_size)))
H5E_THROW(H5E_CANTINIT, "can't create data block data element buffer factory")
} /* end if */
@@ -327,7 +327,7 @@ H5EA__hdr_free_elmts(H5EA_hdr_t *hdr, size_t nelmts, void *elmts))
/* Compute the index of the element buffer factory */
H5_CHECK_OVERFLOW(nelmts, /*From:*/size_t, /*To:*/uint32_t);
- idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->data_blk_min_elmts);
+ idx = H5V_log2_of2((uint32_t)nelmts) - H5V_log2_of2((uint32_t)hdr->cparam.data_blk_min_elmts);
#ifdef QAK
HDfprintf(stderr, "%s: nelmts = %Zu, hdr->data_blk_min_elmts = %u, idx = %u\n", FUNC, nelmts, (unsigned)hdr->data_blk_min_elmts, idx);
#endif /* QAK */
@@ -392,18 +392,14 @@ HDfprintf(stderr, "%s: Called\n", FUNC);
hdr->idx_blk_addr = HADDR_UNDEF;
/* Set the creation parameters for the array */
- hdr->raw_elmt_size = cparam->raw_elmt_size;
- hdr->max_nelmts_bits = cparam->max_nelmts_bits;
- hdr->idx_blk_elmts = cparam->idx_blk_elmts;
- hdr->sup_blk_min_data_ptrs = cparam->sup_blk_min_data_ptrs;
- hdr->data_blk_min_elmts = cparam->data_blk_min_elmts;
+ HDmemcpy(&hdr->cparam, cparam, sizeof(hdr->cparam));
/* Finish initializing extensible array header */
if(H5EA__hdr_init(hdr) < 0)
H5E_THROW(H5E_CANTINIT, "initialization failed for extensible array header")
/* Allocate space for the header on disk */
- if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, hdr->size)))
+ if(HADDR_UNDEF == (hdr->addr = H5MF_alloc(f, H5FD_MEM_EARRAY_HDR, dxpl_id, (hsize_t)hdr->size)))
H5E_THROW(H5E_CANTALLOC, "file allocation failed for extensible array header")
/* Cache the new extensible array header */