diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-06-02 21:17:26 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-06-02 21:17:26 (GMT) |
commit | b941208aa1dab642491d9b856e8e1d4912273ffc (patch) | |
tree | e74c72bb0c8be7b0106801692df3fc5a76ebf157 /src | |
parent | bae373c32236ad99425154f5fcec4cb185e583d0 (diff) | |
download | hdf5-b941208aa1dab642491d9b856e8e1d4912273ffc.zip hdf5-b941208aa1dab642491d9b856e8e1d4912273ffc.tar.gz hdf5-b941208aa1dab642491d9b856e8e1d4912273ffc.tar.bz2 |
[svn-r16998] Description:
Bring r16982:16997 from trunk into revise_chunks branch.
Tested on:
Mac OS X/32 10.5.7 (amazon)
h5committest not needed on this branch
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dearray.c | 4 | ||||
-rw-r--r-- | src/H5EA.c | 100 | ||||
-rw-r--r-- | src/H5EAprivate.h | 6 | ||||
-rw-r--r-- | src/H5O.c | 13 | ||||
-rw-r--r-- | src/H5S.c | 73 | ||||
-rw-r--r-- | src/H5Sprivate.h | 2 | ||||
-rw-r--r-- | src/H5public.h | 4 | ||||
-rw-r--r-- | src/Makefile.in | 2 |
8 files changed, 145 insertions, 59 deletions
diff --git a/src/H5Dearray.c b/src/H5Dearray.c index 66de57d..bca9bb0 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -1516,7 +1516,7 @@ H5D_earray_idx_depend(const H5D_chk_idx_info_t *idx_info, /* Create flush dependency between the child_entry and the piece of metadata * in the extensible array that contains the entry for this chunk. */ - if(H5EA_depend(ea, idx_info->dxpl_id, idx, child_entry) < 0) + if(H5EA_support(ea, idx_info->dxpl_id, idx, child_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTDEPEND, FAIL, "unable to create flush dependency on extensible array metadata") done: @@ -1567,7 +1567,7 @@ H5D_earray_idx_undepend(const H5D_chk_idx_info_t *idx_info, /* Remove flush dependency between the child_entry and the piece of metadata * in the extensible array that contains the entry for this chunk. */ - if(H5EA_undepend(ea, idx_info->dxpl_id, idx, child_entry) < 0) + if(H5EA_unsupport(ea, idx_info->dxpl_id, idx, child_entry) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTUNDEPEND, FAIL, "unable to remove flush dependency on extensible array metadata") done: @@ -781,8 +781,94 @@ END_FUNC(PRIV) /* end H5EA_get() */ /*------------------------------------------------------------------------- * Function: H5EA_depend * - * Purpose: Create a flush dependency on the array metadata that contains - * the element for an array index. + * Purpose: Make a child flush dependency between the extensible array's + * header and another piece of metadata in the file. + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 27 2009 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PRIV, ERR, +herr_t, SUCCEED, FAIL, +H5EA_depend(H5AC_info_t *parent_entry, H5EA_t *ea)) + + /* Local variables */ + H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ + +#ifdef QAK +HDfprintf(stderr, "%s: Called\n", FUNC); +#endif /* QAK */ + + /* + * Check arguments. + */ + HDassert(ea); + HDassert(hdr); + + /* Set the shared array header's file context for this operation */ + hdr->f = ea->f; + + /* Set up flush dependency between child_entry and metadata array 'thing' */ + if(H5EA__create_flush_depend(hdr, parent_entry, (H5AC_info_t *)hdr) < 0) + H5E_THROW(H5E_CANTDEPEND, "unable to create flush dependency on file metadata") + +CATCH + +END_FUNC(PRIV) /* end H5EA_depend() */ + + +/*------------------------------------------------------------------------- + * Function: H5EA_undepend + * + * Purpose: Remove a child flush dependency between the extensible array's + * header and another piece of metadata in the file. + * + * Return: SUCCEED/FAIL + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * May 27 2009 + * + *------------------------------------------------------------------------- + */ +BEGIN_FUNC(PRIV, ERR, +herr_t, SUCCEED, FAIL, +H5EA_undepend(H5AC_info_t *parent_entry, H5EA_t *ea)) + + /* Local variables */ + H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ + +#ifdef QAK +HDfprintf(stderr, "%s: Called\n", FUNC); +#endif /* QAK */ + + /* + * Check arguments. + */ + HDassert(ea); + HDassert(hdr); + + /* Set the shared array header's file context for this operation */ + hdr->f = ea->f; + + /* Remove flush dependency between child_entry and metadata array 'thing' */ + if(H5EA__destroy_flush_depend(hdr, parent_entry, (H5AC_info_t *)hdr) < 0) + H5E_THROW(H5E_CANTUNDEPEND, "unable to destroy flush dependency on file metadata") + +CATCH + +END_FUNC(PRIV) /* end H5EA_undepend() */ + + +/*------------------------------------------------------------------------- + * Function: H5EA_support + * + * Purpose: Create a child flush dependency on the array metadata that + * contains the element for an array index. * * Return: SUCCEED/FAIL * @@ -794,7 +880,7 @@ END_FUNC(PRIV) /* end H5EA_get() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_depend(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry)) +H5EA_support(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -835,11 +921,11 @@ CATCH if(thing && (thing_unprot_func)(thing, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata") -END_FUNC(PRIV) /* end H5EA_depend() */ +END_FUNC(PRIV) /* end H5EA_support() */ /*------------------------------------------------------------------------- - * Function: H5EA_undepend + * Function: H5EA_unsupport * * Purpose: Remove a flush dependency on the array metadata that contains * the element for an array index. @@ -854,7 +940,7 @@ END_FUNC(PRIV) /* end H5EA_depend() */ */ BEGIN_FUNC(PRIV, ERR, herr_t, SUCCEED, FAIL, -H5EA_undepend(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry)) +H5EA_unsupport(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry)) /* Local variables */ H5EA_hdr_t *hdr = ea->hdr; /* Header for EA */ @@ -895,7 +981,7 @@ CATCH if(thing && (thing_unprot_func)(thing, dxpl_id, H5AC__NO_FLAGS_SET) < 0) H5E_THROW(H5E_CANTUNPROTECT, "unable to release extensible array metadata") -END_FUNC(PRIV) /* end H5EA_undepend() */ +END_FUNC(PRIV) /* end H5EA_unsupport() */ /*------------------------------------------------------------------------- diff --git a/src/H5EAprivate.h b/src/H5EAprivate.h index 43899a1..12074fe 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -130,9 +130,11 @@ H5_DLL herr_t H5EA_get_nelmts(const H5EA_t *ea, hsize_t *nelmts); H5_DLL herr_t H5EA_get_addr(const H5EA_t *ea, haddr_t *addr); H5_DLL herr_t H5EA_set(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, const void *elmt); H5_DLL herr_t H5EA_get(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, void *elmt); -H5_DLL herr_t H5EA_depend(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, +H5_DLL herr_t H5EA_depend(H5AC_info_t *parent_entry, H5EA_t *ea); +H5_DLL herr_t H5EA_undepend(H5AC_info_t *parent_entry, H5EA_t *ea); +H5_DLL herr_t H5EA_support(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry); -H5_DLL herr_t H5EA_undepend(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, +H5_DLL herr_t H5EA_unsupport(const H5EA_t *ea, hid_t dxpl_id, hsize_t idx, H5AC_info_t *child_entry); H5_DLL herr_t H5EA_close(H5EA_t *ea, hid_t dxpl_id); H5_DLL herr_t H5EA_delete(H5F_t *f, hid_t dxpl_id, haddr_t ea_addr); @@ -1580,20 +1580,17 @@ H5O_protect(H5O_loc_t *loc, hid_t dxpl_id) /* Lock the object header into the cache */ if(NULL == (ret_value = (H5O_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, NULL, NULL, H5AC_WRITE))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "unable to load object header") + HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header") /* Mark object header as un-evictable */ - if(H5AC_pin_protected_entry(loc->file, ret_value) < 0) { - if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, ret_value, H5AC__NO_FLAGS_SET) < 0) - HDONE_ERROR(H5E_OHDR, H5E_PROTECT, NULL, "unable to release object header") - + if(H5AC_pin_protected_entry(loc->file, ret_value) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTPIN, NULL, "unable to pin object header") - } /* end if */ +done: /* Release the object header from the cache */ if(H5AC_unprotect(loc->file, dxpl_id, H5AC_OHDR, loc->addr, ret_value, H5AC__NO_FLAGS_SET) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_PROTECT, NULL, "unable to release object header") -done: + HDONE_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, NULL, "unable to release object header") + FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_protect() */ @@ -1756,27 +1756,25 @@ done: /*------------------------------------------------------------------------- - * Function: H5S_set_extent + * Function: H5S_set_extent * - * Purpose: Modify the dimensions of a dataspace. Based on H5S_extend + * Purpose: Modify the dimensions of a dataspace. Based on H5S_extend * - * Return: Success: Non-negative + * Return: Success: Non-negative + * Failure: Negative * - * Failure: Negative - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: March 13, 2002 + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * March 13, 2002 * *------------------------------------------------------------------------- */ -int +htri_t H5S_set_extent(H5S_t *space, const hsize_t *size) { unsigned u; /* Local index variable */ - herr_t ret_value = 0; /* Return value */ + htri_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI(H5S_set_extent, FAIL); + FUNC_ENTER_NOAPI(H5S_set_extent, FAIL) /* Check args */ HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); @@ -1785,21 +1783,26 @@ H5S_set_extent(H5S_t *space, const hsize_t *size) /* Verify that the dimensions being changed are allowed to change */ for(u = 0; u < space->extent.rank; u++) { if(space->extent.size[u] != size[u]) { + /* Check for invalid dimension size modification */ if(space->extent.max && H5S_UNLIMITED != space->extent.max[u] && space->extent.max[u] < size[u]) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dimension cannot be modified") - ret_value++; + HGOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "dimension cannot be modified") + + /* Indicate that dimension size can be modified */ + ret_value = TRUE; } /* end if */ } /* end for */ - /* Update */ + /* Update dimension size(s) */ if(ret_value) - H5S_set_extent_real(space, size); + if(H5S_set_extent_real(space, size) < 0) + HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSET, FAIL, "failed to change dimension size(s)") done: - FUNC_LEAVE_NOAPI(ret_value); -} + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5S_set_extent() */ + /*------------------------------------------------------------------------- * Function: H5S_has_extent * @@ -1824,7 +1827,7 @@ H5S_has_extent(const H5S_t *ds) HDassert(ds); - if(ds->extent.rank==0 && ds->extent.nelem == 0 && ds->extent.type != H5S_NULL) + if(0 == ds->extent.rank && 0 == ds->extent.nelem && H5S_NULL != ds->extent.type) ret_value = FALSE; else ret_value = TRUE; @@ -1835,43 +1838,41 @@ done: /*------------------------------------------------------------------------- - * Function: H5S_set_extent_real - * - * Purpose: Modify the dimensions of a dataspace. Based on H5S_extend - * - * Return: Success: Non-negative + * Function: H5S_set_extent_real * - * Failure: Negative + * Purpose: Modify the dimensions of a dataspace. Based on H5S_extend * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * Return: Success: Non-negative + * Failure: Negative * - * Date: March 13, 2002 + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * March 13, 2002 * *------------------------------------------------------------------------- */ herr_t -H5S_set_extent_real( H5S_t *space, const hsize_t *size ) +H5S_set_extent_real(H5S_t *space, const hsize_t *size) { hsize_t nelem; /* Number of elements in extent */ unsigned u; /* Local index variable */ - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5S_set_extent_real, FAIL ); + FUNC_ENTER_NOAPI(H5S_set_extent_real, FAIL) /* Check args */ - assert(space && H5S_SIMPLE==H5S_GET_EXTENT_TYPE(space)); - assert(size); + HDassert(space && H5S_SIMPLE == H5S_GET_EXTENT_TYPE(space)); + HDassert(size); /* Change the dataspace size & re-compute the number of elements in the extent */ - for (u=0, nelem=1; u < space->extent.rank; u++ ) { + for(u = 0, nelem = 1; u < space->extent.rank; u++ ) { space->extent.size[u] = size[u]; - nelem*=space->extent.size[u]; + nelem *= space->extent.size[u]; } /* end for */ space->extent.nelem = nelem; /* If the selection is 'all', update the number of elements selected */ - if(H5S_GET_SELECT_TYPE(space)==H5S_SEL_ALL) - if(H5S_select_all(space, FALSE)<0) + if(H5S_SEL_ALL == H5S_GET_SELECT_TYPE(space)) + if(H5S_select_all(space, FALSE) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection") /* Mark the dataspace as no longer shared if it was before */ @@ -1879,7 +1880,7 @@ H5S_set_extent_real( H5S_t *space, const hsize_t *size ) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTRESET, FAIL, "can't stop sharing dataspace") done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value) } /* end H5S_set_extent_real() */ diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h index e78fb51..3514670 100644 --- a/src/H5Sprivate.h +++ b/src/H5Sprivate.h @@ -184,7 +184,7 @@ H5_DLL herr_t H5S_write(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned update_flag H5S_t *ds); H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, H5S_t *ds); H5_DLL H5S_t *H5S_read(const struct H5O_loc_t *loc, hid_t dxpl_id); -H5_DLL int H5S_set_extent(H5S_t *space, const hsize_t *size); +H5_DLL htri_t H5S_set_extent(H5S_t *space, const hsize_t *size); H5_DLL herr_t H5S_set_extent_real(H5S_t *space, const hsize_t *size); H5_DLL H5S_t *H5S_create(H5S_class_t type); H5_DLL H5S_t *H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], diff --git a/src/H5public.h b/src/H5public.h index 371847d..92eb6d4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -71,10 +71,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 39 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 40 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "FA_a1" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.39-FA_a1" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.40-FA_a1" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 2709f3b..d8a7a81 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -409,7 +409,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 29 +LT_VERS_REVISION = 30 LT_VERS_AGE = 0 H5detect_CFLAGS = -g |