[svn-r27204] Description:

Clean up compiler warnings before merging in v3 metadata cache changes
from branch.

Tested on:
    MacOSX/64 10.10.3 (amazon) w/serial & parallel
    Linux/32 2.6.x (jam) w/serial & parallel
This commit is contained in:
Quincey Koziol 2015-06-15 11:07:38 -05:00
parent b5a6740703
commit adbb64c6cd
22 changed files with 1842 additions and 2156 deletions

View File

@ -300,7 +300,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@ -311,7 +311,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(data_float_in[i],data_float_out[i])) {
goto out;
}
}
@ -336,7 +336,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@ -347,7 +347,7 @@ static int test_dsets( void )
for (i = 0; i < DIM; i++)
{
if(!DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(data_double_in[i],data_double_out[i])) {
goto out;
}
}
@ -959,7 +959,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@ -970,7 +970,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
if(!H5_FLT_ABS_EQUAL(attr_float_in[i],attr_float_out[i])) {
return -1;
}
}
@ -1003,7 +1003,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}
@ -1014,7 +1014,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name )
for (i = 0; i < 5; i++)
{
if(!DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
if(!H5_DBL_ABS_EQUAL(attr_double_in[i],attr_double_out[i])) {
return -1;
}
}

View File

@ -75,8 +75,8 @@ static int cmp_par(size_t i, size_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) ) {
return -1;
}
return 0;

View File

