summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-05-20 12:43:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-05-20 12:43:30 (GMT)
commit83f50e5a722f7a58562a0885fef695f74bce7285 (patch)
tree604f4dad662be4824a77eb85cffa3639cd35a9de /src/H5AC.c
parent02a23331992c618bb3cacb35bc0ea52f36ba1482 (diff)
downloadhdf5-83f50e5a722f7a58562a0885fef695f74bce7285.zip
hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.tar.gz
hdf5-83f50e5a722f7a58562a0885fef695f74bce7285.tar.bz2
[svn-r18865] Description:
Bring r18864 from trunk to 1.8 branch: General cleanups to align metadata journaling branch and trunk Tested on: FreeBSD/32 6.3 (duty) in debug mode (h5committested on trunk)
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c414
1 files changed, 20 insertions, 394 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 5fe150d..a4624b0 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -24,22 +24,6 @@
* with a particular HDF file share the same cache; each
* HDF file has it's own cache.
*
- * Modifications:
- *
- * Robb Matzke, 4 Aug 1997
- * Added calls to H5E.
- *
- * Quincey Koziol, 22 Apr 2000
- * Turned on "H5AC_SORT_BY_ADDR"
- *
- * John Mainzer, 5/19/04
- * Complete redesign and rewrite. See the header comments for
- * H5AC_t for an overview of what is going on.
- *
- * John Mainzer, 6/4/04
- * Factored the new cache code into a separate file (H5C.c) to
- * facilitate re-use. Re-worked this file again to use H5C.
- *
*-------------------------------------------------------------------------
*/
@@ -207,8 +191,6 @@ static herr_t H5AC_flush_entries(H5F_t *f);
* Programmer: Quincey Koziol
* Saturday, January 18, 2003
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -234,8 +216,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
static herr_t
@@ -355,8 +335,6 @@ done:
* Programmer: Quincey Koziol
* Thursday, July 18, 2002
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
int
@@ -418,57 +396,6 @@ H5AC_term_interface(void)
* matzke@llnl.gov
* Jul 9 1997
*
- * Modifications:
- *
- * Complete re-design and re-write to support the re-designed
- * metadata cache.
- *
- * At present, the size_hint is ignored, and the
- * max_cache_size and min_clean_size fields are hard
- * coded. This should be fixed, but a parameter
- * list change will be required, so I will leave it
- * for now.
- *
- * Since no-one seems to care, the function now returns
- * one on success.
- * JRM - 4/28/04
- *
- * Reworked the function again after abstracting its guts to
- * the similar function in H5C.c. The function is now a
- * wrapper for H5C_create().
- * JRM - 6/4/04
- *
- * Deleted the old size_hint parameter and added the
- * max_cache_size, and min_clean_size parameters.
- *
- * JRM - 3/10/05
- *
- * Deleted the max_cache_size, and min_clean_size parameters,
- * and added the config_ptr parameter. Added code to
- * validate the resize configuration before we do anything.
- *
- * JRM - 3/24/05
- *
- * Changed the type of config_ptr from H5AC_auto_size_ctl_t *
- * to H5AC_cache_config_t *. Propagated associated changes
- * through the function.
- * JRM - 4/7/05
- *
- * Added code allocating and initializing the auxilary
- * structure (an instance of H5AC_aux_t), and linking it
- * to the instance of H5C_t created by H5C_create(). At
- * present, the auxilary structure is only used in PHDF5.
- *
- * JRM - 6/28/05
- *
- * Added code to set the prefix if required.
- *
- * JRM - 1/20/06
- *
- * Added code to initialize the new write_done field.
- *
- * JRM - 5/11/06
- *
*-------------------------------------------------------------------------
*/
@@ -804,12 +731,6 @@ done:
* Programmer: John Mainzer
* 6/30/06
*
- * Modifications:
- *
- * Added 'flags' paramater, to allow freeing file space
- *
- * QAK - 2/5/08
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -856,7 +777,7 @@ H5AC_expunge_entry(H5F_t *f,
#endif /* H5AC__TRACE_FILE_ENABLED */
result = H5C_expunge_entry(f,
- dxpl_id,
+ dxpl_id,
H5AC_noblock_dxpl_id,
type,
addr,
@@ -968,10 +889,6 @@ done:
* Programmer: John Mainzer
* 4/27/06
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1044,54 +961,8 @@ done:
* matzke@llnl.gov
* Jul 9 1997
*
- * Modifications:
- * Robb Matzke, 1999-07-27
- * The ADDR argument is passed by value.
- *
- * Bill Wendling, 2003-09-16
- * Added automatic "flush" if the FPHDF5 driver is being
- * used. This'll write the metadata to the SAP where other,
- * lesser processes can grab it.
- *
- * JRM - 5/13/04
- * Complete re-write for the new metadata cache. The new
- * code is functionally almost identical to the old, although
- * the sanity check for a protected entry is now an assert
- * at the beginning of the function.
- *
- * JRM - 6/7/04
- * Abstracted the guts of the function to H5C_insert_entry()
- * in H5C.c, and then re-wrote the function as a wrapper for
- * H5C_insert_entry().
- *
- * JRM - 1/6/05
- * Added the flags parameter. At present, this parameter is
- * only used to set the new flush_marker field on the new
- * entry. Since this doesn't apply to the SAP code, no change
- * is needed there. Thus the only change to the body of the
- * code is to pass the flags parameter through to
- * H5C_insert_entry().
- *
- * JRM - 6/6/05
- * Added code to force newly inserted entries to be dirty
- * in the flexible parallel case. The normal case is handled
- * in H5C.c. This is part of a series of changes directed at
- * moving management of the dirty flag on cache entries into
- * the cache code.
- *
- * JRM - 7/5/05
- * Added code to track dirty byte generation, and to trigger
- * clean entry list propagation when it exceeds a user
- * specified threshold. Note that this code only applies in
- * the PHDF5 case. It should have no effect on either the
- * serial or FPHSD5 cases.
- *
- * JRM - 6/6/06
- * Added trace file support.
- *
*-------------------------------------------------------------------------
*/
-
herr_t
H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags)
{
@@ -1168,12 +1039,12 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *
#endif /* H5_HAVE_PARALLEL */
result = H5C_insert_entry(f,
- dxpl_id,
+ dxpl_id,
H5AC_noblock_dxpl_id,
- type,
- addr,
- thing,
- flags);
+ type,
+ addr,
+ thing,
+ flags);
if ( result < 0 ) {
@@ -1458,56 +1329,13 @@ done:
* or flushed -- nor may it be accessed by another call to
* H5AC_protect. Any attempt to do so will result in a failure.
*
- * This comment is a re-write of the original Purpose: section.
- * For historical interest, the original version is reproduced
- * below:
- *
- * Original Purpose section:
- *
- * Similar to H5AC_find() except the object is removed from
- * the cache and given to the caller, preventing other parts
- * of the program from modifying the protected object or
- * preempting it from the cache.
- *
- * The caller must call H5AC_unprotect() when finished with
- * the pointer.
- *
* Return: Success: Ptr to the object.
- *
* Failure: NULL
*
* Programmer: Robb Matzke
* matzke@llnl.gov
* Sep 2 1997
*
- * Modifications:
- * Robb Matzke, 1999-07-27
- * The ADDR argument is passed by value.
- *
- * Bill Wendling, 2003-09-10
- * Added parameter to indicate whether this is a READ or
- * WRITE type of protect.
- *
- * JRM -- 5/17/04
- * Complete re-write for the new client cache. See revised
- * Purpose section above.
- *
- * JRM - 6/7/04
- * Abstracted the guts of the function to H5C_protect()
- * in H5C.c, and then re-wrote the function as a wrapper for
- * H5C_protect().
- *
- * JRM - 6/6/06
- * Added trace file support.
- *
- * JRM - 3/18/07
- * Modified code to support the new flags parameter for
- * H5C_protect(). For now, that means passing in the
- * H5C_READ_ONLY_FLAG if rw == H5AC_READ.
- *
- * Also updated the trace file output to save the
- * rw parameter, since we are now doing something with it.
- *
*-------------------------------------------------------------------------
*/
void *
@@ -1518,7 +1346,6 @@ H5AC_protect(H5F_t *f,
void *udata,
H5AC_protect_t rw)
{
- /* char * fcn_name = "H5AC_protect"; */
unsigned protect_flags = H5C__NO_FLAGS_SET;
void * thing = (void *)NULL;
void * ret_value; /* Return value */
@@ -1583,11 +1410,11 @@ H5AC_protect(H5F_t *f,
}
thing = H5C_protect(f,
- dxpl_id,
+ dxpl_id,
H5AC_noblock_dxpl_id,
- type,
- addr,
- udata,
+ type,
+ addr,
+ udata,
protect_flags);
if ( thing == NULL ) {
@@ -1774,57 +1601,6 @@ done:
* matzke@llnl.gov
* Sep 2 1997
*
- * Modifications:
- * Robb Matzke, 1999-07-27
- * The ADDR argument is passed by value.
- *
- * Quincey Koziol, 2003-03-19
- * Added "deleted" argument
- *
- * Bill Wendling, 2003-09-18
- * If this is an FPHDF5 driver and the data is dirty,
- * perform a "flush" that writes the data to the SAP.
- *
- * John Mainzer 5/19/04
- * Complete re-write for the new metadata cache.
- *
- * JRM - 6/7/04
- * Abstracted the guts of the function to H5C_unprotect()
- * in H5C.c, and then re-wrote the function as a wrapper for
- * H5C_unprotect().
- *
- * JRM - 1/6/05
- * Replaced the deleted parameter with the new flags parameter.
- * Since the deleted parameter is not used by the FPHDF5 code,
- * the only change in the body is to replace the deleted
- * parameter with the flags parameter in the call to
- * H5C_unprotect().
- *
- * JRM - 6/6/05
- * Added the dirtied flag and supporting code. This is
- * part of a collection of changes directed at moving
- * management of cache entry dirty flags into the H5C code.
- *
- * JRM - 7/5/05
- * Added code to track dirty byte generation, and to trigger
- * clean entry list propagation when it exceeds a user
- * specified threshold. Note that this code only applies in
- * the PHDF5 case. It should have no effect on either the
- * serial or FPHSD5 cases.
- *
- * JRM - 9/8/05
- * Added code to track entry size changes. This is necessary
- * as it can effect dirty byte creation counts, thereby
- * throwing the caches out of sync in the PHDF5 case.
- *
- * JRM - 5/16/06
- * Added code to use the new dirtied field in
- * H5C_cache_entry_t in the test to see if the entry has
- * been dirtied.
- *
- * JRM - 6/7/06
- * Added support for the trace file.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -1840,8 +1616,6 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
#endif /* H5_HAVE_PARALLEL */
#if H5AC__TRACE_FILE_ENABLED
char trace[128] = "";
- size_t trace_new_size = 0;
- unsigned trace_flags = 0;
FILE * trace_file_ptr = NULL;
#endif /* H5AC__TRACE_FILE_ENABLED */
herr_t ret_value=SUCCEED; /* Return value */
@@ -1873,8 +1647,6 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
sprintf(trace, "H5AC_unprotect 0x%lx %d",
(unsigned long)addr,
(int)(type->id));
-
- trace_flags = flags;
}
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1923,12 +1695,12 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
#endif /* H5_HAVE_PARALLEL */
result = H5C_unprotect(f,
- dxpl_id,
+ dxpl_id,
H5AC_noblock_dxpl_id,
- type,
- addr,
- thing,
- flags);
+ type,
+ addr,
+ thing,
+ flags);
if ( result < 0 ) {
@@ -1959,10 +1731,9 @@ done:
#if H5AC__TRACE_FILE_ENABLED
if ( trace_file_ptr != NULL ) {
- HDfprintf(trace_file_ptr, "%s %d %x %d\n",
+ HDfprintf(trace_file_ptr, "%s %x %d\n",
trace,
- (int)trace_new_size,
- (unsigned)trace_flags,
+ (unsigned)flags,
(int)ret_value);
}
#endif /* H5AC__TRACE_FILE_ENABLED */
@@ -1984,11 +1755,8 @@ done:
* Programmer: John Mainzer
* 5/11/06
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
herr_t
H5AC_set_write_done_callback(H5C_t * cache_ptr,
@@ -2031,15 +1799,6 @@ done:
* Programmer: Robb Matzke
* Thursday, October 30, 1997
*
- * Modifications:
- * John Mainzer 5/19/04
- * Re-write to support the new metadata cache.
- *
- * JRM - 6/7/04
- * Abstracted the guts of the function to H5C_stats()
- * in H5C.c, and then re-wrote the function as a wrapper for
- * H5C_stats().
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2072,34 +1831,8 @@ done:
* Programmer: John Mainzer
* 3/10/05
*
- * Modifications:
- *
- * JRM - 4/6/05
- * Reworked for the addition of struct H5AC_cache_config_t.
- *
- * JRM - 10/25/05
- * Added support for the new dirty_bytes_threshold field of
- * both H5AC_cache_config_t and H5AC_aux_t.
- *
- * JRM - 6/8/06
- * Added support for the new trace file related fields.
- *
- * JRM - 7/28/07
- * Added support for the new evictions enabled related fields.
- *
- * Observe that H5AC_get_cache_auto_resize_config() and
- * H5AC_set_cache_auto_resize_config() are becoming generic
- * metadata cache configuration routines as they gain
- * switches for functions that are only tenuously related
- * to auto resize configuration.
- *
- * JRM - 1/2/08
- * Added support for the new flash cache increment related
- * fields.
- *
*-------------------------------------------------------------------------
*/
-
herr_t
H5AC_get_cache_auto_resize_config(const H5AC_t * cache_ptr,
H5AC_cache_config_t *config_ptr)
@@ -2219,10 +1952,6 @@ done:
* Programmer: John Mainzer
* 3/11/05
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2266,10 +1995,6 @@ done:
* Programmer: John Mainzer
* 3/10/05
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2297,13 +2022,8 @@ done:
*
* Programmer: John Mainzer, 3/10/05
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
-
herr_t
H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr)
{
@@ -2337,31 +2057,6 @@ done:
* Programmer: John Mainzer
* 3/10/05
*
- * Modifications:
- *
- * John Mainzer -- 4/6/05
- * Updated for the addition of H5AC_cache_config_t.
- *
- * John Mainzer -- 10/25/05
- * Added support for the new dirty_bytes_threshold field of
- * both H5AC_cache_config_t and H5AC_aux_t.
- *
- * John Mainzer -- 6/7/06
- * Added trace file support.
- *
- * John Mainzer -- 7/28/07
- * Added support for the new evictions enabled related fields.
- *
- * Observe that H5AC_get_cache_auto_resize_config() and
- * H5AC_set_cache_auto_resize_config() are becoming generic
- * metadata cache configuration routines as they gain
- * switches for functions that are only tenuously related
- * to auto resize configuration.
- *
- * John Mainzer -- 1/3/07
- * Updated trace file code to record the new flash cache
- * size increase related fields.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2559,21 +2254,6 @@ done:
* Programmer: John Mainzer
* 4/6/05
*
- * Modifications:
- *
- * - Added code testing the trace file configuration fields.
- * These tests are not comprehensive, as many errors cannot
- * be caught until the directives contained in these fields
- * are applied.
- * JRM - 5/15/06
- *
- * - Added code testing the evictions enabled field. At
- * present this consists of verifying that if
- * evictions_enabled is FALSE, then automatic cache
- * resizing in disabled.
- *
- * JRM - 7/28/07
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2701,13 +2381,8 @@ done:
* Programmer: John Mainzer
* 6/2/06
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
-
herr_t
H5AC_close_trace_file(H5AC_t * cache_ptr)
@@ -2764,10 +2439,6 @@ done:
* Programmer: John Mainzer
* 6/1/06
*
- * Modifications:
- *
- * None.
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -2887,11 +2558,8 @@ done:
*
* Programmer: John Mainzer, 7/1/05
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
static herr_t
H5AC_broadcast_clean_list(H5AC_t * cache_ptr)
@@ -3064,21 +2732,8 @@ done:
*
* Programmer: John Mainzer, 5/15/04
*
- * Modifications:
- *
- * John Mainzer, 9/23/05
- * Rewrote function to return the value of the
- * write_permitted field in aux structure if the structure
- * exists and mpi_rank is 0.
- *
- * If the aux structure exists, but mpi_rank isn't 0, the
- * function now returns FALSE.
- *
- * In all other cases, the function returns TRUE.
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
static herr_t
H5AC_check_if_write_permitted(const H5F_t *f,
@@ -3147,12 +2802,6 @@ done:
* Programmer: John Mainzer
* 1/26/06
*
- * Modifications:
- *
- * Updated function for flash cache increment fields.
- *
- * JRM -- 1/2/08
- *
*-------------------------------------------------------------------------
*/
herr_t
@@ -3227,11 +2876,8 @@ done:
*
* Programmer: John Mainzer, 6/29/05
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
static herr_t
H5AC_log_deleted_entry(H5AC_t * cache_ptr,
@@ -3348,7 +2994,6 @@ static herr_t
H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
haddr_t addr)
{
- size_t entry_size;
H5AC_t * cache_ptr;
H5AC_aux_t * aux_ptr;
herr_t ret_value = SUCCEED; /* Return value */
@@ -3369,8 +3014,6 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
HDassert( aux_ptr != NULL );
HDassert( aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC );
- entry_size = entry_ptr->size;
-
if ( aux_ptr->mpi_rank == 0 ) {
H5AC_slist_entry_t * slist_entry_ptr;
@@ -3399,9 +3042,9 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
}
aux_ptr->d_slist_len += 1;
- aux_ptr->dirty_bytes += entry_size;
+ aux_ptr->dirty_bytes += entry_ptr->size;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
- aux_ptr->unprotect_dirty_bytes += entry_size;
+ aux_ptr->unprotect_dirty_bytes += entry_ptr->size;
aux_ptr->unprotect_dirty_bytes_updates += 1;
#endif /* H5AC_DEBUG_DIRTY_BYTES_CREATION */
}
@@ -3436,7 +3079,7 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
}
} else {
- aux_ptr->dirty_bytes += entry_size;
+ aux_ptr->dirty_bytes += entry_ptr->size;
#if H5AC_DEBUG_DIRTY_BYTES_CREATION
aux_ptr->unprotect_dirty_bytes += entry_size;
aux_ptr->unprotect_dirty_bytes_updates += 1;
@@ -3470,11 +3113,8 @@ done:
*
* Programmer: John Mainzer, 6/29/05
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
#if 0 /* This is useful debugging code. -- JRM */
static herr_t
@@ -3632,11 +3272,8 @@ done:
*
* Programmer: John Mainzer, 6/30/05
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
static herr_t
H5AC_log_inserted_entry(H5F_t * f,
@@ -3773,8 +3410,6 @@ done:
*
* Programmer: John Mainzer, 6/30/05
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
#ifdef H5_HAVE_PARALLEL
@@ -4001,14 +3636,8 @@ done:
* Programmer: John Mainzer
* July 5, 2005
*
- * Modifications:
- *
- * JRM -- 5/11/06
- * Added code to call the write_done callback.
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
herr_t
H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f,
@@ -4130,11 +3759,8 @@ done:
*
* Programmer: John Mainzer, 7/4/05
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
-
#ifdef H5_HAVE_PARALLEL
static herr_t
H5AC_receive_and_apply_clean_list(H5F_t * f,