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.c848
1 files changed, 424 insertions, 424 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c
index 0d18851..3659b2b 100644
--- a/testpar/t_cache.c
+++ b/testpar/t_cache.c
@@ -31,9 +31,9 @@
#define BASE_ADDR (haddr_t)1024
-int nerrors = 0;
-int failures = 0;
-hbool_t verbose = TRUE; /* used to control error messages */
+int nerrors = 0;
+int failures = 0;
+bool verbose = true; /* used to control error messages */
#define NFILENAME 2
const char *FILENAME[NFILENAME] = {"CacheTestDummy", NULL};
@@ -41,15 +41,15 @@ const char *FILENAME[NFILENAME] = {"CacheTestDummy", NULL};
#define PATH_MAX 512
#endif /* !PATH_MAX */
char *filenames[NFILENAME];
-hid_t fapl; /* file access property list */
-haddr_t max_addr = 0; /* used to store the end of
- * the address space used by
- * the data array (see below).
- */
-hbool_t callbacks_verbose = FALSE; /* flag used to control whether
- * the callback functions are in
- * verbose mode.
- */
+hid_t fapl; /* file access property list */
+haddr_t max_addr = 0; /* used to store the end of
+ * the address space used by
+ * the data array (see below).
+ */
+bool callbacks_verbose = false; /* flag used to control whether
+ * the callback functions are in
+ * verbose mode.
+ */
int world_mpi_size = -1;
int world_mpi_rank = -1;
@@ -161,13 +161,13 @@ struct datum {
size_t len;
size_t local_len;
int ver;
- hbool_t dirty;
- hbool_t valid;
- hbool_t locked;
- hbool_t global_pinned;
- hbool_t local_pinned;
- hbool_t cleared;
- hbool_t flushed;
+ bool dirty;
+ bool valid;
+ bool locked;
+ bool global_pinned;
+ bool local_pinned;
+ bool cleared;
+ bool flushed;
int reads;
int writes;
int index;
@@ -234,7 +234,7 @@ int *data_index = NULL;
* reads and writes. Without some such mechanism, the test code contains
* race conditions that will frequently cause spurious failures.
*
- * When set to TRUE, DO_WRITE_REQ_ACK forces the server to send an ack after
+ * When set to true, DO_WRITE_REQ_ACK forces the server to send an ack after
* each write request, and the client to wait until the ack is received
* before proceeding. This was my first solution to the problem, and at
* first glance, it would seem to have a lot of unnecessary overhead.
@@ -251,13 +251,13 @@ int *data_index = NULL;
*
* Thus I have left code supporting the second solution in place.
*
- * Note that while one of these two #defines must be set to TRUE, there
- * should never be any need to set both of them to TRUE (although the
+ * Note that while one of these two #defines must be set to true, there
+ * should never be any need to set both of them to true (although the
* tests will still function with this setting).
*****************************************************************************/
-#define DO_WRITE_REQ_ACK TRUE
-#define DO_SYNC_AFTER_WRITE FALSE
+#define DO_WRITE_REQ_ACK true
+#define DO_SYNC_AFTER_WRITE false
/*****************************************************************************
* struct mssg
@@ -332,7 +332,7 @@ static void reset_stats(void);
/* MPI setup functions */
-static hbool_t set_up_file_communicator(void);
+static bool set_up_file_communicator(void);
/* data array manipulation functions */
@@ -347,29 +347,29 @@ static int get_max_nerrors(void);
/* mssg xfer related functions */
-static hbool_t recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset);
-static hbool_t send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag);
-static hbool_t setup_derived_types(void);
-static hbool_t takedown_derived_types(void);
+static bool recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset);
+static bool send_mssg(struct mssg_t *mssg_ptr, bool add_req_to_tag);
+static bool setup_derived_types(void);
+static bool takedown_derived_types(void);
/* server functions */
-static hbool_t reset_server_counters(void);
-static hbool_t server_main(void);
-static hbool_t serve_read_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_sync_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_write_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_total_writes_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_total_reads_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_entry_writes_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_entry_reads_request(struct mssg_t *mssg_ptr);
-static hbool_t serve_rw_count_reset_request(struct mssg_t *mssg_ptr);
+static bool reset_server_counters(void);
+static bool server_main(void);
+static bool serve_read_request(struct mssg_t *mssg_ptr);
+static bool serve_sync_request(struct mssg_t *mssg_ptr);
+static bool serve_write_request(struct mssg_t *mssg_ptr);
+static bool serve_total_writes_request(struct mssg_t *mssg_ptr);
+static bool serve_total_reads_request(struct mssg_t *mssg_ptr);
+static bool serve_entry_writes_request(struct mssg_t *mssg_ptr);
+static bool serve_entry_reads_request(struct mssg_t *mssg_ptr);
+static bool serve_rw_count_reset_request(struct mssg_t *mssg_ptr);
/* call back functions & related data structures */
static herr_t datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr);
-static void *datum_deserialize(const void *image_ptr, size_t len, void *udata_ptr, hbool_t *dirty_ptr);
+static void *datum_deserialize(const void *image_ptr, size_t len, void *udata_ptr, bool *dirty_ptr);
static herr_t datum_image_len(const void *thing, size_t *image_len_ptr);
@@ -417,45 +417,45 @@ const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = {{
/* test utility functions */
-static void expunge_entry(H5F_t *file_ptr, int32_t idx);
-static void insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags);
-static void local_pin_and_unpin_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, int min_count,
- int max_count);
-static void local_pin_random_entry(H5F_t *file_ptr, int min_idx, int max_idx);
-static void local_unpin_all_entries(H5F_t *file_ptr, hbool_t via_unprotect);
-static int local_unpin_next_pinned_entry(H5F_t *file_ptr, int start_idx, hbool_t via_unprotect);
-static void lock_and_unlock_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, int min_count,
- int max_count);
-static void lock_and_unlock_random_entry(H5F_t *file_ptr, int min_idx, int max_idx);
-static void lock_entry(H5F_t *file_ptr, int32_t idx);
-static void mark_entry_dirty(int32_t idx);
-static void pin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty);
-static void pin_protected_entry(int32_t idx, hbool_t global);
-static void move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx);
-static hbool_t reset_server_counts(void);
-static void resize_entry(int32_t idx, size_t new_size);
-static hbool_t setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr,
- int metadata_write_strategy);
-static void setup_rand(void);
-static hbool_t take_down_cache(hid_t fid, H5C_t *cache_ptr);
-static hbool_t verify_entry_reads(haddr_t addr, int expected_entry_reads);
-static hbool_t verify_entry_writes(haddr_t addr, int expected_entry_writes);
-static hbool_t verify_total_reads(int expected_total_reads);
-static hbool_t verify_total_writes(unsigned expected_total_writes);
-static void verify_writes(unsigned num_writes, haddr_t *written_entries_tbl);
-static void unlock_entry(H5F_t *file_ptr, int32_t type, unsigned int flags);
-static void unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t via_unprotect);
+static void expunge_entry(H5F_t *file_ptr, int32_t idx);
+static void insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags);
+static void local_pin_and_unpin_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, int min_count,
+ int max_count);
+static void local_pin_random_entry(H5F_t *file_ptr, int min_idx, int max_idx);
+static void local_unpin_all_entries(H5F_t *file_ptr, bool via_unprotect);
+static int local_unpin_next_pinned_entry(H5F_t *file_ptr, int start_idx, bool via_unprotect);
+static void lock_and_unlock_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, int min_count,
+ int max_count);
+static void lock_and_unlock_random_entry(H5F_t *file_ptr, int min_idx, int max_idx);
+static void lock_entry(H5F_t *file_ptr, int32_t idx);
+static void mark_entry_dirty(int32_t idx);
+static void pin_entry(H5F_t *file_ptr, int32_t idx, bool global, bool dirty);
+static void pin_protected_entry(int32_t idx, bool global);
+static void move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx);
+static bool reset_server_counts(void);
+static void resize_entry(int32_t idx, size_t new_size);
+static bool setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr,
+ int metadata_write_strategy);
+static void setup_rand(void);
+static bool take_down_cache(hid_t fid, H5C_t *cache_ptr);
+static bool verify_entry_reads(haddr_t addr, int expected_entry_reads);
+static bool verify_entry_writes(haddr_t addr, int expected_entry_writes);
+static bool verify_total_reads(int expected_total_reads);
+static bool verify_total_writes(unsigned expected_total_writes);
+static void verify_writes(unsigned num_writes, haddr_t *written_entries_tbl);
+static void unlock_entry(H5F_t *file_ptr, int32_t type, unsigned int flags);
+static void unpin_entry(H5F_t *file_ptr, int32_t idx, bool global, bool dirty, bool via_unprotect);
/* test functions */
-static hbool_t server_smoke_check(void);
-static hbool_t smoke_check_1(int metadata_write_strategy);
-static hbool_t smoke_check_2(int metadata_write_strategy);
-static hbool_t smoke_check_3(int metadata_write_strategy);
-static hbool_t smoke_check_4(int metadata_write_strategy);
-static hbool_t smoke_check_5(int metadata_write_strategy);
-static hbool_t smoke_check_6(int metadata_write_strategy);
-static hbool_t trace_file_check(int metadata_write_strategy);
+static bool server_smoke_check(void);
+static bool smoke_check_1(int metadata_write_strategy);
+static bool smoke_check_2(int metadata_write_strategy);
+static bool smoke_check_3(int metadata_write_strategy);
+static bool smoke_check_4(int metadata_write_strategy);
+static bool smoke_check_5(int metadata_write_strategy);
+static bool smoke_check_6(int metadata_write_strategy);
+static bool trace_file_check(int metadata_write_strategy);
/*****************************************************************************/
/****************************** stats functions ******************************/
@@ -529,16 +529,16 @@ reset_stats(void)
* Purpose: Create the MPI communicator used to open a HDF5 file with.
* In passing, also initialize the file_mpi... globals.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
set_up_file_communicator(void)
{
- hbool_t success = TRUE;
+ bool success = true;
int mpi_result;
int num_excluded_ranks;
int excluded_ranks[1];
@@ -552,7 +552,7 @@ set_up_file_communicator(void)
if (mpi_result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Comm_group() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
@@ -569,7 +569,7 @@ set_up_file_communicator(void)
if (mpi_result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Group_excl() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
@@ -584,7 +584,7 @@ set_up_file_communicator(void)
if (mpi_result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Comm_create() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
@@ -597,7 +597,7 @@ set_up_file_communicator(void)
if (file_mpi_comm == MPI_COMM_NULL) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: file_mpi_comm == MPI_COMM_NULL.\n", world_mpi_rank, __func__);
}
@@ -610,7 +610,7 @@ set_up_file_communicator(void)
if (file_mpi_comm != MPI_COMM_NULL) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: file_mpi_comm != MPI_COMM_NULL.\n", world_mpi_rank, __func__);
}
@@ -626,7 +626,7 @@ set_up_file_communicator(void)
if (mpi_result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Comm_size() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
@@ -641,7 +641,7 @@ set_up_file_communicator(void)
if (mpi_result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Comm_rank() failed with error %d.\n", world_mpi_rank, __func__,
mpi_result);
@@ -712,9 +712,9 @@ addr_to_datum_index(haddr_t base_addr)
* Purpose: Initialize the data array, from which cache entries are
* loaded.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
static void
@@ -743,13 +743,13 @@ init_data(void)
data[i].len = (size_t)(addr_offsets[j]);
data[i].local_len = (size_t)(addr_offsets[j]);
data[i].ver = 0;
- data[i].dirty = FALSE;
- data[i].valid = FALSE;
- data[i].locked = FALSE;
- data[i].global_pinned = FALSE;
- data[i].local_pinned = FALSE;
- data[i].cleared = FALSE;
- data[i].flushed = FALSE;
+ data[i].dirty = false;
+ data[i].valid = false;
+ data[i].locked = false;
+ data[i].global_pinned = false;
+ data[i].local_pinned = false;
+ data[i].cleared = false;
+ data[i].flushed = false;
data[i].reads = 0;
data[i].writes = 0;
data[i].index = i;
@@ -851,7 +851,7 @@ do_sync(void)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
if (verbose) {
@@ -928,18 +928,18 @@ get_max_nerrors(void)
* Purpose: Receive a message from any process in the provided instance
* of struct mssg.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
#define CACHE_TEST_TAG 99 /* different from any used by the library */
-static hbool_t
+static bool
recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
{
- hbool_t success = TRUE;
+ bool success = true;
int mssg_tag = CACHE_TEST_TAG;
int result;
MPI_Status status;
@@ -947,7 +947,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
if ((mssg_ptr == NULL) || (mssg_tag_offset < 0) || (mssg_tag_offset > MAX_REQ_CODE)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: bad param(s) on entry.\n", world_mpi_rank, __func__);
}
@@ -964,7 +964,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
if (result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Recv() failed.\n", world_mpi_rank, __func__);
}
@@ -972,7 +972,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
else if (mssg_ptr->magic != MSSG_MAGIC) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: invalid magic.\n", world_mpi_rank, __func__);
}
@@ -980,7 +980,7 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
else if (mssg_ptr->src != status.MPI_SOURCE) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: mssg_ptr->src != status.MPI_SOURCE.\n", world_mpi_rank, __func__);
}
@@ -1000,15 +1000,15 @@ recv_mssg(struct mssg_t *mssg_ptr, int mssg_tag_offset)
* Note that all source and destination ranks are in the
* global communicator.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
-send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag)
+static bool
+send_mssg(struct mssg_t *mssg_ptr, bool add_req_to_tag)
{
- hbool_t success = TRUE;
+ bool success = true;
int mssg_tag = CACHE_TEST_TAG;
int result;
static long mssg_num = 0;
@@ -1018,7 +1018,7 @@ send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag)
(mssg_ptr->req > MAX_REQ_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Invalid mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1038,7 +1038,7 @@ send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag)
if (result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Send() failed.\n", world_mpi_rank, __func__);
}
@@ -1056,15 +1056,15 @@ send_mssg(struct mssg_t *mssg_ptr, hbool_t add_req_to_tag)
* Purpose: Set up the derived types used by the test bed. At present,
* only the mpi_mssg derived type is needed.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
setup_derived_types(void)
{
- hbool_t success = TRUE;
+ bool success = true;
int i;
int result;
MPI_Datatype mpi_types[9] = {MPI_INT, MPI_INT, MPI_INT, MPI_LONG, HADDR_AS_MPI_TYPE,
@@ -1087,7 +1087,7 @@ setup_derived_types(void)
(MPI_SUCCESS != MPI_Get_address(&sample.magic, &displs[8]))) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Get_address() call failed.\n", world_mpi_rank, __func__);
}
@@ -1107,7 +1107,7 @@ setup_derived_types(void)
if (result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Type_create_struct() call failed.\n", world_mpi_rank, __func__);
}
@@ -1121,7 +1121,7 @@ setup_derived_types(void)
if (result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Type_commit() call failed.\n", world_mpi_rank, __func__);
}
@@ -1139,16 +1139,16 @@ setup_derived_types(void)
* Purpose: take down the derived types used by the test bed. At present,
* only the mpi_mssg derived type is needed.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
takedown_derived_types(void)
{
- hbool_t success = TRUE;
- int result;
+ bool success = true;
+ int result;
if (mpi_mssg_t == MPI_DATATYPE_NULL)
return (success);
@@ -1158,7 +1158,7 @@ takedown_derived_types(void)
if (result != MPI_SUCCESS) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: MPI_Type_free() call failed.\n", world_mpi_rank, __func__);
}
@@ -1179,18 +1179,18 @@ takedown_derived_types(void)
* Purpose: Reset the counters maintained by the server, doing a
* sanity check in passing.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
reset_server_counters(void)
{
- hbool_t success = TRUE;
- int i;
- long actual_total_reads = 0;
- long actual_total_writes = 0;
+ bool success = true;
+ int i;
+ long actual_total_reads = 0;
+ long actual_total_writes = 0;
for (i = 0; i < NUM_DATA_ENTRIES; i++) {
if (data[i].reads > 0) {
@@ -1208,7 +1208,7 @@ reset_server_counters(void)
if (actual_total_reads != total_reads) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: actual/total reads mismatch (%ld/%d).\n", world_mpi_rank, __func__,
@@ -1218,7 +1218,7 @@ reset_server_counters(void)
if (actual_total_writes != total_writes) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: actual/total writes mismatch (%ld/%d).\n", world_mpi_rank, __func__,
@@ -1244,23 +1244,23 @@ reset_server_counters(void)
* the test until the count of done messages received equals
* the number of client processes.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
server_main(void)
{
- hbool_t done = FALSE;
- hbool_t success = TRUE;
+ bool done = false;
+ bool success = true;
int done_count = 0;
struct mssg_t mssg;
if (world_mpi_rank != world_server_mpi_rank) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: This isn't the server process?!?!?\n", world_mpi_rank, __func__);
}
@@ -1277,7 +1277,7 @@ server_main(void)
break;
case WRITE_REQ_ACK_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received write ack?!?.\n", __func__);
break;
@@ -1287,7 +1287,7 @@ server_main(void)
break;
case READ_REQ_REPLY_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received read req reply?!?.\n", __func__);
break;
@@ -1297,7 +1297,7 @@ server_main(void)
break;
case SYNC_ACK_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received sync ack?!?.\n", __func__);
break;
@@ -1307,7 +1307,7 @@ server_main(void)
break;
case REQ_TTL_WRITES_RPLY_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received total writes reply?!?.\n", __func__);
break;
@@ -1317,7 +1317,7 @@ server_main(void)
break;
case REQ_TTL_READS_RPLY_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received total reads reply?!?.\n", __func__);
break;
@@ -1327,7 +1327,7 @@ server_main(void)
break;
case REQ_ENTRY_WRITES_RPLY_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received entry writes reply?!?.\n", __func__);
break;
@@ -1337,7 +1337,7 @@ server_main(void)
break;
case REQ_ENTRY_READS_RPLY_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received entry reads reply?!?.\n", __func__);
break;
@@ -1347,7 +1347,7 @@ server_main(void)
break;
case REQ_RW_COUNT_RESET_RPLY_CODE:
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%s: Received RW count reset reply?!?.\n", __func__);
break;
@@ -1355,12 +1355,12 @@ server_main(void)
case DONE_REQ_CODE:
done_count++;
if (done_count >= file_mpi_size)
- done = TRUE;
+ done = true;
break;
default:
nerrors++;
- success = FALSE;
+ success = false;
if (verbose)
fprintf(stdout, "%d:%s: Unknown request code.\n", world_mpi_rank, __func__);
break;
@@ -1383,16 +1383,16 @@ server_main(void)
* a copy of the indicated datum from the data array to
* the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_read_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
int target_index;
haddr_t target_addr;
struct mssg_t reply;
@@ -1400,7 +1400,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
if ((mssg_ptr == NULL) || (mssg_ptr->req != READ_REQ_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1414,7 +1414,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
if (target_index < 0) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
@@ -1423,7 +1423,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
else if (data[target_index].len != mssg_ptr->len) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, __func__,
data[target_index].len, mssg_ptr->len);
@@ -1432,7 +1432,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
else if (!(data[target_index].valid)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout,
"%d:%s: proc %d read invalid entry. "
@@ -1461,7 +1461,7 @@ serve_read_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -1498,22 +1498,22 @@ serve_read_request(struct mssg_t *mssg_ptr)
* that all previous messages have been processed before
* proceeding.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_sync_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
struct mssg_t reply;
if ((mssg_ptr == NULL) || (mssg_ptr->req != SYNC_REQ_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1535,7 +1535,7 @@ serve_sync_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -1565,16 +1565,16 @@ serve_sync_request(struct mssg_t *mssg_ptr)
* the version number of the target data array entry as
* specified in the message.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_write_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
int target_index;
int new_ver_num = 0;
haddr_t target_addr;
@@ -1585,7 +1585,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
if ((mssg_ptr == NULL) || (mssg_ptr->req != WRITE_REQ_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1599,7 +1599,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
if (target_index < 0) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
@@ -1608,7 +1608,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
else if (data[target_index].len != mssg_ptr->len) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: data[i].len = %zu != mssg->len = %d.\n", world_mpi_rank, __func__,
data[target_index].len, mssg_ptr->len);
@@ -1624,7 +1624,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
if (new_ver_num <= data[target_index].ver) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: new ver = %d <= old ver = %d.\n", world_mpi_rank, __func__,
new_ver_num, data[target_index].ver);
@@ -1636,7 +1636,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
/* process the write */
data[target_index].ver = new_ver_num;
- data[target_index].valid = TRUE;
+ data[target_index].valid = true;
/* and update the counters */
total_writes++;
@@ -1656,7 +1656,7 @@ serve_write_request(struct mssg_t *mssg_ptr)
reply.magic = MSSG_MAGIC;
/* and send it */
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
#endif /* DO_WRITE_REQ_ACK */
}
@@ -1693,22 +1693,22 @@ serve_write_request(struct mssg_t *mssg_ptr)
* the current value of the total_writes global variable to
* the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_total_writes_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
struct mssg_t reply;
if ((mssg_ptr == NULL) || (mssg_ptr->req != REQ_TTL_WRITES_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1730,7 +1730,7 @@ serve_total_writes_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -1761,22 +1761,22 @@ serve_total_writes_request(struct mssg_t *mssg_ptr)
* the current value of the total_reads global variable to
* the requesting process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_total_reads_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
struct mssg_t reply;
if ((mssg_ptr == NULL) || (mssg_ptr->req != REQ_TTL_READS_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1798,7 +1798,7 @@ serve_total_reads_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -1829,16 +1829,16 @@ serve_total_reads_request(struct mssg_t *mssg_ptr)
* written since the last counter reset to the requesting
* process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_entry_writes_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
int target_index;
haddr_t target_addr;
struct mssg_t reply;
@@ -1846,7 +1846,7 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
if ((mssg_ptr == NULL) || (mssg_ptr->req != REQ_ENTRY_WRITES_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1860,7 +1860,7 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
if (target_index < 0) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
@@ -1883,7 +1883,7 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -1916,16 +1916,16 @@ serve_entry_writes_request(struct mssg_t *mssg_ptr)
* read since the last counter reset to the requesting
* process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_entry_reads_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
int target_index;
haddr_t target_addr;
struct mssg_t reply;
@@ -1933,7 +1933,7 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
if ((mssg_ptr == NULL) || (mssg_ptr->req != REQ_ENTRY_READS_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -1947,7 +1947,7 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
if (target_index < 0) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: addr lookup failed for %" PRIuHADDR ".\n", world_mpi_rank, __func__,
target_addr);
@@ -1970,7 +1970,7 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -2002,22 +2002,22 @@ serve_entry_reads_request(struct mssg_t *mssg_ptr)
* read/write counters, and sends a confirmation message to
* the calling process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
serve_rw_count_reset_request(struct mssg_t *mssg_ptr)
{
- hbool_t report_mssg = FALSE;
- hbool_t success = TRUE;
+ bool report_mssg = false;
+ bool success = true;
struct mssg_t reply;
if ((mssg_ptr == NULL) || (mssg_ptr->req != REQ_RW_COUNT_RESET_CODE) || (mssg_ptr->magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad mssg on entry.\n", world_mpi_rank, __func__);
}
@@ -2044,7 +2044,7 @@ serve_rw_count_reset_request(struct mssg_t *mssg_ptr)
if (success) {
- success = send_mssg(&reply, TRUE);
+ success = send_mssg(&reply, true);
}
if (report_mssg) {
@@ -2122,10 +2122,10 @@ datum_get_initial_load_size(void *udata_ptr, size_t *image_len_ptr)
*/
static void *
datum_deserialize(const void H5_ATTR_NDEBUG_UNUSED *image_ptr, H5_ATTR_UNUSED size_t len, void *udata_ptr,
- hbool_t *dirty_ptr)
+ bool *dirty_ptr)
{
haddr_t addr = *(haddr_t *)udata_ptr;
- hbool_t success = TRUE;
+ bool success = true;
int idx;
struct datum *entry_ptr = NULL;
@@ -2152,7 +2152,7 @@ datum_deserialize(const void H5_ATTR_NDEBUG_UNUSED *image_ptr, H5_ATTR_UNUSED si
fflush(stdout);
}
- *dirty_ptr = FALSE;
+ *dirty_ptr = false;
if (!success) {
@@ -2285,7 +2285,7 @@ datum_serialize(const H5F_t *f, void H5_ATTR_NDEBUG_UNUSED *image_ptr, size_t le
static herr_t
datum_notify(H5C_notify_action_t action, void *thing)
{
- hbool_t was_dirty = FALSE;
+ bool was_dirty = false;
herr_t ret_value = SUCCEED;
struct datum *entry_ptr;
struct H5AC_aux_t *aux_ptr;
@@ -2349,7 +2349,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
ret_value = FAIL;
@@ -2446,7 +2446,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
else {
entry_ptr->ver = mssg.ver;
- entry_ptr->dirty = FALSE;
+ entry_ptr->dirty = false;
datum_loads++;
}
}
@@ -2478,7 +2478,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
if (entry_ptr->header.is_dirty) {
- was_dirty = TRUE; /* so we will receive the ack
+ was_dirty = true; /* so we will receive the ack
* if requested
*/
@@ -2493,7 +2493,7 @@ datum_notify(H5C_notify_action_t action, void *thing)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
ret_value = FAIL;
@@ -2502,8 +2502,8 @@ datum_notify(H5C_notify_action_t action, void *thing)
}
}
else {
- entry_ptr->dirty = FALSE;
- entry_ptr->flushed = TRUE;
+ entry_ptr->dirty = false;
+ entry_ptr->flushed = true;
}
}
}
@@ -2574,8 +2574,8 @@ datum_notify(H5C_notify_action_t action, void *thing)
fflush(stdout);
}
- entry_ptr->cleared = TRUE;
- entry_ptr->dirty = FALSE;
+ entry_ptr->cleared = true;
+ entry_ptr->dirty = false;
datum_clears++;
@@ -2711,7 +2711,7 @@ datum_free_icr(void *thing)
static void
expunge_entry(H5F_t *file_ptr, int32_t idx)
{
- hbool_t in_cache;
+ bool in_cache;
herr_t result;
struct datum *entry_ptr;
@@ -2725,7 +2725,7 @@ expunge_entry(H5F_t *file_ptr, int32_t idx)
assert(!(entry_ptr->global_pinned));
assert(!(entry_ptr->local_pinned));
- entry_ptr->dirty = FALSE;
+ entry_ptr->dirty = false;
if (nerrors == 0) {
@@ -2779,7 +2779,7 @@ expunge_entry(H5F_t *file_ptr, int32_t idx)
static void
insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags)
{
- hbool_t insert_pinned;
+ bool insert_pinned;
herr_t result;
struct datum *entry_ptr;
@@ -2797,7 +2797,7 @@ insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags)
if (nerrors == 0) {
(entry_ptr->ver)++;
- entry_ptr->dirty = TRUE;
+ entry_ptr->dirty = true;
result = H5AC_insert_entry(file_ptr, &(types[0]), entry_ptr->base_addr,
(void *)(&(entry_ptr->header)), flags);
@@ -2836,13 +2836,13 @@ insert_entry(H5C_t *cache_ptr, H5F_t *file_ptr, int32_t idx, unsigned int flags)
if (insert_pinned) {
assert(entry_ptr->header.is_pinned);
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = true;
global_pins++;
}
else {
assert(!(entry_ptr->header.is_pinned));
- entry_ptr->global_pinned = FALSE;
+ entry_ptr->global_pinned = false;
}
/* assert( entry_ptr->header.is_dirty ); */
@@ -2870,10 +2870,10 @@ local_pin_and_unpin_random_entries(H5F_t *file_ptr, int min_idx, int max_idx, in
if (nerrors == 0) {
- hbool_t via_unprotect;
- int count;
- int i;
- int idx;
+ bool via_unprotect;
+ int count;
+ int i;
+ int idx;
assert(file_ptr);
assert(0 <= min_idx);
@@ -2943,7 +2943,7 @@ local_pin_random_entry(H5F_t *file_ptr, int min_idx, int max_idx)
assert(idx <= max_idx);
} while (data[idx].global_pinned || data[idx].local_pinned);
- pin_entry(file_ptr, idx, FALSE, FALSE);
+ pin_entry(file_ptr, idx, false, false);
}
return;
@@ -2961,7 +2961,7 @@ local_pin_random_entry(H5F_t *file_ptr, int min_idx, int max_idx)
*
*****************************************************************************/
static void
-local_unpin_all_entries(H5F_t *file_ptr, hbool_t via_unprotect)
+local_unpin_all_entries(H5F_t *file_ptr, bool via_unprotect)
{
if (nerrors == 0) {
@@ -2995,7 +2995,7 @@ local_unpin_all_entries(H5F_t *file_ptr, hbool_t via_unprotect)
*
*****************************************************************************/
static int
-local_unpin_next_pinned_entry(H5F_t *file_ptr, int start_idx, hbool_t via_unprotect)
+local_unpin_next_pinned_entry(H5F_t *file_ptr, int start_idx, bool via_unprotect)
{
int i = 0;
int idx = -1;
@@ -3019,7 +3019,7 @@ local_unpin_next_pinned_entry(H5F_t *file_ptr, int start_idx, hbool_t via_unprot
if (data[idx].local_pinned) {
- unpin_entry(file_ptr, idx, FALSE, FALSE, via_unprotect);
+ unpin_entry(file_ptr, idx, false, false, via_unprotect);
}
else {
@@ -3146,7 +3146,7 @@ lock_entry(H5F_t *file_ptr, int32_t idx)
}
else {
- entry_ptr->locked = TRUE;
+ entry_ptr->locked = true;
}
assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE);
@@ -3183,7 +3183,7 @@ mark_entry_dirty(int32_t idx)
assert(!(entry_ptr->local_pinned));
(entry_ptr->ver)++;
- entry_ptr->dirty = TRUE;
+ entry_ptr->dirty = true;
result = H5AC_mark_entry_dirty((void *)entry_ptr);
@@ -3214,7 +3214,7 @@ mark_entry_dirty(int32_t idx)
*
*****************************************************************************/
static void
-pin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty)
+pin_entry(H5F_t *file_ptr, int32_t idx, bool global, bool dirty)
{
unsigned int flags = H5AC__PIN_ENTRY_FLAG;
struct datum *entry_ptr;
@@ -3245,13 +3245,13 @@ pin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty)
if (global) {
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = true;
global_pins++;
}
else {
- entry_ptr->local_pinned = TRUE;
+ entry_ptr->local_pinned = true;
local_pins++;
}
@@ -3273,7 +3273,7 @@ pin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty)
*
*****************************************************************************/
static void
-pin_protected_entry(int32_t idx, hbool_t global)
+pin_protected_entry(int32_t idx, bool global)
{
herr_t result;
struct datum *entry_ptr;
@@ -3302,13 +3302,13 @@ pin_protected_entry(int32_t idx, hbool_t global)
if (global) {
- entry_ptr->global_pinned = TRUE;
+ entry_ptr->global_pinned = true;
global_pins++;
}
else {
- entry_ptr->local_pinned = TRUE;
+ entry_ptr->local_pinned = true;
local_pins++;
}
@@ -3364,7 +3364,7 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx)
new_addr = new_entry_ptr->base_addr;
/* Moving will mark the entry dirty if it is not already */
- old_entry_ptr->dirty = TRUE;
+ old_entry_ptr->dirty = true;
/* touch up versions, base_addrs, and data_index. Do this
* now as it is possible that the rename will trigger a
@@ -3441,15 +3441,15 @@ move_entry(H5F_t *file_ptr, int32_t old_idx, int32_t new_idx)
* Purpose: Send a message to the server process requesting it to reset
* its counters. Await confirmation message.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
reset_server_counts(void)
{
- hbool_t success = TRUE; /* will set to FALSE if appropriate. */
+ bool success = true; /* will set to false if appropriate. */
struct mssg_t mssg;
if (success) {
@@ -3465,10 +3465,10 @@ reset_server_counts(void)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -3480,7 +3480,7 @@ reset_server_counts(void)
if (!recv_mssg(&mssg, REQ_RW_COUNT_RESET_RPLY_CODE)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -3490,7 +3490,7 @@ reset_server_counts(void)
(mssg.ver != 0) || (mssg.count != 0) || (mssg.magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in req r/w counter reset reply.\n", world_mpi_rank,
__func__);
@@ -3550,7 +3550,7 @@ resize_entry(int32_t idx, size_t new_size)
assert(entry_ptr->header.is_dirty);
assert(entry_ptr->header.size == new_size);
- entry_ptr->dirty = TRUE;
+ entry_ptr->dirty = true;
entry_ptr->local_len = new_size;
/* touch up version. */
@@ -3575,16 +3575,16 @@ resize_entry(int32_t idx, size_t new_size)
* look up the address of the metadata cache, and then instruct
* the cache to omit sanity checks on dxpl IDs.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr, int metadata_write_strategy)
{
- hbool_t success = FALSE; /* will set to TRUE if appropriate. */
- hbool_t enable_rpt_fcn = FALSE;
+ bool success = false; /* will set to true if appropriate. */
+ bool enable_rpt_fcn = false;
hid_t fid = -1;
H5AC_cache_config_t config;
H5AC_cache_config_t test_config;
@@ -3634,12 +3634,12 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
}
}
else {
- cache_ptr->ignore_tags = TRUE;
+ cache_ptr->ignore_tags = true;
*fid_ptr = fid;
*file_ptr_ptr = file_ptr;
*cache_ptr_ptr = cache_ptr;
H5C_stats__reset(cache_ptr);
- success = TRUE;
+ success = true;
}
if (success) {
@@ -3727,7 +3727,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
if (actual_base_addr == HADDR_UNDEF) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
@@ -3740,7 +3740,7 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
* actual_base_addr is <= BASE_ADDR. This should only happen
* if the size of the superblock is increase.
*/
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
@@ -3819,9 +3819,9 @@ setup_cache_for_test(hid_t *fid_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr
static void
verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
{
- const hbool_t report = FALSE;
- hbool_t proceed = TRUE;
- unsigned u = 0;
+ const bool report = false;
+ bool proceed = true;
+ unsigned u = 0;
assert(world_mpi_rank != world_server_mpi_rank);
assert((num_writes == 0) || (written_entries_tbl != NULL));
@@ -3833,7 +3833,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- proceed = FALSE;
+ proceed = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: barrier 1 failed.\n", world_mpi_rank, __func__);
@@ -3856,7 +3856,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- proceed = FALSE;
+ proceed = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: barrier 2 failed.\n", world_mpi_rank, __func__);
@@ -3892,7 +3892,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- proceed = FALSE;
+ proceed = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: barrier 3 failed.\n", world_mpi_rank, __func__);
@@ -3919,7 +3919,7 @@ verify_writes(unsigned num_writes, haddr_t *written_entries_tbl)
static void
setup_rand(void)
{
- hbool_t use_predefined_seeds = FALSE;
+ bool use_predefined_seeds = false;
int num_predefined_seeds = 3;
unsigned predefined_seeds[3] = {18669, 89925, 12577};
unsigned seed;
@@ -3967,22 +3967,22 @@ setup_rand(void)
* To do this, we must close the file, and delete if if
* possible.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
take_down_cache(hid_t fid, H5C_t *cache_ptr)
{
- hbool_t success = TRUE; /* will set to FALSE if appropriate. */
+ bool success = true; /* will set to false if appropriate. */
/* flush the file -- this should write out any remaining test
* entries in the cache.
*/
if ((success) && (H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, __func__);
@@ -3998,7 +3998,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
if (H5AC__set_sync_point_done_callback(cache_ptr, NULL) != SUCCEED) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: H5AC__set_sync_point_done_callback failed.\n", world_mpi_rank,
@@ -4010,7 +4010,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
/* close the file */
if ((success) && (H5Fclose(fid) < 0)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: H5Fclose() failed.\n", world_mpi_rank, __func__);
@@ -4018,7 +4018,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
}
/* Pop API context */
- H5CX_pop(FALSE);
+ H5CX_pop(false);
if (success) {
@@ -4026,7 +4026,7 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
if (HDremove(filenames[0]) < 0) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: HDremove() failed.\n", world_mpi_rank, __func__);
@@ -4053,20 +4053,20 @@ take_down_cache(hid_t fid, H5C_t *cache_ptr)
* indicated entry has been read since the last time the
* server counters were reset.
*
- * Return TRUE if successful, and if the supplied expected
+ * Return true if successful, and if the supplied expected
* number of reads matches the number of reads reported by
* the server process.
*
- * Return FALSE and flag an error otherwise.
+ * Return false and flag an error otherwise.
*
- * Return: TRUE if successful, FALSE otherwise.
+ * Return: true if successful, false otherwise.
*
*-------------------------------------------------------------------------
*/
-static hbool_t
+static bool
verify_entry_reads(haddr_t addr, int expected_entry_reads)
{
- hbool_t success = TRUE;
+ bool success = true;
int reported_entry_reads = 0;
struct mssg_t mssg;
@@ -4083,10 +4083,10 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4098,7 +4098,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
if (!recv_mssg(&mssg, REQ_ENTRY_READS_RPLY_CODE)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4112,7 +4112,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
(mssg.magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in req entry reads reply.\n", world_mpi_rank, __func__);
}
@@ -4128,7 +4128,7 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
if (reported_entry_reads != expected_entry_reads) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: rep/exp entry 0x%" PRIxHADDR " reads mismatch (%d/%d).\n",
world_mpi_rank, __func__, addr, reported_entry_reads, expected_entry_reads);
@@ -4147,20 +4147,20 @@ verify_entry_reads(haddr_t addr, int expected_entry_reads)
* indicated entry has been written since the last time the
* server counters were reset.
*
- * Return TRUE if successful, and if the supplied expected
+ * Return true if successful, and if the supplied expected
* number of reads matches the number of reads reported by
* the server process.
*
- * Return FALSE and flag an error otherwise.
+ * Return false and flag an error otherwise.
*
- * Return: TRUE if successful, FALSE otherwise.
+ * Return: true if successful, false otherwise.
*
*-------------------------------------------------------------------------
*/
-static hbool_t
+static bool
verify_entry_writes(haddr_t addr, int expected_entry_writes)
{
- hbool_t success = TRUE;
+ bool success = true;
int reported_entry_writes = 0;
struct mssg_t mssg;
@@ -4177,10 +4177,10 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
mssg.count = 0; /* not used */
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4192,7 +4192,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
if (!recv_mssg(&mssg, REQ_ENTRY_WRITES_RPLY_CODE)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4206,7 +4206,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
(mssg.magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in req entry writes reply.\n", world_mpi_rank, __func__);
}
@@ -4222,7 +4222,7 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
if (reported_entry_writes != expected_entry_writes) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: rep/exp entry 0x%llx writes mismatch (%d/%d).\n", world_mpi_rank,
__func__, (long long)addr, reported_entry_writes, expected_entry_writes);
@@ -4242,19 +4242,19 @@ verify_entry_writes(haddr_t addr, int expected_entry_writes)
* server counter reset, and compare this value with the supplied
* expected value.
*
- * If the values match, return TRUE.
+ * If the values match, return true.
*
- * If the values don't match, flag an error and return FALSE.
+ * If the values don't match, flag an error and return false.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
verify_total_reads(int expected_total_reads)
{
- hbool_t success = TRUE; /* will set to FALSE if appropriate. */
+ bool success = true; /* will set to false if appropriate. */
long reported_total_reads;
struct mssg_t mssg;
@@ -4271,10 +4271,10 @@ verify_total_reads(int expected_total_reads)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4286,7 +4286,7 @@ verify_total_reads(int expected_total_reads)
if (!recv_mssg(&mssg, REQ_TTL_READS_RPLY_CODE)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4296,7 +4296,7 @@ verify_total_reads(int expected_total_reads)
(mssg.ver != 0) || (mssg.magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", world_mpi_rank, __func__);
}
@@ -4312,7 +4312,7 @@ verify_total_reads(int expected_total_reads)
if (reported_total_reads != expected_total_reads) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: reported/expected total reads mismatch (%ld/%d).\n", world_mpi_rank,
__func__, reported_total_reads, expected_total_reads);
@@ -4332,19 +4332,19 @@ verify_total_reads(int expected_total_reads)
* server counter reset, and compare this value with the supplied
* expected value.
*
- * If the values match, return TRUE.
+ * If the values match, return true.
*
- * If the values don't match, flag an error and return FALSE.
+ * If the values don't match, flag an error and return false.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
verify_total_writes(unsigned expected_total_writes)
{
- hbool_t success = TRUE; /* will set to FALSE if appropriate. */
+ bool success = true; /* will set to false if appropriate. */
unsigned reported_total_writes;
struct mssg_t mssg;
@@ -4361,10 +4361,10 @@ verify_total_writes(unsigned expected_total_writes)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if (!send_mssg(&mssg, FALSE)) {
+ if (!send_mssg(&mssg, false)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: send_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4376,7 +4376,7 @@ verify_total_writes(unsigned expected_total_writes)
if (!recv_mssg(&mssg, REQ_TTL_WRITES_RPLY_CODE)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: recv_mssg() failed.\n", world_mpi_rank, __func__);
}
@@ -4386,7 +4386,7 @@ verify_total_writes(unsigned expected_total_writes)
(mssg.ver != 0) || (mssg.magic != MSSG_MAGIC)) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in req total reads reply.\n", world_mpi_rank, __func__);
}
@@ -4402,7 +4402,7 @@ verify_total_writes(unsigned expected_total_writes)
if (reported_total_writes != expected_total_writes) {
nerrors++;
- success = FALSE;
+ success = false;
if (verbose) {
fprintf(stdout, "%d:%s: reported/expected total writes mismatch (%u/%u).\n", world_mpi_rank,
__func__, reported_total_writes, expected_total_writes);
@@ -4446,7 +4446,7 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags)
if (dirtied) {
(entry_ptr->ver)++;
- entry_ptr->dirty = TRUE;
+ entry_ptr->dirty = true;
}
result = H5AC_unprotect(file_ptr, &(types[0]), entry_ptr->base_addr, (void *)(&(entry_ptr->header)),
@@ -4464,7 +4464,7 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags)
}
else {
- entry_ptr->locked = FALSE;
+ entry_ptr->locked = false;
}
assert(((entry_ptr->header).type)->id == DATUM_ENTRY_TYPE);
@@ -4492,7 +4492,7 @@ unlock_entry(H5F_t *file_ptr, int32_t idx, unsigned int flags)
*
*****************************************************************************/
static void
-unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t via_unprotect)
+unpin_entry(H5F_t *file_ptr, int32_t idx, bool global, bool dirty, bool via_unprotect)
{
herr_t result;
unsigned int flags = H5AC__UNPIN_ENTRY_FLAG;
@@ -4544,11 +4544,11 @@ unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t
if (global) {
- entry_ptr->global_pinned = FALSE;
+ entry_ptr->global_pinned = false;
}
else {
- entry_ptr->local_pinned = FALSE;
+ entry_ptr->local_pinned = false;
}
}
@@ -4566,15 +4566,15 @@ unpin_entry(H5F_t *file_ptr, int32_t idx, hbool_t global, hbool_t dirty, hbool_t
*
* Purpose: Quick smoke check for the server process.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
server_smoke_check(void)
{
- hbool_t success = TRUE;
+ bool success = true;
int max_nerrors;
struct mssg_t mssg;
@@ -4611,7 +4611,7 @@ server_smoke_check(void)
mssg.count = 0;
mssg.magic = MSSG_MAGIC;
- if (!(success = send_mssg(&mssg, FALSE))) {
+ if (!(success = send_mssg(&mssg, false))) {
nerrors++;
if (verbose) {
@@ -4643,7 +4643,7 @@ server_smoke_check(void)
(mssg.len != data[world_mpi_rank].len) || (mssg.ver != data[world_mpi_rank].ver) ||
(mssg.magic != MSSG_MAGIC)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in write req ack.\n", world_mpi_rank, __func__);
@@ -4658,7 +4658,7 @@ server_smoke_check(void)
/* barrier to allow all writes to complete */
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: barrier 1 failed.\n", world_mpi_rank, __func__);
@@ -4689,7 +4689,7 @@ server_smoke_check(void)
/* barrier to allow all writes to complete */
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
@@ -4710,7 +4710,7 @@ server_smoke_check(void)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -4743,7 +4743,7 @@ server_smoke_check(void)
(mssg.len != data[world_mpi_rank].len) || (mssg.ver != data[world_mpi_rank].ver) ||
(mssg.magic != MSSG_MAGIC)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: Bad data in read req reply.\n", world_mpi_rank, __func__);
@@ -4754,7 +4754,7 @@ server_smoke_check(void)
/* barrier to allow all writes to complete */
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: barrier 3 failed.\n", world_mpi_rank, __func__);
@@ -4784,7 +4784,7 @@ server_smoke_check(void)
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
@@ -4800,7 +4800,7 @@ server_smoke_check(void)
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
@@ -4831,7 +4831,7 @@ server_smoke_check(void)
if (MPI_SUCCESS != MPI_Barrier(file_mpi_comm)) {
- success = FALSE;
+ success = false;
nerrors++;
if (verbose) {
@@ -4852,7 +4852,7 @@ server_smoke_check(void)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -4891,15 +4891,15 @@ server_smoke_check(void)
*
* Purpose: First smoke check for the parallel cache.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
smoke_check_1(int metadata_write_strategy)
{
- hbool_t success = TRUE;
+ bool success = true;
int i;
int max_nerrors;
hid_t fid = -1;
@@ -5011,7 +5011,7 @@ smoke_check_1(int metadata_write_strategy)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -5053,15 +5053,15 @@ smoke_check_1(int metadata_write_strategy)
* Introduce random reads, but keep all processes with roughly
* the same work load.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
smoke_check_2(int metadata_write_strategy)
{
- hbool_t success = TRUE;
+ bool success = true;
int i;
int max_nerrors;
hid_t fid = -1;
@@ -5129,10 +5129,10 @@ smoke_check_2(int metadata_write_strategy)
for (i = 0; i < (virt_num_data_entries / 2); i += 61) {
/* Make sure we don't step on any locally pinned entries */
if (data[i].local_pinned) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, false, false, false);
}
- pin_entry(file_ptr, i, TRUE, FALSE);
+ pin_entry(file_ptr, i, true, false);
}
for (i = (virt_num_data_entries / 2) - 1; i >= 0; i -= 2) {
@@ -5149,7 +5149,7 @@ smoke_check_2(int metadata_write_strategy)
}
/* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, false);
/* Move the first half of the entries... */
for (i = 0; i < (virt_num_data_entries / 2); i++) {
@@ -5168,10 +5168,10 @@ smoke_check_2(int metadata_write_strategy)
}
for (i = 0; i < (virt_num_data_entries / 2); i += 61) {
- hbool_t via_unprotect = ((((unsigned)i) & 0x01) == 0);
- hbool_t dirty = ((((unsigned)i) & 0x02) == 0);
+ bool via_unprotect = ((((unsigned)i) & 0x01) == 0);
+ bool dirty = ((((unsigned)i) & 0x02) == 0);
- unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
+ unpin_entry(file_ptr, i, true, dirty, via_unprotect);
}
if (fid >= 0) {
@@ -5207,7 +5207,7 @@ smoke_check_2(int metadata_write_strategy)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -5252,15 +5252,15 @@ smoke_check_2(int metadata_write_strategy)
* In this test, load process 0 heavily, and the other
* processes lightly.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
smoke_check_3(int metadata_write_strategy)
{
- hbool_t success = TRUE;
+ bool success = true;
int i;
int max_nerrors;
int min_count;
@@ -5341,13 +5341,13 @@ smoke_check_3(int metadata_write_strategy)
if (i % 59 == 0) {
- hbool_t dirty = ((i % 2) == 0);
+ bool dirty = ((i % 2) == 0);
if (data[i].local_pinned) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, false, false, false);
}
- pin_entry(file_ptr, i, TRUE, dirty);
+ pin_entry(file_ptr, i, true, dirty);
assert(!dirty || data[i].header.is_dirty);
assert(data[i].header.is_pinned);
@@ -5384,13 +5384,13 @@ smoke_check_3(int metadata_write_strategy)
for (i = (virt_num_data_entries / 2) - 1; i >= 0; i--) {
if ((i >= (virt_num_data_entries / 4)) && (i % 59 == 0)) {
- hbool_t via_unprotect = ((((unsigned)i) & 0x02) == 0);
- hbool_t dirty = ((((unsigned)i) & 0x04) == 0);
+ bool via_unprotect = ((((unsigned)i) & 0x02) == 0);
+ bool dirty = ((((unsigned)i) & 0x04) == 0);
assert(data[i].global_pinned);
assert(!data[i].local_pinned);
- unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
+ unpin_entry(file_ptr, i, true, dirty, via_unprotect);
}
if (i % 2 == 0) {
@@ -5415,7 +5415,7 @@ smoke_check_3(int metadata_write_strategy)
}
/* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, false);
min_count = 10 / (file_mpi_rank + 1);
max_count = min_count + 100;
@@ -5455,7 +5455,7 @@ smoke_check_3(int metadata_write_strategy)
}
/* release any local pins before we take down the cache. */
- local_unpin_all_entries(file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, false);
if (fid >= 0) {
@@ -5490,7 +5490,7 @@ smoke_check_3(int metadata_write_strategy)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -5535,15 +5535,15 @@ smoke_check_3(int metadata_write_strategy)
* In this test, load process 0 lightly, and the other
* processes heavily.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
smoke_check_4(int metadata_write_strategy)
{
- hbool_t success = TRUE;
+ bool success = true;
int i;
int max_nerrors;
int min_count;
@@ -5631,18 +5631,18 @@ smoke_check_4(int metadata_write_strategy)
* entries are in fact pinned (which unpin_entry() should do).
*/
insert_entry(cache_ptr, file_ptr, i, H5C__PIN_ENTRY_FLAG);
- unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, true, false, false);
}
if (i % 59 == 0) {
- hbool_t dirty = ((i % 2) == 0);
+ bool dirty = ((i % 2) == 0);
if (data[i].local_pinned) {
- unpin_entry(file_ptr, i, FALSE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, false, false, false);
}
- pin_entry(file_ptr, i, TRUE, dirty);
+ pin_entry(file_ptr, i, true, dirty);
assert(!dirty || data[i].header.is_dirty);
assert(data[i].header.is_pinned);
@@ -5675,13 +5675,13 @@ smoke_check_4(int metadata_write_strategy)
for (i = (virt_num_data_entries / 2) - 1; i >= 0; i--) {
if ((i >= (virt_num_data_entries / 4)) && (i % 59 == 0)) {
- hbool_t via_unprotect = ((((unsigned)i) & 0x02) == 0);
- hbool_t dirty = ((((unsigned)i) & 0x04) == 0);
+ bool via_unprotect = ((((unsigned)i) & 0x02) == 0);
+ bool dirty = ((((unsigned)i) & 0x04) == 0);
assert(data[i].global_pinned);
assert(!data[i].local_pinned);
- unpin_entry(file_ptr, i, TRUE, dirty, via_unprotect);
+ unpin_entry(file_ptr, i, true, dirty, via_unprotect);
}
if (i % 2 == 0) {
@@ -5702,7 +5702,7 @@ smoke_check_4(int metadata_write_strategy)
}
/* we can't move pinned entries, so release any local pins now. */
- local_unpin_all_entries(file_ptr, FALSE);
+ local_unpin_all_entries(file_ptr, false);
min_count = 10 * (file_mpi_rank % 4);
max_count = min_count + 100;
@@ -5772,7 +5772,7 @@ smoke_check_4(int metadata_write_strategy)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -5812,15 +5812,15 @@ smoke_check_4(int metadata_write_strategy)
* Purpose: Similar to smoke check 1, but modified to verify that
* H5AC_mark_entry_dirty() works in the parallel case.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
smoke_check_5(int metadata_write_strategy)
{
- hbool_t success = TRUE;
+ bool success = true;
int i;
int max_nerrors;
hid_t fid = -1;
@@ -5910,7 +5910,7 @@ smoke_check_5(int metadata_write_strategy)
}
for (i = (virt_num_data_entries / 2) - 1; i >= (virt_num_data_entries / 4); i--) {
- pin_entry(file_ptr, i, TRUE, FALSE);
+ pin_entry(file_ptr, i, true, false);
if (i % 2 == 0) {
if (i % 8 <= 4) {
@@ -5926,7 +5926,7 @@ smoke_check_5(int metadata_write_strategy)
}
}
- unpin_entry(file_ptr, i, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, i, true, false, false);
}
if (fid >= 0) {
@@ -5962,7 +5962,7 @@ smoke_check_5(int metadata_write_strategy)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -6025,15 +6025,15 @@ smoke_check_5(int metadata_write_strategy)
* - H5AC_expunge_entry()
* - H5AC_resize_entry()
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
trace_file_check(int metadata_write_strategy)
{
- hbool_t success = TRUE;
+ bool success = true;
const char *((*expected_output)[]) = NULL;
const char *expected_output_0[] = {"### HDF5 metadata cache trace file version 1 ###\n",
@@ -6090,7 +6090,7 @@ trace_file_check(int metadata_write_strategy)
NULL};
char buffer[256];
char trace_file_name[64];
- hbool_t done = FALSE;
+ bool done = false;
int i;
int max_nerrors;
size_t expected_line_len;
@@ -6168,7 +6168,7 @@ trace_file_check(int metadata_write_strategy)
__func__);
}
else {
- config.open_trace_file = TRUE;
+ config.open_trace_file = true;
strcpy(config.trace_file_name, "t_cache_trace.txt");
if (H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
@@ -6189,19 +6189,19 @@ trace_file_check(int metadata_write_strategy)
unlock_entry(file_ptr, 0, H5AC__NO_FLAGS_SET);
lock_entry(file_ptr, 1);
- pin_protected_entry(1, TRUE);
+ pin_protected_entry(1, true);
unlock_entry(file_ptr, 1, H5AC__NO_FLAGS_SET);
- unpin_entry(file_ptr, 1, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, 1, true, false, false);
expunge_entry(file_ptr, 1);
lock_entry(file_ptr, 2);
- pin_protected_entry(2, TRUE);
+ pin_protected_entry(2, true);
unlock_entry(file_ptr, 2, H5AC__NO_FLAGS_SET);
mark_entry_dirty(2);
resize_entry(2, data[2].len / 2);
resize_entry(2, data[2].len);
- unpin_entry(file_ptr, 2, TRUE, FALSE, FALSE);
+ unpin_entry(file_ptr, 2, true, false, false);
move_entry(file_ptr, 0, 20);
move_entry(file_ptr, 0, 20);
@@ -6221,8 +6221,8 @@ trace_file_check(int metadata_write_strategy)
__func__);
}
else {
- config.open_trace_file = FALSE;
- config.close_trace_file = TRUE;
+ config.open_trace_file = false;
+ config.close_trace_file = true;
config.trace_file_name[0] = '\0';
if (H5AC_set_cache_auto_resize_config(cache_ptr, &config) != SUCCEED) {
@@ -6263,7 +6263,7 @@ trace_file_check(int metadata_write_strategy)
mssg.magic = MSSG_MAGIC;
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
nerrors++;
@@ -6301,7 +6301,7 @@ trace_file_check(int metadata_write_strategy)
if ((actual_line_len == 0) || (expected_line_len == 0)) {
if ((actual_line_len == 0) && (expected_line_len == 0)) {
/* Both ran out at the same time - we're done */
- done = TRUE;
+ done = true;
}
else {
/* One ran out before the other - BADNESS */
@@ -6398,17 +6398,17 @@ trace_file_check(int metadata_write_strategy)
*
* Purpose: Sixth smoke check for the parallel cache.
*
- * Return: Success: TRUE
+ * Return: Success: true
*
- * Failure: FALSE
+ * Failure: false
*
*****************************************************************************/
-static hbool_t
+static bool
smoke_check_6(int metadata_write_strategy)
{
H5P_coll_md_read_flag_t md_reads_file_flag;
- hbool_t md_reads_context_flag;
- hbool_t success = TRUE;
+ bool md_reads_context_flag;
+ bool success = true;
int i;
int max_nerrors;
hid_t fid = -1;
@@ -6471,7 +6471,7 @@ smoke_check_6(int metadata_write_strategy)
/* insert the first half collectively */
md_reads_file_flag = H5P_USER_TRUE;
- md_reads_context_flag = TRUE;
+ md_reads_context_flag = true;
H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag);
for (i = 0; i < virt_num_data_entries / 2; i++) {
struct datum *entry_ptr;
@@ -6479,7 +6479,7 @@ smoke_check_6(int metadata_write_strategy)
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- if (TRUE != entry_ptr->header.coll_access) {
+ if (true != entry_ptr->header.coll_access) {
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: Entry inserted not marked as collective.\n", world_mpi_rank,
@@ -6496,7 +6496,7 @@ smoke_check_6(int metadata_write_strategy)
/* insert the other half independently */
md_reads_file_flag = H5P_USER_FALSE;
- md_reads_context_flag = FALSE;
+ md_reads_context_flag = false;
H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag);
for (i = virt_num_data_entries / 2; i < virt_num_data_entries; i++) {
struct datum *entry_ptr;
@@ -6504,7 +6504,7 @@ smoke_check_6(int metadata_write_strategy)
insert_entry(cache_ptr, file_ptr, i, H5AC__NO_FLAGS_SET);
- if (FALSE != entry_ptr->header.coll_access) {
+ if (false != entry_ptr->header.coll_access) {
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: Entry inserted independently marked as collective.\n",
@@ -6528,7 +6528,7 @@ smoke_check_6(int metadata_write_strategy)
/* Protect the first half of the entries collectively */
md_reads_file_flag = H5P_USER_TRUE;
- md_reads_context_flag = TRUE;
+ md_reads_context_flag = true;
H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag);
for (i = 0; i < (virt_num_data_entries / 2); i++) {
struct datum *entry_ptr;
@@ -6536,7 +6536,7 @@ smoke_check_6(int metadata_write_strategy)
lock_entry(file_ptr, i);
- if (TRUE != entry_ptr->header.coll_access) {
+ if (true != entry_ptr->header.coll_access) {
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: Entry protected not marked as collective.\n", world_mpi_rank,
@@ -6552,7 +6552,7 @@ smoke_check_6(int metadata_write_strategy)
/* protect the other half independently */
md_reads_file_flag = H5P_USER_FALSE;
- md_reads_context_flag = FALSE;
+ md_reads_context_flag = false;
H5F_set_coll_metadata_reads(file_ptr, &md_reads_file_flag, &md_reads_context_flag);
for (i = virt_num_data_entries / 2; i < virt_num_data_entries; i++) {
struct datum *entry_ptr;
@@ -6560,7 +6560,7 @@ smoke_check_6(int metadata_write_strategy)
lock_entry(file_ptr, i);
- if (FALSE != entry_ptr->header.coll_access) {
+ if (false != entry_ptr->header.coll_access) {
nerrors++;
if (verbose) {
fprintf(stdout, "%d:%s: Entry inserted independently marked as collective.\n",
@@ -6611,7 +6611,7 @@ smoke_check_6(int metadata_write_strategy)
if (success) {
- success = send_mssg(&mssg, FALSE);
+ success = send_mssg(&mssg, false);
if (!success) {
@@ -6816,7 +6816,7 @@ main(int argc, char **argv)
#endif
/* enable the collective metadata read property */
if (world_mpi_rank != world_server_mpi_rank) {
- if (H5Pset_all_coll_metadata_ops(fapl, TRUE) < 0) {
+ if (H5Pset_all_coll_metadata_ops(fapl, true) < 0) {
nerrors++;
if (verbose) {