summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5ACdbg.c2
-rw-r--r--src/H5ACprivate.h80
-rw-r--r--src/H5ACproxy_entry.c162
-rw-r--r--src/H5C.c185
-rw-r--r--src/H5Ocache.c6
-rw-r--r--src/H5Odtype.c287
-rw-r--r--src/H5Opkg.h6
-rw-r--r--src/H5PL.c2
-rw-r--r--src/H5public.h4
-rw-r--r--src/H5system.c7
-rw-r--r--src/H5win32defs.h3
11 files changed, 303 insertions, 441 deletions
diff --git a/src/H5ACdbg.c b/src/H5ACdbg.c
index 3830606..6120242 100644
--- a/src/H5ACdbg.c
+++ b/src/H5ACdbg.c
@@ -72,7 +72,6 @@
/*******************/
-#ifndef NDEBUG /* debugging functions */
/*-------------------------------------------------------------------------
* Function: H5AC_stats
@@ -134,7 +133,6 @@ H5AC_dump_cache(const H5F_t *f)
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_dump_cache() */
-#endif /* NDEBUG */
/*-------------------------------------------------------------------------
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index bbaa614..9a4ab55 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -59,36 +59,36 @@
/* Types of metadata objects cached */
typedef enum {
- H5AC_BT_ID = 0, /* ( 0) B-tree nodes */
- H5AC_SNODE_ID, /* ( 1) symbol table nodes */
- H5AC_LHEAP_PRFX_ID, /* ( 2) local heap prefix */
- H5AC_LHEAP_DBLK_ID, /* ( 3) local heap data block */
- H5AC_GHEAP_ID, /* ( 4) global heap */
- H5AC_OHDR_ID, /* ( 5) object header */
- H5AC_OHDR_CHK_ID, /* ( 6) object header chunk */
- H5AC_BT2_HDR_ID, /* ( 7) v2 B-tree header */
- H5AC_BT2_INT_ID, /* ( 8) v2 B-tree internal node */
- H5AC_BT2_LEAF_ID, /* ( 9) v2 B-tree leaf node */
- H5AC_FHEAP_HDR_ID, /* (10) fractal heap header */
- H5AC_FHEAP_DBLOCK_ID, /* (11) fractal heap direct block */
- H5AC_FHEAP_IBLOCK_ID, /* (12) fractal heap indirect block */
- H5AC_FSPACE_HDR_ID, /* (13) free space header */
- H5AC_FSPACE_SINFO_ID, /* (14) free space sections */
- H5AC_SOHM_TABLE_ID, /* (15) shared object header message master table */
- H5AC_SOHM_LIST_ID, /* (16) shared message index stored as a list */
- H5AC_EARRAY_HDR_ID, /* (17) extensible array header */
- H5AC_EARRAY_IBLOCK_ID, /* (18) extensible array index block */
- H5AC_EARRAY_SBLOCK_ID, /* (19) extensible array super block */
- H5AC_EARRAY_DBLOCK_ID, /* (20) extensible array data block */
- H5AC_EARRAY_DBLK_PAGE_ID, /* (21) extensible array data block page */
- H5AC_FARRAY_HDR_ID, /* (22) fixed array header */
- H5AC_FARRAY_DBLOCK_ID, /* (23) fixed array data block */
- H5AC_FARRAY_DBLK_PAGE_ID, /* (24) fixed array data block page */
- H5AC_SUPERBLOCK_ID, /* (25) file superblock */
- H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock)*/
- H5AC_PROXY_ENTRY_ID, /* (27) cache entry proxy */
- H5AC_TEST_ID, /* (28) test entry -- not used for actual files */
- H5AC_NTYPES /* Number of types, must be last */
+ H5AC_BT_ID = 0, /* ( 0) B-tree nodes */
+ H5AC_SNODE_ID, /* ( 1) symbol table nodes */
+ H5AC_LHEAP_PRFX_ID, /* ( 2) local heap prefix */
+ H5AC_LHEAP_DBLK_ID, /* ( 3) local heap data block */
+ H5AC_GHEAP_ID, /* ( 4) global heap */
+ H5AC_OHDR_ID, /* ( 5) object header */
+ H5AC_OHDR_CHK_ID, /* ( 6) object header chunk */
+ H5AC_BT2_HDR_ID, /* ( 7) v2 B-tree header */
+ H5AC_BT2_INT_ID, /* ( 8) v2 B-tree internal node */
+ H5AC_BT2_LEAF_ID, /* ( 9) v2 B-tree leaf node */
+ H5AC_FHEAP_HDR_ID, /* (10) fractal heap header */
+ H5AC_FHEAP_DBLOCK_ID, /* (11) fractal heap direct block */
+ H5AC_FHEAP_IBLOCK_ID, /* (12) fractal heap indirect block */
+ H5AC_FSPACE_HDR_ID, /* (13) free space header */
+ H5AC_FSPACE_SINFO_ID, /* (14) free space sections */
+ H5AC_SOHM_TABLE_ID, /* (15) shared object header message master table */
+ H5AC_SOHM_LIST_ID, /* (16) shared message index stored as a list */
+ H5AC_EARRAY_HDR_ID, /* (17) extensible array header */
+ H5AC_EARRAY_IBLOCK_ID, /* (18) extensible array index block */
+ H5AC_EARRAY_SBLOCK_ID, /* (19) extensible array super block */
+ H5AC_EARRAY_DBLOCK_ID, /* (20) extensible array data block */
+ H5AC_EARRAY_DBLK_PAGE_ID, /* (21) extensible array data block page */
+ H5AC_FARRAY_HDR_ID, /* (22) fixed array header */
+ H5AC_FARRAY_DBLOCK_ID, /* (23) fixed array data block */
+ H5AC_FARRAY_DBLK_PAGE_ID, /* (24) fixed array data block page */
+ H5AC_SUPERBLOCK_ID, /* (25) file superblock */
+ H5AC_DRVRINFO_ID, /* (26) driver info block (supplements superblock) */
+ H5AC_PROXY_ENTRY_ID, /* (27) cache entry proxy */
+ H5AC_TEST_ID, /* (28) test entry -- not used for actual files */
+ H5AC_NTYPES /* Number of types, must be last */
} H5AC_type_t;
/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when
@@ -173,8 +173,8 @@ typedef H5C_notify_action_t H5AC_notify_action_t;
#define H5AC__CLASS_SPECULATIVE_LOAD_FLAG H5C__CLASS_SPECULATIVE_LOAD_FLAG
/* The following flags should only appear in test code */
-#define H5AC__CLASS_SKIP_READS H5C__CLASS_SKIP_READS
-#define H5AC__CLASS_SKIP_WRITES H5C__CLASS_SKIP_WRITES
+#define H5AC__CLASS_SKIP_READS H5C__CLASS_SKIP_READS
+#define H5AC__CLASS_SKIP_WRITES H5C__CLASS_SKIP_WRITES
typedef H5C_get_initial_load_size_func_t H5AC_get_initial_load_size_func_t;
typedef H5C_get_final_load_size_func_t H5AC_get_final_load_size_func_t;
@@ -345,13 +345,13 @@ H5_DLLVAR hid_t H5AC_rawdata_dxpl_id;
* H5AC_get_entry_status() call.
*/
-#define H5AC_ES__IN_CACHE 0x0001
-#define H5AC_ES__IS_DIRTY 0x0002
-#define H5AC_ES__IS_PROTECTED 0x0004
-#define H5AC_ES__IS_PINNED 0x0008
-#define H5AC_ES__IS_FLUSH_DEP_PARENT 0x0010
-#define H5AC_ES__IS_FLUSH_DEP_CHILD 0x0020
-#define H5AC_ES__IS_CORKED 0x0040
+#define H5AC_ES__IN_CACHE 0x0001
+#define H5AC_ES__IS_DIRTY 0x0002
+#define H5AC_ES__IS_PROTECTED 0x0004
+#define H5AC_ES__IS_PINNED 0x0008
+#define H5AC_ES__IS_FLUSH_DEP_PARENT 0x0010
+#define H5AC_ES__IS_FLUSH_DEP_CHILD 0x0020
+#define H5AC_ES__IS_CORKED 0x0040
/* external function declarations: */
@@ -419,10 +419,8 @@ H5_DLL herr_t H5AC_add_candidate(H5AC_t * cache_ptr, haddr_t addr);
#endif /* H5_HAVE_PARALLEL */
/* Debugging functions */
-#ifndef NDEBUG
H5_DLL herr_t H5AC_stats(const H5F_t *f);
H5_DLL herr_t H5AC_dump_cache(const H5F_t *f);
-#endif /* NDEBUG */ /* end debugging functions */
#endif /* !_H5ACprivate_H */
diff --git a/src/H5ACproxy_entry.c b/src/H5ACproxy_entry.c
index ab5edb9..66aacb3 100644
--- a/src/H5ACproxy_entry.c
+++ b/src/H5ACproxy_entry.c
@@ -632,165 +632,3 @@ done:
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC__proxy_entry_free_icr() */
-#ifdef OLD_CODE
-
-/*-------------------------------------------------------------------------
- * Function: H5AC_virt_entry_dirty_parent
- *
- * Purpose: Indicate that a virtual entry's parent became dirty
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * July 23, 2016
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5AC_virt_entry_dirty_parent(H5AC_virt_entry_t *ventry)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity check */
- HDassert(ventry);
- HDassert(ventry->track_parents);
- HDassert(ventry->nparents > 0);
-
- /* If this is the first dirty parent or child, mark the virtual entry dirty */
- if(ventry->in_cache && 0 == ventry->ndirty_parents && 0 == ventry->ndirty_children)
- if(H5AC_mark_entry_dirty(ventry) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDIRTY, FAIL, "can't mark virtual entry dirty")
-
- /* Increment the number of dirty parents */
- ventry->ndirty_parents++;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5AC_virt_entry_dirty_parent() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5AC_virt_entry_clean_parent
- *
- * Purpose: Indicate that a virtual entry's parent became clean
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * July 23, 2016
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5AC_virt_entry_clean_parent(H5AC_virt_entry_t *ventry)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity check */
- HDassert(ventry);
- HDassert(ventry->track_parents);
-// HDassert(ventry->nparents > 0);
- HDassert(ventry->ndirty_parents > 0);
-
- /* Decrement the number of dirty parents */
- ventry->ndirty_parents--;
-
- /* If this is the last dirty parent or child, mark the virtual entry clean */
- if(ventry->in_cache && 0 == ventry->ndirty_parents && 0 == ventry->ndirty_children)
- if(H5AC_mark_entry_clean(ventry) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCLEAN, FAIL, "can't mark virtual entry clean")
-
- /* Destroy the skip list, if no more parents */
- if(0 == ventry->nparents && 0 == ventry->ndirty_parents) {
-// /* Sanity check */
-// HDassert(0 == ventry->ndirty_parents);
-
- if(H5SL_close(ventry->parents) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CLOSEERROR, FAIL, "can't close parent list")
- ventry->parents = NULL;
- } /* end if */
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5AC_virt_entry_clean_parent() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5AC_virt_entry_dirty_child
- *
- * Purpose: Indicate that a virtual entry's child became dirty
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * July 24, 2016
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5AC_virt_entry_dirty_child(H5AC_virt_entry_t *ventry)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity check */
- HDassert(ventry);
- HDassert(ventry->nchildren > 0);
-
- /* If this is the first dirty parent or child, mark the virtual entry dirty */
- if(ventry->in_cache && 0 == ventry->ndirty_parents && 0 == ventry->ndirty_children)
- if(H5AC_mark_entry_dirty(ventry) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTDIRTY, FAIL, "can't mark virtual entry dirty")
-
- /* Increment the number of dirty children */
- ventry->ndirty_children++;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5AC_virt_entry_dirty_child() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5AC_virt_entry_clean_child
- *
- * Purpose: Indicate that a virtual entry's child became clean
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Quincey Koziol
- * July 24, 2016
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5AC_virt_entry_clean_child(H5AC_virt_entry_t *ventry)
-{
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(FAIL)
-
- /* Sanity check */
- HDassert(ventry);
- HDassert(ventry->nchildren > 0);
- HDassert(ventry->ndirty_children > 0);
-
- /* Decrement the number of dirty children */
- ventry->ndirty_children--;
-
- /* If this is the last dirty parent or child, mark the virtual entry clean */
- if(ventry->in_cache && 0 == ventry->ndirty_parents && 0 == ventry->ndirty_children)
- if(H5AC_mark_entry_clean(ventry) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTCLEAN, FAIL, "can't mark virtual entry clean")
-
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-} /* end H5AC_virt_entry_clean_child() */
-
-#endif /* OLD_CODE */
-
-
diff --git a/src/H5C.c b/src/H5C.c
index 9a60049..1ce24a8 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -269,7 +269,7 @@ H5C_create(size_t max_cache_size,
for ( i = 0; i <= max_type_id; i++ ) {
HDassert( (type_name_table_ptr)[i] );
HDassert( HDstrlen(( type_name_table_ptr)[i]) > 0 );
- }
+ } /* end for */
if(NULL == (cache_ptr = H5FL_CALLOC(H5C_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
@@ -327,6 +327,9 @@ H5C_create(size_t max_cache_size,
cache_ptr->slist_ring_size[i] = (size_t)0;
} /* end for */
+ for(i = 0; i < H5C__HASH_TABLE_LEN; i++)
+ (cache_ptr->index)[i] = NULL;
+
/* Tagging Field Initializations */
cache_ptr->ignore_tags = FALSE;
@@ -339,9 +342,6 @@ H5C_create(size_t max_cache_size,
cache_ptr->slist_size_increase = 0;
#endif /* H5C_DO_SANITY_CHECKS */
- for(i = 0; i < H5C__HASH_TABLE_LEN; i++)
- (cache_ptr->index)[i] = NULL;
-
cache_ptr->entries_removed_counter = 0;
cache_ptr->last_entry_removed_ptr = NULL;
cache_ptr->entry_watched_for_removal = NULL;
@@ -809,7 +809,7 @@ H5C_expunge_entry(H5F_t *f, hid_t dxpl_id, const H5C_class_t *type,
#if H5C_DO_EXTREME_SANITY_CHECKS
if(H5C_validate_lru_list(cache_ptr) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry.\n");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "LRU extreme sanity check failed on entry.\n")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
/* Look for entry in cache */
@@ -957,7 +957,7 @@ H5C_flush_cache(H5F_t *f, hid_t dxpl_id, unsigned flags)
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.\n")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 );
@@ -1021,7 +1021,7 @@ H5C_flush_to_min_clean(H5F_t * f,
H5C_t * cache_ptr;
herr_t result;
hbool_t write_permitted;
-#if 0 /* modified code -- commented out for now */
+#if 0 /* modified code -- commented out for now */ /* JRM */
int i;
int flushed_entries_count = 0;
size_t flushed_entries_size = 0;
@@ -1322,12 +1322,12 @@ H5C_insert_entry(H5F_t * f,
entry_ptr->ring = ring;
- /* Initialize flush dependency height fields */
- entry_ptr->flush_dep_parent = NULL;
- entry_ptr->flush_dep_nparents = 0;
- entry_ptr->flush_dep_parent_nalloc = 0;
- entry_ptr->flush_dep_nchildren = 0;
- entry_ptr->flush_dep_ndirty_children = 0;
+ /* Initialize flush dependency fields */
+ entry_ptr->flush_dep_parent = NULL;
+ entry_ptr->flush_dep_nparents = 0;
+ entry_ptr->flush_dep_parent_nalloc = 0;
+ entry_ptr->flush_dep_nchildren = 0;
+ entry_ptr->flush_dep_ndirty_children = 0;
entry_ptr->ht_next = NULL;
entry_ptr->ht_prev = NULL;
@@ -1436,7 +1436,7 @@ H5C_insert_entry(H5F_t * f,
#ifdef H5_HAVE_PARALLEL
/* Get the dataset transfer property list */
if(NULL == (dxpl = (H5P_genplist_t *)H5I_object(dxpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
if(H5F_HAS_FEATURE(f, H5FD_FEAT_HAS_MPI)) {
coll_access = (H5P_USER_TRUE == f->coll_md_read ? TRUE : FALSE);
@@ -1702,6 +1702,13 @@ H5C_move_entry(H5C_t * cache_ptr,
HDassert(entry_ptr->addr == old_addr);
HDassert(entry_ptr->type == type);
+ /* Check for R/W status, otherwise error */
+ /* (Moving a R/O entry would mark it dirty, which shouldn't
+ * happen. QAK - 2016/12/02)
+ */
+ if(entry_ptr->is_read_only)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTMOVE, FAIL, "can't move R/O entry")
+
H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL)
if(test_entry_ptr != NULL) { /* we are hosed */
@@ -1731,7 +1738,6 @@ H5C_move_entry(H5C_t * cache_ptr,
if(entry_ptr->in_slist) {
HDassert(cache_ptr->slist_ptr);
-
H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr, FALSE)
} /* end if */
} /* end if */
@@ -2152,8 +2158,7 @@ H5C_protect(H5F_t * f,
( H5C_validate_pinned_entry_list(cache_ptr) < 0 ) ||
( H5C_validate_lru_list(cache_ptr) < 0 ) ) {
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, \
- "an extreme sanity check failed on entry.\n");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "an extreme sanity check failed on entry.\n")
}
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
@@ -2188,7 +2193,7 @@ H5C_protect(H5F_t * f,
if ( entry_ptr != NULL ) {
if(entry_ptr->ring != ring)
- HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry\n");
+ HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, NULL, "ring type mismatch occured for cache entry\n")
/* Check for trying to load the wrong type of entry from an address */
if(entry_ptr->type != type)
@@ -2256,7 +2261,7 @@ H5C_protect(H5F_t * f,
/* Get the tag from the DXPL */
if((H5P_get(dxpl, H5AC_TAG_NAME, &tag)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to query property value");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to query property value")
if(H5C_verify_tag(entry_ptr->type->id, tag) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTGET, NULL, "tag verification failed")
@@ -2329,22 +2334,16 @@ H5C_protect(H5F_t * f,
HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "Can't get write_permitted 1")
else
have_write_permitted = TRUE;
- } else {
-
+ } /* end if */
+ else {
write_permitted = cache_ptr->write_permitted;
-
have_write_permitted = TRUE;
+ } /* end else */
- }
-
- HDassert( entry_ptr->size <= H5C_MAX_ENTRY_SIZE );
-
+ HDassert(entry_ptr->size <= H5C_MAX_ENTRY_SIZE);
space_needed = entry_ptr->size;
-
- if ( space_needed > cache_ptr->max_cache_size ) {
-
+ if(space_needed > cache_ptr->max_cache_size)
space_needed = cache_ptr->max_cache_size;
- }
/* Note that space_needed is just the amount of space that
* needed to insert the new entry without exceeding the cache
@@ -3070,7 +3069,6 @@ H5C_unprotect(H5F_t * f,
if(H5C_unpin_entry_from_client(cache_ptr, entry_ptr, FALSE) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPIN, FAIL, "Can't unpin entry by client")
} /* end if */
-
} else {
if(entry_ptr->is_read_only) {
/* Sanity check */
@@ -3198,7 +3196,7 @@ H5C_unprotect(H5F_t * f,
* makes good use of existing code.
* JRM - 5/19/04
*/
- if ( deleted ) {
+ if(deleted) {
unsigned flush_flags = (H5C__FLUSH_CLEAR_ONLY_FLAG |
H5C__FLUSH_INVALIDATE_FLAG);
@@ -3225,7 +3223,7 @@ H5C_unprotect(H5F_t * f,
}
#ifdef H5_HAVE_PARALLEL
- else if ( clear_entry ) {
+ else if(clear_entry) {
/* verify that the target entry is in the cache. */
H5C__SEARCH_INDEX(cache_ptr, addr, test_entry_ptr, FAIL)
@@ -3236,7 +3234,7 @@ H5C_unprotect(H5F_t * f,
if(H5C__flush_single_entry(f, dxpl_id, entry_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0)
HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't clear entry")
- }
+ } /* end else if */
#endif /* H5_HAVE_PARALLEL */
}
@@ -3322,12 +3320,12 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
if ( config_ptr->epoch_length < H5C__MIN_AR_EPOCH_LENGTH ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too small");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too small")
}
if ( config_ptr->epoch_length > H5C__MAX_AR_EPOCH_LENGTH ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too big");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "epoch_length too big")
}
} /* H5C_RESIZE_CFG__VALIDATE_GENERAL */
@@ -3337,7 +3335,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
if ( ( config_ptr->incr_mode != H5C_incr__off ) &&
( config_ptr->incr_mode != H5C_incr__threshold ) ) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid incr_mode")
}
if ( config_ptr->incr_mode == H5C_incr__threshold ) {
@@ -3392,7 +3390,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
( config_ptr->decr_mode != H5C_decr__age_out_with_threshold )
) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid decr_mode");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid decr_mode")
}
if ( config_ptr->decr_mode == H5C_decr__threshold ) {
@@ -4069,9 +4067,7 @@ H5C__auto_adjust_cache_size(H5F_t * f,
}
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5C__auto_adjust_cache_size() */
@@ -5066,16 +5062,38 @@ H5C_flush_invalidate_cache(const H5F_t * f, hid_t dxpl_id, unsigned flags)
if(!(flags & H5C__EVICT_ALLOW_LAST_PINS_FLAG)) {
HDassert(cache_ptr->index_size == 0);
HDassert(cache_ptr->clean_index_size == 0);
- HDassert(cache_ptr->dirty_index_size == 0);
- HDassert(cache_ptr->slist_len == 0);
- HDassert(cache_ptr->slist_size == 0);
HDassert(cache_ptr->pel_len == 0);
HDassert(cache_ptr->pel_size == 0);
- HDassert(cache_ptr->pl_len == 0);
- HDassert(cache_ptr->pl_size == 0);
- HDassert(cache_ptr->LRU_list_len == 0);
- HDassert(cache_ptr->LRU_list_size == 0);
} /* end if */
+ else {
+ H5C_cache_entry_t *entry_ptr; /* Cache entry */
+ unsigned u; /* Local index variable */
+
+ /* All rings except ring 4 should be empty now */
+ /* (Ring 4 has the superblock) */
+ for(u = H5C_RING_USER; u < H5C_RING_SB; u++) {
+ HDassert(cache_ptr->index_ring_len[u] == 0);
+ HDassert(cache_ptr->index_ring_size[u] == 0);
+ HDassert(cache_ptr->clean_index_ring_size[u] == 0);
+ } /* end for */
+
+ /* Check that any remaining pinned entries are in the superblock ring */
+ entry_ptr = cache_ptr->pel_head_ptr;
+ while(entry_ptr) {
+ /* Check ring */
+ HDassert(entry_ptr->ring == H5C_RING_SB);
+
+ /* Advance to next entry in pinned entry list */
+ entry_ptr = entry_ptr->next;
+ } /* end while */
+ } /* end else */
+ HDassert(cache_ptr->dirty_index_size == 0);
+ HDassert(cache_ptr->slist_len == 0);
+ HDassert(cache_ptr->slist_size == 0);
+ HDassert(cache_ptr->pl_len == 0);
+ HDassert(cache_ptr->pl_size == 0);
+ HDassert(cache_ptr->LRU_list_len == 0);
+ HDassert(cache_ptr->LRU_list_size == 0);
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -5573,7 +5591,7 @@ H5C_flush_ring(H5F_t *f, hid_t dxpl_id, H5C_ring_t ring, unsigned flags)
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.\n")
#endif /* H5C_DO_EXTREME_SANITY_CHECKS */
ignore_protected = ( (flags & H5C__FLUSH_IGNORE_PROTECTED_FLAG) != 0 );
@@ -6041,7 +6059,6 @@ H5C__flush_single_entry(const H5F_t *f, hid_t dxpl_id, H5C_cache_entry_t *entry_
* Finally, if the destroy_entry flag is set, discard the
* entry.
*/
-
H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr)
if(entry_ptr->in_slist && del_from_slist_on_destroy)
@@ -6546,50 +6563,50 @@ H5C_load_entry(H5F_t * f,
HDassert( ( dirty == FALSE ) || ( type->id == 5 || type->id == 6) );
- entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC;
- entry->cache_ptr = f->shared->cache;
- entry->addr = addr;
- entry->size = len;
+ entry->magic = H5C__H5C_CACHE_ENTRY_T_MAGIC;
+ entry->cache_ptr = f->shared->cache;
+ entry->addr = addr;
+ entry->size = len;
HDassert(entry->size < H5C_MAX_ENTRY_SIZE);
- entry->image_ptr = image;
- entry->image_up_to_date = TRUE;
- entry->type = type;
- entry->is_dirty = dirty;
- entry->dirtied = FALSE;
- entry->is_protected = FALSE;
- entry->is_read_only = FALSE;
- entry->ro_ref_count = 0;
- entry->is_pinned = FALSE;
- entry->in_slist = FALSE;
- entry->flush_marker = FALSE;
+ entry->image_ptr = image;
+ entry->image_up_to_date = TRUE;
+ entry->type = type;
+ entry->is_dirty = dirty;
+ entry->dirtied = FALSE;
+ entry->is_protected = FALSE;
+ entry->is_read_only = FALSE;
+ entry->ro_ref_count = 0;
+ entry->is_pinned = FALSE;
+ entry->in_slist = FALSE;
+ entry->flush_marker = FALSE;
#ifdef H5_HAVE_PARALLEL
- entry->clear_on_unprotect = FALSE;
- entry->flush_immediately = FALSE;
- entry->coll_access = coll_access;
+ entry->clear_on_unprotect = FALSE;
+ entry->flush_immediately = FALSE;
+ entry->coll_access = coll_access;
#endif /* H5_HAVE_PARALLEL */
- entry->flush_in_progress = FALSE;
- entry->destroy_in_progress = FALSE;
+ entry->flush_in_progress = FALSE;
+ entry->destroy_in_progress = FALSE;
- entry->ring = H5C_RING_UNDEFINED;
+ entry->ring = H5C_RING_UNDEFINED;
- /* Initialize flush dependency height fields */
- entry->flush_dep_parent = NULL;
- entry->flush_dep_nparents = 0;
- entry->flush_dep_parent_nalloc = 0;
- entry->flush_dep_nchildren = 0;
- entry->flush_dep_ndirty_children = 0;
- entry->ht_next = NULL;
- entry->ht_prev = NULL;
+ /* Initialize flush dependency fields */
+ entry->flush_dep_parent = NULL;
+ entry->flush_dep_nparents = 0;
+ entry->flush_dep_parent_nalloc = 0;
+ entry->flush_dep_nchildren = 0;
+ entry->flush_dep_ndirty_children = 0;
+ entry->ht_next = NULL;
+ entry->ht_prev = NULL;
- entry->next = NULL;
- entry->prev = NULL;
+ entry->next = NULL;
+ entry->prev = NULL;
- entry->aux_next = NULL;
- entry->aux_prev = NULL;
+ entry->aux_next = NULL;
+ entry->aux_prev = NULL;
#ifdef H5_HAVE_PARALLEL
- entry->coll_next = NULL;
- entry->coll_prev = NULL;
+ entry->coll_next = NULL;
+ entry->coll_prev = NULL;
#endif /* H5_HAVE_PARALLEL */
H5C__RESET_CACHE_ENTRY_STATS(entry);
diff --git a/src/H5Ocache.c b/src/H5Ocache.c
index 94498ee..d398e41 100644
--- a/src/H5Ocache.c
+++ b/src/H5Ocache.c
@@ -46,12 +46,6 @@
/* Local Macros */
/****************/
-/* Set the object header size to speculatively read in */
-/* (needs to be more than the object header prefix size to work at all and
- * should be larger than the largest object type's default object header
- * size to save the extra I/O operations) */
-#define H5O_SPEC_READ_SIZE 512
-
/******************/
/* Local Typedefs */
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 799f475..7ccf328 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -1446,9 +1446,10 @@ H5O_dtype_set_share(void *_mesg/*in,out*/, const H5O_shared_t *sh)
dt->shared->state = H5T_STATE_NAMED;
/* Set up the object location for the datatype also */
+ if(H5O_loc_reset(&(dt->oloc)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to reset location")
dt->oloc.file = sh->file;
- dt->oloc.addr = sh->u.loc.oh_addr;;
- dt->oloc.holding_file = FALSE;
+ dt->oloc.addr = sh->u.loc.oh_addr;
} /* end if */
done:
@@ -1611,18 +1612,22 @@ H5O_dtype_shared_post_copy_upd(const H5O_loc_t H5_ATTR_UNUSED *src_oloc,
hid_t H5_ATTR_UNUSED dxpl_id, H5O_copy_t H5_ATTR_UNUSED *cpy_info)
{
H5T_t *dt_dst = (H5T_t *)mesg_dst; /* Destination datatype */
+ herr_t ret_value = SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ FUNC_ENTER_NOAPI_NOINIT
if(dt_dst->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) {
HDassert(H5T_committed(dt_dst));
+ if(H5O_loc_reset(&(dt_dst->oloc)) < 0)
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to reset location")
dt_dst->oloc.file = dt_dst->sh_loc.file;
dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr;
} /* end if */
else
HDassert(!H5T_committed(dt_dst));
- FUNC_LEAVE_NOAPI(SUCCEED)
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_dtype_shared_post_copy_upd */
@@ -1712,62 +1717,64 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_NO_CLASS:
case H5T_NCLASSES:
default:
- sprintf(buf, "H5T_CLASS_%d", (int)(dt->shared->type));
+ HDsprintf(buf, "H5T_CLASS_%d", (int)(dt->shared->type));
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Type class:",
s);
- fprintf(stream, "%*s%-*s %lu byte%s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %lu byte%s\n", indent, "", fwidth,
"Size:",
(unsigned long)(dt->shared->size), 1 == dt->shared->size ? "" : "s");
- fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
"Version:", dt->shared->version);
if (H5T_COMPOUND == dt->shared->type) {
- fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Number of members:",
- dt->shared->u.compnd.nmembs);
- for(i = 0; i < dt->shared->u.compnd.nmembs; i++) {
- sprintf(buf, "Member %u:", i);
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- buf,
- dt->shared->u.compnd.memb[i].name);
- fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth-3),
- "Byte offset:",
- (unsigned long)(dt->shared->u.compnd.memb[i].offset));
- H5O_dtype_debug(f, dxpl_id, dt->shared->u.compnd.memb[i].type, stream,
- indent + 3, MAX(0, fwidth - 3));
- }
- } else if(H5T_ENUM == dt->shared->type) {
- fprintf(stream, "%*s%s\n", indent, "", "Base type:");
- H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3));
- fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Number of members:",
- dt->shared->u.enumer.nmembs);
- for(i = 0; i < dt->shared->u.enumer.nmembs; i++) {
- sprintf(buf, "Member %u:", i);
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- buf,
- dt->shared->u.enumer.name[i]);
- fprintf(stream, "%*s%-*s 0x", indent, "", fwidth,
- "Raw bytes of value:");
- for(k = 0; k < dt->shared->parent->shared->size; k++)
- fprintf(stream, "%02x",
- dt->shared->u.enumer.value[i*dt->shared->parent->shared->size + k]);
- fprintf(stream, "\n");
- } /* end for */
-
- } else if(H5T_OPAQUE == dt->shared->type) {
- fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth,
- "Tag:", dt->shared->u.opaque.tag);
- } else if(H5T_REFERENCE == dt->shared->type) {
- fprintf(stream, "%*s%-*s\n", indent, "", fwidth,
- "Fix dumping reference types!");
- } else if(H5T_STRING == dt->shared->type) {
+ HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
+ "Number of members:",
+ dt->shared->u.compnd.nmembs);
+ for(i = 0; i < dt->shared->u.compnd.nmembs; i++) {
+ HDsprintf(buf, "Member %u:", i);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ buf,
+ dt->shared->u.compnd.memb[i].name);
+ HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0, fwidth-3),
+ "Byte offset:",
+ (unsigned long)(dt->shared->u.compnd.memb[i].offset));
+ H5O_dtype_debug(f, dxpl_id, dt->shared->u.compnd.memb[i].type, stream,
+ indent + 3, MAX(0, fwidth - 3));
+ } /* end for */
+ } /* end if */
+ else if(H5T_ENUM == dt->shared->type) {
+ HDfprintf(stream, "%*s%s\n", indent, "", "Base type:");
+ H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent+3, MAX(0, fwidth-3));
+ HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
+ "Number of members:",
+ dt->shared->u.enumer.nmembs);
+ for(i = 0; i < dt->shared->u.enumer.nmembs; i++) {
+ HDsprintf(buf, "Member %u:", i);
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ buf,
+ dt->shared->u.enumer.name[i]);
+ HDfprintf(stream, "%*s%-*s 0x", indent, "", fwidth,
+ "Raw bytes of value:");
+ for(k = 0; k < dt->shared->parent->shared->size; k++)
+ HDfprintf(stream, "%02x", dt->shared->u.enumer.value[i*dt->shared->parent->shared->size + k]);
+ HDfprintf(stream, "\n");
+ } /* end for */
+ } /* end else if */
+ else if(H5T_OPAQUE == dt->shared->type) {
+ HDfprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth,
+ "Tag:", dt->shared->u.opaque.tag);
+ } /* end else if */
+ else if(H5T_REFERENCE == dt->shared->type) {
+ HDfprintf(stream, "%*s%-*s\n", indent, "", fwidth,
+ "Fix dumping reference types!");
+ } /* end else if */
+ else if(H5T_STRING == dt->shared->type) {
switch(dt->shared->u.atomic.u.s.cset) {
case H5T_CSET_ASCII:
s = "ASCII";
@@ -1791,17 +1798,17 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_CSET_RESERVED_13:
case H5T_CSET_RESERVED_14:
case H5T_CSET_RESERVED_15:
- sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(dt->shared->u.atomic.u.s.cset));
+ HDsprintf(buf, "H5T_CSET_RESERVED_%d", (int)(dt->shared->u.atomic.u.s.cset));
s = buf;
break;
case H5T_CSET_ERROR:
default:
- sprintf(buf, "Unknown character set: %d", (int)(dt->shared->u.atomic.u.s.cset));
+ HDsprintf(buf, "Unknown character set: %d", (int)(dt->shared->u.atomic.u.s.cset));
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Character Set:",
s);
@@ -1831,20 +1838,21 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_STR_RESERVED_13:
case H5T_STR_RESERVED_14:
case H5T_STR_RESERVED_15:
- sprintf(buf, "H5T_STR_RESERVED_%d", (int)(dt->shared->u.atomic.u.s.pad));
+ HDsprintf(buf, "H5T_STR_RESERVED_%d", (int)(dt->shared->u.atomic.u.s.pad));
s = buf;
break;
case H5T_STR_ERROR:
default:
- sprintf(buf, "Unknown string padding: %d", (int)(dt->shared->u.atomic.u.s.pad));
+ HDsprintf(buf, "Unknown string padding: %d", (int)(dt->shared->u.atomic.u.s.pad));
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"String Padding:",
s);
- } else if(H5T_VLEN == dt->shared->type) {
+ } /* end else if */
+ else if(H5T_VLEN == dt->shared->type) {
switch(dt->shared->u.vlen.type) {
case H5T_VLEN_SEQUENCE:
s = "sequence";
@@ -1857,11 +1865,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_VLEN_BADTYPE:
case H5T_VLEN_MAXTYPE:
default:
- sprintf(buf, "H5T_VLEN_%d", dt->shared->u.vlen.type);
+ HDsprintf(buf, "H5T_VLEN_%d", dt->shared->u.vlen.type);
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Vlen type:", s);
switch(dt->shared->u.vlen.loc) {
@@ -1876,11 +1884,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_LOC_BADLOC:
case H5T_LOC_MAXLOC:
default:
- sprintf(buf, "H5T_LOC_%d", (int)dt->shared->u.vlen.loc);
+ HDsprintf(buf, "H5T_LOC_%d", (int)dt->shared->u.vlen.loc);
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Location:", s);
/* Extra information for VL-strings */
@@ -1908,17 +1916,17 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_CSET_RESERVED_13:
case H5T_CSET_RESERVED_14:
case H5T_CSET_RESERVED_15:
- sprintf(buf, "H5T_CSET_RESERVED_%d", (int)(dt->shared->u.vlen.cset));
+ HDsprintf(buf, "H5T_CSET_RESERVED_%d", (int)(dt->shared->u.vlen.cset));
s = buf;
break;
case H5T_CSET_ERROR:
default:
- sprintf(buf, "Unknown character set: %d", (int)(dt->shared->u.vlen.cset));
+ HDsprintf(buf, "Unknown character set: %d", (int)(dt->shared->u.vlen.cset));
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"Character Set:",
s);
@@ -1948,32 +1956,34 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_STR_RESERVED_13:
case H5T_STR_RESERVED_14:
case H5T_STR_RESERVED_15:
- sprintf(buf, "H5T_STR_RESERVED_%d", (int)(dt->shared->u.vlen.pad));
+ HDsprintf(buf, "H5T_STR_RESERVED_%d", (int)(dt->shared->u.vlen.pad));
s = buf;
break;
case H5T_STR_ERROR:
default:
- sprintf(buf, "Unknown string padding: %d", (int)(dt->shared->u.vlen.pad));
+ HDsprintf(buf, "Unknown string padding: %d", (int)(dt->shared->u.vlen.pad));
s = buf;
break;
} /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
"String Padding:",
s);
} /* end if */
- } else if(H5T_ARRAY == dt->shared->type) {
- fprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Rank:",
- dt->shared->u.array.ndims);
- fprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
+ } /* end else if */
+ else if(H5T_ARRAY == dt->shared->type) {
+ HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
+ "Rank:",
+ dt->shared->u.array.ndims);
+ HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
for(i = 0; i < dt->shared->u.array.ndims; i++)
- fprintf(stream, "%s%u", (i ? ", " : ""), (unsigned)dt->shared->u.array.dim[i]);
- fprintf(stream, "}\n");
- fprintf(stream, "%*s%s\n", indent, "", "Base type:");
- H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent + 3, MAX(0, fwidth - 3));
- } else {
- switch (dt->shared->u.atomic.order) {
+ HDfprintf(stream, "%s%u", (i ? ", " : ""), (unsigned)dt->shared->u.array.dim[i]);
+ HDfprintf(stream, "}\n");
+ HDfprintf(stream, "%*s%s\n", indent, "", "Base type:");
+ H5O_dtype_debug(f, dxpl_id, dt->shared->parent, stream, indent + 3, MAX(0, fwidth - 3));
+ } /* end else if */
+ else {
+ switch (dt->shared->u.atomic.order) {
case H5T_ORDER_LE:
s = "little endian";
break;
@@ -1996,25 +2006,25 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_ORDER_ERROR:
default:
- sprintf(buf, "H5T_ORDER_%d", dt->shared->u.atomic.order);
+ HDsprintf(buf, "H5T_ORDER_%d", dt->shared->u.atomic.order);
s = buf;
break;
- } /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Byte order:",
- s);
-
- fprintf(stream, "%*s%-*s %lu bit%s\n", indent, "", fwidth,
- "Precision:",
- (unsigned long)(dt->shared->u.atomic.prec),
- 1==dt->shared->u.atomic.prec?"":"s");
-
- fprintf(stream, "%*s%-*s %lu bit%s\n", indent, "", fwidth,
- "Offset:",
- (unsigned long)(dt->shared->u.atomic.offset),
- 1==dt->shared->u.atomic.offset?"":"s");
-
- switch (dt->shared->u.atomic.lsb_pad) {
+ } /* end switch */
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Byte order:",
+ s);
+
+ HDfprintf(stream, "%*s%-*s %lu bit%s\n", indent, "", fwidth,
+ "Precision:",
+ (unsigned long)(dt->shared->u.atomic.prec),
+ 1==dt->shared->u.atomic.prec?"":"s");
+
+ HDfprintf(stream, "%*s%-*s %lu bit%s\n", indent, "", fwidth,
+ "Offset:",
+ (unsigned long)(dt->shared->u.atomic.offset),
+ 1==dt->shared->u.atomic.offset?"":"s");
+
+ switch (dt->shared->u.atomic.lsb_pad) {
case H5T_PAD_ZERO:
s = "zero";
break;
@@ -2032,11 +2042,11 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
default:
s = "pad?";
break;
- } /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Low pad type:", s);
+ } /* end switch */
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Low pad type:", s);
- switch (dt->shared->u.atomic.msb_pad) {
+ switch (dt->shared->u.atomic.msb_pad) {
case H5T_PAD_ZERO:
s = "zero";
break;
@@ -2054,12 +2064,12 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
default:
s = "pad?";
break;
- } /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "High pad type:", s);
+ } /* end switch */
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "High pad type:", s);
- if (H5T_FLOAT == dt->shared->type) {
- switch (dt->shared->u.atomic.u.f.pad) {
+ if (H5T_FLOAT == dt->shared->type) {
+ switch (dt->shared->u.atomic.u.f.pad) {
case H5T_PAD_ZERO:
s = "zero";
break;
@@ -2076,16 +2086,16 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_NPAD:
default:
if (dt->shared->u.atomic.u.f.pad < 0)
- sprintf(buf, "H5T_PAD_%d", -(dt->shared->u.atomic.u.f.pad));
+ HDsprintf(buf, "H5T_PAD_%d", -(dt->shared->u.atomic.u.f.pad));
else
- sprintf(buf, "bit-%d", dt->shared->u.atomic.u.f.pad);
+ HDsprintf(buf, "bit-%d", dt->shared->u.atomic.u.f.pad);
s = buf;
break;
- } /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Internal pad type:", s);
+ } /* end switch */
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Internal pad type:", s);
- switch (dt->shared->u.atomic.u.f.norm) {
+ switch (dt->shared->u.atomic.u.f.norm) {
case H5T_NORM_IMPLIED:
s = "implied";
break;
@@ -2100,38 +2110,39 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_NORM_ERROR:
default:
- sprintf(buf, "H5T_NORM_%d", (int) (dt->shared->u.atomic.u.f.norm));
+ HDsprintf(buf, "H5T_NORM_%d", (int) (dt->shared->u.atomic.u.f.norm));
s = buf;
- } /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Normalization:", s);
+ } /* end switch */
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Normalization:", s);
- fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Sign bit location:",
- (unsigned long) (dt->shared->u.atomic.u.f.sign));
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ "Sign bit location:",
+ (unsigned long) (dt->shared->u.atomic.u.f.sign));
- fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Exponent location:",
- (unsigned long) (dt->shared->u.atomic.u.f.epos));
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ "Exponent location:",
+ (unsigned long) (dt->shared->u.atomic.u.f.epos));
- fprintf(stream, "%*s%-*s 0x%08lx\n", indent, "", fwidth,
- "Exponent bias:",
- (unsigned long) (dt->shared->u.atomic.u.f.ebias));
+ HDfprintf(stream, "%*s%-*s 0x%08lx\n", indent, "", fwidth,
+ "Exponent bias:",
+ (unsigned long) (dt->shared->u.atomic.u.f.ebias));
- fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Exponent size:",
- (unsigned long) (dt->shared->u.atomic.u.f.esize));
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ "Exponent size:",
+ (unsigned long) (dt->shared->u.atomic.u.f.esize));
- fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Mantissa location:",
- (unsigned long) (dt->shared->u.atomic.u.f.mpos));
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ "Mantissa location:",
+ (unsigned long) (dt->shared->u.atomic.u.f.mpos));
- fprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
- "Mantissa size:",
- (unsigned long) (dt->shared->u.atomic.u.f.msize));
+ HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth,
+ "Mantissa size:",
+ (unsigned long) (dt->shared->u.atomic.u.f.msize));
- } else if (H5T_INTEGER == dt->shared->type) {
- switch (dt->shared->u.atomic.u.i.sign) {
+ } /* end if */
+ else if (H5T_INTEGER == dt->shared->type) {
+ switch (dt->shared->u.atomic.u.i.sign) {
case H5T_SGN_NONE:
s = "none";
break;
@@ -2143,14 +2154,14 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
case H5T_SGN_ERROR:
case H5T_NSGN:
default:
- sprintf(buf, "H5T_SGN_%d", (int) (dt->shared->u.atomic.u.i.sign));
+ HDsprintf(buf, "H5T_SGN_%d", (int) (dt->shared->u.atomic.u.i.sign));
s = buf;
break;
- } /* end switch */
- fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Sign scheme:", s);
- }
- }
+ } /* end switch */
+ HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
+ "Sign scheme:", s);
+ } /* end else if */
+ } /* end else */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5O_dtype_debug() */
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index e778f90..ef49535 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -217,6 +217,12 @@
#define H5O_SHARE_IS_SHARABLE 0x01
#define H5O_SHARE_IN_OHDR 0x02
+/* Set the object header size to speculatively read in */
+/* (needs to be more than the object header prefix size to work at all and
+ * should be larger than the largest object type's default object header
+ * size to save the extra I/O operations) */
+#define H5O_SPEC_READ_SIZE 512
+
/* The "message class" type */
struct H5O_msg_class_t {
diff --git a/src/H5PL.c b/src/H5PL.c
index 7e4dbcc..1f7bb2a 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -84,7 +84,7 @@ typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void);
#define H5PL_HANDLE void *
/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */
-#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_NOW)
+#define H5PL_OPEN_DLIB(S) dlopen(S, RTLD_LAZY)
/* Get the address of a symbol in dynamic library */
#define H5PL_GET_LIB_FUNC(H,N) dlsym(H,N)
diff --git a/src/H5public.h b/src/H5public.h
index 84c98fa..f0eb63a 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -94,10 +94,10 @@ extern "C" {
/* Version numbers */
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
-#define H5_VERS_RELEASE 235 /* For tweaks, bug-fixes, or development */
+#define H5_VERS_RELEASE 236 /* For tweaks, bug-fixes, or development */
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
/* Empty string for real releases. */
-#define H5_VERS_INFO "HDF5 library version: 1.9.235" /* Full version string */
+#define H5_VERS_INFO "HDF5 library version: 1.9.236" /* Full version string */
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
H5_VERS_RELEASE)
diff --git a/src/H5system.c b/src/H5system.c
index 4aada77..ac323c0 100644
--- a/src/H5system.c
+++ b/src/H5system.c
@@ -923,13 +923,12 @@ Wflock(int fd, int operation) {
* Fall 2016
*--------------------------------------------------------------------------
*/
-void
-Wnanosleep(uint64_t nanosec)
+int
+Wnanosleep(const struct timespec *req, struct timespec *rem)
{
/* XXX: Currently just a placeholder */
- FUNC_ENTER_NOAPI_NOINIT_NOERR
+ return 0;
- FUNC_LEAVE_NOAPI_VOID
} /* end Wnanosleep() */
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 33d37b6..63c3a16 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -42,7 +42,7 @@ typedef __int64 h5_stat_size_t;
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#define HDlstat(S,B) _lstati64(S,B)
#define HDmkdir(S,M) _mkdir(S)
-#define HDnanosleep(S) Wnanosleep(S)
+#define HDnanosleep(N, O) Wnanosleep(N, O)
#define HDoff_t __int64
/* _O_BINARY must be set in Windows to avoid CR-LF <-> LF EOL
* transformations when performing I/O.
@@ -102,6 +102,7 @@ extern "C" {
H5_DLL char* Wgetlogin(void);
H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
H5_DLL int c99_vsnprintf(char* str, size_t size, const char* format, va_list ap);
+ H5_DLL int Wnanosleep(const struct timespec *req, struct timespec *rem);
/* Round functions only needed for VS2012 and earlier.
* They are always built to ensure they don't go stale and