mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-04-12 17:31:09 +08:00
Misc. style cleanups from the page_buffering branch.
This commit is contained in:
parent
7e4b64bd83
commit
b26b684339
102
src/H5AC.c
102
src/H5AC.c
@ -413,7 +413,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get mpi size")
|
||||
|
||||
if(NULL == (aux_ptr = H5FL_CALLOC(H5AC_aux_t)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "Can't allocate H5AC auxilary structure")
|
||||
|
||||
aux_ptr->magic = H5AC__H5AC_AUX_T_MAGIC;
|
||||
aux_ptr->mpi_comm = mpi_comm;
|
||||
@ -443,10 +443,10 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
|
||||
|
||||
if(mpi_rank == 0) {
|
||||
if(NULL == (aux_ptr->d_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create dirtied entry list")
|
||||
|
||||
if(NULL == (aux_ptr->c_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create cleaned entry list")
|
||||
} /* end if */
|
||||
|
||||
/* construct the candidate slist for all processes.
|
||||
@ -454,7 +454,7 @@ H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr, H5AC_cache_image_co
|
||||
* will use it in the case of a flush.
|
||||
*/
|
||||
if(NULL == (aux_ptr->candidate_slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create candidate entry list")
|
||||
|
||||
if(aux_ptr != NULL)
|
||||
if(aux_ptr->mpi_rank == 0)
|
||||
@ -583,7 +583,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
|
||||
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
if(H5AC__close_trace_file(f->shared->cache) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed")
|
||||
#endif /* H5AC__TRACE_FILE_ENABLED */
|
||||
|
||||
if(H5F_USE_MDC_LOGGING(f)) {
|
||||
@ -597,7 +597,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/* destroying the cache, so clear all collective entries */
|
||||
if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed")
|
||||
|
||||
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(f->shared->cache);
|
||||
if(aux_ptr)
|
||||
@ -606,7 +606,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
|
||||
|
||||
/* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */
|
||||
if(H5AC__flush_entries(f, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush")
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
/* Destroy the cache */
|
||||
@ -732,7 +732,7 @@ H5AC_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
|
||||
#endif /* H5AC__TRACE_FILE_ENABLED */
|
||||
|
||||
if(H5C_expunge_entry(f, dxpl_id, type, addr, flags) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTEXPUNGE, FAIL, "H5C_expunge_entry() failed")
|
||||
|
||||
done:
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
@ -802,17 +802,17 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/* flushing the cache, so clear all collective entries */
|
||||
if(H5C_clear_coll_entries(f->shared->cache, FALSE) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, FAIL, "H5C_clear_coll_entries() failed")
|
||||
|
||||
/* Attempt to flush all entries from rank 0 & Bcast clean list to other ranks */
|
||||
if(H5AC__flush_entries(f, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush")
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
/* Flush the cache */
|
||||
/* (Again, in parallel - writes out the superblock) */
|
||||
if(H5C_flush_cache(f, dxpl_id, H5AC__NO_FLAGS_SET) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache")
|
||||
|
||||
done:
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
@ -866,11 +866,11 @@ H5AC_get_entry_status(const H5F_t *f, haddr_t addr, unsigned *status)
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if((f == NULL) || (!H5F_addr_defined(addr)) || (status == NULL))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry")
|
||||
|
||||
if(H5C_get_entry_status(f, addr, NULL, &in_cache, &is_dirty,
|
||||
&is_protected, &is_pinned, &is_corked, &is_flush_dep_parent, &is_flush_dep_child, &image_is_up_to_date) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_entry_status() failed")
|
||||
|
||||
if(in_cache) {
|
||||
*status |= H5AC_ES__IN_CACHE;
|
||||
@ -984,7 +984,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
|
||||
/* Check if we should try to flush */
|
||||
if(aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)
|
||||
if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point")
|
||||
} /* end if */
|
||||
}
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
@ -1391,13 +1391,13 @@ H5_ATTR_UNUSED
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
if(H5C_move_entry(f->shared->cache, type, old_addr, new_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "H5C_move_entry() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "H5C_move_entry() failed")
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/* Check if we should try to flush */
|
||||
if(NULL != aux_ptr && aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold)
|
||||
if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point")
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
done:
|
||||
@ -1487,7 +1487,7 @@ done:
|
||||
* Function: H5AC_prep_for_file_close
|
||||
*
|
||||
* Purpose: This function should be called just prior to the cache
|
||||
* flushes at file close.
|
||||
* flushes at file close.
|
||||
*
|
||||
* The objective of the call is to allow the metadata cache
|
||||
* to do any preparatory work prior to generation of a
|
||||
@ -1569,7 +1569,7 @@ H5AC_create_flush_dependency(void * parent_thing, void * child_thing)
|
||||
|
||||
/* Create the flush dependency */
|
||||
if(H5C_create_flush_dependency(parent_thing, child_thing) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "H5C_create_flush_dependency() failed")
|
||||
|
||||
done:
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
@ -1670,7 +1670,7 @@ H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
|
||||
#endif /* H5AC_DO_TAGGING_SANITY_CHECKS */
|
||||
|
||||
if(NULL == (thing = H5C_protect(f, dxpl_id, type, addr, udata, flags)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed")
|
||||
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
if(trace_file_ptr != NULL)
|
||||
@ -1893,7 +1893,7 @@ H5AC_destroy_flush_dependency(void * parent_thing, void * child_thing)
|
||||
|
||||
/* Destroy the flush dependency */
|
||||
if(H5C_destroy_flush_dependency(parent_thing, child_thing) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNDEPEND, FAIL, "H5C_destroy_flush_dependency() failed")
|
||||
|
||||
done:
|
||||
#if H5AC__TRACE_FILE_ENABLED
|
||||
@ -2017,18 +2017,18 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
|
||||
|
||||
if(deleted && aux_ptr->mpi_rank == 0)
|
||||
if(H5AC__log_deleted_entry((H5AC_info_t *)thing) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5AC__log_deleted_entry() failed")
|
||||
} /* end if */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
if(H5C_unprotect(f, dxpl_id, addr, thing, flags) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "H5C_unprotect() failed")
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
/* Check if we should try to flush */
|
||||
if((aux_ptr != NULL) && (aux_ptr->dirty_bytes >= aux_ptr->dirty_bytes_threshold))
|
||||
if(H5AC__run_sync_point(f, dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point")
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
done:
|
||||
@ -2071,22 +2071,22 @@ H5AC_get_cache_auto_resize_config(const H5AC_t *cache_ptr,
|
||||
/* Check args */
|
||||
if((cache_ptr == NULL) || (config_ptr == NULL) ||
|
||||
(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or config_ptr on entry")
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
{
|
||||
H5AC_aux_t *aux_ptr;
|
||||
|
||||
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr);
|
||||
if((aux_ptr != NULL) && (aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad aux_ptr on entry")
|
||||
}
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
/* Retrieve the configuration */
|
||||
if(H5C_get_cache_auto_resize_config((const H5C_t *)cache_ptr, &internal_config) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_auto_resize_config() failed")
|
||||
if(H5C_get_evictions_enabled((const H5C_t *)cache_ptr, &evictions_enabled) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_resize_enabled() failed")
|
||||
|
||||
/* Set the information to return */
|
||||
if(internal_config.rpt_fcn == NULL)
|
||||
@ -2163,7 +2163,7 @@ H5AC_get_cache_size(H5AC_t *cache_ptr, size_t *max_size_ptr, size_t *min_clean_s
|
||||
|
||||
if(H5C_get_cache_size((H5C_t *)cache_ptr, max_size_ptr, min_clean_size_ptr,
|
||||
cur_size_ptr, cur_num_entries_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_size() failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -2190,7 +2190,7 @@ H5AC_get_cache_hit_rate(H5AC_t *cache_ptr, double *hit_rate_ptr)
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if(H5C_get_cache_hit_rate((H5C_t *)cache_ptr, hit_rate_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_cache_hit_rate() failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -2217,7 +2217,7 @@ H5AC_reset_cache_hit_rate_stats(H5AC_t * cache_ptr)
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
if(H5C_reset_cache_hit_rate_stats((H5C_t *)cache_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_reset_cache_hit_rate_stats() failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -2266,14 +2266,14 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config
|
||||
#endif /* H5AC__TRACE_FILE_ENABLED */
|
||||
|
||||
if(cache_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad cache_ptr on entry")
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
{
|
||||
H5AC_aux_t *aux_ptr;
|
||||
|
||||
aux_ptr = (H5AC_aux_t *)H5C_get_aux_ptr(cache_ptr);
|
||||
if((aux_ptr != NULL) && (aux_ptr->magic != H5AC__H5AC_AUX_T_MAGIC))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad aux_ptr on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "bad aux_ptr on entry")
|
||||
}
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
@ -2285,29 +2285,29 @@ H5AC_set_cache_auto_resize_config(H5AC_t *cache_ptr, H5AC_cache_config_t *config
|
||||
FILE * file_ptr;
|
||||
|
||||
if(NULL == (file_ptr = H5C_get_trace_file_ptr(cache_ptr)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_get_trace_file_ptr() failed")
|
||||
|
||||
if((!(config_ptr->close_trace_file)) && (file_ptr != NULL))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Trace file already open")
|
||||
} /* end if */
|
||||
|
||||
/* Close & reopen trace file, if requested */
|
||||
if(config_ptr->close_trace_file)
|
||||
if(H5AC__close_trace_file(cache_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__close_trace_file() failed")
|
||||
if(config_ptr->open_trace_file)
|
||||
if(H5AC__open_trace_file(cache_ptr, config_ptr->trace_file_name) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC__open_trace_file() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "H5AC__open_trace_file() failed")
|
||||
|
||||
/* Convert external configuration to internal representation */
|
||||
if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed")
|
||||
|
||||
/* Set configuration */
|
||||
if(H5C_set_cache_auto_resize_config(cache_ptr, &internal_config) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_cache_auto_resize_config() failed")
|
||||
if(H5C_set_evictions_enabled(cache_ptr, config_ptr->evictions_enabled) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5C_set_evictions_enabled() failed")
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
{
|
||||
@ -2406,9 +2406,9 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr)
|
||||
|
||||
/* Check args */
|
||||
if(config_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "NULL config_ptr on entry")
|
||||
if(config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Unknown config version")
|
||||
|
||||
/* don't bother to test trace_file_name unless open_trace_file is TRUE */
|
||||
if(config_ptr->open_trace_file) {
|
||||
@ -2420,31 +2420,31 @@ H5AC_validate_config(H5AC_cache_config_t *config_ptr)
|
||||
*/
|
||||
name_len = HDstrlen(config_ptr->trace_file_name);
|
||||
if(name_len == 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name is empty")
|
||||
else if(name_len > H5AC__MAX_TRACE_FILE_NAME_LEN)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->trace_file_name too long")
|
||||
} /* end if */
|
||||
|
||||
if((config_ptr->evictions_enabled == FALSE) &&
|
||||
((config_ptr->incr_mode != H5C_incr__off) ||
|
||||
(config_ptr->flash_incr_mode != H5C_flash_incr__off) ||
|
||||
(config_ptr->decr_mode != H5C_decr__off)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "Can't disable evictions while auto-resize is enabled")
|
||||
|
||||
if(config_ptr->dirty_bytes_threshold < H5AC__MIN_DIRTY_BYTES_THRESHOLD)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too small")
|
||||
else if(config_ptr->dirty_bytes_threshold > H5AC__MAX_DIRTY_BYTES_THRESHOLD)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "dirty_bytes_threshold too big")
|
||||
|
||||
if((config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY) &&
|
||||
(config_ptr->metadata_write_strategy != H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "config_ptr->metadata_write_strategy out of range")
|
||||
|
||||
if(H5AC__ext_config_2_int_config(config_ptr, &internal_config) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC__ext_config_2_int_config() failed")
|
||||
|
||||
if(H5C_validate_resize_config(&internal_config, H5C_RESIZE_CFG__VALIDATE_ALL) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADVALUE, FAIL, "error(s) in new config")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
@ -2589,7 +2589,7 @@ H5AC__ext_config_2_int_config(H5AC_cache_config_t *ext_conf_ptr,
|
||||
|
||||
if((ext_conf_ptr == NULL) || (ext_conf_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION) ||
|
||||
(int_conf_ptr == NULL))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad ext_conf_ptr or inf_conf_ptr on entry")
|
||||
|
||||
int_conf_ptr->version = H5C__CURR_AUTO_SIZE_CTL_VER;
|
||||
if(ext_conf_ptr->rpt_fcn_enabled)
|
||||
@ -2656,7 +2656,7 @@ H5AC_ignore_tags(const H5F_t *f)
|
||||
|
||||
/* Set up a new metadata tag */
|
||||
if(H5C_ignore_tags(f->shared->cache) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTSET, FAIL, "H5C_ignore_tags() failed")
|
||||
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
@ -486,7 +486,7 @@ H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
|
||||
#ifndef NDEBUG
|
||||
H5_DLL herr_t H5AC_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
|
||||
void **entry_ptr_ptr);
|
||||
H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr,
|
||||
H5_DLL herr_t H5AC_flush_dependency_exists(H5F_t *f, haddr_t parent_addr,
|
||||
haddr_t child_addr, hbool_t *fd_exists_ptr);
|
||||
H5_DLL herr_t H5AC_verify_entry_type(const H5F_t *f, haddr_t addr,
|
||||
const H5AC_class_t *expected_type, hbool_t *in_cache_ptr,
|
||||
|
22
src/H5Cdbg.c
22
src/H5Cdbg.c
@ -105,7 +105,7 @@ H5C_dump_cache(H5C_t * cache_ptr, const char * cache_name)
|
||||
|
||||
/* First, create a skip list */
|
||||
if(NULL == (slist_ptr = H5SL_create(H5SL_TYPE_HADDR, NULL)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "can't create skip list")
|
||||
|
||||
/* Next, scan the index, and insert all entries in the skip list.
|
||||
* Do this, as we want to display cache entries in increasing address
|
||||
@ -241,9 +241,9 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn)
|
||||
(int)(entry_ptr->is_dirty),
|
||||
entry_ptr->type->name);
|
||||
|
||||
HDfprintf(stdout, " node_ptr = 0x%llx, item = 0x%llx\n",
|
||||
HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n",
|
||||
(unsigned long long)node_ptr,
|
||||
(unsigned long long)H5SL_item(node_ptr));
|
||||
H5SL_item(node_ptr));
|
||||
|
||||
/* increment node_ptr before we delete its target */
|
||||
node_ptr = H5SL_next(node_ptr);
|
||||
@ -286,7 +286,7 @@ H5C_set_prefix(H5C_t * cache_ptr, char * prefix)
|
||||
|
||||
if((cache_ptr == NULL) || (cache_ptr->magic != H5C__H5C_T_MAGIC) ||
|
||||
(prefix == NULL) || (HDstrlen(prefix) >= H5C__PREFIX_LEN))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad param(s) on entry")
|
||||
|
||||
HDstrncpy(&(cache_ptr->prefix[0]), prefix, (size_t)(H5C__PREFIX_LEN));
|
||||
|
||||
@ -1118,28 +1118,28 @@ H5C_validate_index_list(H5C_t *cache_ptr)
|
||||
|
||||
if(((cache_ptr->il_head == NULL) || (cache_ptr->il_tail == NULL))
|
||||
&& (cache_ptr->il_head != cache_ptr->il_tail))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 1 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer validation failed")
|
||||
|
||||
if((cache_ptr->index_len == 1) && ((cache_ptr->il_head != cache_ptr->il_tail)
|
||||
|| (cache_ptr->il_head == NULL) || (cache_ptr->il_head->size != cache_ptr->index_size)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 2 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointer sanity checks failed")
|
||||
|
||||
if((cache_ptr->index_len >= 1)
|
||||
&& ((cache_ptr->il_head == NULL)
|
||||
|| (cache_ptr->il_head->il_prev != NULL)
|
||||
|| (cache_ptr->il_tail == NULL)
|
||||
|| (cache_ptr->il_tail->il_next != NULL)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 3 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list length sanity checks failed")
|
||||
|
||||
entry_ptr = cache_ptr->il_head;
|
||||
while(entry_ptr != NULL) {
|
||||
if((entry_ptr != cache_ptr->il_head)
|
||||
&& ((entry_ptr->il_prev == NULL) || (entry_ptr->il_prev->il_next != entry_ptr)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 4 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid")
|
||||
|
||||
if((entry_ptr != cache_ptr->il_tail)
|
||||
&& ((entry_ptr->il_next == NULL) || (entry_ptr->il_next->il_prev != entry_ptr)))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 5 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index list pointers for entry are invalid")
|
||||
|
||||
HDassert(entry_ptr->ring > 0);
|
||||
HDassert(entry_ptr->ring < H5C_RING_NTYPES);
|
||||
@ -1167,7 +1167,7 @@ H5C_validate_index_list(H5C_t *cache_ptr)
|
||||
|| (cache_ptr->clean_index_size != clean_size)
|
||||
|| (cache_ptr->dirty_index_size != dirty_size)
|
||||
|| (clean_size + dirty_size != size))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 6 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid")
|
||||
|
||||
size = 0;
|
||||
clean_size = 0;
|
||||
@ -1181,7 +1181,7 @@ H5C_validate_index_list(H5C_t *cache_ptr)
|
||||
if((cache_ptr->index_size != size)
|
||||
|| (cache_ptr->clean_index_size != clean_size)
|
||||
|| (cache_ptr->dirty_index_size != dirty_size))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Check 7 failed")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Index, clean and dirty sizes for cache are invalid")
|
||||
|
||||
done:
|
||||
if(ret_value != SUCCEED)
|
||||
|
@ -156,7 +156,7 @@ H5FL_DEFINE(H5C_cache_entry_t);
|
||||
*
|
||||
* Purpose: Examine the metadata cache associated with the supplied
|
||||
* instance of H5F_t to determine whether the load of a
|
||||
* cache image has either been queued ir executed, and if
|
||||
* cache image has either been queued or executed, and if
|
||||
* construction of a cache image has been requested.
|
||||
*
|
||||
* This done, it set *load_ci_ptr to TRUE if a cache image
|
||||
@ -734,7 +734,7 @@ H5C__deserialize_prefetched_entry(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr,
|
||||
HDassert(found);
|
||||
|
||||
if(H5C_create_flush_dependency(ds_entry_ptr, fd_children[i]) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Can't restore child flush dependency.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTDEPEND, FAIL, "Can't restore child flush dependency")
|
||||
|
||||
i++;
|
||||
} /* end while */
|
||||
@ -1070,7 +1070,7 @@ H5C__load_cache_image(H5F_t *f, hid_t dxpl_id)
|
||||
} /* end if */
|
||||
|
||||
/* If directed, free the on disk metadata cache image */
|
||||
if(cache_ptr->delete_image) {
|
||||
if(cache_ptr->delete_image) {
|
||||
if(H5F_super_ext_remove_msg(f, dxpl_id, H5O_MDCI_MSG_ID) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTREMOVE, FAIL, "can't remove metadata cache image message from superblock extension")
|
||||
|
||||
@ -2166,7 +2166,7 @@ H5C__encode_cache_image_entry(H5F_t *f, H5C_t *cache_ptr, uint8_t **buf,
|
||||
|
||||
/* Validate and encode dependency parent count */
|
||||
if(ie_ptr->fd_parent_count > H5C__MDCI_MAX_FD_PARENTS)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADRANGE, FAIL, "fd_parent_count out of rang.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_BADRANGE, FAIL, "fd_parent_count out of range")
|
||||
UINT16ENCODE(p, (uint16_t)(ie_ptr->fd_parent_count));
|
||||
|
||||
/* Encode index in LRU */
|
||||
@ -2425,10 +2425,10 @@ H5C__prep_for_file_close__compute_fd_heights(const H5C_t *cache_ptr)
|
||||
* for all entries that may appear in the cache image.
|
||||
*/
|
||||
entry_ptr = cache_ptr->il_head;
|
||||
while(entry_ptr != NULL ) {
|
||||
while(entry_ptr != NULL) {
|
||||
if(entry_ptr->include_in_image && entry_ptr->fd_child_count == 0 &&
|
||||
entry_ptr->fd_parent_count > 0) {
|
||||
for(u = 0; u < entry_ptr->fd_parent_count; u++ ) {
|
||||
for(u = 0; u < entry_ptr->fd_parent_count; u++) {
|
||||
parent_ptr = entry_ptr->flush_dep_parent[u];
|
||||
|
||||
HDassert(parent_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC);
|
||||
@ -3371,7 +3371,7 @@ H5C__serialize_cache(H5F_t *f, hid_t dxpl_id)
|
||||
if((H5C_validate_protected_entry_list(cache_ptr) < 0) ||
|
||||
(H5C_validate_pinned_entry_list(cache_ptr) < 0) ||
|
||||
(H5C_validate_lru_list(cache_ptr) < 0))
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry.\n")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
|
||||
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
|
||||
|
||||
#ifndef NDEBUG
|
||||
@ -3510,7 +3510,7 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring)
|
||||
H5C__serialize_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring)
|
||||
{
|
||||
hbool_t done = FALSE;
|
||||
H5C_t * cache_ptr;
|
||||
|
198
src/H5Cmpio.c
198
src/H5Cmpio.c
@ -235,25 +235,25 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
HDassert( cache_ptr != NULL );
|
||||
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
|
||||
HDassert( num_candidates > 0 );
|
||||
HDassert( num_candidates <= cache_ptr->slist_len );
|
||||
HDassert( candidates_list_ptr != NULL );
|
||||
HDassert( 0 <= mpi_rank );
|
||||
HDassert( mpi_rank < mpi_size );
|
||||
/* Sanity checks */
|
||||
HDassert(cache_ptr != NULL);
|
||||
HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC);
|
||||
HDassert(num_candidates > 0);
|
||||
HDassert(num_candidates <= cache_ptr->slist_len);
|
||||
HDassert(candidates_list_ptr != NULL);
|
||||
HDassert(0 <= mpi_rank);
|
||||
HDassert(mpi_rank < mpi_size);
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n",
|
||||
FUNC, mpi_rank);
|
||||
for ( i = 0; i < 1024; i++ ) tbl_buf[i] = '\0';
|
||||
HDfprintf(stdout, "%s:%d: setting up candidate assignment table.\n", FUNC, mpi_rank);
|
||||
|
||||
HDmemset(tbl_buf, 0, sizeof(tbl_buf));
|
||||
|
||||
sprintf(&(tbl_buf[0]), "candidate list = ");
|
||||
for ( i = 0; i < num_candidates; i++ )
|
||||
{
|
||||
sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx",
|
||||
(long long)(*(candidates_list_ptr + i)));
|
||||
}
|
||||
for(i = 0; i < num_candidates; i++)
|
||||
sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), " 0x%llx", (long long)(*(candidates_list_ptr + i)));
|
||||
sprintf(&(tbl_buf[HDstrlen(tbl_buf)]), "\n");
|
||||
|
||||
HDfprintf(stdout, "%s", tbl_buf);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
@ -269,7 +269,6 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
n = num_candidates / mpi_size;
|
||||
m = num_candidates % mpi_size;
|
||||
HDassert(n >= 0);
|
||||
|
||||
if(NULL == (candidate_assignment_table = (int *)H5MM_malloc(sizeof(int) * (size_t)(mpi_size + 1))))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for candidate assignment table")
|
||||
|
||||
@ -297,9 +296,8 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
HDassert((candidate_assignment_table[mpi_size - 1] + n) == num_candidates);
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
/* verify that the candidate assignment table has the expected form */
|
||||
for ( i = 1; i < mpi_size - 1; i++ )
|
||||
{
|
||||
/* Verify that the candidate assignment table has the expected form */
|
||||
for(i = 1; i < mpi_size - 1; i++) {
|
||||
int a, b;
|
||||
|
||||
a = candidate_assignment_table[i] - candidate_assignment_table[i - 1];
|
||||
@ -331,38 +329,36 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
|
||||
for(i = 0; i < num_candidates; i++) {
|
||||
addr = candidates_list_ptr[i];
|
||||
HDassert( H5F_addr_defined(addr) );
|
||||
HDassert(H5F_addr_defined(addr));
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
if ( i > 0 ) {
|
||||
if ( last_addr == addr ) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list.\n")
|
||||
} else if ( last_addr > addr ) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted.\n")
|
||||
}
|
||||
}
|
||||
if(i > 0) {
|
||||
if(last_addr == addr)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "duplicate entry in cleaned list")
|
||||
else if(last_addr > addr)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "candidate list not sorted")
|
||||
} /* end if */
|
||||
|
||||
last_addr = addr;
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
|
||||
H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL)
|
||||
if(entry_ptr == NULL) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed candidate entry not in cache?!?!?.")
|
||||
} else if(!entry_ptr->is_dirty) {
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?.")
|
||||
} else if ( entry_ptr->is_protected ) {
|
||||
if(entry_ptr == NULL)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "listed candidate entry not in cache?!?!?")
|
||||
if(!entry_ptr->is_dirty)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?")
|
||||
if(entry_ptr->is_protected)
|
||||
/* For now at least, we can't deal with protected entries.
|
||||
* If we encounter one, scream and die. If it becomes an
|
||||
* issue, we should be able to work around this.
|
||||
*/
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry is protected?!?!?.")
|
||||
} else {
|
||||
/* determine whether the entry is to be cleared or flushed,
|
||||
/* Determine whether the entry is to be cleared or flushed,
|
||||
* and mark it accordingly. We will scan the protected and
|
||||
* pinned list shortly, and clear or flush according to these
|
||||
* markings.
|
||||
*/
|
||||
if((i >= first_entry_to_flush) && (i <= last_entry_to_flush)) {
|
||||
if(i >= first_entry_to_flush && i <= last_entry_to_flush) {
|
||||
entries_to_flush++;
|
||||
entry_ptr->flush_immediately = TRUE;
|
||||
} /* end if */
|
||||
@ -376,11 +372,10 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
removed from the coll list. This is OK since the
|
||||
candidate list is collective and uniform across all
|
||||
ranks. */
|
||||
if(TRUE == entry_ptr->coll_access) {
|
||||
if(entry_ptr->coll_access) {
|
||||
entry_ptr->coll_access = FALSE;
|
||||
H5C__REMOVE_FROM_COLL_LIST(cache_ptr, entry_ptr, FAIL)
|
||||
} /* end if */
|
||||
} /* end else */
|
||||
} /* end for */
|
||||
|
||||
#if H5C_APPLY_CANDIDATE_LIST__DEBUG
|
||||
@ -389,7 +384,6 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
(int)entries_to_flush);
|
||||
#endif /* H5C_APPLY_CANDIDATE_LIST__DEBUG */
|
||||
|
||||
|
||||
/* We have now marked all the entries on the candidate list for
|
||||
* either flush or clear -- now scan the LRU and the pinned list
|
||||
* for these entries and do the deed.
|
||||
@ -758,7 +752,7 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
|
||||
/* Write collective list */
|
||||
if(H5C__collective_write(f, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "Can't write metadata collectively")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "can't write metadata collectively")
|
||||
} /* end if */
|
||||
|
||||
/* ====================================================================== *
|
||||
@ -779,7 +773,6 @@ H5C_apply_candidate_list(H5F_t * f,
|
||||
done:
|
||||
if(candidate_assignment_table != NULL)
|
||||
candidate_assignment_table = (int *)H5MM_xfree((void *)candidate_assignment_table);
|
||||
|
||||
if(cache_ptr->coll_write_list) {
|
||||
if(H5SL_close(cache_ptr->coll_write_list) < 0)
|
||||
HDONE_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "failed to destroy skip list")
|
||||
@ -857,7 +850,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
|
||||
|
||||
nominated_addr = entry_ptr->addr;
|
||||
if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(1).")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed")
|
||||
|
||||
nominated_entries_size += entry_ptr->size;
|
||||
nominated_entries_count++;
|
||||
@ -881,7 +874,7 @@ H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr)
|
||||
|
||||
nominated_addr = entry_ptr->addr;
|
||||
if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed(2).")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed")
|
||||
|
||||
nominated_entries_size += entry_ptr->size;
|
||||
nominated_entries_count++;
|
||||
@ -973,7 +966,7 @@ H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr)
|
||||
|
||||
nominated_addr = entry_ptr->addr;
|
||||
if(H5AC_add_candidate((H5AC_t *)cache_ptr, nominated_addr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed.")
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "H5AC_add_candidate() failed")
|
||||
|
||||
nominated_entries_size += entry_ptr->size;
|
||||
nominated_entries_count++;
|
||||
@ -1076,46 +1069,30 @@ H5C_mark_entries_as_clean(H5F_t * f,
|
||||
HDassert( ce_array_ptr != NULL );
|
||||
|
||||
#if H5C_DO_EXTREME_SANITY_CHECKS
|
||||
if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) ||
|
||||
( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
|
||||
( H5C_validate_lru_list(cache_ptr) < 0 ) ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"an extreme sanity check failed on entry.\n");
|
||||
}
|
||||
if(H5C_validate_protected_entry_list(cache_ptr) < 0 ||
|
||||
H5C_validate_pinned_entry_list(cache_ptr) < 0 ||
|
||||
H5C_validate_lru_list(cache_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on entry")
|
||||
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
|
||||
|
||||
for ( i = 0; i < ce_array_len; i++ )
|
||||
{
|
||||
for(i = 0; i < ce_array_len; i++) {
|
||||
addr = ce_array_ptr[i];
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
if ( i == 0 ) {
|
||||
|
||||
if(i == 0)
|
||||
last_addr = addr;
|
||||
|
||||
} else {
|
||||
|
||||
if ( last_addr == addr ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"Duplicate entry in cleaned list.\n");
|
||||
|
||||
} else if ( last_addr > addr ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"cleaned list not sorted.\n");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(last_addr == addr)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Duplicate entry in cleaned list")
|
||||
if(last_addr > addr)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "cleaned list not sorted")
|
||||
} /* end else */
|
||||
|
||||
#if H5C_DO_EXTREME_SANITY_CHECKS
|
||||
if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) ||
|
||||
( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
|
||||
( H5C_validate_lru_list(cache_ptr) < 0 ) ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"an extreme sanity check failed in for loop.\n");
|
||||
}
|
||||
if(H5C_validate_protected_entry_list(cache_ptr) < 0
|
||||
|| H5C_validate_pinned_entry_list(cache_ptr) < 0
|
||||
|| H5C_validate_lru_list(cache_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed in for loop")
|
||||
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
|
||||
@ -1123,28 +1100,24 @@ H5C_mark_entries_as_clean(H5F_t * f,
|
||||
|
||||
H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL)
|
||||
|
||||
if ( entry_ptr == NULL ) {
|
||||
if(entry_ptr == NULL) {
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
HDfprintf(stdout,
|
||||
"H5C_mark_entries_as_clean: entry[%d] = %ld not in cache.\n",
|
||||
(int)i,
|
||||
(long)addr);
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"Listed entry not in cache?!?!?.")
|
||||
|
||||
} else if ( ! entry_ptr->is_dirty ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not in cache?!?!?")
|
||||
} /* end if */
|
||||
else if(!entry_ptr->is_dirty) {
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
HDfprintf(stdout,
|
||||
"H5C_mark_entries_as_clean: entry %ld is not dirty!?!\n",
|
||||
(long)addr);
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"Listed entry not dirty?!?!?.")
|
||||
|
||||
} else {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Listed entry not dirty?!?!?")
|
||||
} /* end else-if */
|
||||
else {
|
||||
/* Mark the entry to be cleared on unprotect. We will
|
||||
* scan the LRU list shortly, and clear all those entries
|
||||
* not currently protected.
|
||||
@ -1200,31 +1173,25 @@ H5C_mark_entries_as_clean(H5F_t * f,
|
||||
* point.
|
||||
* JRM -- 4/7/15
|
||||
*/
|
||||
|
||||
entries_cleared = 0;
|
||||
entries_examined = 0;
|
||||
initial_list_len = cache_ptr->LRU_list_len;
|
||||
entry_ptr = cache_ptr->LRU_tail_ptr;
|
||||
|
||||
while ( ( entry_ptr != NULL ) &&
|
||||
( entries_examined <= initial_list_len ) &&
|
||||
( entries_cleared < ce_array_len ) )
|
||||
{
|
||||
if ( entry_ptr->clear_on_unprotect ) {
|
||||
|
||||
while(entry_ptr != NULL && entries_examined <= initial_list_len &&
|
||||
entries_cleared < ce_array_len) {
|
||||
if(entry_ptr->clear_on_unprotect) {
|
||||
entry_ptr->clear_on_unprotect = FALSE;
|
||||
clear_ptr = entry_ptr;
|
||||
entry_ptr = entry_ptr->prev;
|
||||
entries_cleared++;
|
||||
|
||||
if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.")
|
||||
} else {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "can't clear entry")
|
||||
} /* end if */
|
||||
else
|
||||
entry_ptr = entry_ptr->prev;
|
||||
}
|
||||
entries_examined++;
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
HDassert( entries_cleared == other_entries_marked );
|
||||
@ -1233,25 +1200,20 @@ H5C_mark_entries_as_clean(H5F_t * f,
|
||||
/* It is also possible that some of the cleared entries are on the
|
||||
* pinned list. Must scan that also.
|
||||
*/
|
||||
|
||||
entry_ptr = cache_ptr->pel_head_ptr;
|
||||
|
||||
while ( entry_ptr != NULL )
|
||||
{
|
||||
if ( entry_ptr->clear_on_unprotect ) {
|
||||
|
||||
while(entry_ptr != NULL) {
|
||||
if(entry_ptr->clear_on_unprotect) {
|
||||
entry_ptr->clear_on_unprotect = FALSE;
|
||||
clear_ptr = entry_ptr;
|
||||
entry_ptr = entry_ptr->next;
|
||||
entries_cleared++;
|
||||
|
||||
if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0 )
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry.")
|
||||
} else {
|
||||
|
||||
if(H5C__flush_single_entry(f, dxpl_id, clear_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't clear entry")
|
||||
} /* end if */
|
||||
else
|
||||
entry_ptr = entry_ptr->next;
|
||||
}
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
#if H5C_DO_SANITY_CHECKS
|
||||
HDassert( entries_cleared == pinned_entries_marked + other_entries_marked );
|
||||
@ -1276,19 +1238,14 @@ H5C_mark_entries_as_clean(H5F_t * f,
|
||||
#endif /* H5C_DO_SANITY_CHECKS */
|
||||
|
||||
done:
|
||||
|
||||
#if H5C_DO_EXTREME_SANITY_CHECKS
|
||||
if ( ( H5C_validate_protected_entry_list(cache_ptr) < 0 ) ||
|
||||
( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
|
||||
( H5C_validate_lru_list(cache_ptr) < 0 ) ) {
|
||||
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \
|
||||
"an extreme sanity check failed on exit.\n");
|
||||
}
|
||||
if(H5C_validate_protected_entry_list(cache_ptr) < 0
|
||||
|| H5C_validate_pinned_entry_list(cache_ptr) < 0
|
||||
|| H5C_validate_lru_list(cache_ptr) < 0)
|
||||
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "an extreme sanity check failed on exit")
|
||||
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
|
||||
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
|
||||
} /* H5C_mark_entries_as_clean() */
|
||||
|
||||
|
||||
@ -1499,4 +1456,3 @@ done:
|
||||
FUNC_LEAVE_NOAPI(ret_value);
|
||||
} /* end H5C__collective_write() */
|
||||
#endif /* H5_HAVE_PARALLEL */
|
||||
|
||||
|
140
src/H5MF.c
140
src/H5MF.c
@ -214,7 +214,7 @@ H5MF_init_merge_flags(H5F_t *f)
|
||||
break;
|
||||
|
||||
default:
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_BADVALUE, FAIL, "invalid mapping type")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_BADVALUE, FAIL, "invalid mapping type")
|
||||
} /* end switch */
|
||||
|
||||
done:
|
||||
@ -267,13 +267,13 @@ H5MF__alloc_open(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type)
|
||||
else
|
||||
fsm_ring = H5AC_RING_RDFSM;
|
||||
if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
|
||||
/* Open an existing free space structure for the file */
|
||||
if(NULL == (f->shared->fs_man[type] = H5FS_open(f, dxpl_id, f->shared->fs_addr[type],
|
||||
NELMTS(classes), classes, f, f->shared->alignment, f->shared->threshold)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize free space info")
|
||||
|
||||
/* Set the state for the free space manager to "open", if it is now */
|
||||
if(f->shared->fs_man[type])
|
||||
@ -283,7 +283,7 @@ done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
|
||||
} /* end H5MF__alloc_open() */
|
||||
@ -332,7 +332,7 @@ H5MF_alloc_create(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type)
|
||||
|
||||
if(NULL == (f->shared->fs_man[type] = H5FS_create(f, dxpl_id, NULL,
|
||||
&fs_create, NELMTS(classes), classes, f, f->shared->alignment, f->shared->threshold)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space info")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize free space info")
|
||||
|
||||
|
||||
/* Set the state for the free space manager to "open", if it is now */
|
||||
@ -376,12 +376,12 @@ H5MF__alloc_start(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type)
|
||||
if(H5F_addr_defined(f->shared->fs_addr[type])) {
|
||||
/* Open existing free space manager */
|
||||
if(H5MF__alloc_open(f, dxpl_id, type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTOPENOBJ, FAIL, "can't initialize file free space")
|
||||
} /* end if */
|
||||
else {
|
||||
/* Create new free space manager */
|
||||
if(H5MF_alloc_create(f, dxpl_id, type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCREATE, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCREATE, FAIL, "can't initialize file free space")
|
||||
} /* end else */
|
||||
|
||||
done:
|
||||
@ -476,7 +476,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
|
||||
else
|
||||
fsm_ring = H5AC_RING_RDFSM;
|
||||
if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, HADDR_UNDEF, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
|
||||
/* Check if we are using the free space manager for this file */
|
||||
@ -484,7 +484,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
|
||||
/* Check if the free space manager for the file has been initialized */
|
||||
if(!f->shared->fs_man[fs_type] && H5F_addr_defined(f->shared->fs_addr[fs_type]))
|
||||
if(H5MF__alloc_open(f, dxpl_id, fs_type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTOPENOBJ, HADDR_UNDEF, "can't initialize file free space")
|
||||
|
||||
/* Search for large enough space in the free space manager */
|
||||
if(f->shared->fs_man[fs_type]) {
|
||||
@ -493,7 +493,7 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ
|
||||
|
||||
/* Try to get a section from the free space manager */
|
||||
if((node_found = H5FS_sect_find(f, dxpl_id, f->shared->fs_man[fs_type], size, (H5FS_section_info_t **)&node)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "error locating free space in file")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, HADDR_UNDEF, "error locating free space in file")
|
||||
#ifdef H5MF_ALLOC_DEBUG_MORE
|
||||
HDfprintf(stderr, "%s: Check 1.5, node_found = %t\n", FUNC, node_found);
|
||||
#endif /* H5MF_ALLOC_DEBUG_MORE */
|
||||
@ -513,7 +513,7 @@ HDfprintf(stderr, "%s: Check 1.6, freeing node\n", FUNC);
|
||||
#endif /* H5MF_ALLOC_DEBUG_MORE */
|
||||
/* Free section node */
|
||||
if(H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free simple section node")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTRELEASE, HADDR_UNDEF, "can't free simple section node")
|
||||
} /* end if */
|
||||
else {
|
||||
H5MF_sect_ud_t udata; /* User data for callback */
|
||||
@ -534,7 +534,7 @@ HDfprintf(stderr, "%s: Check 1.7, re-adding node, node->sect_info.size = %Hu\n",
|
||||
#endif /* H5MF_ALLOC_DEBUG_MORE */
|
||||
/* Re-insert section node into file's free space */
|
||||
if(H5FS_sect_add(f, dxpl_id, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, HADDR_UNDEF, "can't re-add section to file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, HADDR_UNDEF, "can't re-add section to file free space")
|
||||
} /* end else */
|
||||
|
||||
/* Leave now */
|
||||
@ -548,13 +548,13 @@ HDfprintf(stderr, "%s: Check 2.0\n", FUNC);
|
||||
|
||||
/* Allocate from the metadata aggregator (or the VFD) */
|
||||
if(HADDR_UNDEF == (ret_value = H5MF_aggr_vfd_alloc(f, alloc_type, dxpl_id, size)))
|
||||
HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed from aggr/vfd")
|
||||
|
||||
done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, HADDR_UNDEF, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, HADDR_UNDEF, "unable to set property value")
|
||||
|
||||
#ifdef H5MF_ALLOC_DEBUG
|
||||
HDfprintf(stderr, "%s: Leaving: ret_value = %a, size = %Hu\n", FUNC, ret_value, size);
|
||||
@ -610,14 +610,14 @@ HDfprintf(stderr, "%s: size = %Hu\n", FUNC, size);
|
||||
|
||||
/* Retrieve the 'eoa' for the file */
|
||||
if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "driver get_eoa request failed")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, HADDR_UNDEF, "driver get_eoa request failed")
|
||||
|
||||
/* Compute value to return */
|
||||
ret_value = f->shared->tmp_addr - size;
|
||||
|
||||
/* Check for overlap into the actual allocated space in the file */
|
||||
if(H5F_addr_le(ret_value, eoa))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, HADDR_UNDEF, "driver get_eoa request failed")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, HADDR_UNDEF, "driver get_eoa request failed")
|
||||
|
||||
/* Adjust temporary address allocator in the file */
|
||||
f->shared->tmp_addr = ret_value;
|
||||
@ -663,12 +663,12 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
|
||||
/* check arguments */
|
||||
HDassert(f);
|
||||
if(!H5F_addr_defined(addr) || 0 == size)
|
||||
HGOTO_DONE(SUCCEED);
|
||||
HGOTO_DONE(SUCCEED)
|
||||
HDassert(addr != 0); /* Can't deallocate the superblock :-) */
|
||||
|
||||
/* Check for attempting to free space that's a 'temporary' file address */
|
||||
if(H5F_addr_le(f->shared->tmp_addr, addr))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_BADRANGE, FAIL, "attempting to free temporary file space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_BADRANGE, FAIL, "attempting to free temporary file space")
|
||||
|
||||
/* Get free space type from allocation type */
|
||||
fs_type = H5MF_ALLOC_TO_FS_TYPE(f, alloc_type);
|
||||
@ -683,7 +683,7 @@ HDfprintf(stderr, "%s: fs_type = %u\n", FUNC, (unsigned)fs_type);
|
||||
else
|
||||
fsm_ring = H5AC_RING_RDFSM;
|
||||
if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
|
||||
/* Set up I/O info for operation */
|
||||
@ -693,7 +693,7 @@ HDfprintf(stderr, "%s: fs_type = %u\n", FUNC, (unsigned)fs_type);
|
||||
|
||||
/* Check if the space to free intersects with the file's metadata accumulator */
|
||||
if(H5F__accum_free(&fio_info, alloc_type, addr, size) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTFREE, FAIL, "can't check free space intersection w/metadata accumulator")
|
||||
|
||||
/* Check if the free space manager for the file has been initialized */
|
||||
if(!f->shared->fs_man[fs_type]) {
|
||||
@ -746,12 +746,12 @@ HDfprintf(stderr, "%s: dropping addr = %a, size = %Hu, on the floor!\n", FUNC, a
|
||||
* the file space manager
|
||||
*/
|
||||
if(H5MF__alloc_start(f, dxpl_id, fs_type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
} /* end if */
|
||||
|
||||
/* Create free space section for block */
|
||||
if(NULL == (node = H5MF_sect_simple_new(addr, size)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize free space section")
|
||||
|
||||
/* Construct user data for callbacks */
|
||||
udata.f = f;
|
||||
@ -769,7 +769,7 @@ HDfprintf(stderr, "%s: Before H5FS_sect_add()\n", FUNC);
|
||||
#endif /* H5MF_ALLOC_DEBUG_MORE */
|
||||
/* Add to the free space for the file */
|
||||
if(H5FS_sect_add(f, dxpl_id, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't add section to file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't add section to file free space")
|
||||
node = NULL;
|
||||
#ifdef H5MF_ALLOC_DEBUG_MORE
|
||||
HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC);
|
||||
@ -780,7 +780,7 @@ HDfprintf(stderr, "%s: After H5FS_sect_add()\n", FUNC);
|
||||
|
||||
/* Try to merge the section that is smaller than threshold */
|
||||
if((merged = H5FS_sect_try_merge(f, dxpl_id, f->shared->fs_man[fs_type], (H5FS_section_info_t *)node, H5FS_ADD_RETURNED_SPACE, &udata)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINSERT, FAIL, "can't merge section to file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINSERT, FAIL, "can't merge section to file free space")
|
||||
else if(merged == TRUE) /* successfully merged */
|
||||
/* Indicate that the node was used */
|
||||
node = NULL;
|
||||
@ -790,12 +790,12 @@ done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
/* Release section node, if allocated and not added to section list or merged */
|
||||
if(node)
|
||||
if(H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
|
||||
|
||||
#ifdef H5MF_ALLOC_DEBUG
|
||||
HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
|
||||
@ -859,30 +859,30 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r
|
||||
else
|
||||
fsm_ring = H5AC_RING_RDFSM;
|
||||
if(H5AC_set_ring(dxpl_id, fsm_ring, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
|
||||
/* Check if the block is exactly at the end of the file */
|
||||
if((ret_value = H5FD_try_extend(f->shared->lf, map_type, f, dxpl_id, end, extra_requested)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTEXTEND, FAIL, "error extending file")
|
||||
else if(ret_value == FALSE) {
|
||||
H5F_blk_aggr_t *aggr; /* Aggregator to use */
|
||||
|
||||
/* Check for test block able to extend aggregation block */
|
||||
aggr = (map_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr);
|
||||
if((ret_value = H5MF_aggr_try_extend(f, dxpl_id, aggr, map_type, end, extra_requested)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTEXTEND, FAIL, "error extending aggregation block")
|
||||
else if(ret_value == FALSE) {
|
||||
|
||||
/* Check if the free space for the file has been initialized */
|
||||
if(!f->shared->fs_man[fs_type] && H5F_addr_defined(f->shared->fs_addr[fs_type]))
|
||||
if(H5MF__alloc_open(f, dxpl_id, fs_type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
|
||||
/* Check for test block able to block in free space manager */
|
||||
if(f->shared->fs_man[fs_type])
|
||||
if((ret_value = H5FS_sect_try_extend(f, dxpl_id, f->shared->fs_man[fs_type], addr, size, extra_requested)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending block in free space manager")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTEXTEND, FAIL, "error extending block in free space manager")
|
||||
} /* end if */
|
||||
} /* end else-if */
|
||||
|
||||
@ -890,7 +890,7 @@ done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
#ifdef H5MF_ALLOC_DEBUG
|
||||
HDfprintf(stderr, "%s: Leaving: ret_value = %t\n", FUNC, ret_value);
|
||||
@ -950,21 +950,21 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
|
||||
|
||||
/* Retrieve the 'eoa' for the file */
|
||||
if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, H5FD_MEM_DEFAULT)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "driver get_eoa request failed")
|
||||
|
||||
/* Set the ring type in the DXPL */
|
||||
if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
curr_ring = H5AC_RING_RDFSM;
|
||||
|
||||
/* Retrieve metadata aggregator info, if available */
|
||||
if(H5MF_aggr_query(f, &(f->shared->meta_aggr), &ma_addr, &ma_size) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't query metadata aggregator stats")
|
||||
|
||||
/* Retrieve 'small data' aggregator info, if available */
|
||||
if(H5MF_aggr_query(f, &(f->shared->sdata_aggr), &sda_addr, &sda_size) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't query small data aggregator stats")
|
||||
|
||||
/* Iterate over all the free space types that have managers and get each free list's space */
|
||||
for(type = H5FD_MEM_DEFAULT; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
|
||||
@ -980,14 +980,14 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
|
||||
|
||||
if(needed_ring != curr_ring) {
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (2)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value (2)")
|
||||
curr_ring = needed_ring;
|
||||
} /* end if */
|
||||
|
||||
/* Check if the free space for the file has been initialized */
|
||||
if(!f->shared->fs_man[type] && H5F_addr_defined(f->shared->fs_addr[type])) {
|
||||
if(H5MF__alloc_open(f, dxpl_id, type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
HDassert(f->shared->fs_man[type]);
|
||||
fs_started[type] = TRUE;
|
||||
} /* end if */
|
||||
@ -999,9 +999,9 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
|
||||
|
||||
/* Retrieve free space size from free space manager */
|
||||
if(H5FS_sect_stats(f->shared->fs_man[type], &type_fs_size, NULL) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space stats")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't query free space stats")
|
||||
if(H5FS_size(f, f->shared->fs_man[type], &type_meta_size) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space metadata stats")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't query free space metadata stats")
|
||||
|
||||
/* Increment total free space for types */
|
||||
tot_fs_size += type_fs_size;
|
||||
@ -1020,7 +1020,7 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
|
||||
|
||||
if(f->shared->fs_man[type]) {
|
||||
if(H5FS_sect_query_last_sect(f->shared->fs_man[type], §_addr, §_size) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query last section on merge list")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't query last section on merge list")
|
||||
|
||||
/* Deduct space from previous accumulation if the section is at EOA */
|
||||
if(H5F_addr_eq(sect_addr + sect_size, eoa)) {
|
||||
@ -1057,12 +1057,12 @@ H5MF_get_freespace(H5F_t *f, hid_t dxpl_id, hsize_t *tot_space, hsize_t *meta_si
|
||||
|
||||
if(needed_ring != curr_ring) {
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (3)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value (3)")
|
||||
curr_ring = needed_ring;
|
||||
} /* end if */
|
||||
|
||||
if(H5MF__alloc_close(f, dxpl_id, type) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't close file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't close file free space")
|
||||
} /* end if */
|
||||
} /* end for */
|
||||
|
||||
@ -1077,7 +1077,7 @@ done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
|
||||
} /* end H5MF_get_freespace() */
|
||||
@ -1119,7 +1119,7 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
|
||||
|
||||
/* Create free space section for block */
|
||||
if(NULL == (node = H5MF_sect_simple_new(addr, size)))
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize free space section")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize free space section")
|
||||
|
||||
/* Construct user data for callbacks */
|
||||
udata.f = f;
|
||||
@ -1130,18 +1130,18 @@ HDfprintf(stderr, "%s: Entering - alloc_type = %u, addr = %a, size = %Hu\n", FUN
|
||||
|
||||
/* Call the "can shrink" callback for the section */
|
||||
if((ret_value = H5MF_sect_simple_can_shrink((const H5FS_section_info_t *)node, &udata)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTMERGE, FAIL, "can't check if section can shrink container")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTMERGE, FAIL, "can't check if section can shrink container")
|
||||
else if(ret_value > 0) {
|
||||
/* Shrink or absorb the section */
|
||||
if(H5MF_sect_simple_shrink((H5FS_section_info_t **)&node, &udata) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink container")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink container")
|
||||
} /* end if */
|
||||
|
||||
done:
|
||||
|
||||
/* Free section node allocated */
|
||||
if(node && H5MF_sect_simple_free((H5FS_section_info_t *)node) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTRELEASE, FAIL, "can't free simple section node")
|
||||
|
||||
#ifdef H5MF_ALLOC_DEBUG
|
||||
HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value);
|
||||
@ -1195,7 +1195,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id)
|
||||
* the DXPL to that value. We will alter this later if needed.
|
||||
*/
|
||||
if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value(1)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value(1)")
|
||||
reset_ring = TRUE;
|
||||
curr_ring = H5AC_RING_RDFSM;
|
||||
|
||||
@ -1215,7 +1215,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id)
|
||||
|
||||
if(needed_ring != curr_ring) {
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (2)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value (2)")
|
||||
curr_ring = needed_ring;
|
||||
} /* end if */
|
||||
|
||||
@ -1230,7 +1230,7 @@ H5MF__close_shrink_eoa(H5F_t *f, hid_t dxpl_id)
|
||||
|
||||
/* check the two aggregators */
|
||||
if((status = H5MF_aggrs_try_shrink_eoa(f, dxpl_id)) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't check for shrinking eoa")
|
||||
else if(status > 0)
|
||||
eoa_shrank = TRUE;
|
||||
} while(eoa_shrank);
|
||||
@ -1239,7 +1239,7 @@ done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
|
||||
} /* end H5MF__close_shrink_eoa() */
|
||||
@ -1917,7 +1917,7 @@ HDfprintf(stderr, "%s: Check 1.0 - f->shared->fs_man[%u] = %p, f->shared->fs_add
|
||||
|
||||
if(needed_ring != curr_ring) {
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, dxpl, &curr_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (4)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value (4)")
|
||||
curr_ring = needed_ring;
|
||||
} /* end if */
|
||||
|
||||
@ -2006,18 +2006,18 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
|
||||
/* Set the ring type in the DXPL */
|
||||
if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
|
||||
/* Close and delete freespace managers from the file */
|
||||
if(H5MF__close_delete(f, dxpl_id, &dxpl) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to close delete free-space managers")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to close delete free-space managers")
|
||||
|
||||
done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
#ifdef H5MF_ALLOC_DEBUG
|
||||
HDfprintf(stderr, "%s: Leaving\n", FUNC);
|
||||
@ -2071,7 +2071,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
* needed.
|
||||
*/
|
||||
if(H5AC_set_ring(dxpl_id, H5AC_RING_RDFSM, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
curr_ring = H5AC_RING_RDFSM;
|
||||
|
||||
@ -2082,7 +2082,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
|
||||
/* Trying shrinking the EOA for the file */
|
||||
if(H5MF__close_shrink_eoa(f, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink eoa")
|
||||
|
||||
/* Making free-space managers persistent for superblock version >= 2 */
|
||||
if(f->shared->sblock->super_vers >= HDF5_SUPERBLOCK_VERSION_2
|
||||
@ -2114,7 +2114,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
|
||||
/* Write the free space manager message -- message must already exist */
|
||||
if(H5F_super_ext_write_msg(f, dxpl_id, H5O_FSINFO_ID, &fsinfo, FALSE, H5O_MSG_NO_FLAGS_SET) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_WRITEERROR, FAIL, "error in writing message to superblock extension")
|
||||
|
||||
/* Final close of free-space managers */
|
||||
for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) {
|
||||
@ -2130,7 +2130,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
|
||||
if(needed_ring != curr_ring) {
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (3)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value (3)")
|
||||
curr_ring = needed_ring;
|
||||
} /* end if */
|
||||
|
||||
@ -2159,7 +2159,7 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
else { /* super_vers can be 0, 1, 2 */
|
||||
/* Close and delete freespace managers from the file */
|
||||
if(H5MF__close_delete(f, dxpl_id, &dxpl) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTINIT, FAIL, "can't initialize file free space")
|
||||
|
||||
/* moved code that was for both the persistant and non persistant free
|
||||
* space managers to the non-persistant case. In the persistant
|
||||
@ -2175,14 +2175,14 @@ HDfprintf(stderr, "%s: Entering\n", FUNC);
|
||||
/* Trying shrinking the EOA for the file */
|
||||
/* (in case any free space is now at the EOA) */
|
||||
if(H5MF__close_shrink_eoa(f, dxpl_id) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSHRINK, FAIL, "can't shrink eoa")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSHRINK, FAIL, "can't shrink eoa")
|
||||
} /* end else */
|
||||
|
||||
done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
#ifdef H5MF_ALLOC_DEBUG
|
||||
HDfprintf(stderr, "%s: Leaving\n", FUNC);
|
||||
@ -2283,7 +2283,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects,
|
||||
needed_ring = H5AC_RING_RDFSM;
|
||||
curr_ring = needed_ring;
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &orig_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value")
|
||||
reset_ring = TRUE;
|
||||
|
||||
/* Iterate over memory types, retrieving the number of sections of each type */
|
||||
@ -2299,14 +2299,14 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects,
|
||||
|
||||
if(needed_ring != curr_ring) {
|
||||
if(H5AC_set_ring(dxpl_id, needed_ring, &dxpl, &curr_ring) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set ring value (2)")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set ring value (2)")
|
||||
curr_ring = needed_ring;
|
||||
} /* end if */
|
||||
|
||||
/* Open free space manager of this type, if it isn't already */
|
||||
if(!f->shared->fs_man[ty] && H5F_addr_defined(f->shared->fs_addr[ty])) {
|
||||
if(H5MF__alloc_open(f, dxpl_id, ty) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTOPENOBJ, FAIL, "can't initialize file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTOPENOBJ, FAIL, "can't initialize file free space")
|
||||
HDassert(f->shared->fs_man[ty]);
|
||||
fs_started = TRUE;
|
||||
} /* end if */
|
||||
@ -2318,7 +2318,7 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects,
|
||||
|
||||
/* Query how many sections of this type */
|
||||
if(H5FS_sect_stats(f->shared->fs_man[ty], NULL, &hnums) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "can't query free space stats")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTGET, FAIL, "can't query free space stats")
|
||||
H5_CHECKED_ASSIGN(nums, size_t, hnums, hsize_t);
|
||||
|
||||
/* Increment total # of sections */
|
||||
@ -2328,14 +2328,14 @@ H5MF_get_free_sections(H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, size_t nsects,
|
||||
if(sect_info && nums > 0) {
|
||||
/* Iterate over all the free space sections of this type, adding them to the user's section info */
|
||||
if(H5FS_sect_iterate(f, dxpl_id, f->shared->fs_man[ty], H5MF_sects_cb, §_udata) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_BADITER, FAIL, "can't iterate over sections")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections")
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
|
||||
/* Close the free space manager of this type, if we started it here */
|
||||
if(fs_started)
|
||||
if(H5MF__alloc_close(f, dxpl_id, ty) < 0)
|
||||
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCLOSEOBJ, FAIL, "can't close file free space")
|
||||
HGOTO_ERROR(H5E_FSPACE, H5E_CANTCLOSEOBJ, FAIL, "can't close file free space")
|
||||
} /* end for */
|
||||
|
||||
/* Set return value */
|
||||
@ -2345,7 +2345,7 @@ done:
|
||||
/* Reset the ring in the DXPL */
|
||||
if(reset_ring)
|
||||
if(H5AC_reset_ring(dxpl, orig_ring) < 0)
|
||||
HDONE_ERROR(H5E_RESOURCE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
HDONE_ERROR(H5E_FSPACE, H5E_CANTSET, FAIL, "unable to set property value")
|
||||
|
||||
FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL)
|
||||
} /* H5MF_get_free_sections() */
|
||||
|
Loading…
x
Reference in New Issue
Block a user