diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2009-06-02 20:14:17 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2009-06-02 20:14:17 (GMT) |
commit | fc2899346417fed3727f28115d30d9fd62d6691d (patch) | |
tree | 342de31f2d0bfcccaa03e2b05cc827e8ae638506 /src | |
parent | 126dae2440467e5e2f5a182a5a9424ab357d8992 (diff) | |
download | hdf5-fc2899346417fed3727f28115d30d9fd62d6691d.zip hdf5-fc2899346417fed3727f28115d30d9fd62d6691d.tar.gz hdf5-fc2899346417fed3727f28115d30d9fd62d6691d.tar.bz2 |
[svn-r16997] Description:
Change previous "depend/undepend" routine names to be "support/unsupport"
and add new "depend/undepend" routines, which make the extensible array a child
flush dependency of another piece of metadata in the file.
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
Diffstat (limited to 'src')
-rw-r--r-- | src/H5EA.c | 100 | ||||
-rw-r--r-- | src/H5EAprivate.h | 6 |
2 files changed, 97 insertions, 9 deletions
@@ -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 adc0b4f..a132006 100644 --- a/src/H5EAprivate.h +++ b/src/H5EAprivate.h @@ -127,9 +127,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); |