From 00aa7f1d8a39d900e90e1f68a58c7bce7eb3b113 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 20 May 2010 07:27:02 -0500 Subject: [svn-r18864] Description: General cleanups to align metadata journaling branch and trunk 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/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) 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-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- src/H5AC.c | 414 ++---------------------------- src/H5C.c | 717 +--------------------------------------------------- src/H5F.c | 2 +- src/H5HFdblock.c | 6 +- src/H5HFpkg.h | 7 + src/H5O.c | 2 +- src/H5Oalloc.c | 2 +- src/H5Oattribute.c | 2 +- src/H5Ocache.c | 6 +- src/H5Ochunk.c | 8 +- src/H5Opkg.h | 2 +- src/H5Pfapl.c | 8 - src/H5Ppublic.h | 2 +- src/H5SM.c | 73 +++++- src/H5SMpkg.h | 10 +- src/H5SMtest.c | 7 +- test/cache_common.c | 137 +++++++--- test/cache_common.h | 100 +------- test/ohdr.c | 18 ++ testpar/t_cache.c | 10 +- 20 files changed, 254 insertions(+), 1279 deletions(-) diff --git a/src/H5AC.c b/src/H5AC.c index fe69703..4add188 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 - * *------------------------------------------------------------------------- */ @@ -812,12 +739,6 @@ done: * Programmer: John Mainzer * 6/30/06 * - * Modifications: - * - * Added 'flags' paramater, to allow freeing file space - * - * QAK - 2/5/08 - * *------------------------------------------------------------------------- */ herr_t @@ -864,7 +785,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, @@ -976,10 +897,6 @@ done: * Programmer: John Mainzer * 4/27/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1061,54 +978,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) @@ -1186,12 +1057,12 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, #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 ) { @@ -1527,56 +1398,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 * @@ -1587,7 +1415,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 */ @@ -1652,11 +1479,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 ) { @@ -1893,57 +1720,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 @@ -1959,8 +1735,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 */ @@ -1992,8 +1766,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 */ @@ -2042,12 +1814,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 ) { @@ -2078,10 +1850,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 */ @@ -2103,11 +1874,8 @@ done: * Programmer: John Mainzer * 5/11/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL herr_t H5AC_set_write_done_callback(H5C_t * cache_ptr, @@ -2150,15 +1918,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 @@ -2191,34 +1950,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) @@ -2338,10 +2071,6 @@ done: * Programmer: John Mainzer * 3/11/05 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2385,10 +2114,6 @@ done: * Programmer: John Mainzer * 3/10/05 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2416,13 +2141,8 @@ done: * * Programmer: John Mainzer, 3/10/05 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - herr_t H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr) { @@ -2456,31 +2176,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 @@ -2678,21 +2373,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 @@ -2820,13 +2500,8 @@ done: * Programmer: John Mainzer * 6/2/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - herr_t H5AC_close_trace_file(H5AC_t * cache_ptr) @@ -2883,10 +2558,6 @@ done: * Programmer: John Mainzer * 6/1/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -3006,11 +2677,8 @@ done: * * Programmer: John Mainzer, 7/1/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_broadcast_clean_list(H5AC_t * cache_ptr) @@ -3183,21 +2851,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, @@ -3266,12 +2921,6 @@ done: * Programmer: John Mainzer * 1/26/06 * - * Modifications: - * - * Updated function for flash cache increment fields. - * - * JRM -- 1/2/08 - * *------------------------------------------------------------------------- */ herr_t @@ -3346,11 +2995,8 @@ done: * * Programmer: John Mainzer, 6/29/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_log_deleted_entry(H5AC_t * cache_ptr, @@ -3467,7 +3113,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 */ @@ -3488,8 +3133,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; @@ -3518,9 +3161,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 */ } @@ -3555,7 +3198,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; @@ -3589,11 +3232,8 @@ done: * * Programmer: John Mainzer, 6/29/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL #if 0 /* This is useful debugging code. -- JRM */ static herr_t @@ -3751,11 +3391,8 @@ done: * * Programmer: John Mainzer, 6/30/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #ifdef H5_HAVE_PARALLEL static herr_t H5AC_log_inserted_entry(H5F_t * f, @@ -3892,8 +3529,6 @@ done: * * Programmer: John Mainzer, 6/30/05 * - * Modifications: - * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL @@ -4120,14 +3755,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, @@ -4249,11 +3878,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, diff --git a/src/H5C.c b/src/H5C.c index 6f88b5e..66653e9 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -32,24 +32,6 @@ * For a detailed overview of the cache, please see the * header comment for H5C_t in H5Cpkg.h. * - * Modifications: - * - * QAK - 11/27/2004 - * Switched over to using skip list routines instead of TBBT - * routines. - * - * JRM - 12/15/04 - * Added code supporting manual and automatic cache resizing. - * See the header for H5C_auto_size_ctl_t in H5Cprivate.h for - * an overview. - * - * Some elements of the automatic cache resize code depend on - * the LRU list. Thus if we ever choose to support a new - * replacement policy, we will either have to disable those - * elements of the auto resize code when running the new - * policy, or modify them to make use of similar information - * maintained by the new policy code. - * *------------------------------------------------------------------------- */ @@ -63,13 +45,6 @@ * * - Change protect/unprotect to lock/unlock. * - * - Change the way the dirty flag is set. Probably pass it in - * as a parameter in unprotect & insert. - * - * - Size should also be passed in as a parameter in insert and - * unprotect -- or some other way should be found to advise the - * cache of changes in entry size. - * * - Flush entries in increasing address order in * H5C_make_space_in_cache(). * @@ -335,7 +310,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - /*------------------------------------------------------------------------- * Function: H5C_create @@ -359,70 +333,12 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/20/04 - * Updated for the addition of the hash table. - * - * JRM -- 10/5/04 - * Added call to H5C_reset_cache_hit_rate_stats(). Also - * added initialization for cache_is_full flag and for - * resize_ctl. - * - * JRM -- 11/12/04 - * Added initialization for the new size_decreased field. - * - * JRM -- 11/17/04 - * Added/updated initialization for the automatic cache - * size control data structures. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of - * the H5C_t structure. - * - * JRM -- 7/5/05 - * Added the new log_flush parameter and supporting code. - * - * JRM -- 9/21/05 - * Added the new aux_ptr parameter and supporting code. - * - * JRM -- 1/20/06 - * Added initialization of the new prefix field in H5C_t. - * - * JRM -- 3/16/06 - * Added initialization for the pinned entry related fields. - * - * JRM -- 5/31/06 - * Added initialization for the trace_file_ptr field. - * - * JRM -- 8/19/06 - * Added initialization for the flush_in_progress field. - * - * JRM -- 8/25/06 - * Added initialization for the slist_len_increase and - * slist_size_increase fields. These fields are used - * for sanity checking in the flush process, and are not - * compiled in unless H5C_DO_SANITY_CHECKS is TRUE. - * - * JRM -- 3/28/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 7/27/07 - * Added initialization for the new evictions_enabled - * field of H5C_t. - * - * JRM -- 12/31/07 - * Added initialization for the new flash cache size increase - * related fields of H5C_t. - * * JRM -- 11/5/08 * Added initialization for the new clean_index_size and * dirty_index_size fields of H5C_t. * *------------------------------------------------------------------------- */ - H5C_t * H5C_create(size_t max_cache_size, size_t min_clean_size, @@ -643,19 +559,6 @@ done: * Programmer: John Mainzer * 10/27/04 * - * Modifications: - * - * JRM -- 11/22/04 - * Reworked function to adapt it to the addition of the - * ageout method of cache size reduction. - * - * JRM -- 1/19/06 - * Updated function for display the new prefix field of - * H5C_t in output. - * - * JRM 12/31/07 - * Updated function to handle flash size increases. - * *------------------------------------------------------------------------- */ void @@ -900,10 +803,6 @@ done: * Programmer: John Mainzer * 6/29/06 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1026,77 +925,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/20/04 - * Modified the function for the addition of the hash table. - * - * JRM -- 11/22/04 - * Added code to remove all epoch markers (if any) from the - * LRU list before a destroy. Strictly speaking, this isn't - * necessary, as the marker entries reside only in the LRU - * list, never in the index or in the tree. However, it - * never hurts to tidy up. - * - * JRM -- 1/6/05 - * Reworked code to support the new - * H5C__FLUSH_MARKED_ENTRIES_FLAG, and for the replacement of - * H5F_FLUSH_INVALIDATE flag with H5C__FLUSH_INVALIDATE_FLAG. - * - * Note that the H5C__FLUSH_INVALIDATE_FLAG takes precidence - * over the H5C__FLUSH_MARKED_ENTRIES_FLAG. Thus if both are - * set, the functions behaves as if just the - * H5C__FLUSH_INVALIDATE_FLAG was set. - * - * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with - * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the - * H5C__FLUSH_INVALIDATE_FLAG. In all cases, it is simply - * passed along to H5C_flush_single_entry(). In the case of - * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to - * the marked entries. - * - * JRM -- 10/15/05 - * Added code supporting the new - * H5C__FLUSH_IGNORE_PROTECTED_FLAG. We need this flag, as - * we now use this function to flush large number of entries - * in increasing address order. We do this by marking the - * entries to be flushed, calling this function to flush them, - * and then restoring LRU order. - * - * However, it is possible that the cache will contain other, - * unmarked protected entries, when we make this call. This - * new flag allows us to ignore them. - * - * Note that even with this flag set, it is still an error - * to try to flush a protected entry. - * - * JRM -- 3/25/06 - * Updated function to handle pinned entries. - * - * JRM -- 8/19/06 - * Added code managing the new flush_in_progress field of - * H5C_t. - * - * Also reworked function to allow for the possibility that - * entries will be dirtied, resized, or moved during flush - * callbacks. As a result, we may have to make multiple - * passes through the skip list before the cache is flushed. - * - * JRM -- 10/13/07 - * Added code to detect and manage the case in which a - * flush callback changes the s-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * *------------------------------------------------------------------------- */ herr_t @@ -1479,34 +1307,6 @@ done: * Programmer: John Mainzer * 9/16/05 * - * Modifications: - * - * Re-wrote function to flush dirty entries in increasing - * address order, while maintaining LRU order in the LRU list - * upon return. - * - * Do this by scanning up the dirty LRU list for entries to - * flush to reach min clean size, setting their flush_marker - * flags, and recording their addresses in the order - * encountered. - * - * Then call H5C_flush_cache() to flush the marked entries. - * - * Finally, use the list of marked entries to force the - * correct LRU list order after the flush. - * - * JRM - 10/13/05 - * - * This change had the oposite of the desired effect. Lets - * leave it in (albeit commented out for now). If we can't - * find a case where it helps, lets get rid of it. - * - * - * Added some sanity checks to the change which verify the - * expected values of the new is_read_only and ro_ref_count - * fields. - * JRM - 3/29/07 - * *------------------------------------------------------------------------- */ herr_t @@ -1694,10 +1494,6 @@ done: * Programmer: John Mainzer * 10/8/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1744,10 +1540,6 @@ done: * Programmer: John Mainzer * 10/8/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1807,10 +1599,6 @@ done: * Programmer: John Mainzer * 10/7/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -1872,11 +1660,6 @@ done: * Programmer: John Mainzer * 7/1/05 * - * Modifications: - * - * JRM -- 4/26/06 - * Added the is_pinned_ptr parameter and supporting code. - * *------------------------------------------------------------------------- */ herr_t @@ -1976,10 +1759,6 @@ done: * Programmer: John Mainzer * 7/27/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -2098,59 +1877,6 @@ H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr, * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM -- 10/28/04 - * Added code to set the cache_full flag to TRUE when ever - * we need to make space in the cache. - * - * JRM -- 11/22/04 - * Updated function for the addition of the first_flush_ptr - * parameter to H5C_make_space_in_cache(). - * - * JRM -- 1/6/05 - * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. - * - * JRM -- 6/6/05 - * Added code to force all inserted entries to be dirty. - * This is part of a set of changes moving management of the - * is_dirty field of H5C_cache_entry_t into the H5C code. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of - * the H5C_t structure. - * - * JRM -- 3/16/06 - * Added initialization for the new is_pinned field of the - * H5C_cache_entry_t structure. - * - * JRM -- 5/3/06 - * Added initialization for the new dirtied field of the - * H5C_cache_entry_t structure. - * - * JRM -- 8/9/06 - * Added code supporting insertion of pinned entries. - * - * JRM -- 8/21/06 - * Added initialization for the new flush_in_progress and - * destroy_in_progress fields. - * - * JRM -- 3/29/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 8/1/07 - * Added code to disable evictions when the new - * evictions_enabled field is FALSE. - * - * JRM -- 12/31/07 - * Added code supporting flash cache size increases. - * * QAK -- 1/31/08 * Added initialization for the new free_file_space_on_destroy * field. @@ -2497,20 +2223,6 @@ done: * Programmer: John Mainzer * 7/5/05 * - * Modifications: - * - * Reworked function to flush entries in LRU order instead - * of increasing address order. The hope is that this will - * improve the hit rate on the slave caches. - * - * JRM - 10/13/05 - * - * Leave the old code in place for now (commented out) for - * benchmarking. - * - * JRM -- 4/13/06 - * Updated function to deal with pinned entries. - * *------------------------------------------------------------------------- */ #ifdef H5_HAVE_PARALLEL @@ -3065,7 +2777,7 @@ H5C_resize_entry(void *thing, size_t new_size) if(new_size <= 0) HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "New size is non-positive.") if(!(entry_ptr->is_pinned || entry_ptr->is_protected)) - HGOTO_ERROR(H5E_CACHE, H5E_CANTRESIZE, FAIL, "Entry isn't pinned or protected??") + HGOTO_ERROR(H5E_CACHE, H5E_BADTYPE, FAIL, "Entry isn't pinned or protected??") /* update for change in entry size if necessary */ if ( entry_ptr->size != new_size ) { @@ -3096,12 +2808,12 @@ H5C_resize_entry(void *thing, size_t new_size) if(entry_ptr->is_pinned) { H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pel_len), \ (cache_ptr->pel_size), \ - (entry_ptr->size), (new_size)); + (entry_ptr->size), (new_size)) } /* end if */ if(entry_ptr->is_protected) { H5C__DLL_UPDATE_FOR_SIZE_CHANGE((cache_ptr->pl_len), \ (cache_ptr->pl_size), \ - (entry_ptr->size), (new_size)); + (entry_ptr->size), (new_size)) } /* end if */ /* update the hash table */ @@ -3255,62 +2967,10 @@ done: * check_write_permitted function if it is called. * * Return: Success: Ptr to the desired entry - * * Failure: NULL * * Programmer: John Mainzer - 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated for the addition of the hash table. - * - * JRM -- 10/28/04 - * Added code to set cache_full to TRUE whenever we try to - * make space in the cache. - * - * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() - * after the call to H5C__auto_adjust_cache_size() if that - * function sets the size_decreased flag is TRUE. - * - * JRM -- 4/25/05 - * The size_decreased flag can also be set to TRUE in - * H5C_set_cache_auto_resize_config() if a new configuration - * forces an immediate reduction in cache size. Modified - * the code to deal with this eventuallity. - * - * JRM -- 6/24/05 - * Added support for the new write_permitted field of H5C_t. - * - * JRM -- 10/22/05 - * Hand optimizations. - * - * JRM -- 5/3/06 - * Added code to set the new dirtied field in - * H5C_cache_entry_t to FALSE prior to return. - * - * JRM -- 6/23/06 - * Modified code to allow dirty entries to be loaded from - * disk. This is necessary as a bug fix in the object - * header code requires us to modify a header as it is read. - * - * JRM -- 3/28/07 - * Added the flags parameter and supporting code. At least - * for now, this parameter is used to allow the entry to - * be protected read only, thus allowing multiple protects. - * - * Also added code to allow multiple read only protects - * of cache entries. - * - * JRM -- 7/27/07 - * Added code supporting the new evictions_enabled field - * in H5C_t. - * - * JRM -- 1/3/08 - * Added to do a flash cache size increase if appropriate - * when a large entry is loaded. - * * JRM -- 11/13/08 * Modified function to call H5C_make_space_in_cache() when * the min_clean_size is violated, not just when there isn't @@ -3719,13 +3379,8 @@ done: * * Programmer: John Mainzer, 10/5/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr) { @@ -3765,21 +3420,6 @@ done: * Programmer: John Mainzer * 10/8/04 * - * Modifications: - * - * JRM -- 11/18/04 - * Reworked function to match major changes in - * H5C_auto_size_ctl_t. - * - * JRM -- 4/25/05 - * Added code to set cache_ptr->size_decreased to TRUE - * if the new configuration forces an immediate reduction - * in cache size. - * - * JRM -- 12/31/07 - * Added code supporting the new flash cache size increase - * code. - * *------------------------------------------------------------------------- */ herr_t @@ -4057,10 +3697,6 @@ done: * Programmer: John Mainzer * 7/27/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t @@ -4116,11 +3752,8 @@ done: * Programmer: John Mainzer * 1/20/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix) @@ -4162,11 +3795,8 @@ done: * Programmer: John Mainzer * 6/11/04 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C_set_skip_flags(H5C_t * cache_ptr, hbool_t skip_file_checks, @@ -4207,11 +3837,8 @@ done: * Programmer: John Mainzer * 1/20/06 * - * Modifications: - * *------------------------------------------------------------------------- */ - herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr, FILE * trace_file_ptr) @@ -4246,32 +3873,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM -- 9/8/05 - * Updated function for the addition of cache entry size - * change statistics. - * - * JRM -- 1/13/06 - * Added code to use the prefix field of H5C_t to allow - * tagging of statistics output. - * - * JRM -- 3/21/06 - * Added code supporting the pinned entry related stats. - * - * JRM -- 8/9/06 - * More code supporting pinned entry related stats. - * - * JRM -- 8/23/06 - * Added code supporting new flush related statistics. - * - * JRM -- 3/31/07 - * Added code supporting the new write_protects, - * read_protects, and max_read_protects fields. - * * JRM -- 11/13/08 * Added code displaying the max_clean_index_size and * max_dirty_index_size. @@ -4283,7 +3884,6 @@ done: * *------------------------------------------------------------------------- */ - herr_t H5C_stats(H5C_t * cache_ptr, const char * cache_name, @@ -4732,31 +4332,6 @@ done: * * Programmer: John Mainzer, 4/28/04 * - * Modifications: - * - * JRM - 7/21/04 - * Updated for hash table related statistics. - * - * JRM - 9/8/05 - * Updated for size increase / decrease statistics. - * - * JRM - 3/20/06 - * Updated for pin / unpin related statistics. - * - * JRM - 8/9/06 - * Further updates for pin related statistics. - * - * JRM 8/23/06 - * Added initialization code for new flush related statistics. - * - * JRM 2/16/07 - * Added conditional compile code to avoid unused parameter - * warning in the production build. - * - * JRM 3/31/07 - * Added initialization for the new write_protects, - * read_protects, and max_read_protects fields. - * * JRM 11/13/08 * Added initialization for the new max_clean_index_size and * max_dirty_index_size fields. @@ -4768,7 +4343,6 @@ done: * *------------------------------------------------------------------------- */ - void #ifndef NDEBUG H5C_stats__reset(H5C_t * cache_ptr) @@ -4986,85 +4560,6 @@ done: * Programmer: John Mainzer * 6/2/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated the function for the addition of the hash table. - * In particular, we now add dirty entries to the tree if - * they aren't in the tree already. - * - * JRM -- 1/6/05 - * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. Also note that - * once the flush_marker field of an entry is set, the - * only way it can be reset is by being flushed. - * - * JRM -- 6/3/05 - * Added the dirtied parameter and supporting code. This - * is part of an effort to move management of the is_dirty - * field into the cache code. This has become necessary - * to repair a cache coherency bug in PHDF5. - * - * JRM -- 7/5/05 - * Added code supporting the new clear_on_unprotect field - * of H5C_cache_entry_t. This change is also part of the - * above mentioned cache coherency bug fix in PHDF5. - * - * JRM -- 9/8/05 - * Added the size_changed and new_size parameters and the - * supporting code. Since the metadata cache synchronizes - * on dirty bytes creation in the PHDF5 case, we must now - * track changes in entry size. - * - * Note that the new_size parameter is ignored unless the - * size_changed parameter is TRUE. In this case, the new_size - * must be positive. - * - * Also observe that if size_changed is TRUE, dirtied must be - * TRUE. - * - * JRM -- 9/23/05 - * Moved the size_changed parameter into flags. - * - * JRM -- 3/21/06 - * Unpdated function to pin and unpin entries as directed via - * the new H5C__PIN_ENTRY_FLAG and H5C__UNPIN_ENTRY_FLAG flags. - * - * JRM -- 5/3/06 - * Added code to make use of the new dirtied field in - * H5C_cache_entry_t. If this field is TRUE, it is the - * equivalent of setting the H5C__DIRTIED_FLAG. - * - * JRM -- 3/29/07 - * Modified function to allow a entry to be protected - * more than once if the entry is protected read only. - * - * Also added sanity checks using the new is_read_only and - * ro_ref_count parameters. - * - * JRM -- 12/31/07 - * Modified function to support flash cache resizes. - * - * QAK -- 1/31/08 - * Modified function to support freeing file space in client's - * 'dest' callback routine. - * - * QAK -- 2/07/08 - * Separated "destroy entry" concept from "remove entry from - * cache" concept, by adding the 'take_ownership' flag. - * - * JRM -- 11/5/08 - * Added code to update the clean_index_size and - * dirty_index_size fields of H5C_t in cases where the - * the entry was clean on protect, was marked dirty on - * unprotect, and did not change its size. Do this via - * a call to H5C__UPDATE_INDEX_FOR_ENTRY_DIRTY(). - * - * If the size changed, this case is already dealt with by - * by the pre-existing call to - * H5C__UPDATE_INDEX_FOR_SIZE_CHANGE(). - * *------------------------------------------------------------------------- */ herr_t @@ -5248,8 +4743,8 @@ H5C_unprotect(H5F_t * f, } - /* H5C__UPDATE_RP_FOR_UNPROTECT will places the unprotected entry on - * the pinned entry list if entry_ptr->is_pined is TRUE. + /* H5C__UPDATE_RP_FOR_UNPROTECT will place the unprotected entry on + * the pinned entry list if entry_ptr->is_pinned is TRUE. */ H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, FAIL) @@ -5400,15 +4895,8 @@ done: * Programmer: John Mainzer * 3/23/05 * - * Modifications: - * - * Added validation for the flash increment fields. - * - * JRM -- 12/31/07 - * *------------------------------------------------------------------------- */ - herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, unsigned int tests) @@ -6018,16 +5506,6 @@ done: * * Programmer: John Mainzer, 10/7/04 * - * Modifications: - * - * JRM -- 11/18/04 - * Major re-write to support ageout method of cache size - * reduction, and to adjust to changes in the - * H5C_auto_size_ctl_t structure. - * - * JRM -- 1/5/08 - * Added support for flash cache size increases. - * *------------------------------------------------------------------------- */ static herr_t @@ -6381,10 +5859,6 @@ done: * * Programmer: John Mainzer, 11/18/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ static herr_t @@ -6507,13 +5981,8 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) { @@ -6639,23 +6108,6 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Modifications: - * - * JRM -- 10/13/07 - * Added code to detect and manage the case in which a - * flush callback changes the LRU-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * *------------------------------------------------------------------------- */ static herr_t @@ -6874,13 +6326,8 @@ done: * * Programmer: John Mainzer, 11/19/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) { @@ -6956,13 +6403,8 @@ done: * * Programmer: John Mainzer, 11/22/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) { @@ -7042,13 +6484,8 @@ done: * * Programmer: John Mainzer, 11/19/04 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ - static herr_t H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) { @@ -7136,10 +6573,6 @@ done: * * Programmer: John Mainzer, 12/31/07 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ static herr_t @@ -7325,30 +6758,6 @@ done: * Programmer: John Mainzer * 3/24/065 * - * Modifications: - * - * To support the fractal heap, the cache must now deal with - * entries being dirtied, resized, and/or moved inside - * flush callbacks. Updated function to support this. - * - * -- JRM 8/27/06 - * - * Added code to detect and manage the case in which a - * flush callback changes the s-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * - * -- JRM 10/13/07 - * *------------------------------------------------------------------------- */ static herr_t @@ -7904,58 +7313,6 @@ done: * * Programmer: John Mainzer, 5/5/04 * - * Modifications: - * - * JRM -- 7/21/04 - * Updated function for the addition of the hash table. - * - * QAK -- 11/26/04 - * Updated function for the switch from TBBTs to skip lists. - * - * JRM -- 1/6/05 - * Updated function to reset the flush_marker field. - * Also replace references to H5F_FLUSH_INVALIDATE and - * H5F_FLUSH_CLEAR_ONLY with references to - * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG - * respectively. - * - * JRM -- 6/24/05 - * Added code to remove dirty entries from the slist after - * they have been flushed. Also added a sanity check that - * will scream if we attempt a write when writes are - * completely disabled. - * - * JRM -- 7/5/05 - * Added code to call the new log_flush callback whenever - * a dirty entry is written to disk. Note that the callback - * is not called if the H5C__FLUSH_CLEAR_ONLY_FLAG is set, - * as there is no write to file in this case. - * - * JRM -- 8/21/06 - * Added code maintaining the flush_in_progress and - * destroy_in_progress fields in H5C_cache_entry_t. - * - * Also added flush_flags parameter to the call to - * type_ptr->flush() so that the flush routine can report - * whether the entry has been resized or moved. Added - * code using the flush_flags variable to detect the case - * in which the target entry is resized during flush, and - * update the caches data structures accordingly. - * - * JRM -- 3/29/07 - * Added sanity checks on the new is_read_only and - * ro_ref_count fields. - * - * QAK -- 2/07/08 - * Separated "destroy entry" concept from "remove entry from - * cache" concept, by adding the 'take_ownership' flag and - * the "destroy_entry" variable. - * - * JRM -- 11/5/08 - * Added call to H5C__UPDATE_INDEX_FOR_ENTRY_CLEAN() to - * maintain the new clean_index_size and clean_index_size - * fields of H5C_t. - * *------------------------------------------------------------------------- */ static herr_t @@ -8532,25 +7889,6 @@ done: * * Programmer: John Mainzer, 5/18/04 * - * Modifications: - * - * JRM - 7/21/04 - * Updated function for the addition of the hash table. - * - * JRM - 6/23/06 - * Deleted assertion that verified that a newly loaded - * entry is clean. Due to a bug fix, this need not be - * the case, as our code will attempt to repair errors - * on load. - * - * JRM - 8/21/06 - * Added initialization for the new flush_in_progress and - * destroy in progress fields. - * - * JRM - 3/29/07 - * Added initialization for the new is_read_only and - * ro_ref_count fields. - * * QAK -- 1/31/08 * Added initialization for the new free_file_space_on_destroy * field. @@ -8702,44 +8040,6 @@ done: * * Programmer: John Mainzer, 5/14/04 * - * Modifications: - * - * JRM --7/21/04 - * Minor modifications in support of the addition of a hash - * table to facilitate lookups. - * - * JRM -- 11/22/04 - * Added the first_flush_ptr parameter, which replaces the - * old first_flush local variable. This allows the function - * to coordinate on the first flush issue with other functions. - * - * JRM -- 12/13/04 - * Added code to skip over epoch markers if present. - * - * JRM -- 1/3/06 - * Modified function to work correctly when the the cache - * is not full. This case occurs when we need to flush to - * min clean size before the cache has filled. - * - * JRM -- 3/29/07 - * Added sanity checks using the new is_read_only and - * ro_ref_count fields. - * - * JRM -- 10/13/07 - * Added code to detect and manage the case in which a - * flush callback changes the LRU-list out from under - * the function. The only way I can think of in which this - * can happen is if a flush function loads an entry - * into the cache that isn't there already. Quincey tells - * me that this will never happen, but I'm not sure I - * believe him. - * - * Note that this is a pretty bad scenario if it ever - * happens. The code I have added should allow us to - * handle the situation under all but the worst conditions, - * but one can argue that I should just scream and die if I - * ever detect the condidtion. - * * JRM -- 11/13/08 * Modified function to always observe the min_clean_size * whether we are maintaining the clean and dirt LRU lists @@ -9072,11 +8372,8 @@ done: * * Programmer: John Mainzer, 7/14/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #if H5C_DO_EXTREME_SANITY_CHECKS static herr_t @@ -9195,11 +8492,8 @@ done: * * Programmer: John Mainzer, 7/14/05 * - * Modifications: - * *------------------------------------------------------------------------- */ - #if H5C_DO_EXTREME_SANITY_CHECKS static herr_t @@ -9246,3 +8540,4 @@ done: } /* H5C_verify_not_in_index() */ #endif /* H5C_DO_EXTREME_SANITY_CHECKS */ + diff --git a/src/H5F.c b/src/H5F.c index d9e76b3..c1d04e0 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -930,7 +930,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf) * The cache might be created with a different number of elements and * the access property list should be updated to reflect that. */ - if(SUCCEED != H5AC_create(f, &(f->shared->mdc_initCacheCfg))) + if(H5AC_create(f, &(f->shared->mdc_initCacheCfg)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create metadata cache") /* Create the file's "open object" information */ diff --git a/src/H5HFdblock.c b/src/H5HFdblock.c index a68cc75..b2b3077 100644 --- a/src/H5HFdblock.c +++ b/src/H5HFdblock.c @@ -466,6 +466,7 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, */ if(hdr->filter_len > 0) { if(par_iblock == NULL) { + udata.odi_size = hdr->pline_root_direct_size; udata.filter_mask = hdr->pline_root_direct_filter_mask; } /* end if */ else { @@ -473,11 +474,14 @@ H5HF_man_dblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t dblock_addr, HDassert(H5F_addr_eq(par_iblock->ents[par_entry].addr, dblock_addr)); /* Set up parameters to read filtered direct block */ + udata.odi_size = par_iblock->filt_ents[par_entry].size; udata.filter_mask = par_iblock->filt_ents[par_entry].filter_mask; } /* end else */ } /* end if */ - else + else { + udata.odi_size = dblock_size; udata.filter_mask = 0; + } /* end else */ /* Protect the direct block */ if(NULL == (dblock = (H5HF_direct_t *)H5AC_protect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, &udata, rw))) diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index faa2e1a..6892f0d 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -484,6 +484,13 @@ typedef struct H5HF_iblock_cache_ud_t { typedef struct H5HF_dblock_cache_ud_t { H5HF_parent_t par_info; /* Parent info */ H5F_t * f; /* File pointer */ + size_t odi_size; /* On disk image size of the direct block. + * Note that there is no necessary relation + * between this value, and the actual + * direct block size, as conpression may + * reduce the size of the on disk image, + * and check sums may increase it. + */ size_t dblock_size; /* size of the direct block, which bears * no necessary relation to the block * odi_size -- the size of the on disk diff --git a/src/H5O.c b/src/H5O.c index 0971142..e7b3965 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -1691,7 +1691,7 @@ H5O_protect(const H5O_loc_t *loc, hid_t dxpl_id, H5AC_protect_t prot) /* Bring the chunk into the cache */ /* (which adds to the object header) */ chk_udata.common.addr = cont_msg_info.msgs[curr_msg].addr; - chk_udata.chunk_size = cont_msg_info.msgs[curr_msg].size; + chk_udata.size = cont_msg_info.msgs[curr_msg].size; if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(loc->file, dxpl_id, H5AC_OHDR_CHK, cont_msg_info.msgs[curr_msg].addr, &chk_udata, prot))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, NULL, "unable to load object header chunk") diff --git a/src/H5Oalloc.c b/src/H5Oalloc.c index 1bdf277..a06740c 100644 --- a/src/H5Oalloc.c +++ b/src/H5Oalloc.c @@ -663,8 +663,8 @@ H5O_alloc_extend_chunk(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned chunkno, if(chunkno > 0 && (H5O_CONT_ID == oh->mesg[u].type->id) && (((H5O_cont_t *)(oh->mesg[u].native))->chunkno == chunkno)) { H5O_chunk_proxy_t *chk_proxy2 = NULL; /* Chunk that continuation message is in */ - unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ hbool_t chk_dirtied2 = FALSE; /* Flag for unprotecting chunk */ + unsigned cont_chunkno = oh->mesg[u].chunkno; /* Chunk # for continuation message */ /* Protect chunk containing continuation message */ if(NULL == (chk_proxy2 = H5O_chunk_protect(f, dxpl_id, oh, cont_chunkno))) diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 8260379..aa9e660 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -1035,7 +1035,7 @@ H5O_attr_rename_mod_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, { H5O_iter_ren_t *udata = (H5O_iter_ren_t *)_udata; /* Operator user data */ H5O_chunk_proxy_t *chk_proxy = NULL; /* Chunk that message is in */ - hbool_t chk_dirtied = FALSE; /* Flags for unprotecting chunk */ + hbool_t chk_dirtied = FALSE; /* Flag for unprotecting chunk */ herr_t ret_value = H5_ITER_CONT; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5O_attr_rename_mod_cb) diff --git a/src/H5Ocache.c b/src/H5Ocache.c index 6ae2f0d..46b5f2f 100644 --- a/src/H5Ocache.c +++ b/src/H5Ocache.c @@ -665,11 +665,11 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't wrap buffer") /* Get a pointer to a buffer that's large enough for serialized header */ - if(NULL == (buf = (uint8_t *)H5WB_actual(wb, udata->chunk_size))) + if(NULL == (buf = (uint8_t *)H5WB_actual(wb, udata->size))) HGOTO_ERROR(H5E_OHDR, H5E_NOSPACE, NULL, "can't get actual buffer") /* Read rest of the raw data */ - if(H5F_block_read(f, H5FD_MEM_OHDR, addr, udata->chunk_size, dxpl_id, buf) < 0) + if(H5F_block_read(f, H5FD_MEM_OHDR, addr, udata->size, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header continuation chunk") /* Check if we are still decoding the object header */ @@ -680,7 +680,7 @@ H5O_cache_chk_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) HDassert(udata->common.cont_msg_info); /* Parse the chunk */ - if(H5O_chunk_deserialize(udata->oh, udata->common.addr, udata->chunk_size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) + if(H5O_chunk_deserialize(udata->oh, udata->common.addr, udata->size, buf, &(udata->common), &chk_proxy->cache_info.is_dirty) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "can't deserialize object header chunk") /* Set the fields for the chunk proxy */ diff --git a/src/H5Ochunk.c b/src/H5Ochunk.c index a137d54..5def4f7 100644 --- a/src/H5Ochunk.c +++ b/src/H5Ochunk.c @@ -181,7 +181,7 @@ H5O_chunk_protect(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDmemset(&chk_udata, 0, sizeof(chk_udata)); chk_udata.oh = oh; chk_udata.chunkno = idx; - chk_udata.chunk_size = oh->chunk[idx].size; + chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC_WRITE))) @@ -243,7 +243,7 @@ H5O_chunk_unprotect(H5F_t *f, hid_t dxpl_id, H5O_chunk_proxy_t *chk_proxy, chk_proxy = H5FL_FREE(H5O_chunk_proxy_t, chk_proxy); } /* end if */ else { - /* Release the chunk proxy from the cache, marking it dirty */ + /* Release the chunk proxy from the cache, possibly marking it dirty */ if(H5AC_unprotect(f, dxpl_id, H5AC_OHDR_CHK, chk_proxy->oh->chunk[chk_proxy->chunkno].addr, chk_proxy, (dirtied ? H5AC__DIRTIED_FLAG : H5AC__NO_FLAGS_SET)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTUNPROTECT, FAIL, "unable to release object header chunk") } /* end else */ @@ -329,7 +329,7 @@ H5O_chunk_update_idx(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDmemset(&chk_udata, 0, sizeof(chk_udata)); chk_udata.oh = oh; chk_udata.chunkno = idx; - chk_udata.chunk_size = oh->chunk[idx].size; + chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC_WRITE))) @@ -381,7 +381,7 @@ H5O_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx) HDmemset(&chk_udata, 0, sizeof(chk_udata)); chk_udata.oh = oh; chk_udata.chunkno = idx; - chk_udata.chunk_size = oh->chunk[idx].size; + chk_udata.size = oh->chunk[idx].size; /* Get the chunk proxy */ if(NULL == (chk_proxy = (H5O_chunk_proxy_t *)H5AC_protect(f, dxpl_id, H5AC_OHDR_CHK, oh->chunk[idx].addr, &chk_udata, H5AC_WRITE))) diff --git a/src/H5Opkg.h b/src/H5Opkg.h index f4fba45..b46af85 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -374,7 +374,7 @@ typedef struct H5O_chk_cache_ud_t { hbool_t decoding; /* Whether the object header is being decoded */ H5O_t *oh; /* Object header for this chunk */ unsigned chunkno; /* Index of chunk being brought in (for re-loads) */ - size_t chunk_size; /* Chunk size */ + size_t size; /* Size of chunk in the file */ H5O_common_cache_ud_t common; /* Common object header cache callback info */ } H5O_chk_cache_ud_t; diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 07b66e7..10922da 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -1330,10 +1330,6 @@ done: * Programmer: J. Mainzer * Thursday, April 7, 2005 * - * Modifications: - * - * Done. - * *------------------------------------------------------------------------- */ herr_t @@ -1382,10 +1378,6 @@ done: * Programmer: J. Mainzer * Thursday, April 7, 2005 * - * Modifications: - * - * None. - * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 1c0bb61..09eb796 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -24,7 +24,7 @@ /* Public headers needed by this file */ #include "H5public.h" -#include "H5Cpublic.h" +#include "H5ACpublic.h" #include "H5Dpublic.h" #include "H5Fpublic.h" #include "H5FDpublic.h" diff --git a/src/H5SM.c b/src/H5SM.c index ce54499..8045183 100755 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -356,7 +356,13 @@ H5SM_type_shared(H5F_t *f, unsigned type_id, hid_t dxpl_id) /* Look up the master SOHM table */ if(H5F_addr_defined(f->shared->sohm_addr)) { - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ + + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ else @@ -396,6 +402,7 @@ herr_t H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_addr) { H5SM_master_table_t *table = NULL; /* Shared object master table */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Which index */ herr_t ret_value = SUCCEED; /* Return value */ @@ -405,8 +412,12 @@ H5SM_get_fheap_addr(H5F_t *f, hid_t dxpl_id, unsigned type_id, haddr_t *fheap_ad HDassert(f); HDassert(fheap_addr); + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Look up index for message type */ @@ -931,7 +942,13 @@ H5SM_can_share(H5F_t *f, hid_t dxpl_id, H5SM_master_table_t *table, if(table) my_table = table; else { - if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ + + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + + if(NULL == (my_table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") } /* end if */ @@ -1021,6 +1038,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, void *mesg, unsigned *mesg_flags) { H5SM_master_table_t *table = NULL; + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned cache_flags = H5AC__NO_FLAGS_SET; ssize_t index_num; htri_t tri_ret; @@ -1036,8 +1054,12 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned type_id, if(tri_ret == FALSE) HGOTO_DONE(FALSE) + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* "complex" sharing checks */ @@ -1416,6 +1438,7 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) { H5SM_master_table_t *table = NULL; unsigned cache_flags = H5AC__NO_FLAGS_SET; + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; void *mesg_buf = NULL; void *native_mesg = NULL; @@ -1431,8 +1454,12 @@ H5SM_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_shared_t *sh_mesg) /* Get message type */ type_id = sh_mesg->msg_type_id; + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_WRITE))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_WRITE))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and try to delete from it */ @@ -1846,6 +1873,7 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) if((status = H5O_msg_exists(ext_loc, H5O_SHMESG_ID, dxpl_id)) < 0) HGOTO_ERROR(H5E_SOHM, H5E_CANTGET, FAIL, "unable to read object header") if(status) { + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned index_flags[H5O_SHMESG_MAX_NINDEXES]; /* Message flags for each index */ unsigned minsizes[H5O_SHMESG_MAX_NINDEXES]; /* Minimum message size for each index */ unsigned sohm_l2b; /* SOHM list-to-btree cutoff */ @@ -1867,8 +1895,12 @@ H5SM_get_info(const H5O_loc_t *ext_loc, H5P_genplist_t *fc_plist, hid_t dxpl_id) HDassert(H5F_addr_defined(shared->sohm_addr)); HDassert(shared->sohm_nindexes > 0 && shared->sohm_nindexes <= H5O_SHMESG_MAX_NINDEXES); + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Read the rest of the SOHM table information from the cache */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get index conversion limits */ @@ -2008,6 +2040,7 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, H5HF_t *fheap = NULL; /* Fractal heap that contains shared messages */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5SM_table_cache_ud_t tbl_cache_udata; /* User-data for callback */ H5SM_list_t *list = NULL; /* SOHM index list for message type (if in list form) */ H5SM_index_header_t *header=NULL; /* Index header for message type */ H5SM_mesg_key_t key; /* Key for looking up message */ @@ -2024,8 +2057,12 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, HDassert(sh_mesg); HDassert(ref_count); + /* Set up user data for callback */ + tbl_cache_udata.f = f; + tbl_cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &tbl_cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index and find the message in it */ @@ -2056,15 +2093,15 @@ H5SM_get_refcount(H5F_t *f, hid_t dxpl_id, unsigned type_id, /* Try to find the message in the index */ if(header->index_type == H5SM_LIST) { - H5SM_list_cache_ud_t cache_udata; /* User-data for metadata cache callback */ + H5SM_list_cache_ud_t lst_cache_udata; /* User-data for metadata cache callback */ size_t list_pos; /* Position of the message in the list */ /* Set up user data for metadata cache callback */ - cache_udata.f = f; - cache_udata.header = header; + lst_cache_udata.f = f; + lst_cache_udata.header = header; /* If the index is stored as a list, get it from the cache */ - if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &cache_udata, H5AC_READ))) + if(NULL == (list = (H5SM_list_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_LIST, header->index_addr, &lst_cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM index") /* Find the message in the list */ @@ -2388,6 +2425,7 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, unsigned table_vers, unsigned num_indexes) { H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ unsigned x; /* Counter variable */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2417,8 +2455,12 @@ H5SM_table_debug(H5F_t *f, hid_t dxpl_id, haddr_t table_addr, if(num_indexes == 0 || num_indexes > H5O_SHMESG_MAX_NINDEXES) HGOTO_ERROR(H5E_SOHM, H5E_BADVALUE, FAIL, "number of indexes must be between 1 and H5O_SHMESG_MAX_NINDEXES") + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, table_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") HDfprintf(stream, "%*sShared Message Master Table...\n", indent, ""); @@ -2563,6 +2605,7 @@ herr_t H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) { H5SM_master_table_t *table = NULL; /* SOHM master table */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ H5HF_t *fheap = NULL; /* Fractal heap handle */ H5B2_t *bt2 = NULL; /* v2 B-tree handle for index */ unsigned u; /* Local index variable */ @@ -2576,8 +2619,12 @@ H5SM_ih_size(H5F_t *f, hid_t dxpl_id, hsize_t *hdr_size, H5_ih_info_t *ih_info) HDassert(hdr_size); HDassert(ih_info); + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Get SOHM header size */ diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h index 3aab317..6594912 100755 --- a/src/H5SMpkg.h +++ b/src/H5SMpkg.h @@ -219,9 +219,15 @@ typedef struct H5SM_bt2_ctx_t { uint8_t sizeof_addr; /* Size of file addresses */ } H5SM_bt2_ctx_t; -/* Callback info for loading a shared message index into the cache */ +/* Callback info for loading a shared message table index into the cache */ +typedef struct H5SM_table_cache_ud_t { + H5F_t *f; /* File that shared message index stored as a table is in */ + size_t table_size; /* Size of SOHM master table in file */ +} H5SM_table_cache_ud_t; + +/* Callback info for loading a shared message list index into the cache */ typedef struct H5SM_list_cache_ud_t { - H5F_t *f; /* File that shared message index stored as a list is in */ + H5F_t *f; /* File that shared message index stored as a table is in */ H5SM_index_header_t *header; /* Index header for this list */ } H5SM_list_cache_ud_t; diff --git a/src/H5SMtest.c b/src/H5SMtest.c index cc8a98f..78fb161 100644 --- a/src/H5SMtest.c +++ b/src/H5SMtest.c @@ -91,10 +91,15 @@ H5SM_get_mesg_count_test(H5F_t *f, hid_t dxpl_id, unsigned type_id, /* Check for shared messages being enabled */ if(H5F_addr_defined(f->shared->sohm_addr)) { H5SM_index_header_t *header; /* Index header for message type */ + H5SM_table_cache_ud_t cache_udata; /* User-data for callback */ ssize_t index_num; /* Table index for message type */ + /* Set up user data for callback */ + cache_udata.f = f; + cache_udata.table_size = H5SM_TABLE_SIZE(f) + (f->shared->sohm_nindexes * H5SM_INDEX_HEADER_SIZE(f)); + /* Look up the master SOHM table */ - if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, f, H5AC_READ))) + if(NULL == (table = (H5SM_master_table_t *)H5AC_protect(f, dxpl_id, H5AC_SOHM_TABLE, f->shared->sohm_addr, &cache_udata, H5AC_READ))) HGOTO_ERROR(H5E_SOHM, H5E_CANTPROTECT, FAIL, "unable to load SOHM master table") /* Find the correct index for this message type */ diff --git a/test/cache_common.c b/test/cache_common.c index 68803ad..868b4d9 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -64,20 +64,93 @@ hbool_t try_core_file_driver = FALSE; hbool_t core_file_driver_failed = FALSE; const char *failure_mssg = NULL; -test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; -test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; -test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; -test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; -test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; -test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; -test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; -test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; -test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; -test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; -test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; +static test_entry_t pico_entries[NUM_PICO_ENTRIES], orig_pico_entries[NUM_PICO_ENTRIES]; +static test_entry_t nano_entries[NUM_NANO_ENTRIES], orig_nano_entries[NUM_NANO_ENTRIES]; +static test_entry_t micro_entries[NUM_MICRO_ENTRIES], orig_micro_entries[NUM_MICRO_ENTRIES]; +static test_entry_t tiny_entries[NUM_TINY_ENTRIES], orig_tiny_entries[NUM_TINY_ENTRIES]; +static test_entry_t small_entries[NUM_SMALL_ENTRIES], orig_small_entries[NUM_SMALL_ENTRIES]; +static test_entry_t medium_entries[NUM_MEDIUM_ENTRIES], orig_medium_entries[NUM_MEDIUM_ENTRIES]; +static test_entry_t large_entries[NUM_LARGE_ENTRIES], orig_large_entries[NUM_LARGE_ENTRIES]; +static test_entry_t huge_entries[NUM_HUGE_ENTRIES], orig_huge_entries[NUM_HUGE_ENTRIES]; +static test_entry_t monster_entries[NUM_MONSTER_ENTRIES], orig_monster_entries[NUM_MONSTER_ENTRIES]; +static test_entry_t variable_entries[NUM_VARIABLE_ENTRIES], orig_variable_entries[NUM_VARIABLE_ENTRIES]; +static test_entry_t notify_entries[NUM_NOTIFY_ENTRIES], orig_notify_entries[NUM_NOTIFY_ENTRIES]; hbool_t orig_entry_arrays_init = FALSE; +static herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); +static herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); + +static herr_t pico_dest(H5F_t * f, void * thing); +static herr_t nano_dest(H5F_t * f, void * thing); +static herr_t micro_dest(H5F_t * f, void * thing); +static herr_t tiny_dest(H5F_t * f, void * thing); +static herr_t small_dest(H5F_t * f, void * thing); +static herr_t medium_dest(H5F_t * f, void * thing); +static herr_t large_dest(H5F_t * f, void * thing); +static herr_t huge_dest(H5F_t * f, void * thing); +static herr_t monster_dest(H5F_t * f, void * thing); +static herr_t variable_dest(H5F_t * f, void * thing); +static herr_t notify_dest(H5F_t * f, void * thing); + +static herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); +static herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, + haddr_t addr, void *thing, unsigned * flags_ptr); + +static void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); +static void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); + +static herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); +static herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); + +static herr_t notify_notify(H5C_notify_action_t action, void *thing); + test_entry_t * entries[NUMBER_OF_ENTRY_TYPES] = { pico_entries, @@ -304,6 +377,7 @@ static void execute_flush_op(H5F_t *file_ptr, struct test_entry_t *entry_ptr, /* address translation funtions: */ + /*------------------------------------------------------------------------- * Function: addr_to_type_and_index * @@ -1816,25 +1890,20 @@ reset_entries(void) /*------------------------------------------------------------------------- - * Function: resize_entry + * Function: resize_entry * - * Purpose: Given a pointer to a cache, an entry type, an index, and + * Purpose: Given a pointer to a cache, an entry type, an index, and * a new size, set the size of the target entry to the new size. * * Note that at present, the type of the entry must be * VARIABLE_ENTRY_TYPE. * - * If the in_cache parameter is true, verify that the - * target entry is in the cache. If it - * isn't, scream and die. If it is, use the - * H5C_resize_entry() call to resize it. - * - * Do nothing if pass is false on entry. + * Do nothing if pass is false on entry. * - * Return: void + * Return: void * - * Programmer: John Mainzer - * 6/10/04 + * Programmer: John Mainzer + * 1/11/08 * *------------------------------------------------------------------------- */ @@ -1843,7 +1912,7 @@ void resize_entry(H5F_t * file_ptr, int32_t type, int32_t idx, - size_t new_size, + size_t new_size, hbool_t in_cache) { test_entry_t * base_addr; @@ -1898,8 +1967,8 @@ resize_entry(H5F_t * file_ptr, HDassert( entry_ptr->size = (entry_ptr->header).size ); } - } - } + } + } } else { protect_entry(file_ptr, type, idx); @@ -2574,7 +2643,7 @@ setup_cache(size_t max_cache_size, cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), - (const char **)entry_type_names, + (const char **)entry_type_names, check_write_permitted, TRUE, NULL, @@ -2675,7 +2744,7 @@ setup_cache(size_t max_cache_size, * Return: void * * Programmer: John Mainzer - * 6/11/04 + * 9/14/07 * *------------------------------------------------------------------------- */ @@ -3279,10 +3348,9 @@ protect_entry_ro(H5F_t * file_ptr, int32_t type, int32_t idx) { - /* const char * fcn_name = "protect_entry_ro()"; */ H5C_t *cache_ptr; - test_entry_t * base_addr; - test_entry_t * entry_ptr; + test_entry_t *base_addr; + test_entry_t *entry_ptr; H5C_cache_entry_t * cache_entry_ptr; if ( pass ) { @@ -3416,7 +3484,6 @@ void unpin_entry(int32_t type, int32_t idx) { - /* const char * fcn_name = "unpin_entry()"; */ herr_t result; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3437,7 +3504,7 @@ unpin_entry(int32_t type, HDassert( entry_ptr->is_pinned ); HDassert( entry_ptr->pinned_from_client ); - result = H5C_unpin_entry((void *)entry_ptr); + result = H5C_unpin_entry(entry_ptr); if ( ( result < 0 ) || ( entry_ptr->header.pinned_from_client ) || @@ -4244,7 +4311,7 @@ row_major_scan_backward(H5F_t * file_ptr, } else { unprotect_entry(file_ptr, type, idx + lag, - (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); + (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); } break; @@ -4279,7 +4346,7 @@ row_major_scan_backward(H5F_t * file_ptr, ( ( idx + lag) <= max_indices[type] ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); + HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); unprotect_entry(file_ptr, type, idx + lag, (dirty_unprotects ? H5C__DIRTIED_FLAG : H5C__NO_FLAGS_SET)); @@ -4422,8 +4489,6 @@ hl_row_major_scan_backward(H5F_t * file_ptr, * Programmer: John Mainzer * 6/23/04 * - * Modifications: - * *------------------------------------------------------------------------- */ diff --git a/test/cache_common.h b/test/cache_common.h index 67228eb..d828304 100644 --- a/test/cache_common.h +++ b/test/cache_common.h @@ -450,16 +450,6 @@ extern hbool_t skip_long_tests; extern hbool_t run_full_test; extern const char *failure_mssg; -extern test_entry_t pico_entries[NUM_PICO_ENTRIES]; -extern test_entry_t nano_entries[NUM_NANO_ENTRIES]; -extern test_entry_t micro_entries[NUM_MICRO_ENTRIES]; -extern test_entry_t tiny_entries[NUM_TINY_ENTRIES]; -extern test_entry_t small_entries[NUM_SMALL_ENTRIES]; -extern test_entry_t medium_entries[NUM_MEDIUM_ENTRIES]; -extern test_entry_t large_entries[NUM_LARGE_ENTRIES]; -extern test_entry_t huge_entries[NUM_HUGE_ENTRIES]; -extern test_entry_t monster_entries[NUM_MONSTER_ENTRIES]; - extern test_entry_t * entries[NUMBER_OF_ENTRY_TYPES]; extern const int32_t max_indices[NUMBER_OF_ENTRY_TYPES]; extern const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES]; @@ -474,82 +464,6 @@ herr_t check_write_permitted(const H5F_t * f, hid_t dxpl_id, hbool_t * write_permitted_ptr); -herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t small_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t large_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t variable_clear(H5F_t * f, void * thing, hbool_t dest); -herr_t notify_clear(H5F_t * f, void * thing, hbool_t dest); - - -herr_t pico_dest(H5F_t * f, void * thing); -herr_t nano_dest(H5F_t * f, void * thing); -herr_t micro_dest(H5F_t * f, void * thing); -herr_t tiny_dest(H5F_t * f, void * thing); -herr_t small_dest(H5F_t * f, void * thing); -herr_t medium_dest(H5F_t * f, void * thing); -herr_t large_dest(H5F_t * f, void * thing); -herr_t huge_dest(H5F_t * f, void * thing); -herr_t monster_dest(H5F_t * f, void * thing); -herr_t variable_dest(H5F_t * f, void * thing); -herr_t notify_dest(H5F_t * f, void * thing); - - -herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t variable_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); -herr_t notify_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, - haddr_t addr, void *thing, unsigned * flags_ptr); - - -void * pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * variable_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); -void * notify_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata); - - -herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t variable_size(H5F_t * f, void * thing, size_t * size_ptr); -herr_t notify_size(H5F_t * f, void * thing, size_t * size_ptr); - -herr_t notify_notify(H5C_notify_action_t action, void *thing); /* callback table extern */ @@ -595,9 +509,9 @@ void mark_entry_dirty(int32_t type, int32_t idx); void move_entry(H5C_t * cache_ptr, - int32_t type, - int32_t idx, - hbool_t main_addr); + int32_t type, + int32_t idx, + hbool_t main_addr); void protect_entry(H5F_t * file_ptr, int32_t type, @@ -623,10 +537,10 @@ void create_pinned_entry_dependency(H5F_t * file_ptr, void reset_entries(void); void resize_entry(H5F_t * file_ptr, - int32_t type, - int32_t idx, - size_t new_size, - hbool_t in_cache); + int32_t type, + int32_t idx, + size_t new_size, + hbool_t in_cache); H5F_t *setup_cache(size_t max_cache_size, size_t min_clean_size); diff --git a/test/ohdr.c b/test/ohdr.c index ad83ec1..37699e5 100644 --- a/test/ohdr.c +++ b/test/ohdr.c @@ -500,6 +500,8 @@ main(void) HDputs("Accessing objects with unknown header messages:"); { hid_t file2; /* File ID for 'bogus' object file */ + hid_t sid; /* Dataspace ID */ + hid_t aid; /* Attribute ID */ const char *testfile = H5_get_srcdir_filename(FILE_BOGUS); TESTING("object with unknown header message and no flags set"); @@ -567,6 +569,22 @@ main(void) if((dset = H5Dopen2(file, "/Dataset3", H5P_DEFAULT)) < 0) TEST_ERROR + /* Create data space */ + if((sid = H5Screate(H5S_SCALAR)) < 0) + FAIL_STACK_ERROR + + /* Create an attribute, to get the object header into write access */ + if((aid = H5Acreate2(dset, "Attr", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + + /* Close dataspace */ + if(H5Sclose(sid) < 0) + FAIL_STACK_ERROR + + /* Close attribute */ + if(H5Aclose(aid) < 0) + FAIL_STACK_ERROR + /* Close the dataset */ if(H5Dclose(dset) < 0) TEST_ERROR diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 8d6b546..b80730b 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -3589,8 +3589,7 @@ unlock_entry(H5C_t * cache_ptr, } result = H5AC_unprotect(file_ptr, H5P_DATASET_XFER_DEFAULT, &(types[0]), - entry_ptr->base_addr, - (void *)(&(entry_ptr->header)), flags); + entry_ptr->base_addr, (void *)(&(entry_ptr->header)), flags); if ( ( result < 0 ) || ( entry_ptr->header.type != &(types[0]) ) || @@ -4230,7 +4229,7 @@ smoke_check_2(void) /* we can't move pinned entries, so release any local pins now. */ local_unpin_all_entries(cache_ptr, file_ptr, FALSE); - /* move the first half of the entries... */ + /* Move the first half of the entries... */ for ( i = 0; i < (virt_num_data_entries / 2); i++ ) { lock_entry(cache_ptr, file_ptr, i); @@ -5173,10 +5172,7 @@ smoke_check_5(void) resize_entry(i, data[i].len / 2); } - if ( i % 4 == 0 ) - mark_entry_dirty(cache_ptr, file_ptr, i); - else - mark_entry_dirty(cache_ptr, file_ptr, i); + mark_entry_dirty(cache_ptr, file_ptr, i); if ( i % 8 <= 4 ) { -- cgit v0.12