diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-02-10 17:26:09 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-02-10 17:26:09 (GMT) |
commit | 24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435 (patch) | |
tree | 6b2eb3bb1e782c40718204882428e6471b6281ac /src/H5ACprivate.h | |
parent | 738661ab9f409b8d961ba1402d6c4dd5f99ecb43 (diff) | |
download | hdf5-24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435.zip hdf5-24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435.tar.gz hdf5-24d8506dd564c5cc0fdebb5ebdfaec7bda5a7435.tar.bz2 |
[svn-r6387] Purpose:
Bug Fix
Description:
Metadata cache in parallel I/O can cause hangs in applications which
perform independent I/O on chunked datasets, because the metadata cache
can attempt to flush out dirty metadata from only a single process, instead
of collectively from all processes.
Solution:
Pass a dataset transfer property list down from every API function which
could possibly trigger metadata I/O.
Then, split the metadata cache into two sets of entries to allow dirty
metadata to be set aside when a hash table collision occurs during
independent I/O.
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}
FreeBSD 4.7 (sleipnir) serial & parallel
Misc. update:
Updated release_docs/RELEASE
Diffstat (limited to 'src/H5ACprivate.h')
-rw-r--r-- | src/H5ACprivate.h | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index d587df6..96cf05c 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -34,6 +34,16 @@ # undef H5AC_DEBUG #endif +/* Dataset transfer property list for flush calls */ +/* (Collective set, "block before metadata write" set and "library internal" set) */ +/* (Global variable declaration, definition is in H5AC.c) */ +extern hid_t H5AC_dxpl_id; + +/* Dataset transfer property list for independent metadata I/O calls */ +/* (just "library internal" set - i.e. independent transfer mode) */ +/* (Global variable declaration, definition is in H5AC.c) */ +extern hid_t H5AC_ind_dxpl_id; + /* * Class methods pertaining to caching. Each type of cached object will * have a constant variable with permanent life-span that describes how @@ -58,13 +68,15 @@ typedef enum H5AC_subid_t { H5AC_NTYPES = 5 /*THIS MUST BE LAST! */ } H5AC_subid_t; -typedef void *(*H5AC_load_func_t)(H5F_t*, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -typedef herr_t (*H5AC_flush_func_t)(H5F_t*, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); +typedef void *(*H5AC_load_func_t)(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); +typedef herr_t (*H5AC_flush_func_t)(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); +typedef herr_t (*H5AC_dest_func_t)(H5F_t *f, void *thing); typedef struct H5AC_class_t { H5AC_subid_t id; H5AC_load_func_t load; H5AC_flush_func_t flush; + H5AC_dest_func_t dest; } H5AC_class_t; /* @@ -81,6 +93,7 @@ typedef struct H5AC_class_t { typedef struct H5AC_info_t { const H5AC_class_t *type; /*type of object stored here */ haddr_t addr; /*file address for object */ + hbool_t dirty; /* 'Dirty' flag for cached object */ } H5AC_info_t; typedef H5AC_info_t *H5AC_info_ptr_t; /* Typedef for free lists */ @@ -95,6 +108,7 @@ typedef struct H5AC_prot_t { typedef struct H5AC_t { unsigned nslots; /*number of cache slots */ H5AC_info_t **slot; /*the cache slots, an array of pointers to the cached objects */ + H5AC_info_t **dslot; /*"held object" cache slots, an array of pointers to dirty cached objects */ #ifdef H5AC_DEBUG H5AC_prot_t *prot; /*the protected slots */ #endif /* H5AC_DEBUG */ @@ -105,6 +119,11 @@ typedef struct H5AC_t { unsigned nmisses; /*number of cache misses */ unsigned ninits; /*number of cache inits */ unsigned nflushes; /*number of flushes to disk */ +#ifdef H5_HAVE_PARALLEL + unsigned ndestroys; /*number of cache destroys */ + unsigned nholds; /*number of cache holds */ + unsigned nrestores; /*number of cache restores */ +#endif /* H5_HAVE_PARALLEL */ } diagnostics[H5AC_NTYPES]; /*diagnostics for each type of object*/ #endif /* H5AC_DEBUG */ } H5AC_t; @@ -114,39 +133,32 @@ typedef struct H5AC_t { #define H5AC_BLOCK_BEFORE_META_WRITE_NAME "H5AC_block_before_meta_write" #define H5AC_BLOCK_BEFORE_META_WRITE_SIZE sizeof(unsigned) #define H5AC_BLOCK_BEFORE_META_WRITE_DEF 0 + +/* Definitions for "library internal" property */ +#define H5AC_LIBRARY_INTERNAL_NAME "H5AC_library_internal" +#define H5AC_LIBRARY_INTERNAL_SIZE sizeof(unsigned) +#define H5AC_LIBRARY_INTERNAL_DEF 0 #endif /* H5_HAVE_PARALLEL */ /* * Library prototypes. */ -H5_DLL herr_t H5AC_dest(H5F_t *f); -H5_DLL void *H5AC_find_f(H5F_t *f, const H5AC_class_t *type, haddr_t addr, - const void *udata1, void *udata2); -H5_DLL void *H5AC_protect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, +H5_DLL herr_t H5AC_init(void); +H5_DLL herr_t H5AC_create(H5F_t *f, int size_hint); +H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, + void *thing); +H5_DLL void *H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, const void *udata1, void *udata2); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, const H5AC_class_t *type, haddr_t addr, +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing); -H5_DLL herr_t H5AC_flush(H5F_t *f, const H5AC_class_t *type, haddr_t addr, +H5_DLL void *H5AC_find(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, + haddr_t addr, const void *udata1, void *udata2); +H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, hbool_t destroy); -H5_DLL herr_t H5AC_create(H5F_t *f, int size_hint); -H5_DLL herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type, +H5_DLL herr_t H5AC_rename(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr); -H5_DLL herr_t H5AC_set(H5F_t *f, const H5AC_class_t *type, haddr_t addr, - void *thing); +H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5AC_debug(H5F_t *f); -/* This seems to be slower than just calling H5AC_find_f, which performs the - * cache lookup also. - QAK - */ -#ifdef OLD_WAY -#define H5AC_find(F,TYPE,ADDR,UDATA1,UDATA2) \ - ((F)->shared->cache->slot[H5AC_HASH(F,ADDR)]!=NULL && \ - ((F)->shared->cache->slot[H5AC_HASH(F,ADDR)]->type==(TYPE) && \ - (F)->shared->cache->slot[H5AC_HASH(F,ADDR)]->addr==ADDR) ? \ - ((F)->shared->cache->diagnostics[(TYPE)->id].nhits++, \ - (F)->shared->cache->slot[H5AC_HASH(F,ADDR)]) : \ - H5AC_find_f(F, TYPE, ADDR, UDATA1, UDATA2)) -#endif /* OLD_WAY */ - #endif /* !_H5ACprivate_H */ |