From 8ae371469a5441e54c5df3c6a3372bdf6a66fc6b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 3 Jun 2002 21:20:07 -0500 Subject: [svn-r5519] Purpose: Bug Fix Description: The "dirty" flag for symbol table entries and symbol table nodes was not being cleared when they were flushed to the file, causing lots of extra metadata I/O. Solution: Reset the symbol table entry & nodes' flags when thy are flushed to disk. This reduces the number of I/O operations which hit the disk for my test program from 83 to 53 (i.e. from 393 to 53, overall). Platforms tested: Solaris 2.7 (arabica) w/FORTRAN & FreeBSD 4.5 (sleipnir) w/C++ --- release_docs/RELEASE.txt | 2 ++ src/H5Gnode.c | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1ec6ce2..d3b126b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -36,6 +36,8 @@ Bug Fixes since HDF5-1.4.0 Library ------- + * Clear symbol table node "dirty" flag when flushing symbol tables to + disk, to reduce I/O calls made & improve performance. QAK - 2002/06/03 * Fixed bug where an object's header could get corrupted in certain obscure situations where many objects were created in the file. QAK - 2002/05/31 * Fixed bug where read/write intent in file IDs created with H5Freopen diff --git a/src/H5Gnode.c b/src/H5Gnode.c index eedb8e6..2acd0a4 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -338,7 +338,13 @@ H5G_node_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5G_node_t *sym) * Look for dirty entries and set the node dirty flag. */ for (i=0; insyms; i++) { - if (sym->entry[i].dirty) sym->dirty = TRUE; + if (sym->entry[i].dirty) { + /* Set the node's dirty flag */ + sym->dirty = TRUE; + + /* Reset the entry's dirty flag */ + sym->entry[i].dirty=FALSE; + } /* end if */ } /* @@ -376,7 +382,11 @@ H5G_node_flush(H5F_t *f, hbool_t destroy, haddr_t addr, H5G_node_t *sym) "unable to write symbol table node to the file"); if (buf) H5FL_BLK_FREE(symbol_node,buf); + + /* Reset the node's dirty flag */ + sym->dirty = FALSE; } + /* * Destroy the symbol node? This might happen if the node is being * preempted from the cache. -- cgit v0.12