diff options
Diffstat (limited to 'src/H5FDsubfiling')
-rw-r--r-- | src/H5FDsubfiling/H5FDioc.c | 30 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDioc_int.c | 2 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDioc_priv.h | 18 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDioc_threads.c | 38 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDsubfiling.c | 80 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDsubfiling.h | 6 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5subfiling_common.c | 54 |
7 files changed, 114 insertions, 114 deletions
diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index 570c747..8a7169a 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -36,7 +36,7 @@ static hid_t H5FD_IOC_g = H5I_INVALID_HID; /* Whether the driver initialized MPI on its own */ -static hbool_t H5FD_mpi_self_initialized = FALSE; +static bool H5FD_mpi_self_initialized = false; /* Pointer to value for MPI_TAG_UB */ int *H5FD_IOC_tag_ub_val_ptr = NULL; @@ -126,9 +126,9 @@ static herr_t H5FD__ioc_read_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count haddr_t addrs[], size_t sizes[], void *bufs[] /* out */); static herr_t H5FD__ioc_write_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], const void *bufs[] /* in */); -static herr_t H5FD__ioc_flush(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__ioc_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); -static herr_t H5FD__ioc_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__ioc_flush(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__ioc_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); +static herr_t H5FD__ioc_lock(H5FD_t *_file, bool rw); static herr_t H5FD__ioc_unlock(H5FD_t *_file); static herr_t H5FD__ioc_del(const char *name, hid_t fapl); /* @@ -219,7 +219,7 @@ H5FD_ioc_init(void) int key_val_retrieved = 0; int mpi_code; - if ((H5FD_IOC_g = H5FD_register(&H5FD_ioc_g, sizeof(H5FD_class_t), FALSE)) < 0) + if ((H5FD_IOC_g = H5FD_register(&H5FD_ioc_g, sizeof(H5FD_class_t), false)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register IOC VFD"); /* Check if IOC VFD has been loaded dynamically */ @@ -247,7 +247,7 @@ H5FD_ioc_init(void) if (MPI_SUCCESS != (mpi_code = MPI_Init_thread(NULL, NULL, required, &provided))) H5_SUBFILING_MPI_GOTO_ERROR(H5I_INVALID_HID, "MPI_Init_thread failed", mpi_code); - H5FD_mpi_self_initialized = TRUE; + H5FD_mpi_self_initialized = true; if (provided != required) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, @@ -299,7 +299,7 @@ H5FD__ioc_term(void) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalize failed", mpi_code); } - H5FD_mpi_self_initialized = FALSE; + H5FD_mpi_self_initialized = false; } } @@ -373,7 +373,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out) { const H5FD_ioc_config_t *config_ptr = NULL; H5P_genplist_t *plist_ptr = NULL; - hbool_t use_default_config = FALSE; + bool use_default_config = false; herr_t ret_value = SUCCEED; H5FD_IOC_LOG_CALL(__func__); @@ -386,11 +386,11 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_IOC != H5P_peek_driver(plist_ptr)) - use_default_config = TRUE; + use_default_config = true; else { config_ptr = H5P_peek_driver_info(plist_ptr); if (NULL == config_ptr) - use_default_config = TRUE; + use_default_config = true; } if (use_default_config) { @@ -1293,7 +1293,7 @@ H5FD__ioc_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_mem_t t dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1336,7 +1336,7 @@ H5FD__ioc_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_mem_t dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -1355,7 +1355,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__ioc_flush(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__ioc_flush(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { herr_t ret_value = SUCCEED; @@ -1375,7 +1375,7 @@ H5FD__ioc_flush(H5FD_t H5_ATTR_UNUSED *_file, hid_t H5_ATTR_UNUSED dxpl_id, hboo *------------------------------------------------------------------------- */ static herr_t -H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_ioc_t *file = (H5FD_ioc_t *)_file; herr_t ret_value = SUCCEED; @@ -1401,7 +1401,7 @@ H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ *-------------------------------------------------------------------------- */ static herr_t -H5FD__ioc_lock(H5FD_t H5_ATTR_UNUSED *_file, hbool_t H5_ATTR_UNUSED rw) +H5FD__ioc_lock(H5FD_t H5_ATTR_UNUSED *_file, bool H5_ATTR_UNUSED rw) { herr_t ret_value = SUCCEED; diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index d7a62d1..674b08d 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -265,7 +265,7 @@ ioc__read_independent_async(int64_t context_id, int64_t offset, int64_t elements subfiling_context_t *sf_context = NULL; MPI_Request ack_request = MPI_REQUEST_NULL; io_req_t *sf_io_request = NULL; - hbool_t need_data_tag = FALSE; + bool need_data_tag = false; int64_t ioc_start; int64_t ioc_offset; int64_t ioc_subfile_idx; diff --git a/src/H5FDsubfiling/H5FDioc_priv.h b/src/H5FDsubfiling/H5FDioc_priv.h index cac2806..fbce1a0 100644 --- a/src/H5FDsubfiling/H5FDioc_priv.h +++ b/src/H5FDsubfiling/H5FDioc_priv.h @@ -87,7 +87,7 @@ do { assert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ assert((entry_ptr)->next == NULL); \ assert((entry_ptr)->prev == NULL); \ - assert((entry_ptr)->in_progress == FALSE); \ + assert((entry_ptr)->in_progress == false); \ \ if ( ((q_ptr)->q_head) == NULL ) \ { \ @@ -101,7 +101,7 @@ do { ((q_ptr)->q_tail) = (entry_ptr); \ } \ ((q_ptr)->q_len)++; \ -} while ( FALSE ) /* H5FD_IOC__Q_APPEND() */ +} while ( false ) /* H5FD_IOC__Q_APPEND() */ #define H5FD_IOC__Q_REMOVE(q_ptr, entry_ptr) \ do { \ @@ -113,7 +113,7 @@ do { assert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ assert((((q_ptr)->q_len == 1) && ((entry_ptr)->next == NULL) && ((entry_ptr)->prev == NULL)) || \ (((q_ptr)->q_len > 1) && (((entry_ptr)->next != NULL) || ((entry_ptr)->prev != NULL)))); \ - assert((entry_ptr)->in_progress == TRUE); \ + assert((entry_ptr)->in_progress == true); \ \ { \ if ( (((q_ptr)->q_head)) == (entry_ptr) ) \ @@ -140,7 +140,7 @@ do { (entry_ptr)->prev = NULL; \ ((q_ptr)->q_len)--; \ } \ -} while ( FALSE ) /* H5FD_IOC__Q_REMOVE() */ +} while ( false ) /* H5FD_IOC__Q_REMOVE() */ /* clang-format on */ @@ -160,8 +160,8 @@ do { * the IOC I/O Queue. This field points to the previous entry * in the queue, or NULL if there is no previous entry. * - * in_progress: Boolean flag that must be FALSE when the entry is inserted - * into the IOC I/O Queue, and set to TRUE when the entry is dispatched + * in_progress: Boolean flag that must be false when the entry is inserted + * into the IOC I/O Queue, and set to true when the entry is dispatched * to the worker thread pool for execution. * * When in_progress is FALS, the entry is said to be pending. @@ -184,7 +184,7 @@ do { * * Statistics: * - * The following fields are only defined if H5FD_IOC_COLLECT_STATS is TRUE. + * The following fields are only defined if H5FD_IOC_COLLECT_STATS is true. * They are intended to allow collection of basic statistics on the * behaviour of the IOC I/O Queue for purposes of debugging and performance * optimization. @@ -209,7 +209,7 @@ typedef struct ioc_io_queue_entry { uint32_t magic; struct ioc_io_queue_entry *next; struct ioc_io_queue_entry *prev; - hbool_t in_progress; + bool in_progress; uint32_t counter; sf_work_request_t wk_req; @@ -321,7 +321,7 @@ typedef struct ioc_io_queue_entry { * * Statistics: * - * The following fields are only defined if H5FD_IOC_COLLECT_STATS is TRUE. + * The following fields are only defined if H5FD_IOC_COLLECT_STATS is true. * They are intended to allow collection of basic statistics on the * behaviour of the IOC I/O Queue for purposes of debugging and performance * optimization. diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index cb3458e..98dd00b 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -85,7 +85,7 @@ static int ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm); static ioc_io_queue_entry_t *ioc_io_queue_alloc_entry(void); static void ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_ptr); -static void ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock); +static void ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, bool try_lock); static void ioc_io_queue_free_entry(ioc_io_queue_entry_t *q_entry_ptr); static void ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr); @@ -654,7 +654,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ { subfiling_context_t *sf_context = NULL; MPI_Status msg_status; - hbool_t send_nack = FALSE; + bool send_nack = false; int64_t file_context_id; int64_t data_size; int64_t file_offset; @@ -686,7 +686,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ subfile_idx = msg->header[2]; if (data_size < 0) { - send_nack = TRUE; + send_nack = true; H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_BADVALUE, -1, "invalid data size for write"); } @@ -719,7 +719,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ /* Allocate space to receive data sent from the client */ if (NULL == (recv_buf = malloc((size_t)data_size))) { - send_nack = TRUE; + send_nack = true; H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, -1, "couldn't allocate receive buffer for data"); } @@ -839,9 +839,9 @@ static int ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_Comm comm, uint32_t counter) { subfiling_context_t *sf_context = NULL; - hbool_t send_empty_buf = TRUE; - hbool_t send_nack = FALSE; - hbool_t need_data_tag = FALSE; + bool send_empty_buf = true; + bool send_nack = false; + bool need_data_tag = false; int64_t file_context_id; int64_t data_size; int64_t file_offset; @@ -886,8 +886,8 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C if (data_size < 0) { if (need_data_tag) { - send_nack = TRUE; - send_empty_buf = FALSE; + send_nack = true; + send_empty_buf = false; } H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_BADVALUE, -1, "invalid data size for read"); } @@ -913,8 +913,8 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C /* Allocate space to send data read from file to client */ if (NULL == (send_buf = malloc((size_t)data_size))) { if (need_data_tag) { - send_nack = TRUE; - send_empty_buf = FALSE; + send_nack = true; + send_empty_buf = false; } H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, -1, "couldn't allocate send buffer for data"); } @@ -934,7 +934,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C send_tag += IO_TAG_BASE; if (send_ack_to_client(send_tag, source, ioc_idx, READ_INDEP_ACK, comm) < 0) { - send_empty_buf = FALSE; + send_empty_buf = false; H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_READERROR, -1, "couldn't send ACK to client"); } } @@ -951,7 +951,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C read_ret); } - send_empty_buf = FALSE; + send_empty_buf = false; /* Send read data to the client */ H5_CHECK_OVERFLOW(data_size, int64_t, int); @@ -1251,7 +1251,7 @@ ioc_io_queue_alloc_entry(void) q_entry_ptr->magic = H5FD_IOC__IO_Q_ENTRY_MAGIC; q_entry_ptr->next = NULL; q_entry_ptr->prev = NULL; - q_entry_ptr->in_progress = FALSE; + q_entry_ptr->in_progress = false; q_entry_ptr->counter = 0; /* will memcpy the wk_req field, so don't bother to initialize */ @@ -1414,9 +1414,9 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) * can become O(N**2) in the worst case. */ static void -ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) +ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, bool try_lock) { - hbool_t conflict_detected; + bool conflict_detected; int64_t entry_offset; int64_t entry_len; int64_t scan_offset; @@ -1462,7 +1462,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) entry_offset = entry_ptr->wk_req.header[1]; entry_len = entry_ptr->wk_req.header[0]; - conflict_detected = FALSE; + conflict_detected = false; scan_ptr = entry_ptr->prev; @@ -1497,7 +1497,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) /* TODO: update this if statement when we add collective I/O */ if ((entry_ptr->wk_req.tag != READ_INDEP) || (scan_ptr->wk_req.tag != READ_INDEP)) { - conflict_detected = TRUE; + conflict_detected = true; } } @@ -1509,7 +1509,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) assert(scan_ptr == NULL); assert(!entry_ptr->in_progress); - entry_ptr->in_progress = TRUE; + entry_ptr->in_progress = true; assert(ioc_data->io_queue.num_pending > 0); diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 89afa01..8f738c7 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -36,7 +36,7 @@ static hid_t H5FD_SUBFILING_g = H5I_INVALID_HID; /* Whether the driver initialized MPI on its own */ -static hbool_t H5FD_mpi_self_initialized = FALSE; +static bool H5FD_mpi_self_initialized = false; /* The description of a file belonging to this driver. The 'eoa' and 'eof' * determine the amount of hdf5 address space in use and the high-water mark @@ -101,7 +101,7 @@ typedef struct H5FD_subfiling_t { uint64_t file_id; int64_t context_id; /* The value used to lookup a subfiling context for the file */ - hbool_t fail_to_encode; /* Used to check for failures from sb_get_size routine */ + bool fail_to_encode; /* Used to check for failures from sb_get_size routine */ char *file_dir; /* Directory where we find files */ char *file_path; /* The user defined filename */ @@ -172,9 +172,9 @@ static herr_t H5FD__subfiling_read_vector(H5FD_t *file, hid_t dxpl_id, uint32_t haddr_t addrs[], size_t sizes[], void *bufs[] /* out */); static herr_t H5FD__subfiling_write_vector(H5FD_t *file, hid_t dxpl_id, uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], const void *bufs[] /* in */); -static herr_t H5FD__subfiling_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); +static herr_t H5FD__subfiling_truncate(H5FD_t *_file, hid_t dxpl_id, bool closing); #if 0 -static herr_t H5FD__subfiling_lock(H5FD_t *_file, hbool_t rw); +static herr_t H5FD__subfiling_lock(H5FD_t *_file, bool rw); static herr_t H5FD__subfiling_unlock(H5FD_t *_file); #endif static herr_t H5FD__subfiling_del(const char *name, hid_t fapl); @@ -291,7 +291,7 @@ H5FD_subfiling_init(void) int provided = 0; int mpi_code; - if ((H5FD_SUBFILING_g = H5FD_register(&H5FD_subfiling_g, sizeof(H5FD_class_t), FALSE)) < 0) + if ((H5FD_SUBFILING_g = H5FD_register(&H5FD_subfiling_g, sizeof(H5FD_class_t), false)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_ID, H5E_CANTREGISTER, H5I_INVALID_HID, "can't register subfiling VFD"); @@ -321,7 +321,7 @@ H5FD_subfiling_init(void) if (MPI_SUCCESS != (mpi_code = MPI_Init_thread(NULL, NULL, required, &provided))) H5_SUBFILING_MPI_GOTO_ERROR(H5I_INVALID_HID, "MPI_Init_thread failed", mpi_code); - H5FD_mpi_self_initialized = TRUE; + H5FD_mpi_self_initialized = true; if (provided != required) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, H5I_INVALID_HID, @@ -527,7 +527,7 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out) { const H5FD_subfiling_config_t *config_ptr = NULL; H5P_genplist_t *plist = NULL; - hbool_t use_default_config = FALSE; + bool use_default_config = false; herr_t ret_value = SUCCEED; /*NO TRACE*/ @@ -539,11 +539,11 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (H5FD_SUBFILING != H5P_peek_driver(plist)) - use_default_config = TRUE; + use_default_config = true; else { config_ptr = H5P_peek_driver_info(plist); if (NULL == config_ptr) - use_default_config = TRUE; + use_default_config = true; } if (use_default_config) { @@ -579,7 +579,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi config_out->magic = H5FD_SUBFILING_FAPL_MAGIC; config_out->version = H5FD_SUBFILING_CURR_FAPL_VERSION; config_out->ioc_fapl_id = H5I_INVALID_HID; - config_out->require_ioc = TRUE; + config_out->require_ioc = true; config_out->shared_cfg.ioc_selection = SELECT_IOC_ONE_PER_NODE; config_out->shared_cfg.stripe_size = H5FD_SUBFILING_DEFAULT_STRIPE_SIZE; @@ -588,7 +588,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi if ((h5_require_ioc = HDgetenv("H5_REQUIRE_IOC")) != NULL) { int value_check = atoi(h5_require_ioc); if (value_check == 0) - config_out->require_ioc = FALSE; + config_out->require_ioc = false; } /* Check if any MPI parameters were set on the FAPL */ @@ -720,7 +720,7 @@ H5FD__subfiling_sb_size(H5FD_t *_file) * errors later. */ if (NULL == (sf_context = H5_get_subfiling_object(file->context_id))) { - file->fail_to_encode = TRUE; + file->fail_to_encode = true; } else { if (sf_context->config_file_prefix) { @@ -744,7 +744,7 @@ H5FD__subfiling_sb_size(H5FD_t *_file) * a buffer. */ if (ret_value > H5FD_SUBFILING_MAX_DRV_INFO_SIZE) - file->fail_to_encode = TRUE; + file->fail_to_encode = true; H5_SUBFILING_FUNC_LEAVE; } /* end H5FD__subfiling_sb_size() */ @@ -873,7 +873,7 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char * /* Decode "require IOC" field */ INT32DECODE(p, tmp32); - file->fa.require_ioc = (hbool_t)tmp32; + file->fa.require_ioc = (bool)tmp32; /* Decode subfiling stripe size */ INT64DECODE(p, file->fa.shared_cfg.stripe_size); @@ -998,14 +998,14 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) assert(id_out_ptr != NULL); - if (FALSE == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) + if (false == H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "not a file access property list"); plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id); if (NULL == plist_ptr) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, -1, "unable to get property list"); - *id_out_ptr = H5P_copy_plist(plist_ptr, FALSE); + *id_out_ptr = H5P_copy_plist(plist_ptr, false); if (H5I_INVALID_HID == *id_out_ptr) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADTYPE, -1, "unable to copy file access property list"); @@ -1101,7 +1101,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma H5FD_class_t *driver = NULL; /* VFD for file */ H5P_genplist_t *plist_ptr = NULL; H5FD_driver_prop_t driver_prop; /* Property for driver ID & info */ - hbool_t bcasted_eof = FALSE; + bool bcasted_eof = false; int64_t sf_eof = -1; int mpi_code; /* MPI return code */ H5FD_t *ret_value = NULL; @@ -1122,7 +1122,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma file_ptr->context_id = -1; file_ptr->fa.ioc_fapl_id = H5I_INVALID_HID; file_ptr->ext_comm = MPI_COMM_NULL; - file_ptr->fail_to_encode = FALSE; + file_ptr->fail_to_encode = false; /* Get the driver-specific file access properties */ if (NULL == (plist_ptr = (H5P_genplist_t *)H5I_object(fapl_id))) @@ -1250,7 +1250,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma H5_SUBFILING_MPI_GOTO_ERROR(NULL, "MPI_Bcast", mpi_code); } - bcasted_eof = TRUE; + bcasted_eof = true; if (sf_eof < 0) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "lead MPI process failed to get file EOF"); @@ -1319,7 +1319,7 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free MPI communicator"); } - file_ptr->fail_to_encode = FALSE; + file_ptr->fail_to_encode = false; done: free(file_ptr->file_path); @@ -1544,7 +1544,7 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i int64_t *source_data_offset = NULL; int64_t *sf_data_size = NULL; int64_t *sf_offset = NULL; - hbool_t rank0_bcast = FALSE; + bool rank0_bcast = false; int num_subfiles; herr_t ret_value = SUCCEED; @@ -2079,7 +2079,7 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } @@ -2089,8 +2089,8 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m /* TODO: setup real support for vector I/O */ if (file_ptr->fa.require_ioc) { - hbool_t extend_sizes = FALSE; - hbool_t extend_types = FALSE; + bool extend_sizes = false; + bool extend_types = false; int k; size_t size; H5FD_mem_t type; @@ -2119,7 +2119,7 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m if (sizes[k] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[k - 1]; } else { @@ -2132,7 +2132,7 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m if (types[k] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[k - 1]; } else { @@ -2241,14 +2241,14 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ dxpl_id = H5P_DATASET_XFER_DEFAULT; } else { - if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) + if (true != H5P_isa_class(dxpl_id, H5P_DATASET_XFER)) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list"); } /* Call the subfiling IOC write*/ if (file_ptr->fa.require_ioc) { - hbool_t extend_sizes = FALSE; - hbool_t extend_types = FALSE; + bool extend_sizes = false; + bool extend_types = false; int k; size_t size; H5FD_mem_t type; @@ -2277,7 +2277,7 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ if (sizes[k] == 0) { - extend_sizes = TRUE; + extend_sizes = true; size = sizes[k - 1]; } else { @@ -2290,7 +2290,7 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ if (types[k] == H5FD_MEM_NOLIST) { - extend_types = TRUE; + extend_types = true; type = types[k - 1]; } else { @@ -2340,7 +2340,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD__subfiling_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_UNUSED closing) +H5FD__subfiling_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, bool H5_ATTR_UNUSED closing) { H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ @@ -2408,8 +2408,8 @@ done: * * Purpose: To place an advisory lock on a file. * The lock type to apply depends on the parameter "rw": - * TRUE--opens for write: an exclusive lock - * FALSE--opens for read: a shared lock + * true--opens for write: an exclusive lock + * false--opens for read: a shared lock * * Return: SUCCEED/FAIL * @@ -2417,7 +2417,7 @@ done: */ #if 0 static herr_t -H5FD__subfiling_lock(H5FD_t *_file, hbool_t rw) +H5FD__subfiling_lock(H5FD_t *_file, bool rw) { H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2829,8 +2829,8 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne int64_t *_io_block_len; int64_t subfile_bytes = 0; int64_t iovec_depth; - hbool_t is_first = FALSE; - hbool_t is_last = FALSE; + bool is_first = false; + bool is_last = false; size_t output_offset; iovec_depth = curr_max_iovec_depth; @@ -2857,7 +2857,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne int64_t num_full_stripes = iovec_depth; if (k == first_subfile) { - is_first = TRUE; + is_first = true; /* * Add partial segment length if not @@ -2870,7 +2870,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne } if (k == last_subfile) { - is_last = TRUE; + is_last = true; /* * Add partial segment length if not @@ -2885,7 +2885,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne /* Account for subfiles with uniform segments */ if (!is_first && !is_last) { - hbool_t thin_uniform_section = FALSE; + bool thin_uniform_section = false; if (last_subfile >= first_subfile) { /* diff --git a/src/H5FDsubfiling/H5FDsubfiling.h b/src/H5FDsubfiling/H5FDsubfiling.h index b1cf53a..5a520ce 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.h +++ b/src/H5FDsubfiling/H5FDsubfiling.h @@ -285,10 +285,10 @@ typedef struct H5FD_subfiling_params_t { * the #H5FD_IOC driver by calling H5Pset_fapl_ioc(), but future development * may allow other file drivers to be used. * - * \var hbool_t H5FD_subfiling_config_t::require_ioc + * \var bool H5FD_subfiling_config_t::require_ioc * A boolean flag which indicates whether the #H5FD_SUBFILING driver should * use the #H5FD_IOC driver for its I/O operations. This field should currently - * always be set to TRUE. + * always be set to true. * * \var H5FD_subfiling_params_t H5FD_subfiling_config_t::shared_cfg * A structure which contains the subfiling parameters that are shared between @@ -300,7 +300,7 @@ typedef struct H5FD_subfiling_config_t { uint32_t magic; /* Must be set to H5FD_SUBFILING_FAPL_MAGIC */ uint32_t version; /* Must be set to H5FD_SUBFILING_CURR_FAPL_VERSION */ hid_t ioc_fapl_id; /* The FAPL setup with the stacked VFD to use for I/O concentrators */ - hbool_t require_ioc; /* Whether to use the IOC VFD (currently must always be TRUE) */ + bool require_ioc; /* Whether to use the IOC VFD (currently must always be true) */ H5FD_subfiling_params_t shared_cfg; /* Subfiling/IOC parameters (stripe size, stripe count, etc.) */ } H5FD_subfiling_config_t; //! <!-- [H5FD_subfiling_config_t_snip] --> diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 34aaa93..cca179d 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -73,7 +73,7 @@ static herr_t record_fid_to_subfile(uint64_t file_id, int64_t subfile_context_id static void clear_fid_map_entry(uint64_t file_id, int64_t sf_context_id); static herr_t ioc_open_files(int64_t file_context_id, int file_acc_flags); static herr_t create_config_file(subfiling_context_t *sf_context, const char *base_filename, - const char *config_dir, const char *subfile_dir, hbool_t truncate_if_exists); + const char *config_dir, const char *subfile_dir, bool truncate_if_exists); static herr_t open_config_file(const char *base_filename, const char *config_dir, uint64_t file_id, const char *mode, FILE **config_file_out); @@ -441,12 +441,12 @@ H5_free_subfiling_topology(sf_topology_t *topology) #ifndef NDEBUG { - hbool_t topology_cached = FALSE; + bool topology_cached = false; /* Make sure this application topology object is in the cache */ for (size_t i = 0; i < sf_topology_cache_num_entries; i++) if (topology == sf_topology_cache[i]) - topology_cached = TRUE; + topology_cached = true; assert(topology_cached); } #endif @@ -510,7 +510,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm { H5P_genplist_t *plist = NULL; uint64_t stub_file_id = UINT64_MAX; - hbool_t bcasted_inode = FALSE; + bool bcasted_inode = false; H5FD_t *stub_file = NULL; hid_t fapl_id = H5I_INVALID_HID; int mpi_rank = 0; @@ -539,7 +539,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm MPI_Comm stub_comm = MPI_COMM_SELF; MPI_Info stub_info = MPI_INFO_NULL; - if ((fapl_id = H5P_create_id(H5P_CLS_FILE_ACCESS_g, FALSE)) < 0) + if ((fapl_id = H5P_create_id(H5P_CLS_FILE_ACCESS_g, false)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "can't create FAPL for stub file"); if (NULL == (plist = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) H5_SUBFILING_GOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a file access property list"); @@ -568,7 +568,7 @@ H5_open_subfiling_stub_file(const char *name, unsigned flags, MPI_Comm file_comm stub_file_id = (uint64_t)st.st_ino; } - bcasted_inode = TRUE; + bcasted_inode = true; if (mpi_size > 1) { if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&stub_file_id, 1, MPI_UINT64_T, 0, file_comm))) @@ -1106,7 +1106,7 @@ init_app_topology(int64_t sf_context_id, H5FD_subfiling_params_t *subfiling_conf H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get subfiling topology object"); app_topology->app_layout = NULL; app_topology->app_comm = MPI_COMM_NULL; - app_topology->rank_is_ioc = FALSE; + app_topology->rank_is_ioc = false; app_topology->ioc_idx = -1; app_topology->n_io_concentrators = ioc_count; app_topology->io_concentrators = NULL; @@ -1594,7 +1594,7 @@ compare_layout_nodelocal(const void *layout1, const void *layout2) * can also select one or more additional IOCs. * * As a side effect, we fill the 'io_concentrators' vector - * and set the 'rank_is_ioc' flag to TRUE if our rank is + * and set the 'rank_is_ioc' flag to true if our rank is * identified as owning an I/O Concentrator (IOC). * *------------------------------------------------------------------------- @@ -1658,7 +1658,7 @@ identify_ioc_ranks(int64_t sf_context_id, sf_topology_t *app_topology, int rank_ assert(!app_topology->rank_is_ioc); app_topology->ioc_idx = total_ioc_count; - app_topology->rank_is_ioc = TRUE; + app_topology->rank_is_ioc = true; } total_ioc_count++; @@ -1681,7 +1681,7 @@ identify_ioc_ranks(int64_t sf_context_id, sf_topology_t *app_topology, int rank_ assert(!app_topology->rank_is_ioc); app_topology->ioc_idx = total_ioc_count; - app_topology->rank_is_ioc = TRUE; + app_topology->rank_is_ioc = true; } total_ioc_count++; @@ -1733,7 +1733,7 @@ identify_ioc_ranks(int64_t sf_context_id, sf_topology_t *app_topology, int rank_ if (app_layout->world_rank == io_concentrators[num_iocs_assigned]) { app_topology->ioc_idx = num_iocs_assigned; - app_topology->rank_is_ioc = TRUE; + app_topology->rank_is_ioc = true; } } @@ -2273,14 +2273,14 @@ done: */ static herr_t create_config_file(subfiling_context_t *sf_context, const char *base_filename, const char *config_dir, - const char *subfile_dir, hbool_t truncate_if_exists) + const char *subfile_dir, bool truncate_if_exists) { - hbool_t config_file_exists = FALSE; - FILE *config_file = NULL; - char *config_filename = NULL; - char *line_buf = NULL; - int ret = 0; - herr_t ret_value = SUCCEED; + bool config_file_exists = false; + FILE *config_file = NULL; + char *config_filename = NULL; + char *line_buf = NULL; + int ret = 0; + herr_t ret_value = SUCCEED; assert(sf_context); assert(base_filename); @@ -2406,11 +2406,11 @@ static herr_t open_config_file(const char *base_filename, const char *config_dir, uint64_t file_id, const char *mode, FILE **config_file_out) { - hbool_t config_file_exists = FALSE; - FILE *config_file = NULL; - char *config_filename = NULL; - int ret = 0; - herr_t ret_value = SUCCEED; + bool config_file_exists = false; + FILE *config_file = NULL; + char *config_filename = NULL; + int ret = 0; + herr_t ret_value = SUCCEED; assert(base_filename); assert(config_dir); @@ -2568,8 +2568,8 @@ herr_t H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepath) { hsize_t path_len = HSIZE_UNDEF; - hbool_t bcasted_path_len = FALSE; - hbool_t bcasted_path = FALSE; + bool bcasted_path_len = false; + bool bcasted_path = false; char *resolved_path = NULL; char *file_basename = NULL; char *file_dirname = NULL; @@ -2632,7 +2632,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat } /* Broadcast the size of the resolved filepath string to other ranks */ - bcasted_path_len = TRUE; + bcasted_path_len = true; if (mpi_size > 1) { if (MPI_SUCCESS != (mpi_code = MPI_Bcast(&path_len, 1, HSIZE_AS_MPI_TYPE, 0, comm))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code); @@ -2647,7 +2647,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat } /* Broadcast the resolved filepath to other ranks */ - bcasted_path = TRUE; + bcasted_path = true; if (mpi_size > 1) { H5_CHECK_OVERFLOW(path_len, hsize_t, int); if (MPI_SUCCESS != (mpi_code = MPI_Bcast(resolved_path, (int)path_len, MPI_CHAR, 0, comm))) |