summaryrefslogtreecommitdiffstats
path: root/src/H5C2.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2008-08-22 13:57:58 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2008-08-22 13:57:58 (GMT)
commit1db502ee8e4dd32ace4d61c0095fe841fb3f4e20 (patch)
tree672aa689594c4ac04711ce88c7997cefff7e9d9f /src/H5C2.c
parent98364cc7cf456e5279ef63c8d5450cbd9a25d65e (diff)
downloadhdf5-1db502ee8e4dd32ace4d61c0095fe841fb3f4e20.zip
hdf5-1db502ee8e4dd32ace4d61c0095fe841fb3f4e20.tar.gz
hdf5-1db502ee8e4dd32ace4d61c0095fe841fb3f4e20.tar.bz2
[svn-r15518] A variety of changes:
1) Removed references to H5AC2__CURR_JNL_CONFIG_VER from H5Fget_jnl_config() and H5Pget_jnl_config(), and also references to H5AC__CURR_CACHE_CONFIG_VERSION from H5Fget_mdc_config() and H5Pget_mdc_config(). 2) Removed H5Pset_journal() from H5C2journal.c, and modified test code to use H5F/Pget/set_mdj_config() instead. 3) Implemented support for callbacks on metadata journaling status change along with the associated registration / deregistration calls and associated test code. 4) Fixed bug in journaling shutdown exposed by 3 above. Tested and passed on Phoenix (serial), Linew (serial), and Kagiso (parallel). However, while I was testing there were a couple of checkins, forcing an update and second round of testing. On the second round, tested and passed on Phoenix (serial) and Kagiso (parallel), but failed on Linew (serial). As best I can tell, this was caused by Mike M's checkin -- which broke the smoke checks in cache2_journal on Linew but not Phoenix or Kagiso. A typical delta in the architype files follows: linew.hdfgroup.uiuc.edu% diff -ctw cache2_journal_sc00_000.jnl tmp/cache2_journal_sc00_000.jnl *** cache2_journal_sc00_000.jnl Fri Aug 22 08:28:49 2008 --- tmp/cache2_journal_sc00_000.jnl Fri Aug 22 05:08:41 2008 *************** *** 1,5 **** ! 0 ver_num 1 target_file_name cache_journal_test.h5 creation_date Fri Aug 22 human_readable 1 ! E eoa_value 0x0 C comment Begin transaction on transaction 1.0. 1 bgn_trans 1 2 trans_num 1 length 1 base_addr 0x401 body 01 --- 1,5 ---- ! 0 ver_num 1 target_file_name cache_journal_test.h5 creation_date Wed Aug 20 human_readable 1 ! E eoa_value 0x772a9c01 C comment Begin transaction on transaction 1.0. 1 bgn_trans 1 2 trans_num 1 length 1 base_addr 0x401 body 01 As you can see, it looks like garbage is getting into the first eoa write on Linew. I'm checking in anyway, as Quincey needs my changes, and I will not have time to work on this for several days. Mike: Let me know if you are tackling this one -- if not, I'll deal with it.
Diffstat (limited to 'src/H5C2.c')
-rw-r--r--src/H5C2.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/H5C2.c b/src/H5C2.c
index a643fbd..22cd2cc 100644
--- a/src/H5C2.c
+++ b/src/H5C2.c
@@ -649,6 +649,31 @@ H5C2_create(size_t max_cache_size,
cache_ptr->jwipl_head_ptr = NULL;
cache_ptr->jwipl_tail_ptr = NULL;
+ /* allocate and initialze the metadata journaling status change
+ * callback table, along with the associated fields. Note that
+ * the table will grow and shrink as needed.
+ */
+ cache_ptr->mdjsc_cb_tbl =
+ H5MM_malloc(H5C2__MIN_MDJSC_CB_TBL_LEN *
+ sizeof(H5C2_mdjsc_record_t));
+ if ( cache_ptr->mdjsc_cb_tbl == NULL ) {
+
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, \
+ "can't alloc mdjsc_cb_tbl.")
+ }
+ for ( i = 0; i < H5C2__MIN_MDJSC_CB_TBL_LEN; i++ )
+ {
+ ((cache_ptr->mdjsc_cb_tbl)[i]).fcn_ptr = NULL;
+ ((cache_ptr->mdjsc_cb_tbl)[i]).data_ptr = NULL;
+ ((cache_ptr->mdjsc_cb_tbl)[i]).fl_next = i + 1;
+ }
+ ((cache_ptr->mdjsc_cb_tbl)[H5C2__MIN_MDJSC_CB_TBL_LEN - 1]).fl_next = -1;
+ cache_ptr->mdjsc_cb_tbl_len = H5C2__MIN_MDJSC_CB_TBL_LEN;
+ cache_ptr->num_mdjsc_cbs = 0;
+ cache_ptr->mdjsc_cb_tbl_fl_head = 0;
+ cache_ptr->mdjsc_cb_tbl_max_idx_in_use = -1;
+
+
if ( H5C2_reset_cache_hit_rate_stats(cache_ptr) != SUCCEED ) {
/* this should be impossible... */
@@ -936,6 +961,11 @@ H5C2_dest(H5F_t * f,
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC );
+ /* All metadata journaling status change callbacks should have
+ * de-registered at this point.
+ */
+ HDassert( cache_ptr->num_mdjsc_cbs == 0 );
+
if ( cache_ptr->mdj_enabled ) {
if ( H5C2_end_journaling(f, dxpl_id, cache_ptr) != SUCCEED ) {
@@ -957,6 +987,17 @@ H5C2_dest(H5F_t * f,
cache_ptr->slist_ptr = NULL;
}
+ if ( cache_ptr->mdjsc_cb_tbl != NULL ) {
+
+ cache_ptr->mdjsc_cb_tbl = H5MM_xfree(cache_ptr->mdjsc_cb_tbl);
+
+ if ( cache_ptr->mdjsc_cb_tbl != NULL ) {
+
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, \
+ "free of mdjsc_cb_tbl failed.");
+ }
+ }
+
cache_ptr->magic = 0;
H5FL_FREE(H5C2_t, cache_ptr);