summaryrefslogtreecommitdiffstats
path: root/testpar/t_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'testpar/t_cache.c')
-rw-r--r--testpar/t_cache.c62
1 files changed, 30 insertions, 32 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index cde19fe..954071d 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -28,7 +28,7 @@
#include "H5Fpkg.h"
#include "H5Iprivate.h"
#include "H5MFprivate.h"
-
+#include "H5private.h"
#define BASE_ADDR (haddr_t)1024
@@ -38,7 +38,6 @@ int failures = 0;
hbool_t verbose = TRUE; /* used to control error messages */
#define NFILENAME 2
-#define PARATESTFILE filenames[0]
const char *FILENAME[NFILENAME]={"CacheTestDummy", NULL};
#ifndef PATH_MAX
#define PATH_MAX 512
@@ -219,7 +218,9 @@ struct datum data[NUM_DATA_ENTRIES];
#define STD_VIRT_NUM_DATA_ENTRIES NUM_DATA_ENTRIES
#define EXPRESS_VIRT_NUM_DATA_ENTRIES (NUM_DATA_ENTRIES / 10)
/* Use a smaller test size to avoid creating huge MPE logfiles. */
+#ifdef H5_HAVE_MPE
#define MPE_VIRT_NUM_DATA_ENTIES (NUM_DATA_ENTRIES / 100)
+#endif
int virt_num_data_entries = NUM_DATA_ENTRIES;
@@ -1618,9 +1619,9 @@ serve_read_request(struct mssg_t * mssg_ptr)
reply.dest = mssg_ptr->src;
reply.mssg_num = -1; /* set by send function */
reply.base_addr = data[target_index].base_addr;
- reply.len = data[target_index].len;
+ H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t);
reply.ver = data[target_index].ver;
- reply.count = 0;
+ reply.count = 0;
reply.magic = MSSG_MAGIC;
/* and update the counters */
@@ -1761,7 +1762,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
hbool_t report_mssg = FALSE;
hbool_t success = TRUE;
int target_index;
- int new_ver_num;
+ int new_ver_num = 0;
haddr_t target_addr;
#if DO_WRITE_REQ_ACK
struct mssg_t reply;
@@ -1840,7 +1841,7 @@ serve_write_request(struct mssg_t * mssg_ptr)
reply.dest = mssg_ptr->src;
reply.mssg_num = -1; /* set by send function */
reply.base_addr = data[target_index].base_addr;
- reply.len = data[target_index].len;
+ H5_CHECKED_ASSIGN(reply.len, unsigned, data[target_index].len, size_t);
reply.ver = data[target_index].ver;
reply.count = 0;
reply.magic = MSSG_MAGIC;
@@ -1926,7 +1927,7 @@ serve_total_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = total_writes;
+ reply.count = (unsigned)total_writes;
reply.magic = MSSG_MAGIC;
}
@@ -2005,7 +2006,7 @@ serve_total_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = 0;
reply.len = 0;
reply.ver = 0;
- reply.count = total_reads;
+ reply.count = (unsigned)total_reads;
reply.magic = MSSG_MAGIC;
}
@@ -2099,7 +2100,7 @@ serve_entry_writes_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = data[target_index].writes;
+ reply.count = (unsigned)data[target_index].writes;
reply.magic = MSSG_MAGIC;
}
}
@@ -2196,7 +2197,7 @@ serve_entry_reads_request(struct mssg_t * mssg_ptr)
reply.base_addr = target_addr;
reply.len = 0;
reply.ver = 0;
- reply.count = (long)(data[target_index].reads);
+ reply.count = (unsigned)(data[target_index].reads);
reply.magic = MSSG_MAGIC;
}
}
@@ -2378,7 +2379,7 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr)
*-------------------------------------------------------------------------
*/
static void *
-datum_deserialize(const void * image_ptr,
+datum_deserialize(const void H5_ATTR_NDEBUG_UNUSED *image_ptr,
H5_ATTR_UNUSED size_t len,
void * udata_ptr,
hbool_t * dirty_ptr)
@@ -2491,14 +2492,13 @@ datum_image_len(const void *thing, size_t *image_len)
*/
static herr_t
datum_serialize(const H5F_t *f,
- void *image_ptr,
+ void H5_ATTR_NDEBUG_UNUSED *image_ptr,
size_t len,
void *thing_ptr)
{
herr_t ret_value = SUCCEED;
int idx;
struct datum * entry_ptr;
- H5C_t * cache_ptr;
struct H5AC_aux_t * aux_ptr;
HDassert( thing_ptr );
@@ -2509,11 +2509,8 @@ datum_serialize(const H5F_t *f,
HDassert( f );
HDassert( f->shared );
HDassert( f->shared->cache );
-
- cache_ptr = f->shared->cache;
-
- HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( cache_ptr->aux_ptr );
+ HDassert( f->shared->cache->magic == H5C__H5C_T_MAGIC );
+ HDassert( f->shared->cache->aux_ptr );
aux_ptr = (H5AC_aux_t *)(f->shared->cache->aux_ptr);
@@ -2636,7 +2633,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = entry_ptr->base_addr;
- mssg.len = entry_ptr->len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
mssg.ver = 0; /* bogus -- should be corrected by server */
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
@@ -2792,7 +2789,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = entry_ptr->base_addr;
- mssg.len = entry_ptr->len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, entry_ptr->len, size_t);
mssg.ver = entry_ptr->ver;
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -4612,7 +4609,7 @@ verify_entry_reads(haddr_t addr,
int expected_entry_reads)
{
hbool_t success = TRUE;
- int reported_entry_reads;
+ int reported_entry_reads = 0;
struct mssg_t mssg;
if ( success ) {
@@ -4670,11 +4667,11 @@ verify_entry_reads(haddr_t addr,
}
} else {
- reported_entry_reads = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_reads, int, mssg.count, unsigned);
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_reads != expected_entry_reads ) {
@@ -4719,7 +4716,7 @@ verify_entry_writes(haddr_t addr,
int expected_entry_writes)
{
hbool_t success = TRUE;
- int reported_entry_writes;
+ int reported_entry_writes = 0;
struct mssg_t mssg;
if ( success ) {
@@ -4777,11 +4774,11 @@ verify_entry_writes(haddr_t addr,
}
} else {
- reported_entry_writes = mssg.count;
+ H5_CHECKED_ASSIGN(reported_entry_writes, int, mssg.count, unsigned);
}
}
- if ( ! success ) {
+ if ( success ) {
if ( reported_entry_writes != expected_entry_writes ) {
@@ -5233,7 +5230,7 @@ server_smoke_check(void)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = data[world_mpi_rank].base_addr;
- mssg.len = data[world_mpi_rank].len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t);
mssg.ver = ++(data[world_mpi_rank].ver);
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -5338,7 +5335,7 @@ server_smoke_check(void)
mssg.dest = world_server_mpi_rank;
mssg.mssg_num = -1; /* set by send function */
mssg.base_addr = data[world_mpi_rank].base_addr;
- mssg.len = data[world_mpi_rank].len;
+ H5_CHECKED_ASSIGN(mssg.len, unsigned, data[world_mpi_rank].len, size_t);
mssg.ver = 0; /* bogus -- should be corrected by server */
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
@@ -7268,7 +7265,8 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ H5_CHECK_OVERFLOW(cache_ptr->max_cache_size, size_t, double);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* insert the other half independently */
@@ -7289,7 +7287,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* flush the file */
@@ -7319,7 +7317,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
/* protect the other half independently */
@@ -7340,7 +7338,7 @@ smoke_check_6(int metadata_write_strategy)
}
/* Make sure coll entries do not cross the 80% threshold */
- HDassert(cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
+ HDassert((double)cache_ptr->max_cache_size*0.8 > cache_ptr->coll_list_size);
}
for ( i = 0; i < (virt_num_data_entries); i++ )