@ -166,8 +166,8 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
if ( ( HDstrcmp( rbuf[i].name, wbuf[j].name ) != 0 ) ||
rbuf[i].lati != wbuf[j].lati ||
rbuf[i].longi != wbuf[j].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,wbuf[j].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf[i].temperature,wbuf[j].temperature) )
{
HDfprintf(stderr,"read and write buffers have differences\n");
HDfprintf(stderr,"%s %ld %f %f %d\n",
@ -1140,7 +1140,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
{
HDfprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,(double)rbuf[i].pressure,rbuf[i].lati);
@ -1202,7 +1202,7 @@ static int test_table(hid_t fid, int do_write)
/* Compare the extracted table with the initial values */
for ( i = 0; i < NRECORDS; i++ )
{
if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@ -1265,7 +1265,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@ -1294,7 +1294,7 @@ static int test_table(hid_t fid, int do_write)
{
hsize_t iistart = start;
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[iistart+i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, namepre_in[iistart+i].pressure) ) {
goto out;
}
}
@ -1353,7 +1353,7 @@ static int test_table(hid_t fid, int do_write)
{
if ( rbuf[i].lati != position_in[i-NRECORDS_ADD+1].lati ||
rbuf[i].longi != position_in[i-NRECORDS_ADD+1].longi ||
!FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
!H5_FLT_ABS_EQUAL(rbuf[i].pressure,pressure_in[i-NRECORDS_ADD+1]) )
goto out;
}
}
@ -1406,7 +1406,7 @@ static int test_table(hid_t fid, int do_write)
/* compare the extracted table with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
if ( !FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
if ( !H5_FLT_ABS_EQUAL(pressure_out[i], pressure_in[i]) ) {
goto out;
}
}
@ -1472,7 +1472,7 @@ static int test_table(hid_t fid, int do_write)
for( i = 0; i < NRECORDS; i++ )
{
if ( ( HDstrcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure,namepre_in[i].pressure) ) {
goto out;
}
}
@ -1503,7 +1503,7 @@ static int test_table(hid_t fid, int do_write)
{
int iistart = (int) start;
if ( ( HDstrcmp( namepre_out[i].name, wbuf[iistart+(int)i].name ) != 0 ) ||
!FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
!H5_FLT_ABS_EQUAL(namepre_out[i].pressure, wbuf[iistart+(int)i].pressure) ) {
goto out;
}
}
@ -1546,8 +1546,8 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) ||
rbuf2[i].lati != wbuf[i].lati ||
rbuf2[i].longi != wbuf[i].longi ||
!FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
!DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
!H5_FLT_ABS_EQUAL(rbuf2[i].pressure,wbuf[i].pressure) ||
!H5_DBL_ABS_EQUAL(rbuf2[i].temperature,wbuf[i].temperature) ||
rbuf2[i].new_field != buf_new[i] ) {
goto out;
}
@ -1587,7 +1587,7 @@ static int test_table(hid_t fid, int do_write)
if ( ( HDstrcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) ||
rbuf3[i].lati != wbuf[i].lati ||
rbuf3[i].longi != wbuf[i].longi ||
!DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
!H5_DBL_ABS_EQUAL(rbuf3[i].temperature,wbuf[i].temperature) ) {
goto out;
}
}

View File

@ -1718,10 +1718,10 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
H5C_cache_entry_t * entry_ptr = NULL;
H5C_cache_entry_t * next_entry_ptr = NULL;
#if H5C_DO_SANITY_CHECKS
int64_t flushed_entries_count;
size_t flushed_entries_size;
int64_t initial_slist_len;
size_t initial_slist_size;
int64_t flushed_entries_count = 0;
int64_t flushed_entries_size = 0;
int64_t initial_slist_len = 0;
size_t initial_slist_size = 0;
#endif /* H5C_DO_SANITY_CHECKS */
FUNC_ENTER_NOAPI(FAIL)
@ -1943,7 +1943,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if(entry_ptr->flush_dep_height == curr_flush_dep_height ) {
#if H5C_DO_SANITY_CHECKS
flushed_entries_count++;
flushed_entries_size += entry_ptr->size;
flushed_entries_size += (int64_t)entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
status = H5C_flush_single_entry(f,
primary_dxpl_id,
@ -1976,7 +1976,7 @@ H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id, unsign
if(entry_ptr->flush_dep_height == curr_flush_dep_height ) {
#if H5C_DO_SANITY_CHECKS
flushed_entries_count++;
flushed_entries_size += entry_ptr->size;
flushed_entries_size += (int64_t)entry_ptr->size;
#endif /* H5C_DO_SANITY_CHECKS */
status = H5C_flush_single_entry(f,
primary_dxpl_id,
@ -2027,8 +2027,8 @@ end_of_inner_loop:
HDassert( (initial_slist_len + cache_ptr->slist_len_increase -
flushed_entries_count) == cache_ptr->slist_len );
HDassert( (initial_slist_size +
(size_t)(cache_ptr->slist_size_increase) -
HDassert( (size_t)((int64_t)initial_slist_size +
cache_ptr->slist_size_increase -
flushed_entries_size) == cache_ptr->slist_size );
#endif /* H5C_DO_SANITY_CHECKS */
@ -4647,8 +4647,6 @@ H5C_stats(H5C_t * cache_ptr,
#endif /* H5C_COLLECT_CACHE_STATS */
display_detailed_stats)
{
herr_t ret_value = SUCCEED; /* Return value */
#if H5C_COLLECT_CACHE_STATS
int i;
int64_t total_hits = 0;
@ -4680,11 +4678,12 @@ H5C_stats(H5C_t * cache_ptr,
size_t aggregate_max_size = 0;
int32_t aggregate_max_pins = 0;
double hit_rate;
double average_successful_search_depth = 0.0;
double average_failed_search_depth = 0.0;
double average_entries_skipped_per_calls_to_msic = 0.0;
double average_entries_scanned_per_calls_to_msic = 0.0;
double average_successful_search_depth = 0.0f;
double average_failed_search_depth = 0.0f;
double average_entries_skipped_per_calls_to_msic = 0.0f;
double average_entries_scanned_per_calls_to_msic = 0.0f;
#endif /* H5C_COLLECT_CACHE_STATS */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@ -4748,10 +4747,10 @@ H5C_stats(H5C_t * cache_ptr,
if ( ( total_hits > 0 ) || ( total_misses > 0 ) ) {
hit_rate = 100.0 * ((double)(total_hits)) /
hit_rate = (double)100.0f * ((double)(total_hits)) /
((double)(total_hits + total_misses));
} else {
hit_rate = 0.0;
hit_rate = 0.0f;
}
if ( cache_ptr->successful_ht_searches > 0 ) {
@ -4918,7 +4917,7 @@ H5C_stats(H5C_t * cache_ptr,
HDfprintf(stdout, "%s MSIC: Average/max entries skipped = %lf / %ld\n",
cache_ptr->prefix,
(float)average_entries_skipped_per_calls_to_msic,
(double)average_entries_skipped_per_calls_to_msic,
(long)(cache_ptr->max_entries_skipped_in_msic));
if (cache_ptr->calls_to_msic > 0) {
@ -4929,7 +4928,7 @@ H5C_stats(H5C_t * cache_ptr,
HDfprintf(stdout, "%s MSIC: Average/max entries scanned = %lf / %ld\n",
cache_ptr->prefix,
(float)average_entries_scanned_per_calls_to_msic,
(double)average_entries_scanned_per_calls_to_msic,
(long)(cache_ptr->max_entries_scanned_in_msic));
HDfprintf(stdout, "%s MSIC: Scanned to make space(evict) = %lld\n",
@ -4973,10 +4972,10 @@ H5C_stats(H5C_t * cache_ptr,
if ( ( cache_ptr->hits[i] > 0 ) || ( cache_ptr->misses[i] > 0 ) ) {
hit_rate = 100.0 * ((double)(cache_ptr->hits[i])) /
hit_rate = (double)100.0f * ((double)(cache_ptr->hits[i])) /
((double)(cache_ptr->hits[i] + cache_ptr->misses[i]));
} else {
hit_rate = 0.0;
hit_rate = 0.0f;
}
HDfprintf(stdout,
@ -8229,7 +8228,6 @@ H5C_flush_single_entry(H5F_t * f,
hbool_t was_dirty;
hbool_t destroy_entry;
herr_t status;
int type_id;
unsigned flush_flags = H5C_CALLBACK__NO_FLAGS_SET;
H5C_cache_entry_t * entry_ptr = NULL;
herr_t ret_value = SUCCEED; /* Return value */
@ -8330,7 +8328,6 @@ H5C_flush_single_entry(H5F_t * f,
#endif /* H5_HAVE_PARALLEL */
was_dirty = entry_ptr->is_dirty;
type_id = entry_ptr->type->id;
entry_ptr->flush_marker = FALSE;

File diff suppressed because it is too large Load Diff

View File

@ -36,6 +36,9 @@
#include "H5private.h" /* Generic Functions */
#include "H5Fprivate.h" /* File access */
/**************************/
/* Library Private Macros */
/**************************/
#define H5C_DO_SANITY_CHECKS 0
#define H5C_DO_TAGGING_SANITY_CHECKS 1
@ -61,36 +64,162 @@
* H5C_COLLECT_CACHE_STATS is also defined to true.
*/
#if H5C_COLLECT_CACHE_STATS
#define H5C_COLLECT_CACHE_ENTRY_STATS 1
#else
#define H5C_COLLECT_CACHE_ENTRY_STATS 0
#endif /* H5C_COLLECT_CACHE_STATS */
#ifdef H5_HAVE_PARALLEL
/* we must maintain the clean and dirty LRU lists when we are compiled
* with parallel support.
*/
#define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 1
#else /* H5_HAVE_PARALLEL */
/* The clean and dirty LRU lists don't buy us anything here -- we may
* want them on for testing on occasion, but in general they should be
* off.
*/
#define H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS 0
#endif /* H5_HAVE_PARALLEL */
/* Flags returned from the 'flush' callback */
#define H5C_CALLBACK__NO_FLAGS_SET 0x0
#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
#define H5C_CALLBACK__MOVED_FLAG 0x2
/* Upper and lower limits on cache size. These limits are picked
* out of a hat -- you should be able to change them as necessary.
*
* However, if you need a very big cache, you should also increase the
* size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
* upper bound on cache size is rather large for the current hash table
* size.
*/
#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
/* Default max cache size and min clean size are give here to make
* them generally accessable.
*/
#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
/* Maximum height of flush dependency relationships between entries. This is
* currently tuned to the extensible array (H5EA) data structure, which only
* requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible
* array needs 4 levels, plus another 2 levels are needed: one for the layer
* under the extensible array and one for the layer above it).
*/
#define H5C__NUM_FLUSH_DEP_HEIGHTS 6
#ifndef NDEBUG
/* Values for cache entry magic field */
#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
#endif /* NDEBUG */
/* Cache configuration validation definitions */
#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
#define H5C_RESIZE_CFG__VALIDATE_ALL \
( \
H5C_RESIZE_CFG__VALIDATE_GENERAL | \
H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
)
/* Cache configuration versions */
#define H5C__CURR_AUTO_SIZE_CTL_VER 1
#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
/* Number of epoch markers active */
#define H5C__MAX_EPOCH_MARKERS 10
/* Default configuration settings */
#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
#define H5C__DEF_AR_INCREMENT 2.0f
#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
#define H5C__DEF_AR_DECREMENT 0.9f
#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_EPCHS_B4_EVICT 3
#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
#define H5C__MIN_AR_EPOCH_LENGTH 100
#define H5C__DEF_AR_EPOCH_LENGTH 50000
#define H5C__MAX_AR_EPOCH_LENGTH 1000000
/* #defines of flags used in the flags parameters in some of the
* cache calls. Note that not all flags are applicable
* to all function calls. Flags that don't apply to a particular
* function are ignored in that function.
*
* These flags apply to all function calls:
* H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
*
*
* These flags apply to H5C_insert_entry():
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__PIN_ENTRY_FLAG
*
* These flags apply to H5C_protect()
* H5C__READ_ONLY_FLAG
*
* These flags apply to H5C_unprotect():
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__DELETED_FLAG
* H5C__DIRTIED_FLAG
* H5C__PIN_ENTRY_FLAG
* H5C__UNPIN_ENTRY_FLAG
* H5C__FREE_FILE_SPACE_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*
* These flags apply to H5C_expunge_entry():
* H5C__FREE_FILE_SPACE_FLAG
*
* These flags apply to H5C_flush_cache():
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
* with H5C__FLUSH_INVALIDATE_FLAG)
*
* These flags apply to H5C_flush_single_entry():
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*/
#define H5C__NO_FLAGS_SET 0x0000
#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
#define H5C__DELETED_FLAG 0x0002
#define H5C__DIRTIED_FLAG 0x0004
#define H5C__PIN_ENTRY_FLAG 0x0008
#define H5C__UNPIN_ENTRY_FLAG 0x0010
#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
#define H5C__READ_ONLY_FLAG 0x0200
#define H5C__FREE_FILE_SPACE_FLAG 0x0800
#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
#define H5C__FLUSH_LAST_FLAG 0x2000
#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000
/****************************/
/* Library Private Typedefs */
/****************************/
/* Typedef for the main structure for the cache (defined in H5Cpkg.h) */
typedef struct H5C_t H5C_t;
@ -121,10 +250,6 @@ typedef struct H5C_t H5C_t;
* Note that the space allocated on disk may not be contiguous.
*/
#define H5C_CALLBACK__NO_FLAGS_SET 0x0
#define H5C_CALLBACK__SIZE_CHANGED_FLAG 0x1
#define H5C_CALLBACK__MOVED_FLAG 0x2
/* Actions that can be reported to 'notify' client callback */
typedef enum H5C_notify_action_t {
H5C_NOTIFY_ACTION_AFTER_INSERT, /* Entry has been added to the cache */
@ -135,27 +260,18 @@ typedef enum H5C_notify_action_t {
H5C_NOTIFY_ACTION_BEFORE_EVICT /* Entry is about to be evicted from cache */
} H5C_notify_action_t;
typedef void *(*H5C_load_func_t)(H5F_t *f,
hid_t dxpl_id,
haddr_t addr,
void *udata);
typedef herr_t (*H5C_flush_func_t)(H5F_t *f,
hid_t dxpl_id,
hbool_t dest,
haddr_t addr,
void *thing,
unsigned * flags_ptr);
typedef herr_t (*H5C_dest_func_t)(H5F_t *f,
void *thing);
typedef herr_t (*H5C_clear_func_t)(H5F_t *f,
void *thing,
hbool_t dest);
typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action,
void *thing);
typedef herr_t (*H5C_size_func_t)(const H5F_t *f,
const void *thing,
size_t *size_ptr);
/* Cache client callback function pointers */
typedef void *(*H5C_load_func_t)(H5F_t *f, hid_t dxpl_id, haddr_t addr,
void *udata);
typedef herr_t (*H5C_flush_func_t)(H5F_t *f, hid_t dxpl_id, hbool_t dest,
haddr_t addr, void *thing, unsigned *flags_ptr);
typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing);
typedef herr_t (*H5C_clear_func_t)(H5F_t *f, void *thing, hbool_t dest);
typedef herr_t (*H5C_notify_func_t)(H5C_notify_action_t action, void *thing);
typedef herr_t (*H5C_size_func_t)(const H5F_t *f, const void *thing,
size_t *size_ptr);
/* Metadata cache client class definition */
typedef struct H5C_class_t {
int id;
H5C_load_func_t load;
@ -166,47 +282,11 @@ typedef struct H5C_class_t {
H5C_size_func_t size;
} H5C_class_t;
/* Type defintions of call back functions used by the cache as a whole */
/* Type defintions of callback functions used by the cache as a whole */
typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f,
hbool_t * write_permitted_ptr);
typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
haddr_t addr,
hbool_t was_dirty,
unsigned flags);
/* Upper and lower limits on cache size. These limits are picked
* out of a hat -- you should be able to change them as necessary.
*
* However, if you need a very big cache, you should also increase the
* size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current
* upper bound on cache size is rather large for the current hash table
* size.
*/
#define H5C__MAX_MAX_CACHE_SIZE ((size_t)(128 * 1024 * 1024))
#define H5C__MIN_MAX_CACHE_SIZE ((size_t)(1024))
/* Default max cache size and min clean size are give here to make
* them generally accessable.
*/
#define H5C__DEFAULT_MAX_CACHE_SIZE ((size_t)(4 * 1024 * 1024))
#define H5C__DEFAULT_MIN_CLEAN_SIZE ((size_t)(2 * 1024 * 1024))
/* Maximum height of flush dependency relationships between entries. This is
* currently tuned to the extensible array (H5EA) data structure, which only
* requires 6 levels of dependency (i.e. heights 0-6) (actually, the extensible
* array needs 4 levels, plus another 2 levels are needed: one for the layer
* under the extensible array and one for the layer above it).
*/
#define H5C__NUM_FLUSH_DEP_HEIGHTS 6
hbool_t *write_permitted_ptr);
typedef herr_t (*H5C_log_flush_func_t)(H5C_t *cache_ptr, haddr_t addr,
hbool_t was_dirty, unsigned flags);
/****************************************************************************
*
@ -578,21 +658,14 @@ typedef herr_t (*H5C_log_flush_func_t)(H5C_t * cache_ptr,
* been pinned in cache in its life time.
*
****************************************************************************/
#ifndef NDEBUG
#define H5C__H5C_CACHE_ENTRY_T_MAGIC 0x005CAC0A
#define H5C__H5C_CACHE_ENTRY_T_BAD_MAGIC 0xDeadBeef
#endif /* NDEBUG */
typedef struct H5C_cache_entry_t
{
typedef struct H5C_cache_entry_t {
#ifndef NDEBUG
uint32_t magic;
#endif /* NDEBUG */
H5C_t * cache_ptr;
H5C_t * cache_ptr;
haddr_t addr;
size_t size;
const H5C_class_t * type;
const H5C_class_t * type;
haddr_t tag;
hbool_t is_dirty;
hbool_t dirtied;
@ -613,39 +686,31 @@ typedef struct H5C_cache_entry_t
hbool_t free_file_space_on_destroy;
/* fields supporting the 'flush dependency' feature: */
struct H5C_cache_entry_t * flush_dep_parent;
struct H5C_cache_entry_t * flush_dep_parent;
uint64_t child_flush_dep_height_rc[H5C__NUM_FLUSH_DEP_HEIGHTS];
unsigned flush_dep_height;
hbool_t pinned_from_client;
hbool_t pinned_from_cache;
/* fields supporting the hash table: */
struct H5C_cache_entry_t * ht_next;
struct H5C_cache_entry_t * ht_prev;
struct H5C_cache_entry_t * ht_next;
struct H5C_cache_entry_t * ht_prev;
/* fields supporting replacement policies: */
struct H5C_cache_entry_t * next;
struct H5C_cache_entry_t * prev;
struct H5C_cache_entry_t * aux_next;
struct H5C_cache_entry_t * aux_prev;
struct H5C_cache_entry_t * next;
struct H5C_cache_entry_t * prev;
struct H5C_cache_entry_t * aux_next;
struct H5C_cache_entry_t * aux_prev;
#if H5C_COLLECT_CACHE_ENTRY_STATS
/* cache entry stats fields */
int32_t accesses;
int32_t clears;
int32_t flushes;
int32_t pins;
#endif /* H5C_COLLECT_CACHE_ENTRY_STATS */
} H5C_cache_entry_t;
/****************************************************************************
*
* structure H5C_auto_size_ctl_t
@ -886,41 +951,6 @@ typedef struct H5C_cache_entry_t
*
****************************************************************************/
#define H5C_RESIZE_CFG__VALIDATE_GENERAL 0x1
#define H5C_RESIZE_CFG__VALIDATE_INCREMENT 0x2
#define H5C_RESIZE_CFG__VALIDATE_DECREMENT 0x4
#define H5C_RESIZE_CFG__VALIDATE_INTERACTIONS 0x8
#define H5C_RESIZE_CFG__VALIDATE_ALL \
( \
H5C_RESIZE_CFG__VALIDATE_GENERAL | \
H5C_RESIZE_CFG__VALIDATE_INCREMENT | \
H5C_RESIZE_CFG__VALIDATE_DECREMENT | \
H5C_RESIZE_CFG__VALIDATE_INTERACTIONS \
)
#define H5C__CURR_AUTO_SIZE_CTL_VER 1
#define H5C__CURR_AUTO_RESIZE_RPT_FCN_VER 1
#define H5C__MAX_EPOCH_MARKERS 10
#define H5C__DEF_AR_UPPER_THRESHHOLD 0.9999f
#define H5C__DEF_AR_LOWER_THRESHHOLD 0.9f
#define H5C__DEF_AR_MAX_SIZE ((size_t)(16 * 1024 * 1024))
#define H5C__DEF_AR_INIT_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_SIZE ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_MIN_CLEAN_FRAC 0.5f
#define H5C__DEF_AR_INCREMENT 2.0f
#define H5C__DEF_AR_MAX_INCREMENT ((size_t)( 2 * 1024 * 1024))
#define H5C__DEF_AR_FLASH_MULTIPLE 1.0f
#define H5C__DEV_AR_FLASH_THRESHOLD 0.25f
#define H5C__DEF_AR_DECREMENT 0.9f
#define H5C__DEF_AR_MAX_DECREMENT ((size_t)( 1 * 1024 * 1024))
#define H5C__DEF_AR_EPCHS_B4_EVICT 3
#define H5C__DEF_AR_EMPTY_RESERVE 0.05f
#define H5C__MIN_AR_EPOCH_LENGTH 100
#define H5C__DEF_AR_EPOCH_LENGTH 50000
#define H5C__MAX_AR_EPOCH_LENGTH 1000000
enum H5C_resize_status
{
in_spec,
@ -934,301 +964,118 @@ enum H5C_resize_status
not_full
}; /* enum H5C_resize_conditions */
typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr,
int32_t version,
double hit_rate,
enum H5C_resize_status status,
size_t old_max_cache_size,
size_t new_max_cache_size,
size_t old_min_clean_size,
size_t new_min_clean_size);
typedef void (*H5C_auto_resize_rpt_fcn)(H5C_t * cache_ptr, int32_t version,
double hit_rate, enum H5C_resize_status status, size_t old_max_cache_size,
size_t new_max_cache_size, size_t old_min_clean_size, size_t new_min_clean_size);
typedef struct H5C_auto_size_ctl_t
{
typedef struct H5C_auto_size_ctl_t {
/* general configuration fields: */
int32_t version;
H5C_auto_resize_rpt_fcn rpt_fcn;
hbool_t set_initial_size;
size_t initial_size;
double min_clean_fraction;
size_t max_size;
size_t min_size;
int64_t epoch_length;
/* size increase control fields: */
enum H5C_cache_incr_mode incr_mode;
double lower_hr_threshold;
double increment;
hbool_t apply_max_increment;
size_t max_increment;
enum H5C_cache_flash_incr_mode flash_incr_mode;
double flash_multiple;
double flash_threshold;
/* size decrease control fields: */
enum H5C_cache_decr_mode decr_mode;
double upper_hr_threshold;
double decrement;
hbool_t apply_max_decrement;
size_t max_decrement;
int32_t epochs_before_eviction;
hbool_t apply_empty_reserve;
double empty_reserve;
} H5C_auto_size_ctl_t;
/***************************************/
/* Library-private Function Prototypes */
/***************************************/
/*
* Library prototypes.
*/
/* #defines of flags used in the flags parameters in some of the
* following function calls. Note that not all flags are applicable
* to all function calls. Flags that don't apply to a particular
* function are ignored in that function.
*
* These flags apply to all function calls:
*
* H5C__NO_FLAGS_SET (generic "no flags set" for all fcn calls)
*
*
* These flags apply to H5C_insert_entry():
*
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__PIN_ENTRY_FLAG
*
* These flags apply to H5C_protect()
*
* H5C__READ_ONLY_FLAG
*
* These flags apply to H5C_unprotect():
*
* H5C__SET_FLUSH_MARKER_FLAG
* H5C__DELETED_FLAG
* H5C__DIRTIED_FLAG
* H5C__PIN_ENTRY_FLAG
* H5C__UNPIN_ENTRY_FLAG
* H5C__FREE_FILE_SPACE_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*
* These flags apply to H5C_expunge_entry():
*
* H5C__FREE_FILE_SPACE_FLAG
*
* These flags apply to H5C_flush_cache():
*
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__FLUSH_IGNORE_PROTECTED_FLAG (can't use this flag in combination
* with H5C__FLUSH_INVALIDATE_FLAG)
*
* These flags apply to H5C_flush_single_entry():
*
* H5C__FLUSH_INVALIDATE_FLAG
* H5C__FLUSH_CLEAR_ONLY_FLAG
* H5C__FLUSH_MARKED_ENTRIES_FLAG
* H5C__TAKE_OWNERSHIP_FLAG
*/
#define H5C__NO_FLAGS_SET 0x0000
#define H5C__SET_FLUSH_MARKER_FLAG 0x0001
#define H5C__DELETED_FLAG 0x0002
#define H5C__DIRTIED_FLAG 0x0004
#define H5C__PIN_ENTRY_FLAG 0x0008
#define H5C__UNPIN_ENTRY_FLAG 0x0010
#define H5C__FLUSH_INVALIDATE_FLAG 0x0020
#define H5C__FLUSH_CLEAR_ONLY_FLAG 0x0040
#define H5C__FLUSH_MARKED_ENTRIES_FLAG 0x0080
#define H5C__FLUSH_IGNORE_PROTECTED_FLAG 0x0100
#define H5C__READ_ONLY_FLAG 0x0200
#define H5C__FREE_FILE_SPACE_FLAG 0x0800
#define H5C__TAKE_OWNERSHIP_FLAG 0x1000
#define H5C__FLUSH_LAST_FLAG 0x2000
#define H5C__FLUSH_COLLECTIVELY_FLAG 0x4000
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5C_apply_candidate_list(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
H5C_t * cache_ptr,
int num_candidates,
haddr_t * candidates_list_ptr,
int mpi_rank,
int mpi_size);
H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t * cache_ptr);
H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t * cache_ptr);
#endif /* H5_HAVE_PARALLEL */
H5_DLL H5C_t * H5C_create(size_t max_cache_size,
size_t min_clean_size,
int max_type_id,
const char * (* type_name_table_ptr),
H5C_write_permitted_func_t check_write_permitted,
hbool_t write_permitted,
H5C_log_flush_func_t log_flush,
void * aux_ptr);
H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr,
int32_t version,
double hit_rate,
enum H5C_resize_status status,
size_t old_max_cache_size,
size_t new_max_cache_size,
size_t old_min_clean_size,
size_t new_min_clean_size);
H5_DLL herr_t H5C_dest(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_expunge_entry(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
unsigned flags);
H5_DLL herr_t H5C_flush_cache(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
unsigned flags);
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t * cache_ptr,
H5C_auto_size_ctl_t *config_ptr);
H5_DLL herr_t H5C_get_cache_size(H5C_t * cache_ptr,
size_t * max_size_ptr,
size_t * min_clean_size_ptr,
size_t * cur_size_ptr,
int32_t * cur_num_entries_ptr);
H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t * cache_ptr,
double * hit_rate_ptr);
H5_DLL herr_t H5C_get_entry_status(const H5F_t *f,
haddr_t addr,
size_t * size_ptr,
hbool_t * in_cache_ptr,
hbool_t * is_dirty_ptr,
hbool_t * is_protected_ptr,
hbool_t * is_pinned_ptr,
hbool_t * is_flush_dep_parent_ptr,
hbool_t * is_flush_dep_child_ptr);
H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t * cache_ptr,
hbool_t * evictions_enabled_ptr);
H5_DLL H5C_t *H5C_create(size_t max_cache_size, size_t min_clean_size,
int max_type_id, const char *(*type_name_table_ptr),
H5C_write_permitted_func_t check_write_permitted, hbool_t write_permitted,
H5C_log_flush_func_t log_flush, void *aux_ptr);
H5_DLL void H5C_def_auto_resize_rpt_fcn(H5C_t *cache_ptr, int32_t version,
double hit_rate, enum H5C_resize_status status,
size_t old_max_cache_size, size_t new_max_cache_size,
size_t old_min_clean_size, size_t new_min_clean_size);
H5_DLL herr_t H5C_dest(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_expunge_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, unsigned flags);
H5_DLL herr_t H5C_flush_cache(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
unsigned flags);
H5_DLL herr_t H5C_flush_to_min_clean(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id);
H5_DLL herr_t H5C_get_cache_auto_resize_config(const H5C_t *cache_ptr,
H5C_auto_size_ctl_t *config_ptr);
H5_DLL herr_t H5C_get_cache_size(H5C_t *cache_ptr, size_t *max_size_ptr,
size_t *min_clean_size_ptr, size_t *cur_size_ptr,
int32_t *cur_num_entries_ptr);
H5_DLL herr_t H5C_get_cache_hit_rate(H5C_t *cache_ptr, double *hit_rate_ptr);
H5_DLL herr_t H5C_get_entry_status(const H5F_t *f, haddr_t addr,
size_t *size_ptr, hbool_t *in_cache_ptr, hbool_t *is_dirty_ptr,
hbool_t *is_protected_ptr, hbool_t *is_pinned_ptr,
hbool_t *is_flush_dep_parent_ptr, hbool_t *is_flush_dep_child_ptr);
H5_DLL herr_t H5C_get_evictions_enabled(const H5C_t *cache_ptr, hbool_t *evictions_enabled_ptr);
H5_DLL FILE *H5C_get_trace_file_ptr(const H5C_t *cache_ptr);
H5_DLL FILE *H5C_get_trace_file_ptr_from_entry(const H5C_cache_entry_t *entry_ptr);
H5_DLL herr_t H5C_insert_entry(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
void * thing,
unsigned int flags);
H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
int32_t ce_array_len,
haddr_t *ce_array_ptr);
H5_DLL herr_t H5C_insert_entry(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags);
H5_DLL herr_t H5C_mark_entries_as_clean(H5F_t *f, hid_t primary_dxpl_id,
hid_t secondary_dxpl_id, int32_t ce_array_len, haddr_t *ce_array_ptr);
H5_DLL herr_t H5C_mark_entry_dirty(void *thing);
H5_DLL herr_t H5C_move_entry(H5C_t * cache_ptr,
const H5C_class_t * type,
haddr_t old_addr,
haddr_t new_addr);
H5_DLL herr_t H5C_move_entry(H5C_t *cache_ptr, const H5C_class_t *type,
haddr_t old_addr, haddr_t new_addr);
H5_DLL herr_t H5C_pin_protected_entry(void *thing);
H5_DLL herr_t H5C_create_flush_dependency(void *parent_thing, void *child_thing);
H5_DLL void * H5C_protect(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
void * udata,
unsigned flags);
H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t * cache_ptr);
H5_DLL void * H5C_protect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, void *udata, unsigned flags);
H5_DLL herr_t H5C_reset_cache_hit_rate_stats(H5C_t *cache_ptr);
H5_DLL herr_t H5C_resize_entry(void *thing, size_t new_size);
H5_DLL herr_t H5C_set_cache_auto_resize_config(H5C_t *cache_ptr,
H5C_auto_size_ctl_t *config_ptr);
H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr,
hbool_t evictions_enabled);
H5_DLL herr_t H5C_set_prefix(H5C_t * cache_ptr, char * prefix);
H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t * cache_ptr,
FILE * trace_file_ptr);
H5_DLL herr_t H5C_stats(H5C_t * cache_ptr,
const char * cache_name,
hbool_t display_detailed_stats);
H5_DLL void H5C_stats__reset(H5C_t * cache_ptr);
H5_DLL herr_t H5C_dump_cache(H5C_t * cache_ptr,
const char * cache_name);
H5C_auto_size_ctl_t *config_ptr);
H5_DLL herr_t H5C_set_evictions_enabled(H5C_t *cache_ptr, hbool_t evictions_enabled);
H5_DLL herr_t H5C_set_prefix(H5C_t *cache_ptr, char *prefix);
H5_DLL herr_t H5C_set_trace_file_ptr(H5C_t *cache_ptr, FILE *trace_file_ptr);
H5_DLL herr_t H5C_stats(H5C_t *cache_ptr, const char *cache_name,
hbool_t display_detailed_stats);
H5_DLL void H5C_stats__reset(H5C_t *cache_ptr);
H5_DLL herr_t H5C_dump_cache(H5C_t *cache_ptr, const char *cache_name);
H5_DLL herr_t H5C_unpin_entry(void *thing);
H5_DLL herr_t H5C_destroy_flush_dependency(void *parent_thing, void *child_thing);
H5_DLL herr_t H5C_unprotect(H5F_t *f, hid_t primary_dxpl_id, hid_t secondary_dxpl_id,
const H5C_class_t *type, haddr_t addr, void *thing, unsigned int flags);
H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t *config_ptr,
unsigned int tests);
H5_DLL herr_t H5C_ignore_tags(H5C_t *cache_ptr);
H5_DLL void H5C_retag_copied_metadata(H5C_t *cache_ptr, haddr_t metadata_tag);
H5_DLL herr_t H5C_unprotect(H5F_t * f,
hid_t primary_dxpl_id,
hid_t secondary_dxpl_id,
const H5C_class_t * type,
haddr_t addr,
void * thing,
unsigned int flags);
H5_DLL herr_t H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr,
unsigned int tests);
H5_DLL herr_t H5C_ignore_tags(H5C_t * cache_ptr);
H5_DLL void H5C_retag_copied_metadata(H5C_t * cache_ptr, haddr_t metadata_tag);
#ifdef H5_HAVE_PARALLEL
H5_DLL herr_t H5C_apply_candidate_list(H5F_t *f, hid_t primary_dxpl_id,
hid_t secondary_dxpl_id, H5C_t *cache_ptr, int num_candidates,
haddr_t *candidates_list_ptr, int mpi_rank, int mpi_size);
H5_DLL herr_t H5C_construct_candidate_list__clean_cache(H5C_t *cache_ptr);
H5_DLL herr_t H5C_construct_candidate_list__min_clean(H5C_t *cache_ptr);
#endif /* H5_HAVE_PARALLEL */
#ifndef NDEBUG /* debugging functions */
H5_DLL herr_t H5C_get_entry_ptr_from_addr(const H5F_t *f, haddr_t addr,
void ** entry_ptr_ptr);
H5_DLL herr_t H5C_verify_entry_type(const H5F_t * f, haddr_t addr,
const H5C_class_t * expected_type,
hbool_t * in_cache_ptr,
hbool_t * type_ok_ptr);
void **entry_ptr_ptr);
H5_DLL herr_t H5C_verify_entry_type(const H5F_t *f, haddr_t addr,
const H5C_class_t *expected_type, hbool_t *in_cache_ptr,
hbool_t *type_ok_ptr);
#endif /* NDEBUG */
#endif /* !_H5Cprivate_H */

File diff suppressed because it is too large Load Diff

View File

@ -70,7 +70,6 @@ static unsigned check_file_mdc_api_errs(void);
static unsigned
check_fapl_mdc_api_calls(void)
{
const char * fcn_name = "check_fapl_mdc_api_calls()";
char filename[512];
herr_t result;
hid_t fapl_id = -1;
@ -487,7 +486,7 @@ check_fapl_mdc_api_calls(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
FUNC, failure_mssg);
return !pass;
@ -521,7 +520,6 @@ check_fapl_mdc_api_calls(void)
static unsigned
check_file_mdc_api_calls(void)
{
const char * fcn_name = "check_file_mdc_api_calls()";
char filename[512];
hid_t file_id = -1;
size_t max_size;
@ -775,7 +773,7 @@ check_file_mdc_api_calls(void)
pass = FALSE;
failure_mssg = "H5Fget_mdc_hit_rate() failed 1.\n";
} else if ( hit_rate != 0.0f ) {
} else if ( !H5_DBL_ABS_EQUAL(hit_rate, (double)0.0f) ) {
pass = FALSE;
failure_mssg =
@ -839,7 +837,7 @@ check_file_mdc_api_calls(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
FUNC, failure_mssg);
return !pass;
@ -872,7 +870,6 @@ check_file_mdc_api_calls(void)
static unsigned
mdc_api_call_smoke_check(int express_test)
{
const char * fcn_name = "mdc_api_call_smoke_check()";
char filename[512];
hbool_t valid_chunk;
hbool_t dump_hit_rate = FALSE;
@ -884,7 +881,7 @@ mdc_api_call_smoke_check(int express_test)
hid_t filespace_ids[NUM_DSETS];
hid_t memspace_id = -1;
hid_t dataset_ids[NUM_DSETS];
hid_t properties;
hid_t properties = -1;
char dset_name[64];
int i, j, k, l, m, n;
herr_t status;
@ -1187,8 +1184,8 @@ mdc_api_call_smoke_check(int express_test)
}
/* select on disk hyperslab */
offset[0] = i; /*offset of hyperslab in file*/
offset[1] = j;
offset[0] = (hsize_t)i; /*offset of hyperslab in file*/
offset[1] = (hsize_t)j;
a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
a_size[1] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
@ -1258,8 +1255,8 @@ mdc_api_call_smoke_check(int express_test)
j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
/* select on disk hyperslab */
offset[0] = i; /*offset of hyperslab in file*/
offset[1] = j;
offset[0] = (hsize_t)i; /*offset of hyperslab in file*/
offset[1] = (hsize_t)j;
a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
a_size[1] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
@ -1383,8 +1380,8 @@ mdc_api_call_smoke_check(int express_test)
j = (rand() % (DSET_SIZE / CHUNK_SIZE)) * CHUNK_SIZE;
/* select on disk hyperslab */
offset[0] = i; /*offset of hyperslab in file*/
offset[1] = j;
offset[0] = (hsize_t)i; /*offset of hyperslab in file*/
offset[1] = (hsize_t)j;
a_size[0] = CHUNK_SIZE; /*size of hyperslab*/
a_size[1] = CHUNK_SIZE;
status = H5Sselect_hyperslab(filespace_ids[m], H5S_SELECT_SET,
@ -1516,7 +1513,7 @@ mdc_api_call_smoke_check(int express_test)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
FUNC, failure_mssg);
return !pass;
@ -2885,7 +2882,6 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
static unsigned
check_fapl_mdc_api_errs(void)
{
const char * fcn_name = "check_fapl_mdc_api_errs()";
static char msg[128];
int i;
herr_t result;
@ -3032,7 +3028,7 @@ check_fapl_mdc_api_errs(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
FUNC, failure_mssg);
return !pass;
@ -3058,7 +3054,6 @@ check_fapl_mdc_api_errs(void)
static unsigned
check_file_mdc_api_errs(void)
{
const char * fcn_name = "check_file_mdc_api_errs()";
char filename[512];
static char msg[128];
hbool_t show_progress = FALSE;
@ -3086,7 +3081,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: calling h5_fixname().\n", fcn_name);
HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC);
}
if ( h5_fixname(FILENAME[1], H5P_DEFAULT, filename, sizeof(filename))
@ -3101,7 +3096,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: calling H5Fcreate().\n", fcn_name);
HDfprintf(stdout, "%s: calling H5Fcreate().\n", FUNC);
}
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@ -3123,7 +3118,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", FUNC);
}
H5E_BEGIN_TRY {
@ -3141,7 +3136,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", FUNC);
}
H5E_BEGIN_TRY {
@ -3160,7 +3155,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", FUNC);
}
H5E_BEGIN_TRY {
@ -3182,7 +3177,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", FUNC);
}
H5E_BEGIN_TRY {
@ -3200,7 +3195,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", FUNC);
}
H5E_BEGIN_TRY {
@ -3221,7 +3216,7 @@ check_file_mdc_api_errs(void)
HDfprintf(stdout,
"%s: testing H5Fset_mdc_config() with invalid config %d.\n",
fcn_name, i);
FUNC, i);
}
H5E_BEGIN_TRY {
@ -3250,7 +3245,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n",
fcn_name);
FUNC);
}
H5E_BEGIN_TRY {
@ -3269,7 +3264,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n",
fcn_name);
FUNC);
}
H5E_BEGIN_TRY {
@ -3290,7 +3285,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n",
fcn_name);
FUNC);
}
H5E_BEGIN_TRY {
@ -3311,7 +3306,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", FUNC);
}
H5E_BEGIN_TRY {
@ -3330,7 +3325,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", fcn_name);
HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", FUNC);
}
if ( ( H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0 ) ||
@ -3352,7 +3347,7 @@ check_file_mdc_api_errs(void)
if ( show_progress ) {
HDfprintf(stdout, "%s: cleaning up from tests.\n", fcn_name);
HDfprintf(stdout, "%s: cleaning up from tests.\n", FUNC);
}
if ( H5Fclose(file_id) < 0 ) {
@ -3371,7 +3366,7 @@ check_file_mdc_api_errs(void)
if ( ! pass )
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
FUNC, failure_mssg);
return !pass;

View File

@ -2391,7 +2391,6 @@ H5F_t *
setup_cache(size_t max_cache_size,
size_t min_clean_size)
{
const char * fcn_name = "setup_cache()";
char filename[512];
hbool_t show_progress = FALSE;
hbool_t verbose = TRUE;
@ -2405,7 +2404,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 1 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
saved_fid = -1;
@ -2422,7 +2421,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 2 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
if ( ( pass ) && ( try_core_file_driver ) ) {
@ -2444,7 +2443,7 @@ setup_cache(size_t max_cache_size,
core_file_driver_failed = TRUE;
if ( verbose ) {
HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", fcn_name);
HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC);
}
} else {
@ -2455,7 +2454,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 3 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
/* if we either aren't using the core file driver, or a create
* with the core file driver failed, try again with a regular file.
@ -2473,14 +2472,14 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5Fcreate() failed.";
if ( verbose ) {
HDfprintf(stdout, "%s: H5Fcreate() failed.\n", fcn_name);
HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC);
}
}
}
if ( show_progress ) /* 4 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
if ( pass ) {
@ -2494,7 +2493,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5Fflush() failed.";
if ( verbose ) {
HDfprintf(stdout, "%s: H5Fflush() failed.\n", fcn_name);
HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
}
} else {
@ -2507,7 +2506,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "Can't get file_ptr.";
if ( verbose ) {
HDfprintf(stdout, "%s: H5Fflush() failed.\n", fcn_name);
HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC);
}
}
}
@ -2515,7 +2514,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 5 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
if ( pass ) {
@ -2567,7 +2566,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 6 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
if ( pass ) {
@ -2577,7 +2576,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5C_create() failed.";
if ( verbose ) {
HDfprintf(stdout, "%s: H5C_create() failed.\n", fcn_name);
HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC);
}
} else if ( cache_ptr->magic != H5C__H5C_T_MAGIC ) {
@ -2586,14 +2585,14 @@ setup_cache(size_t max_cache_size,
failure_mssg = "Bad cache_ptr magic.";
if ( verbose ) {
HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", fcn_name);
HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC);
}
}
}
if ( show_progress ) /* 7 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
if ( pass ) { /* allocate space for test entries */
@ -2606,7 +2605,7 @@ setup_cache(size_t max_cache_size,
failure_mssg = "H5MF_alloc() failed.";
if ( verbose ) {
HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", fcn_name);
HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC);
}
} else if ( actual_base_addr > BASE_ADDR ) {
@ -2620,7 +2619,7 @@ setup_cache(size_t max_cache_size,
if ( verbose ) {
HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n",
fcn_name);
FUNC);
}
}
@ -2629,7 +2628,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 8 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
if ( pass ) {
@ -2642,7 +2641,7 @@ setup_cache(size_t max_cache_size,
if ( show_progress ) /* 9 */
HDfprintf(stdout, "%s() - %0d -- pass = %d\n",
fcn_name, mile_stone++, (int)pass);
FUNC, mile_stone++, (int)pass);
return(ret_val);
} /* setup_cache() */
@ -2762,7 +2761,6 @@ expunge_entry(H5F_t * file_ptr,
int32_t type,
int32_t idx)
{
/* const char * fcn_name = "expunge_entry()"; */
herr_t result;
test_entry_t * base_addr;
test_entry_t * entry_ptr;
@ -2825,7 +2823,6 @@ flush_cache(H5F_t * file_ptr,
hbool_t dump_stats,
hbool_t dump_detailed_stats)
{
const char * fcn_name = "flush_cache()";
hbool_t verbose = FALSE;
verify_unprotected();
@ -2861,7 +2858,7 @@ flush_cache(H5F_t * file_ptr,
if(verbose) {
HDfprintf(stdout,
"%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n",
fcn_name,
FUNC,
(long long)(cache_ptr->index_len),
(long long)(cache_ptr->index_size),
(long long)(cache_ptr->clean_index_size),
@ -3579,13 +3576,12 @@ row_major_scan_forward(H5F_t * file_ptr,
int dirty_destroys,
int dirty_unprotects)
{
const char * fcn_name = "row_major_scan_forward";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
if ( verbose )
HDfprintf(stdout, "%s(): entering.\n", fcn_name);
HDfprintf(stdout, "%s(): entering.\n", FUNC);
if ( pass ) {
@ -3871,8 +3867,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr,
hbool_t display_detailed_stats,
hbool_t do_inserts)
{
const char * fcn_name = "hl_row_major_scan_forward";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
int32_t i;
@ -3880,7 +3875,7 @@ hl_row_major_scan_forward(H5F_t * file_ptr,
int32_t local_max_index;
if ( verbose )
HDfprintf(stdout, "%s(): entering.\n", fcn_name);
HDfprintf(stdout, "%s(): entering.\n", FUNC);
if ( pass ) {
@ -3983,13 +3978,12 @@ row_major_scan_backward(H5F_t * file_ptr,
int dirty_destroys,
int dirty_unprotects)
{
const char * fcn_name = "row_major_scan_backward";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = NUMBER_OF_ENTRY_TYPES - 1;
int32_t idx;
if ( verbose )
HDfprintf(stdout, "%s(): Entering.\n", fcn_name);
HDfprintf(stdout, "%s(): Entering.\n", FUNC);
if ( pass ) {
@ -4269,8 +4263,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
hbool_t display_detailed_stats,
hbool_t do_inserts)
{
const char * fcn_name = "hl_row_major_scan_backward";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = NUMBER_OF_ENTRY_TYPES - 1;
int32_t idx;
int32_t i;
@ -4278,7 +4271,7 @@ hl_row_major_scan_backward(H5F_t * file_ptr,
int32_t local_max_index;
if ( verbose )
HDfprintf(stdout, "%s(): entering.\n", fcn_name);
HDfprintf(stdout, "%s(): entering.\n", FUNC);
if ( pass ) {
@ -4376,13 +4369,12 @@ col_major_scan_forward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
const char * fcn_name = "col_major_scan_forward()";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@ -4477,8 +4469,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
const char * fcn_name = "hl_col_major_scan_forward()";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
int32_t lag = 200;
@ -4486,7 +4477,7 @@ hl_col_major_scan_forward(H5F_t * file_ptr,
int32_t local_max_index;
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@ -4594,14 +4585,13 @@ col_major_scan_backward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
const char * fcn_name = "col_major_scan_backward()";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int mile_stone = 1;
int32_t type;
int32_t idx;
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@ -4620,7 +4610,7 @@ col_major_scan_backward(H5F_t * file_ptr,
idx = MAX_ENTRIES + lag;
if ( verbose ) /* 1 */
HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++);
HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++);
while ( ( pass ) && ( (idx + lag) >= 0 ) )
@ -4668,7 +4658,7 @@ col_major_scan_backward(H5F_t * file_ptr,
}
if ( verbose ) /* 2 */
HDfprintf(stdout, "%s: point %d.\n", fcn_name, mile_stone++);
HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++);
if ( ( pass ) && ( display_stats ) ) {
@ -4676,7 +4666,7 @@ col_major_scan_backward(H5F_t * file_ptr,
}
if ( verbose )
HDfprintf(stdout, "%s: exiting.\n", fcn_name);
HDfprintf(stdout, "%s: exiting.\n", FUNC);
return;
@ -4708,16 +4698,15 @@ hl_col_major_scan_backward(H5F_t * file_ptr,
hbool_t do_inserts,
int dirty_unprotects)
{
const char * fcn_name = "hl_col_major_scan_backward()";
H5C_t * cache_ptr;
H5C_t * cache_ptr = NULL;
int32_t type = 0;
int32_t idx;
int32_t idx = -1;
int32_t lag = 50;
int32_t i;
int32_t local_max_index;
int32_t local_max_index = -1;
if ( verbose )
HDfprintf(stdout, "%s: entering.\n", fcn_name);
HDfprintf(stdout, "%s: entering.\n", FUNC);
if ( pass ) {
@ -5101,7 +5090,7 @@ check_and_validate_cache_hit_rate(hid_t file_id,
pass = FALSE;
failure_mssg = "H5Fget_mdc_hit_rate() failed.";
} else if ( ! DBL_REL_EQUAL(hit_rate, expected_hit_rate, 0.00001F) ) {
} else if ( ! H5_DBL_ABS_EQUAL(hit_rate, expected_hit_rate) ) {
pass = FALSE;
failure_mssg = "unexpected hit rate.";
@ -5294,7 +5283,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(compare_init && (a->initial_size != b->initial_size))
return(FALSE);
else if(HDfabs(a->min_clean_fraction - b->min_clean_fraction) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->min_clean_fraction, b->min_clean_fraction))
return(FALSE);
else if(a->max_size != b->max_size)
return(FALSE);
@ -5304,9 +5293,9 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(a->incr_mode != b->incr_mode)
return(FALSE);
else if(HDfabs(a->lower_hr_threshold - b->lower_hr_threshold) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->lower_hr_threshold, b->lower_hr_threshold))
return(FALSE);
else if(HDfabs(a->increment - b->increment) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->increment, b->increment))
return(FALSE);
else if(a->apply_max_increment != b->apply_max_increment)
return(FALSE);
@ -5314,15 +5303,15 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(a->flash_incr_mode != b->flash_incr_mode)
return(FALSE);
else if(HDfabs(a->flash_multiple - b->flash_multiple) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->flash_multiple, b->flash_multiple))
return(FALSE);
else if(HDfabs(a->flash_threshold - b->flash_threshold) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->flash_threshold, b->flash_threshold))
return(FALSE);
else if(a->decr_mode != b->decr_mode)
return(FALSE);
else if(HDfabs(a->upper_hr_threshold - b->upper_hr_threshold) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->upper_hr_threshold, b->upper_hr_threshold))
return(FALSE);
else if(HDfabs(a->decrement - b->decrement) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->decrement, b->decrement))
return(FALSE);
else if(a->apply_max_decrement != b->apply_max_decrement)
return(FALSE);
@ -5332,7 +5321,7 @@ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
return(FALSE);
else if(a->apply_empty_reserve != b->apply_empty_reserve)
return(FALSE);
else if(HDfabs(a->empty_reserve - b->empty_reserve) > FP_EPSILON)
else if(!H5_DBL_ABS_EQUAL(a->empty_reserve, b->empty_reserve))
return(FALSE);
return(TRUE);
}

View File

@ -425,26 +425,26 @@ if ( ( (cache_ptr) == NULL ) || \
( (a).set_initial_size == (b).set_initial_size ) ) && \
( ( ! cmp_init_size ) || \
( (a).initial_size == (b).initial_size ) ) && \
( DBL_REL_EQUAL((a).min_clean_fraction, (b).min_clean_fraction, 0.00001 ) ) && \
( H5_DBL_ABS_EQUAL((a).min_clean_fraction, (b).min_clean_fraction) ) && \
( (a).max_size == (b).max_size ) && \
( (a).min_size == (b).min_size ) && \
( (a).epoch_length == (b).epoch_length ) && \
( (a).incr_mode == (b).incr_mode ) && \
( DBL_REL_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold, 0.00001 ) ) && \
( DBL_REL_EQUAL((a).increment, (b).increment, 0.00001 ) ) && \
( H5_DBL_ABS_EQUAL((a).lower_hr_threshold, (b).lower_hr_threshold) ) && \
( H5_DBL_ABS_EQUAL((a).increment, (b).increment) ) && \
( (a).apply_max_increment == (b).apply_max_increment ) && \
( (a).max_increment == (b).max_increment ) && \
( (a).flash_incr_mode == (b).flash_incr_mode ) && \
( DBL_REL_EQUAL((a).flash_multiple, (b).flash_multiple, 0.00001 ) ) && \
( DBL_REL_EQUAL((a).flash_threshold, (b).flash_threshold, 0.00001 ) ) && \
( H5_DBL_ABS_EQUAL((a).flash_multiple, (b).flash_multiple) ) && \
( H5_DBL_ABS_EQUAL((a).flash_threshold, (b).flash_threshold) ) && \
( (a).decr_mode == (b).decr_mode ) && \
( DBL_REL_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold, 0.00001 ) ) && \
( DBL_REL_EQUAL((a).decrement, (b).decrement, 0.00001 ) ) && \
( H5_DBL_ABS_EQUAL((a).upper_hr_threshold, (b).upper_hr_threshold) ) && \
( H5_DBL_ABS_EQUAL((a).decrement, (b).decrement) ) && \
( (a).apply_max_decrement == (b).apply_max_decrement ) && \
( (a).max_decrement == (b).max_decrement ) && \
( (a).epochs_before_eviction == (b).epochs_before_eviction ) && \
( (a).apply_empty_reserve == (b).apply_empty_reserve ) && \
( DBL_REL_EQUAL((a).empty_reserve, (b).empty_reserve, 0.00001 ) ) && \
( H5_DBL_ABS_EQUAL((a).empty_reserve, (b).empty_reserve) ) && \
( (a).dirty_bytes_threshold == (b).dirty_bytes_threshold ) && \
( (a).metadata_write_strategy == (b).metadata_write_strategy ) )
@ -482,9 +482,6 @@ if ( ( (cache_ptr) == NULL ) || \
(i).empty_reserve = (e).empty_reserve; \
}
/* Epsilon for floating-point comparisons */
#define FP_EPSILON 0.000001f
/* misc type definitions */

View File

@ -1285,16 +1285,16 @@ compare_data(void *src_data, void *dst_data, hbool_t src_subset)
s_ptr->c[3] != d_ptr->c[3] ||
s_ptr->d != d_ptr->d ||
s_ptr->e != d_ptr->e ||
!FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) ||
!FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) ||
!FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) ||
!FLT_ABS_EQUAL(s_ptr->h[1], d_ptr->h[1]) ||
!FLT_ABS_EQUAL(s_ptr->i, d_ptr->i) ||
!FLT_ABS_EQUAL(s_ptr->j, d_ptr->j) ||
!DBL_ABS_EQUAL(s_ptr->k, d_ptr->k) ||
!DBL_ABS_EQUAL(s_ptr->l, d_ptr->l) ||
!DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) ||
!DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) {
!H5_FLT_ABS_EQUAL(s_ptr->f, d_ptr->f) ||
!H5_FLT_ABS_EQUAL(s_ptr->g, d_ptr->g) ||
!H5_FLT_ABS_EQUAL(s_ptr->h[0], d_ptr->h[0]) ||
!H5_FLT_ABS_EQUAL(s_ptr->h[1], d_ptr->h[1]) ||
!H5_FLT_ABS_EQUAL(s_ptr->i, d_ptr->i) ||
!H5_FLT_ABS_EQUAL(s_ptr->j, d_ptr->j) ||
!H5_DBL_ABS_EQUAL(s_ptr->k, d_ptr->k) ||
!H5_DBL_ABS_EQUAL(s_ptr->l, d_ptr->l) ||
!H5_DBL_ABS_EQUAL(s_ptr->m, d_ptr->m) ||
!H5_DBL_ABS_EQUAL(s_ptr->n, d_ptr->n) ) {
H5_FAILED();
printf(" i=%d\n", i);

View File

@ -126,7 +126,7 @@ static int check_data(const char *dsetname, hid_t fid, hbool_t floating_number)
/* Check results */
for (j=0; j<(NX+1); j++) {
for (i=0; i<NY; i++) {
if (!DBL_REL_EQUAL(data_out[j][i], data_in[j][i], 0.001F)) {
if (!H5_DBL_REL_EQUAL(data_out[j][i], data_in[j][i], 0.001F)) {
if (!nerrors++) {
H5_FAILED();
printf("element [%d][%d] is %g but should have been %g\n",

View File

@ -5819,7 +5819,7 @@ test_set_local(hid_t fapl)
for(j=0; j<dims[1]; j++) {
/* If the difference between two values is greater than 0.001%, they're
* considered not equal. */
if(!DBL_REL_EQUAL(points_dbl[i][j],check_dbl[i][j],0.00001F)) {
if(!H5_DBL_REL_EQUAL(points_dbl[i][j],check_dbl[i][j],0.00001F)) {
H5_FAILED();
printf(" Line %d: Read different values than written.\n",__LINE__);
printf(" At index %lu,%lu\n", (unsigned long)(i), (unsigned long)(j));
@ -7127,7 +7127,7 @@ test_chunk_cache(hid_t fapl)
*/
if (H5Pget_cache(fapl_def, NULL, &nslots_1, &nbytes_1, &w0_1) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl1, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_1 != nslots_4) || (nbytes_1 != nbytes_4) || !DBL_ABS_EQUAL(w0_1, w0_4))
if ((nslots_1 != nslots_4) || (nbytes_1 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_1, w0_4))
FAIL_PUTS_ERROR(" Cache values from default dapl do not match those from fapl.")
/* Set a lapl property on dapl1 (to verify inheritance) */
@ -7168,7 +7168,7 @@ test_chunk_cache(hid_t fapl)
/* Retrieve dapl from dataset, verfiy cache values are the same as on fapl_local */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@ -7190,7 +7190,7 @@ test_chunk_cache(hid_t fapl)
*/
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from dapl1.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@ -7201,7 +7201,7 @@ test_chunk_cache(hid_t fapl)
/* Retrieve dapl from dataset, verfiy cache values are the same on fapl_local */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@ -7211,7 +7211,7 @@ test_chunk_cache(hid_t fapl)
FAIL_STACK_ERROR
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
/* Don't close dapl2, we will use it in the next section */
@ -7231,7 +7231,7 @@ test_chunk_cache(hid_t fapl)
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR /* Close dapl2, to avoid id leak */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_2, w0_4))
if ((nslots_2 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_2, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from dapl2.")
/* Test H5D_CHUNK_CACHE_NSLOTS_DEFAULT and H5D_CHUNK_CACHE_W0_DEFAULT */
@ -7244,7 +7244,7 @@ test_chunk_cache(hid_t fapl)
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR /* Close dapl2, to avoid id leak */
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
if ((nslots_3 != nslots_4) || (nbytes_2 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those expected.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
@ -7254,14 +7254,14 @@ test_chunk_cache(hid_t fapl)
if ((dsid = H5Oopen(fid, "dset", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR
if ((dapl2 = H5Dget_access_plist(dsid)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_3 != nslots_4) || (nbytes_3 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
if ((nslots_3 != nslots_4) || (nbytes_3 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from retrieved dapl do not match those from fapl.")
if (H5Pclose(dapl2) < 0) FAIL_STACK_ERROR
/* Verify functionality of H5Pcopy with a dapl */
if ((dapl2 = H5Pcopy(dapl1)) < 0) FAIL_STACK_ERROR
if (H5Pget_chunk_cache(dapl2, &nslots_4, &nbytes_4, &w0_4) < 0) FAIL_STACK_ERROR
if ((nslots_3 != nslots_4) || (nbytes_1 != nbytes_4) || !DBL_ABS_EQUAL(w0_3, w0_4))
if ((nslots_3 != nslots_4) || (nbytes_1 != nbytes_4) || !H5_DBL_ABS_EQUAL(w0_3, w0_4))
FAIL_PUTS_ERROR(" Cache values from dapl2 do not match those from dapl1.")
/* Close */

View File

@ -118,24 +118,6 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */
#define ALARM_ON TestAlarmOn()
#define ALARM_OFF HDalarm(0)
/*
* The methods to compare the equality of floating-point values:
* 1. XXX_ABS_EQUAL - check if the difference is smaller than the
* Epsilon value. The Epsilon values, FLT_EPSILON, DBL_EPSILON,
* and LDBL_EPSILON, are defined by compiler in float.h.
* 2. XXX_REL_EQUAL - check if the relative difference is smaller than a
* predefined value M. See if two values are relatively equal.
* It's the test's responsibility not to pass in the value 0, which
* may cause the equation to fail.
*/
#define FLT_ABS_EQUAL(X,Y) ((float)fabs(X-Y)<FLT_EPSILON)
#define DBL_ABS_EQUAL(X,Y) (fabs(X-Y)<DBL_EPSILON)
#define LDBL_ABS_EQUAL(X,Y) (fabsl(X-Y)<LDBL_EPSILON)
#define FLT_REL_EQUAL(X,Y,M) (fabsf((Y-X)/X<M)
#define DBL_REL_EQUAL(X,Y,M) (fabs((Y-X)/X)<M)
#define LDBL_REL_EQUAL(X,Y,M) (fabsl((Y-X)/X)<M)
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -644,7 +644,7 @@ test_multifill(size_t nx)
for(i = 0; i < nx; i++) {
if(dst[i].left != 3333333)
sprintf(s, "bad dst[%lu].left", (unsigned long)i);
else if(!DBL_ABS_EQUAL(dst[i].mid, fill.mid))
else if(!H5_DBL_ABS_EQUAL(dst[i].mid, fill.mid))
/* Check if two DOUBLE values are equal. If their difference
* is smaller than the EPSILON value for double, they are
* considered equal. See the definition in h5test.h.

View File

@ -685,7 +685,7 @@ test_array_compound_atomic(void)
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].i=%d, rdata[%d][%d].i=%d\n", (int)i, (int)j, (int)wdata[i][j].i, (int)i, (int)j, (int)rdata[i][j].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(wdata[i][j].f, rdata[i][j].f)) {
if(!H5_FLT_ABS_EQUAL(wdata[i][j].f, rdata[i][j].f)) {
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f=%f, rdata[%d][%d].f=%f\n", (int)i, (int)j, (double)wdata[i][j].f, (int)i, (int)j, (double)rdata[i][j].f);
continue;
} /* end if */
@ -928,7 +928,7 @@ test_array_compound_array(void)
continue;
} /* end if */
for(k=0; k<ARRAY1_DIM1; k++)
if(!FLT_ABS_EQUAL(wdata[i][j].f[k],rdata[i][j].f[k])) {
if(!H5_FLT_ABS_EQUAL(wdata[i][j].f[k],rdata[i][j].f[k])) {
TestErrPrintf("Array data information doesn't match!, wdata[%d][%d].f[%d]=%f, rdata[%d][%d].f[%d]=%f\n",(int)i,(int)j,(int)k,(double)wdata[i][j].f[k],(int)i,(int)j,(int)k,(double)rdata[i][j].f[k]);
continue;
} /* end if */
@ -1618,11 +1618,11 @@ test_array_bkg(void)
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
}
if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
if(!H5_FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]);
continue;
}
if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
if(!H5_DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]);
continue;
}
@ -1685,7 +1685,7 @@ test_array_bkg(void)
for (i=0; i< LENGTH; i++)
for (j = 0; j < ALEN; j++)
if(!FLT_ABS_EQUAL(fld[i].b[j],fldr[i].b[j])) {
if(!H5_FLT_ABS_EQUAL(fld[i].b[j],fldr[i].b[j])) {
TestErrPrintf("Field data doesn't match, fld[%d].b[%d]=%f, fldr[%d].b[%d]=%f\n",(int)i,(int)j,(double)fld[i].b[j],(int)i,(int)j,(double)fldr[i].b[j]);
continue;
}
@ -1711,11 +1711,11 @@ test_array_bkg(void)
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
}
if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
if(!H5_FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]);
continue;
}
if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
if(!H5_DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]);
continue;
}
@ -1760,11 +1760,11 @@ test_array_bkg(void)
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
}
if(!FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
if(!H5_FLT_ABS_EQUAL(cf[i].b[j],cfr[i].b[j])) {
TestErrPrintf("Field b data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].b[j],(int)i,(int)j,(double)cfr[i].b[j]);
continue;
}
if(!DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
if(!H5_DBL_ABS_EQUAL(cf[i].c[j],cfr[i].c[j])) {
TestErrPrintf("Field c data doesn't match, cf[%d].b[%d]=%f, cfr[%d].b[%d]=%f\n",(int)i,(int)j,(double)cf[i].c[j],(int)i,(int)j,(double)cfr[i].c[j]);
continue;
}

View File

@ -522,7 +522,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
if(!DBL_ABS_EQUAL(rdata,0.0F))
if(!H5_DBL_ABS_EQUAL(rdata,0.0F))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Fflush(fil, H5F_SCOPE_GLOBAL);
@ -531,7 +531,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
if(!DBL_ABS_EQUAL(rdata,0.0F))
if(!H5_DBL_ABS_EQUAL(rdata,0.0F))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,(double)0.0F);
ret=H5Awrite(att, H5T_NATIVE_DOUBLE, &wdata);
@ -540,7 +540,7 @@ test_attr_flush(hid_t fapl)
ret=H5Aread(att, H5T_NATIVE_DOUBLE, &rdata);
CHECK(ret, FAIL, "H5Awrite");
if(!DBL_ABS_EQUAL(rdata,wdata))
if(!H5_DBL_ABS_EQUAL(rdata,wdata))
TestErrPrintf("attribute value wrong: rdata=%f, should be %f\n",rdata,wdata);
ret=H5Sclose(spc);
@ -1014,7 +1014,7 @@ test_attr_scalar_read(hid_t fapl)
CHECK(ret, FAIL, "H5Aread");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(rdata, attr_data5))
if(!H5_FLT_ABS_EQUAL(rdata, attr_data5))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Aread", (double)attr_data5, (double)rdata, (int)__LINE__, __FILE__);
@ -1355,7 +1355,7 @@ test_attr_mult_read(hid_t fapl)
for(i = 0; i < ATTR3_DIM1; i++)
for(j = 0; j < ATTR3_DIM2; j++)
for(k = 0; k < ATTR3_DIM3; k++)
if(!DBL_ABS_EQUAL(attr_data3[i][j][k], read_data3[i][j][k]))
if(!H5_DBL_ABS_EQUAL(attr_data3[i][j][k], read_data3[i][j][k]))
TestErrPrintf("%d: attribute data different: attr_data3[%d][%d][%d]=%f, read_data3[%d][%d][%d]=%f\n", __LINE__, i, j, k, attr_data3[i][j][k], i, j, k, read_data3[i][j][k]);
/* Verify Name */

View File

@ -681,7 +681,7 @@ test_genprop_basic_list(void)
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@ -773,7 +773,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@ -786,7 +786,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
@ -823,7 +823,7 @@ test_genprop_basic_list_prop(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);
@ -1237,7 +1237,7 @@ test_genprop_list_callback(void)
ret = H5Pget(lid1, PROP2_NAME,&prop2_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
if(!H5_FLT_ABS_EQUAL(prop2_value,*PROP2_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", (double)*PROP2_DEF_VALUE, (double)prop2_value, (int)__LINE__, __FILE__);
@ -1252,7 +1252,7 @@ test_genprop_list_callback(void)
ret = H5Pget(lid1, PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
/* Verify the floating-poing value in this way to avoid compiler warning. */
if(!FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
if(!H5_FLT_ABS_EQUAL(prop4_value,*PROP4_DEF_VALUE))
printf("*** UNEXPECTED VALUE from %s should be %f, but is %f at line %4d in %s\n",
"H5Pget", *PROP4_DEF_VALUE, prop4_value, (int)__LINE__, __FILE__);

View File

@ -1683,7 +1683,7 @@ test_h5s_chunk(void)
for(i=0; i<50000; i++) {
for(j=0; j<3; j++) {
/* Check if the two values are within 0.001% range. */
if(!DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F))
if(!H5_DBL_REL_EQUAL(chunk_data_dbl[i][j], chunk_data_flt[i][j], 0.00001F))
TestErrPrintf("%u: chunk_data_dbl[%d][%d]=%e, chunk_data_flt[%d][%d]=%e\n", (unsigned)__LINE__, i, j, chunk_data_dbl[i][j], i, j, (double)chunk_data_flt[i][j]);
} /* end for */
} /* end for */

View File

@ -2486,7 +2486,7 @@ test_misc14(void)
/* Check data from first dataset */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata, data1))
if(!H5_DBL_ABS_EQUAL(rdata, data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Unlink second dataset */
@ -2500,7 +2500,7 @@ test_misc14(void)
/* Verify the data from dataset #1 */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data1))
if(!H5_DBL_ABS_EQUAL(rdata,data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Close first dataset */
@ -2534,7 +2534,7 @@ test_misc14(void)
/* Check data from second dataset */
ret = H5Dread(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data2))
if(!H5_DBL_ABS_EQUAL(rdata,data2))
TestErrPrintf("Error on line %d: data2!=rdata\n",__LINE__);
/* Unlink first dataset */
@ -2548,7 +2548,7 @@ test_misc14(void)
/* Verify the data from dataset #2 */
ret = H5Dread(Dataset2, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data2))
if(!H5_DBL_ABS_EQUAL(rdata,data2))
TestErrPrintf("Error on line %d: data2!=rdata\n",__LINE__);
/* Close second dataset */
@ -2589,13 +2589,13 @@ test_misc14(void)
/* Check data from first dataset */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data1))
if(!H5_DBL_ABS_EQUAL(rdata,data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Check data from third dataset */
ret = H5Dread(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data3))
if(!H5_DBL_ABS_EQUAL(rdata,data3))
TestErrPrintf("Error on line %d: data3!=rdata\n",__LINE__);
/* Unlink second dataset */
@ -2609,13 +2609,13 @@ test_misc14(void)
/* Verify the data from dataset #1 */
ret = H5Dread(Dataset1, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data1))
if(!H5_DBL_ABS_EQUAL(rdata,data1))
TestErrPrintf("Error on line %d: data1!=rdata\n",__LINE__);
/* Verify the data from dataset #3 */
ret = H5Dread(Dataset3, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &rdata);
CHECK(ret, FAIL, "H5Dread");
if(!DBL_ABS_EQUAL(rdata,data3))
if(!H5_DBL_ABS_EQUAL(rdata,data3))
TestErrPrintf("Error on line %d: data3!=rdata\n",__LINE__);
/* Close first dataset */

View File

@ -798,7 +798,7 @@ test_vltypes_vlen_compound(void)
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].i=%d, rdata[%d].p[%d].i=%d\n",(int)i,(int)j, (int)((s1 *)wdata[i].p)[j].i, (int)i,(int)j, (int)((s1 *)rdata[i].p)[j].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
if(!H5_FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].f=%f, rdata[%d].p[%d].f=%f\n",(int)i,(int)j, (double)((s1 *)wdata[i].p)[j].f, (int)i,(int)j, (double)((s1 *)rdata[i].p)[j].f);
continue;
} /* end if */
@ -943,7 +943,7 @@ rewrite_vltypes_vlen_compound(void)
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].i=%d, rdata[%d].p[%d].i=%d\n",(int)i,(int)j, (int)((s1 *)wdata[i].p)[j].i, (int)i,(int)j, (int)((s1 *)rdata[i].p)[j].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
if(!H5_FLT_ABS_EQUAL(((s1 *)wdata[i].p)[j].f,((s1 *)rdata[i].p)[j].f)) {
TestErrPrintf("VL data values don't match!, wdata[%d].p[%d].f=%f, rdata[%d].p[%d].f=%f\n",(int)i,(int)j, (double)((s1 *)wdata[i].p)[j].f, (int)i,(int)j, (double)((s1 *)rdata[i].p)[j].f);
continue;
} /* end if */
@ -1092,7 +1092,7 @@ test_vltypes_compound_vlen_vlen(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
@ -1546,7 +1546,7 @@ test_vltypes_compound_vlen_atomic(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
@ -1595,7 +1595,7 @@ test_vltypes_compound_vlen_atomic(void)
/* Check data read in */
for(i = 0; i < SPACE1_DIM1; i++)
if(rdata[i].i != 0 || !FLT_ABS_EQUAL(rdata[i].f, 0.0F) || rdata[i].v.len != 0 || rdata[i].v.p != NULL)
if(rdata[i].i != 0 || !H5_FLT_ABS_EQUAL(rdata[i].f, 0.0F) || rdata[i].v.len != 0 || rdata[i].v.p != NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,(double)rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p);
/* Write dataset to disk */
@ -1612,7 +1612,7 @@ test_vltypes_compound_vlen_atomic(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */
@ -1764,7 +1764,7 @@ rewrite_vltypes_compound_vlen_atomic(void)
TestErrPrintf("Integer components don't match!, wdata[%d].i=%d, rdata[%d].i=%d\n",(int)i,(int)wdata[i].i,(int)i,(int)rdata[i].i);
continue;
} /* end if */
if(!FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
if(!H5_FLT_ABS_EQUAL(wdata[i].f,rdata[i].f)) {
TestErrPrintf("Float components don't match!, wdata[%d].f=%f, rdata[%d].f=%f\n",(int)i,(double)wdata[i].f,(int)i,(double)rdata[i].f);
continue;
} /* end if */

File diff suppressed because it is too large Load Diff