diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-01-09 17:20:03 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-01-09 17:20:03 (GMT) |
commit | 9a433b99a56dc575f1c0b11f95b744de61859dbb (patch) | |
tree | d8c766537cb9adc364c902bd45477d97f67a4a9f /src/H5Gnode.c | |
parent | 7fd449cb7987772a2881a5ced2ae7ad5231f1fa3 (diff) | |
download | hdf5-9a433b99a56dc575f1c0b11f95b744de61859dbb.zip hdf5-9a433b99a56dc575f1c0b11f95b744de61859dbb.tar.gz hdf5-9a433b99a56dc575f1c0b11f95b744de61859dbb.tar.bz2 |
[svn-r6252] Purpose:
Lots of performance improvements & a couple new internal API interfaces.
Description:
Performance Improvements:
- Cached file offset & length sizes in shared file struct, to avoid
constantly looking them up in the FCPL.
- Generic property improvements:
- Added "revision" number to generic property classes to speed
up comparisons.
- Changed method of storing properties from using a hash-table
to the TBBT routines in the library.
- Share the propery names between classes and the lists derived
from them.
- Removed redundant 'def_value' buffer from each property.
- Switching code to use a "copy on write" strategy for
properties in each list, where the properties in each list
are shared with the properties in the class, until a
property's value is changed in a list.
- Fixed error in layout code which was allocating too many buffers.
- Redefined public macros of the form (H5open()/H5check, <variable>)
internally to only be (<variable>), avoiding innumerable useless
calls to H5open() and H5check_version().
- Reuse already zeroed buffers in H5F_contig_fill instead of
constantly re-zeroing them.
- Don't write fill values if writing entire dataset.
- Use gettimeofday() system call instead of time() system when
checking the modification time of a dataset.
- Added reference counted string API and use it for tracking the
names of objects opening in a file (for the ID->name code).
- Removed redundant H5P_get() calls in B-tree routines.
- Redefine H5T datatype macros internally to the library, to avoid
calling H5check redundantly.
- Keep dataspace information for dataset locally instead of reading
from disk each time. Added new module to track open objects
in a file, to allow this (which will be useful eventually for
some FPH5 metadata caching issues).
- Remove H5AC_find macro which was inlining metadata cache lookups,
and call function instead.
- Remove redundant memset() calls from H5G_namei() routine.
- Remove redundant checking of object type when locating objects
in metadata cache and rely on the address only.
- Create default dataset object to use when default dataset creation
property list is used to create datasets, bypassing querying
for all the property list values.
- Use default I/O vector size when performing raw data with the
default dataset transfer property list, instead of querying for
I/O vector size.
- Remove H5P_DEFAULT internally to the library, replacing it with
more specific default property list based on the type of
property list needed.
- Remove redundant memset() calls in object header message (H5O*)
routines.
- Remove redunant memset() calls in data I/O routines.
- Split free-list allocation routines into malloc() and calloc()-
like routines, instead of one combined routine.
- Remove lots of indirection in H5O*() routines.
- Simplify metadata cache entry comparison routine (used when
flushing entire cache out).
- Only enable metadata cache statistics when H5AC_DEBUG is turned
on, instead of always tracking them.
- Simplify address comparison macro (H5F_addr_eq).
- Remove redundant metadata cache entry protections during dataset
creation by protecting the object header once and making all
the modifications necessary for the dataset creation before
unprotecting it.
- Reduce # of "number of element in extent" computations performed
by computing and storing the value during dataspace creation.
- Simplify checking for group location's file information, when file
has not been involving in file-mounting operations.
- Use binary encoding for modification time, instead of ASCII.
- Hoist H5HL_peek calls (to get information in a local heap)
out of loops in many group routine.
- Use static variable for iterators of selections, instead of
dynamically allocation them each time.
- Lookup & insert new entries in one step, avoiding traversing
group's B-tree twice.
- Fixed memory leak in H5Gget_objname_idx() routine (tangential to
performance improvements, but fixed along the way).
- Use free-list for reference counted strings.
- Don't bother copying object names into cached group entries,
since they are re-created when an object is opened.
The benchmark I used to measure these results created several thousand
small (2K) datasets in a file and wrote out the data for them. This is
Elena's "regular.c" benchmark.
These changes resulted in approximately ~4.3x speedup of the
development branch when compared to the previous code in the
development branch and ~1.4x speedup compared to the release
branch.
Additionally, these changes reduce the total memory used (code and
data) by the development branch by ~800KB, bringing the development
branch back into the same ballpark as the release branch.
I'll send out a more detailed description of the benchmark results
as a followup note.
New internal API routines:
Added "reference counted strings" API for tracking strings that get
used by multiple owners without duplicating the strings.
Added "ternary search tree" API for text->object mappings.
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}
Other platforms/configurations tested?
FreeBSD 4.7 (sleipnir) serial & parallel
Solaris 2.6 (baldric) serial
Diffstat (limited to 'src/H5Gnode.c')
-rw-r--r-- | src/H5Gnode.c | 170 |
1 files changed, 68 insertions, 102 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 98fde41..d850910 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -224,7 +224,7 @@ H5G_node_size(H5F_t *f) FUNC_ENTER_NOINIT(H5G_node_size); FUNC_LEAVE(H5G_NODE_SIZEOF_HDR(f) + - (2 * H5G_node_k(f)) * H5G_SIZEOF_ENTRY(f)); + (2 * H5F_SYM_LEAF_K(f)) * H5G_SIZEOF_ENTRY(f)); } @@ -267,13 +267,13 @@ H5G_node_create(H5F_t *f, H5B_ins_t UNUSED op, void *_lt_key, assert(f); assert(H5B_INS_FIRST == op); - if (NULL==(sym = H5FL_ALLOC(H5G_node_t,1))) + if (NULL==(sym = H5FL_CALLOC(H5G_node_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); size = H5G_node_size(f); if (HADDR_UNDEF==(*addr_p=H5MF_alloc(f, H5FD_MEM_BTREE, size))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to allocate file space"); sym->dirty = TRUE; - sym->entry = H5FL_ARR_ALLOC(H5G_entry_t,(2*H5G_node_k(f)),1); + sym->entry = H5FL_ARR_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))); if (NULL==sym->entry) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); if (H5AC_set(f, H5AC_SNODE, *addr_p, sym) < 0) @@ -366,7 +366,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ size = H5G_node_size(f); /* Allocate temporary buffer */ - if ((buf=H5FL_BLK_ALLOC(symbol_node,size, 0))==NULL) + if ((buf=H5FL_BLK_MALLOC(symbol_node,size))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); p=buf; @@ -401,10 +401,6 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_ * preempted from the cache. */ if (destroy) { - /* Free the ID to name buffer */ - for (i=0; i<sym->nsyms; i++) - H5G_free_ent_name(&(sym->entry[i])); - sym->entry = H5FL_ARR_FREE(H5G_entry_t,sym->entry); H5FL_FREE(H5G_node_t,sym); } @@ -460,11 +456,11 @@ H5G_node_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void * UNUSED _udata1 * Initialize variables. */ size = H5G_node_size(f); - if ((buf=H5FL_BLK_ALLOC(symbol_node,size,0))==NULL) + if ((buf=H5FL_BLK_MALLOC(symbol_node,size))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for symbol table node"); p=buf; - if (NULL==(sym = H5FL_ALLOC(H5G_node_t,1)) || - NULL==(sym->entry=H5FL_ARR_ALLOC(H5G_entry_t,(2*H5G_node_k(f)),1))) + if (NULL==(sym = H5FL_CALLOC(H5G_node_t)) || + NULL==(sym->entry=H5FL_ARR_CALLOC(H5G_entry_t,(2*H5F_SYM_LEAF_K(f))))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); if (H5F_block_read(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_SYM, H5E_READERROR, NULL, "unable to read symbol table node"); @@ -534,6 +530,7 @@ H5G_node_cmp2(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key) H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; const char *s1, *s2; + const char *base; /* Base of heap */ int ret_value; FUNC_ENTER_NOAPI(H5G_node_cmp2, FAIL); @@ -542,11 +539,14 @@ H5G_node_cmp2(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key) assert(lt_key); assert(rt_key); - if (NULL == (s1 = H5HL_peek(f, udata->heap_addr, lt_key->offset))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol name"); - if (NULL == (s2 = H5HL_peek(f, udata->heap_addr, rt_key->offset))) + /* Get base address of heap */ + if (NULL == (base = H5HL_peek(f, udata->heap_addr, 0))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol name"); + /* Get pointers to string names */ + s1=base+lt_key->offset; + s2=base+rt_key->offset; + /* Set return value */ ret_value = HDstrcmp(s1, s2); @@ -585,23 +585,26 @@ done: static int H5G_node_cmp3(H5F_t *f, void *_lt_key, void *_udata, void *_rt_key) { - H5G_bt_ud1_t *udata = (H5G_bt_ud1_t *) _udata; - H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; - H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; - const char *s; - int ret_value=0; /* Return value */ + H5G_bt_ud1_t *udata = (H5G_bt_ud1_t *) _udata; + H5G_node_key_t *lt_key = (H5G_node_key_t *) _lt_key; + H5G_node_key_t *rt_key = (H5G_node_key_t *) _rt_key; + const char *s; + const char *base; /* Base of heap */ + int ret_value=0; /* Return value */ FUNC_ENTER_NOAPI(H5G_node_cmp3, FAIL); - /* left side */ - if (NULL == (s = H5HL_peek(f, udata->heap_addr, lt_key->offset))) + /* Get base address of heap */ + if (NULL == (base = H5HL_peek(f, udata->heap_addr, 0))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol name"); + + /* left side */ + s=base+lt_key->offset; if (HDstrcmp(udata->name, s) <= 0) HGOTO_DONE(-1); /* right side */ - if (NULL == (s = H5HL_peek(f, udata->heap_addr, rt_key->offset))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol name"); + s=base+rt_key->offset; if (HDstrcmp(udata->name, s) > 0) HGOTO_DONE(1); @@ -647,6 +650,7 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void UNUSED *_lt_key, H5G_node_t *sn = NULL; int lt = 0, idx = 0, rt, cmp = 1; const char *s; + const char *base; /* Base of heap */ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5G_node_found, FAIL); @@ -664,14 +668,17 @@ H5G_node_found(H5F_t *f, haddr_t addr, const void UNUSED *_lt_key, if (NULL == (sn = H5AC_protect(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to protect symbol table node"); + /* Get base address of heap */ + if (NULL == (base = H5HL_peek(f, bt_udata->heap_addr, 0))) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol name"); + /* * Binary search. */ rt = sn->nsyms; while (lt < rt && cmp) { idx = (lt + rt) / 2; - if (NULL == (s = H5HL_peek(f, bt_udata->heap_addr, sn->entry[idx].name_off))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read symbol name"); + s=base+sn->entry[idx].name_off; cmp = HDstrcmp(bt_udata->name, s); if (cmp < 0) { @@ -750,10 +757,11 @@ H5G_node_insert(H5F_t *f, haddr_t addr, void UNUSED *_lt_key, H5G_node_t *sn = NULL, *snrt = NULL; size_t offset; /*offset of name in heap */ const char *s; + const char *base; /* Base of heap */ int idx = -1, cmp = 1; int lt = 0, rt; /*binary search cntrs */ - H5B_ins_t ret_value = H5B_INS_ERROR; H5G_node_t *insert_into = NULL; /*node that gets new entry*/ + H5B_ins_t ret_value = H5B_INS_ERROR; FUNC_ENTER_NOAPI(H5G_node_insert, H5B_INS_ERROR); @@ -773,14 +781,17 @@ H5G_node_insert(H5F_t *f, haddr_t addr, void UNUSED *_lt_key, if (NULL == (sn = H5AC_protect(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node"); + /* Get base address of heap */ + if (NULL == (base = H5HL_peek(f, bt_udata->heap_addr, 0))) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to read symbol name"); + /* * Where does the new symbol get inserted? We use a binary search. */ rt = sn->nsyms; while (lt < rt) { idx = (lt + rt) / 2; - if (NULL == (s = H5HL_peek(f, bt_udata->heap_addr, sn->entry[idx].name_off))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to read symbol name"); + s=base+sn->entry[idx].name_off; if (0 == (cmp = HDstrcmp(bt_udata->name, s))) /*already present */ HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR, "symbol is already present in symbol table"); if (cmp < 0) { @@ -799,7 +810,7 @@ H5G_node_insert(H5F_t *f, haddr_t addr, void UNUSED *_lt_key, bt_udata->ent.name_off = offset; if (0==offset || (size_t)(-1)==offset) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert symbol name into heap"); - if ((size_t)(sn->nsyms) >= 2*H5G_node_k(f)) { + if ((size_t)(sn->nsyms) >= 2*H5F_SYM_LEAF_K(f)) { /* * The node is full. Split it into a left and right * node and return the address of the new right node (the @@ -811,31 +822,31 @@ H5G_node_insert(H5F_t *f, haddr_t addr, void UNUSED *_lt_key, if (H5G_node_create(f, H5B_INS_FIRST, NULL, NULL, NULL, new_node_p/*out*/)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to split symbol table node"); - if (NULL==(snrt=H5AC_find(f, H5AC_SNODE, *new_node_p, NULL, NULL))) + if (NULL==(snrt=H5AC_find_f(f, H5AC_SNODE, *new_node_p, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to split symbol table node"); - HDmemcpy(snrt->entry, sn->entry + H5G_node_k(f), - H5G_node_k(f) * sizeof(H5G_entry_t)); - snrt->nsyms = H5G_node_k(f); + HDmemcpy(snrt->entry, sn->entry + H5F_SYM_LEAF_K(f), + H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); + snrt->nsyms = H5F_SYM_LEAF_K(f); snrt->dirty = TRUE; /* The left node */ - HDmemset(sn->entry + H5G_node_k(f), 0, - H5G_node_k(f) * sizeof(H5G_entry_t)); - sn->nsyms = H5G_node_k(f); + HDmemset(sn->entry + H5F_SYM_LEAF_K(f), 0, + H5F_SYM_LEAF_K(f) * sizeof(H5G_entry_t)); + sn->nsyms = H5F_SYM_LEAF_K(f); sn->dirty = TRUE; /* The middle key */ md_key->offset = sn->entry[sn->nsyms - 1].name_off; /* Where to insert the new entry? */ - if (idx <= (int)H5G_node_k(f)) { + if (idx <= (int)H5F_SYM_LEAF_K(f)) { insert_into = sn; - if (idx == (int)H5G_node_k(f)) + if (idx == (int)H5F_SYM_LEAF_K(f)) md_key->offset = offset; } else { - idx -= H5G_node_k(f); + idx -= H5F_SYM_LEAF_K(f); insert_into = snrt; - if (idx == (int)H5G_node_k (f)) { + if (idx == (int)H5F_SYM_LEAF_K (f)) { rt_key->offset = offset; *rt_key_changed = TRUE; } @@ -856,7 +867,7 @@ H5G_node_insert(H5F_t *f, haddr_t addr, void UNUSED *_lt_key, HDmemmove(insert_into->entry + idx + 1, insert_into->entry + idx, (insert_into->nsyms - idx) * sizeof(H5G_entry_t)); - H5G_ent_copy(&(insert_into->entry[idx]), &(bt_udata->ent),H5G_COPY_DEEP); + H5G_ent_copy(&(insert_into->entry[idx]), &(bt_udata->ent),H5G_COPY_NULL); insert_into->entry[idx].dirty = TRUE; insert_into->nsyms += 1; @@ -905,9 +916,10 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, H5G_node_key_t *rt_key = (H5G_node_key_t*)_rt_key; H5G_bt_ud1_t *bt_udata = (H5G_bt_ud1_t*)_udata; H5G_node_t *sn = NULL; - H5B_ins_t ret_value = H5B_INS_ERROR; int lt=0, rt, idx=0, cmp=1; const char *s = NULL; + const char *base; /* Base of heap */ + H5B_ins_t ret_value = H5B_INS_ERROR; FUNC_ENTER_NOAPI(H5G_node_remove, H5B_INS_ERROR); @@ -922,13 +934,15 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, if (NULL==(sn=H5AC_protect(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_INS_ERROR, "unable to protect symbol table node"); + /* Get base address of heap */ + if (NULL == (base = H5HL_peek(f, bt_udata->heap_addr, 0))) + HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to read symbol name"); + /* Find the name with a binary search */ rt = sn->nsyms; while (lt<rt && cmp) { idx = (lt+rt)/2; - if (NULL==(s=H5HL_peek(f, bt_udata->heap_addr, - sn->entry[idx].name_off))) - HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to read symbol name"); + s=base+sn->entry[idx].name_off; cmp = HDstrcmp(bt_udata->name, s); if (cmp<0) { rt = idx; @@ -941,8 +955,7 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, if (H5G_CACHED_SLINK==sn->entry[idx].type) { /* Remove the symbolic link value */ - if ((s=H5HL_peek(f, bt_udata->heap_addr, - sn->entry[idx].cache.slink.lval_offset))) + if ((s=H5HL_peek(f, bt_udata->heap_addr, sn->entry[idx].cache.slink.lval_offset))) H5HL_remove(f, bt_udata->heap_addr, sn->entry[idx].cache.slink.lval_offset, HDstrlen(s)+1); H5E_clear(); /*no big deal*/ } else { @@ -957,9 +970,6 @@ H5G_node_remove(H5F_t *f, haddr_t addr, void *_lt_key/*in,out*/, H5HL_remove(f, bt_udata->heap_addr, sn->entry[idx].name_off, HDstrlen(s)+1); H5E_clear(); /*no big deal*/ - /* Free the ID to name buffer for the entry being squeezed out */ - H5G_free_ent_name(sn->entry+idx); - /* Remove the entry from the symbol table node */ if (1==sn->nsyms) { /* @@ -1070,7 +1080,7 @@ H5G_node_iterate (H5F_t *f, void UNUSED *_lt_key, haddr_t addr, * Save information about the symbol table node since we can't lock it * because we're about to call an application function. */ - if (NULL == (sn = H5AC_find(f, H5AC_SNODE, addr, NULL, NULL))) + if (NULL == (sn = H5AC_find_f(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); nsyms = sn->nsyms; if (NULL==(name_off = H5MM_malloc (nsyms*sizeof(name_off[0])))) @@ -1082,12 +1092,11 @@ H5G_node_iterate (H5F_t *f, void UNUSED *_lt_key, haddr_t addr, /* * Iterate over the symbol table node entries. */ - for (i=0, ret_value=0; i<nsyms && 0==ret_value; i++) { + for (i=0, ret_value=H5B_ITER_CONT; i<nsyms && H5B_ITER_CONT==ret_value; i++) { if (bt_udata->skip>0) { --bt_udata->skip; } else { - name = H5HL_peek (f, bt_udata->group->ent.cache.stab.heap_addr, - name_off[i]); + name = H5HL_peek (f, bt_udata->group->ent.cache.stab.heap_addr, name_off[i]); assert (name); n = HDstrlen (name); if (n+1>sizeof(buf)) { @@ -1149,7 +1158,7 @@ H5G_node_sumup(H5F_t *f, void UNUSED *_lt_key, haddr_t addr, assert(num_objs); /* Find the object node and add the number of symbol entries. */ - if (NULL == (sn = H5AC_find(f, H5AC_SNODE, addr, NULL, NULL))) + if (NULL == (sn = H5AC_find_f(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); *num_objs += sn->nsyms; @@ -1195,14 +1204,14 @@ H5G_node_name(H5F_t *f, void UNUSED *_lt_key, haddr_t addr, assert(bt_udata); - if (NULL == (sn = H5AC_find(f, H5AC_SNODE, addr, NULL, NULL))) + if (NULL == (sn = H5AC_find_f(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); /* Find the node, locate the object symbol table entry and retrieve the name */ if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { loc_idx = bt_udata->idx - bt_udata->num_objs; name_off = sn->entry[loc_idx].name_off; - name = (const char*)H5HL_peek (f, bt_udata->group->ent.cache.stab.heap_addr, name_off); + name = H5HL_peek (f, bt_udata->group->ent.cache.stab.heap_addr, name_off); assert (name); bt_udata->name = H5MM_strdup (name); HGOTO_DONE(H5B_ITER_STOP); @@ -1247,7 +1256,7 @@ H5G_node_type(H5F_t *f, void UNUSED *_lt_key, haddr_t addr, assert(bt_udata); /* Find the node, locate the object symbol table entry and retrieve the type */ - if (NULL == (sn = H5AC_find(f, H5AC_SNODE, addr, NULL, NULL))) + if (NULL == (sn = H5AC_find_f(f, H5AC_SNODE, addr, NULL, NULL))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { @@ -1318,7 +1327,7 @@ H5G_node_debug(H5F_t *f, haddr_t addr, FILE * stream, int indent, "Size of Node (in bytes):", (unsigned)H5G_node_size(f)); fprintf(stream, "%*s%-*s %d of %d\n", indent, "", fwidth, "Number of Symbols:", - sn->nsyms, 2 * H5G_node_k(f)); + sn->nsyms, 2 * H5F_SYM_LEAF_K(f)); indent += 3; fwidth = MAX(0, fwidth - 3); @@ -1339,46 +1348,3 @@ done: FUNC_LEAVE(ret_value); } - -/*------------------------------------------------------------------------- - * Function: H5G_node_k - * - * Purpose: Replaced a macro to retrieve the symbol table leaf size, - * now that the generic properties are being used to store - * the values. - * - * Return: Success: Non-negative, and the symbol table leaf size is - * returned. - * - * Failure: Negative (should not happen) - * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu - * Oct 14 2001 - * - * Modifications: - * Quincey Koziol, 2001-10-15 - * Added this header and removed unused ret_value variable. - *------------------------------------------------------------------------- - */ -unsigned H5G_node_k(const H5F_t *f) -{ - unsigned sym_leaf_k; - H5P_genplist_t *plist; /* Property list pointer */ - unsigned ret_value; /* Return value */ - - FUNC_ENTER_NOAPI(H5G_node_k, UFAIL); - - assert(f); - - if(NULL == (plist = H5I_object(f->shared->fcpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, UFAIL, "not a file access property list"); - if(H5P_get(plist, H5F_CRT_SYM_LEAF_NAME, &sym_leaf_k) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, UFAIL, "can't get rank for symbol table leaf node"); - - /* Set return value */ - ret_value=sym_leaf_k; - -done: - FUNC_LEAVE(ret_value); -} |