summaryrefslogtreecommitdiffstats
path: root/src/H5C2.c
diff options
context:
space:
mode:
authorJohn Mainzer <mainzer@hdfgroup.org>2008-10-03 06:50:54 (GMT)
committerJohn Mainzer <mainzer@hdfgroup.org>2008-10-03 06:50:54 (GMT)
commit648d6ac066ed4f75e168f7a4946fb62d0da6d400 (patch)
treedfe57c4556e6ced61264cdb00f731ac2edcbbb77 /src/H5C2.c
parentd3f252466cddf196075b31c442fe1aed611b6ca8 (diff)
downloadhdf5-648d6ac066ed4f75e168f7a4946fb62d0da6d400.zip
hdf5-648d6ac066ed4f75e168f7a4946fb62d0da6d400.tar.gz
hdf5-648d6ac066ed4f75e168f7a4946fb62d0da6d400.tar.bz2
[svn-r15763] Converted the fractal heap direct block cache client to use the
revised cache. Note that this conversion is not as efficient as it should be. Specifically, it does it more memcpy's between the metadata cache's on disk image of the direct block and the fractal heap's on disk image of the direct block than is absolutely essential. Eventually, we will want to fix this -- probably by allowing the metadata cache and the fractal heap direct block to share a common on disk image of the direct block. However, this will require extensions to the client / metadata cache interface, and some reworking of the fractal heap as well. This checkin also includes Mike M's fix to the Linew specific bug mentioned in my checkin of 22 Aug 2008. Tested on Phoenix (serial debug and production), Kagiso (parallel), and Linew (serial)
Diffstat (limited to 'src/H5C2.c')
-rw-r--r--src/H5C2.c196
1 files changed, 195 insertions, 1 deletions
diff --git a/src/H5C2.c b/src/H5C2.c
index 22cd2cc..1be0867 100644
--- a/src/H5C2.c
+++ b/src/H5C2.c
@@ -113,6 +113,26 @@
/*
+ * #defines controlling debugging code. All should be turned off
+ * before checkin.
+ */
+
+#define H5C2_PRINT_ENTRY_POINTS FALSE
+
+#if H5C2_PRINT_ENTRY_POINTS
+#define H5C2_PRINT_EXIT_POINTS TRUE
+#define H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(i) \
+ ( ( (i) == H5AC2_FHEAP_HDR_ID ) || \
+ ( (i) == H5AC2_FHEAP_DBLOCK_ID ) || \
+ ( (i) == H5AC2_FHEAP_IBLOCK_ID ) )
+#else /* H5C2_PRINT_ENTRY_POINTS */
+#define H5C2_PRINT_EXIT_POINTS FALSE
+#endif /* H5C2_PRINT_ENTRY_POINTS */
+
+
+
+
+/*
* Private file-scope variables.
*/
@@ -212,6 +232,7 @@ static void * H5C2_epoch_marker_deserialize(haddr_t addr,
static herr_t H5C2_epoch_marker_image_len(const void * thing,
size_t *image_len_ptr);
static herr_t H5C2_epoch_marker_serialize(const H5F_t *f,
+ hid_t dxpl_id,
haddr_t addr,
size_t len,
void * image_ptr,
@@ -284,6 +305,7 @@ done:
static herr_t
H5C2_epoch_marker_serialize(const H5F_t UNUSED *f,
+ hid_t UNUSED dxpl_id,
haddr_t UNUSED addr,
size_t UNUSED len,
void UNUSED * image_ptr,
@@ -1108,6 +1130,14 @@ H5C2_expunge_entry(H5F_t * f,
FUNC_ENTER_NOAPI(H5C2_expunge_entry, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) )
+ {
+ HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n",
+ FUNC, (unsigned long)addr, type->name);
+ }
+#endif /* H5C2_PRINT_ENTRY_POINTS */
+
HDassert( f );
HDassert( f->shared );
@@ -1207,6 +1237,13 @@ done:
}
#endif /* H5C2_DO_EXTREME_SANITY_CHECKS */
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_expunge_entry() */
@@ -1358,6 +1395,10 @@ H5C2_flush_cache(const H5F_t *f,
FUNC_ENTER_NOAPI(H5C2_flush_cache, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ HDfprintf(stdout, "%s: flags = 0x%x.\n", FUNC, flags);
+#endif /* H5C2_PRINT_ENTRY_POINTS */
+
HDassert( f );
HDassert( f->shared );
@@ -1696,6 +1737,11 @@ done:
cache_ptr->flush_in_progress = FALSE;
+#if H5C2_PRINT_EXIT_POINTS
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_flush_cache() */
@@ -2456,6 +2502,14 @@ H5C2_insert_entry(H5F_t * f,
FUNC_ENTER_NOAPI(H5C2_insert_entry, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) )
+ {
+ HDfprintf(stdout, "%s: addr = 0x%lX, len = %d, type = %s.\n", FUNC,
+ (unsigned long)addr, (int)len, type->name);
+ }
+#endif /* JRM */
+
HDassert( f );
HDassert( f->shared );
@@ -2703,6 +2757,14 @@ done:
}
#endif /* H5C2_DO_EXTREME_SANITY_CHECKS */
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_insert_entry() */
@@ -3097,6 +3159,17 @@ H5C2_mark_pinned_entry_dirty(void * thing,
entry_ptr = (H5C2_cache_entry_t *)thing;
+
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) )
+ {
+ HDfprintf(stdout,
+ "%s: addr = 0x%lX, size_changed = %d, new_size = %d.\n",
+ FUNC, (unsigned long)(entry_ptr->addr), (int)size_changed,
+ (int)new_size);
+ }
+#endif /* JRM */
+
if ( ! ( entry_ptr->is_pinned ) ) {
HGOTO_ERROR(H5E_CACHE, H5E_CANTMARKDIRTY, FAIL, \
@@ -3188,6 +3261,13 @@ H5C2_mark_pinned_entry_dirty(void * thing,
done:
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_mark_pinned_entry_dirty() */
@@ -3254,8 +3334,16 @@ H5C2_mark_pinned_or_protected_entry_dirty(void * thing)
entry_ptr = (H5C2_cache_entry_t *)thing;
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) )
+ {
+ HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC,
+ (unsigned long)(entry_ptr->addr), entry_ptr->type->name);
+ }
+#endif /* JRM */
+
if ( entry_ptr->is_protected ) {
-#if 1 /* JRM - uncomment this when possible */
+#if 0 /* JRM - uncomment this when possible */
HDassert( ! ((entry_ptr)->is_read_only) );
#endif
/* set the dirtied flag */
@@ -3292,6 +3380,13 @@ H5C2_mark_pinned_or_protected_entry_dirty(void * thing)
done:
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_mark_pinned_or_protected_entry_dirty() */
@@ -3371,6 +3466,15 @@ H5C2_rename_entry(H5C2_t * cache_ptr,
FUNC_ENTER_NOAPI(H5C2_rename_entry, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) )
+ {
+ HDfprintf(stdout, "%s: type = %s, old_addr = 0x%lX, new_addr = 0x%lx.\n",
+ FUNC, type->name, (unsigned long)old_addr,
+ (unsigned long)new_addr);
+ }
+#endif /* JRM */
+
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C2__H5C2_T_MAGIC );
HDassert( type );
@@ -3533,6 +3637,13 @@ done:
}
#endif /* H5C2_DO_EXTREME_SANITY_CHECKS */
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_rename_entry() */
@@ -3580,6 +3691,15 @@ H5C2_resize_pinned_entry(void * thing,
HDassert( entry_ptr );
HDassert( H5F_addr_defined(entry_ptr->addr) );
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) )
+ {
+ HDfprintf(stdout, "%s: type = %s, addr = 0x%lX, new_size = %d.\n",
+ FUNC, entry_ptr->type->name, (unsigned long)(entry_ptr->addr),
+ (int)new_size);
+ }
+#endif /* JRM */
+
cache_ptr = entry_ptr->cache_ptr;
HDassert( cache_ptr );
@@ -3688,6 +3808,13 @@ H5C2_resize_pinned_entry(void * thing,
done:
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_resize_pinned_entry() */
@@ -3739,6 +3866,14 @@ H5C2_pin_protected_entry(void * thing)
FUNC_ENTER_NOAPI(H5C2_pin_protected_entry, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) )
+ {
+ HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC,
+ (unsigned long)(entry_ptr->addr), entry_ptr->type->name);
+ }
+#endif /* JRM */
+
HDassert( entry_ptr );
HDassert( H5F_addr_defined(entry_ptr->addr) );
@@ -3763,6 +3898,13 @@ H5C2_pin_protected_entry(void * thing)
done:
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_pin_protected_entry() */
@@ -3890,6 +4032,15 @@ H5C2_protect(H5F_t * f,
FUNC_ENTER_NOAPI(H5C2_protect, NULL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) )
+ {
+ HDfprintf(stdout,
+ "%s: addr = 0x%lX, len = %d, type = %s, flags = 0x%x.\n",
+ FUNC, (unsigned long)addr, (int)len, type->name, flags);
+ }
+#endif /* JRM */
+
/* check args */
HDassert( f );
HDassert( f->shared );
@@ -4229,6 +4380,13 @@ done:
}
#endif /* H5C2_DO_EXTREME_SANITY_CHECKS */
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = 0x%lX.\n",
+ FUNC, (unsigned long)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_protect() */
@@ -5363,6 +5521,14 @@ H5C2_unpin_entry(void *_entry_ptr)
FUNC_ENTER_NOAPI(H5C2_unpin_entry, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) )
+ {
+ HDfprintf(stdout, "%s: addr = 0x%lX, type = %s.\n", FUNC,
+ (unsigned long)(entry_ptr->addr), entry_ptr->type->name);
+ }
+#endif /* JRM */
+
HDassert( entry_ptr );
cache_ptr = entry_ptr->cache_ptr;
@@ -5386,6 +5552,13 @@ H5C2_unpin_entry(void *_entry_ptr)
done:
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(entry_ptr->type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_unpin_entry() */
@@ -5522,6 +5695,15 @@ H5C2_unprotect(H5F_t * f,
FUNC_ENTER_NOAPI(H5C2_unprotect, FAIL)
+#if H5C2_PRINT_ENTRY_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) )
+ {
+ HDfprintf(stdout,
+ "%s: addr = 0x%lX, type = %s, flags = 0x%x, new_size = %d.\n",
+ FUNC, (unsigned long)addr, type->name, flags, (int)new_size);
+ }
+#endif /* JRM */
+
deleted = ( (flags & H5C2__DELETED_FLAG) != 0 );
dirtied = ( (flags & H5C2__DIRTIED_FLAG) != 0 );
set_flush_marker = ( (flags & H5C2__SET_FLUSH_MARKER_FLAG) != 0 );
@@ -5893,6 +6075,13 @@ done:
}
#endif /* H5C2_DO_EXTREME_SANITY_CHECKS */
+#if H5C2_PRINT_EXIT_POINTS
+ if ( H5C2_PRINT_ENTRY_POINT_TARGET_TYPE(type->id) ) {
+ HDfprintf(stdout, "%s: Exiting with result = %d.\n",
+ FUNC, (int)ret_value);
+ }
+#endif /* H5C2_PRINT_EXIT_POINTS */
+
FUNC_LEAVE_NOAPI(ret_value)
} /* H5C2_unprotect() */
@@ -8567,6 +8756,7 @@ H5C2_flush_single_entry(const H5F_t * f,
if ( ! ( entry_ptr->image_up_to_date ) ) {
if ( entry_ptr->type->serialize(f,
+ dxpl_id,
entry_ptr->addr,
entry_ptr->size,
entry_ptr->image_ptr,
@@ -8824,6 +9014,10 @@ H5C2_flush_single_entry(const H5F_t * f,
entry_ptr->magic = H5C2__H5C2_CACHE_ENTRY_T_BAD_MAGIC;
#endif /* NDEBUG */
entry_ptr->cache_ptr = NULL;
+#if 0 /* JRM */
+ HDfprintf(stdout, "%s: calling free_icr(%d -- %s).\n", FUNC,
+ type_ptr->id, type_ptr->name);
+#endif /* JRM */
if ( type_ptr->free_icr(entry_ptr->addr, entry_ptr->size,
(void *)entry_ptr) != SUCCEED )
{