summaryrefslogtreecommitdiffstats
path: root/src/H5AC.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5AC.c')
-rw-r--r--src/H5AC.c131
1 files changed, 30 insertions, 101 deletions
diff --git a/src/H5AC.c b/src/H5AC.c
index 8eb0dd9..7ed5047 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -106,11 +106,6 @@ H5FL_DEFINE_STATIC(H5AC_slist_entry_t);
/* (Global variable definition, declaration is in H5ACprivate.h also) */
hid_t H5AC_dxpl_id=(-1);
-/* Private dataset transfer property list for metadata I/O calls */
-/* (Collective set and "library internal" set) */
-/* (Static variable definition) */
-static hid_t H5AC_noblock_dxpl_id=(-1);
-
/* Dataset transfer property list for independent metadata I/O calls */
/* (just "library internal" set - i.e. independent transfer mode) */
/* (Global variable definition, declaration is in H5ACprivate.h also) */
@@ -257,9 +252,7 @@ H5AC_init_interface(void)
{
#ifdef H5_HAVE_PARALLEL
H5P_genplist_t *xfer_plist; /* Dataset transfer property list object */
- unsigned block_before_meta_write; /* "block before meta write" property value */
unsigned coll_meta_write; /* "collective metadata write" property value */
- unsigned library_internal = 1; /* "library internal" property value */
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
@@ -269,7 +262,7 @@ H5AC_init_interface(void)
/* Sanity check */
HDassert(H5P_CLS_DATASET_XFER_g != NULL);
- /* Get an ID for the blocking, collective H5AC dxpl */
+ /* Get an ID for the collective H5AC dxpl */
if((H5AC_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list")
@@ -277,51 +270,13 @@ H5AC_init_interface(void)
if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_dxpl_id)))
HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object")
- /* Insert 'block before metadata write' property */
- block_before_meta_write=1;
- if(H5P_insert(xfer_plist,H5AC_BLOCK_BEFORE_META_WRITE_NAME,H5AC_BLOCK_BEFORE_META_WRITE_SIZE,&block_before_meta_write,
- NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
- /* Insert 'library internal' property */
- if(H5P_insert(xfer_plist,H5AC_LIBRARY_INTERNAL_NAME,H5AC_LIBRARY_INTERNAL_SIZE,&library_internal,
- NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
/* Insert 'collective metadata write' property */
coll_meta_write = 1;
if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
- /* Get an ID for the non-blocking, collective H5AC dxpl */
- if((H5AC_noblock_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list")
-
- /* Get the property list object */
- if (NULL == (xfer_plist = (H5P_genplist_t *)H5I_object(H5AC_noblock_dxpl_id)))
- HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object")
-
- /* Insert 'block before metadata write' property */
- block_before_meta_write=0;
- if(H5P_insert(xfer_plist,H5AC_BLOCK_BEFORE_META_WRITE_NAME,H5AC_BLOCK_BEFORE_META_WRITE_SIZE,&block_before_meta_write,
- NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
- /* Insert 'library internal' property */
- if(H5P_insert(xfer_plist,H5AC_LIBRARY_INTERNAL_NAME,H5AC_LIBRARY_INTERNAL_SIZE,&library_internal,
- NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
- /* Insert 'collective metadata write' property */
- coll_meta_write = 1;
- if(H5P_insert(xfer_plist, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
-
- /* Get an ID for the non-blocking, independent H5AC dxpl */
+ /* Get an ID for the independent H5AC dxpl */
if((H5AC_ind_dxpl_id = H5P_create_id(H5P_CLS_DATASET_XFER_g, FALSE)) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, FAIL, "unable to register property list")
@@ -329,29 +284,16 @@ H5AC_init_interface(void)
if(NULL == (H5AC_ind_dxpl_g = (H5P_genplist_t *)H5I_object(H5AC_ind_dxpl_id)))
HGOTO_ERROR(H5E_CACHE, H5E_BADATOM, FAIL, "can't get new property list object")
- /* Insert 'block before metadata write' property */
- block_before_meta_write=0;
- if(H5P_insert(H5AC_ind_dxpl_g, H5AC_BLOCK_BEFORE_META_WRITE_NAME, H5AC_BLOCK_BEFORE_META_WRITE_SIZE, &block_before_meta_write,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
- /* Insert 'library internal' property */
- if(H5P_insert(H5AC_ind_dxpl_g, H5AC_LIBRARY_INTERNAL_NAME, H5AC_LIBRARY_INTERNAL_SIZE, &library_internal,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
/* Insert 'collective metadata write' property */
coll_meta_write = 0;
if(H5P_insert(H5AC_ind_dxpl_g, H5AC_COLLECTIVE_META_WRITE_NAME, H5AC_COLLECTIVE_META_WRITE_SIZE, &coll_meta_write,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert metadata cache dxpl property")
-
#else /* H5_HAVE_PARALLEL */
/* Sanity check */
HDassert(H5P_LST_DATASET_XFER_ID_g!=(-1));
H5AC_dxpl_id = H5P_DATASET_XFER_DEFAULT;
- H5AC_noblock_dxpl_id = H5P_DATASET_XFER_DEFAULT;
H5AC_ind_dxpl_id = H5P_DATASET_XFER_DEFAULT;
/* Get the property list objects for the IDs */
@@ -388,19 +330,17 @@ H5AC_term_interface(void)
if (H5_interface_initialize_g) {
#ifdef H5_HAVE_PARALLEL
- if(H5AC_dxpl_id > 0 || H5AC_noblock_dxpl_id > 0 || H5AC_ind_dxpl_id > 0) {
+ if(H5AC_dxpl_id > 0 || H5AC_ind_dxpl_id > 0) {
/* Indicate more work to do */
n = 1; /* H5I */
/* Close H5AC dxpl */
if(H5I_dec_ref(H5AC_dxpl_id) < 0 ||
- H5I_dec_ref(H5AC_noblock_dxpl_id) < 0 ||
H5I_dec_ref(H5AC_ind_dxpl_id) < 0)
H5E_clear_stack(NULL); /*ignore error*/
else {
/* Reset static IDs */
H5AC_dxpl_id = (-1);
- H5AC_noblock_dxpl_id = (-1);
H5AC_ind_dxpl_id = (-1);
/* Reset interface initialization flag */
@@ -411,7 +351,6 @@ H5AC_term_interface(void)
#else /* H5_HAVE_PARALLEL */
/* Reset static IDs */
H5AC_dxpl_id=(-1);
- H5AC_noblock_dxpl_id=(-1);
H5AC_ind_dxpl_id=(-1);
#endif /* H5_HAVE_PARALLEL */
/* Reset interface initialization flag */
@@ -689,7 +628,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
#endif /* H5_HAVE_PARALLEL */
/* Destroy the cache */
- if(H5C_dest(f, dxpl_id, H5AC_noblock_dxpl_id) < 0)
+ if(H5C_dest(f, dxpl_id, H5AC_dxpl_id) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFREE, FAIL, "can't destroy cache")
f->shared->cache = NULL;
@@ -702,8 +641,7 @@ H5AC_dest(H5F_t *f, hid_t dxpl_id)
if(aux_ptr->candidate_slist_ptr != NULL)
H5SL_close(aux_ptr->candidate_slist_ptr);
aux_ptr->magic = 0;
- H5FL_FREE(H5AC_aux_t, aux_ptr);
- aux_ptr = NULL;
+ aux_ptr = H5FL_FREE(H5AC_aux_t, aux_ptr);
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -771,7 +709,7 @@ H5AC_expunge_entry(H5F_t *f,
result = H5C_expunge_entry(f,
dxpl_id,
- H5AC_noblock_dxpl_id,
+ H5AC_dxpl_id,
type,
addr,
flags);
@@ -850,7 +788,7 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id)
#endif /* H5_HAVE_PARALLEL */
/* Flush the cache */
- if(H5C_flush_cache(f, dxpl_id, H5AC_noblock_dxpl_id, H5AC__NO_FLAGS_SET) < 0)
+ if(H5C_flush_cache(f, dxpl_id, H5AC_dxpl_id, H5AC__NO_FLAGS_SET) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't flush cache.")
done:
@@ -992,7 +930,7 @@ H5AC_insert_entry(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t add
#endif /* H5AC__TRACE_FILE_ENABLED */
/* Insert entry into metadata cache */
- if(H5C_insert_entry(f, dxpl_id, H5AC_noblock_dxpl_id, type, addr, thing, flags) < 0)
+ if(H5C_insert_entry(f, dxpl_id, H5AC_dxpl_id, type, addr, thing, flags) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed")
#if H5AC__TRACE_FILE_ENABLED
@@ -1013,7 +951,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, H5AC_noblock_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
} /* end if */
}
@@ -1166,7 +1104,7 @@ H5AC_move_entry(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t ne
#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, H5AC_noblock_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -1378,7 +1316,7 @@ H5AC_protect(H5F_t *f,
thing = H5C_protect(f,
dxpl_id,
- H5AC_noblock_dxpl_id,
+ H5AC_dxpl_id,
type,
addr,
udata,
@@ -1696,13 +1634,13 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
} /* end if */
#endif /* H5_HAVE_PARALLEL */
- if(H5C_unprotect(f, dxpl_id, H5AC_noblock_dxpl_id, type, addr, thing, flags) < 0)
+ if(H5C_unprotect(f, dxpl_id, H5AC_dxpl_id, type, addr, thing, flags) < 0)
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, H5AC_noblock_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
+ if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_TO_MIN_CLEAN) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -2925,7 +2863,7 @@ H5AC_broadcast_clean_list(H5AC_t * cache_ptr)
*/
if ( aux_ptr->sync_point_done != NULL ) {
- addr_buf_ptr = H5MM_malloc((size_t)num_entries * sizeof(haddr_t));
+ addr_buf_ptr = (haddr_t *)H5MM_malloc((size_t)num_entries * sizeof(haddr_t));
if ( addr_buf_ptr == NULL ) {
@@ -2971,8 +2909,7 @@ H5AC_broadcast_clean_list(H5AC_t * cache_ptr)
}
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->c_slist_len -= 1;
@@ -2981,7 +2918,7 @@ H5AC_broadcast_clean_list(H5AC_t * cache_ptr)
/* and also remove the matching entry from the dirtied list
* if it exists.
*/
- if((slist_entry_ptr = H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL) {
+ if((slist_entry_ptr = (H5AC_slist_entry_t *)H5SL_search(aux_ptr->d_slist_ptr, (void *)(&addr))) != NULL) {
HDassert( slist_entry_ptr->magic == H5AC__H5AC_SLIST_ENTRY_T_MAGIC );
HDassert( slist_entry_ptr->addr == addr );
@@ -2989,8 +2926,7 @@ H5AC_broadcast_clean_list(H5AC_t * cache_ptr)
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.")
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->d_slist_len -= 1;
@@ -3282,8 +3218,7 @@ H5AC_copy_candidate_list_to_buffer(H5AC_t * cache_ptr,
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from candidate entry slist.")
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->candidate_slist_len -= 1;
@@ -3450,8 +3385,7 @@ H5AC_log_deleted_entry(H5AC_t * cache_ptr,
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.")
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->d_slist_len -= 1;
@@ -3467,8 +3401,7 @@ H5AC_log_deleted_entry(H5AC_t * cache_ptr,
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from cleaned entry slist.")
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->c_slist_len -= 1;
@@ -3577,8 +3510,7 @@ H5AC_log_dirtied_entry(const H5AC_info_t * entry_ptr,
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from clean entry slist.")
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->c_slist_len -= 1;
@@ -3672,8 +3604,7 @@ H5AC_log_flushed_entry(H5C_t * cache_ptr,
}
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->c_slist_len -= 1;
@@ -3694,8 +3625,7 @@ H5AC_log_flushed_entry(H5C_t * cache_ptr,
}
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->d_slist_len -= 1;
@@ -3925,8 +3855,7 @@ H5AC_log_moved_entry(const H5F_t *f,
}
slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
- slist_entry_ptr = NULL;
+ slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, slist_entry_ptr);
aux_ptr->c_slist_len -= 1;
@@ -4307,7 +4236,7 @@ H5AC_propagate_flushed_and_still_clean_entries_list(H5F_t * f,
HDassert( aux_ptr->c_slist_len == 0 );
} /* end if */
else {
- if(H5AC_receive_and_apply_clean_list(f, dxpl_id, H5AC_noblock_dxpl_id, cache_ptr) < 0)
+ if(H5AC_receive_and_apply_clean_list(f, dxpl_id, H5AC_dxpl_id, cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Can't receive and/or process clean slist broadcast.")
} /* end else */
@@ -4881,7 +4810,7 @@ H5AC_rsp__p0_only__flush(H5F_t *f,
} /* end if */
/* Propagate cleaned entries to other ranks. */
- if(H5AC_propagate_flushed_and_still_clean_entries_list(f, H5AC_noblock_dxpl_id, cache_ptr) < 0)
+ if(H5AC_propagate_flushed_and_still_clean_entries_list(f, H5AC_dxpl_id, cache_ptr) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't propagate clean entries list.")
done:
@@ -4988,7 +4917,7 @@ H5AC_rsp__p0_only__flush_to_min_clean(H5F_t *f,
*/
aux_ptr->write_permitted = TRUE;
- result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_noblock_dxpl_id);
+ result = H5C_flush_to_min_clean(f, dxpl_id, H5AC_dxpl_id);
aux_ptr->write_permitted = FALSE;
@@ -5232,7 +5161,7 @@ H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr,
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from dirty entry slist.")
d_slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, d_slist_entry_ptr);
+ d_slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, d_slist_entry_ptr);
aux_ptr->d_slist_len -= 1;
@@ -5248,7 +5177,7 @@ H5AC_tidy_cache_0_lists(H5AC_t * cache_ptr,
HGOTO_ERROR(H5E_CACHE, H5E_CANTDELETE, FAIL, "Can't delete entry from clean entry slist.")
c_slist_entry_ptr->magic = 0;
- H5FL_FREE(H5AC_slist_entry_t, c_slist_entry_ptr);
+ c_slist_entry_ptr = H5FL_FREE(H5AC_slist_entry_t, c_slist_entry_ptr);
aux_ptr->c_slist_len -= 1;
@@ -5291,7 +5220,7 @@ H5AC_flush_entries(H5F_t *f)
/* Check if we have >1 ranks */
if(f->shared->cache->aux_ptr) {
- if(H5AC_run_sync_point(f, H5AC_noblock_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0)
+ if(H5AC_run_sync_point(f, H5AC_dxpl_id, H5AC_SYNC_POINT_OP__FLUSH_CACHE) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Can't run sync point.")
} /* end if */