diff options
Diffstat (limited to 'src/H5FDsubfiling')
-rw-r--r-- | src/H5FDsubfiling/H5FDioc.c | 92 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDioc_int.c | 34 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDioc_priv.h | 30 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDioc_threads.c | 168 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDsubfile_int.c | 36 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5FDsubfiling.c | 236 | ||||
-rw-r--r-- | src/H5FDsubfiling/H5subfiling_common.c | 314 |
7 files changed, 454 insertions, 456 deletions
diff --git a/src/H5FDsubfiling/H5FDioc.c b/src/H5FDsubfiling/H5FDioc.c index dff2d07..2e7e8a8 100644 --- a/src/H5FDsubfiling/H5FDioc.c +++ b/src/H5FDsubfiling/H5FDioc.c @@ -91,8 +91,8 @@ typedef struct H5FD_ioc_t { #ifdef H5FD_IOC_DEBUG #define H5FD_IOC_LOG_CALL(name) \ do { \ - HDprintf("called %s()\n", (name)); \ - HDfflush(stdout); \ + printf("called %s()\n", (name)); \ + fflush(stdout); \ } while (0) #else #define H5FD_IOC_LOG_CALL(name) /* no-op */ @@ -399,7 +399,7 @@ H5Pget_fapl_ioc(hid_t fapl_id, H5FD_ioc_config_t *config_out) } else { /* Copy the IOC fapl data out */ - HDmemcpy(config_out, config_ptr, sizeof(H5FD_ioc_config_t)); + memcpy(config_out, config_ptr, sizeof(H5FD_ioc_config_t)); } done: @@ -422,9 +422,9 @@ H5FD__ioc_get_default_config(H5FD_ioc_config_t *config_out) { herr_t ret_value = SUCCEED; - HDassert(config_out); + assert(config_out); - HDmemset(config_out, 0, sizeof(*config_out)); + memset(config_out, 0, sizeof(*config_out)); config_out->magic = H5FD_IOC_FAPL_MAGIC; config_out->version = H5FD_IOC_CURR_FAPL_VERSION; @@ -455,7 +455,7 @@ H5FD__ioc_validate_config(const H5FD_ioc_config_t *fa) { herr_t ret_value = SUCCEED; - HDassert(fa != NULL); + assert(fa != NULL); if (fa->version != H5FD_IOC_CURR_FAPL_VERSION) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Unknown H5FD_ioc_config_t version"); @@ -660,13 +660,13 @@ H5FD__ioc_fapl_copy(const void *_old_fa) H5FD_IOC_LOG_CALL(__func__); - HDassert(old_fa_ptr); + assert(old_fa_ptr); new_fa_ptr = H5FL_CALLOC(H5FD_ioc_config_t); if (NULL == new_fa_ptr) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTALLOC, NULL, "unable to allocate log file FAPL"); - HDmemcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_ioc_config_t)); + memcpy(new_fa_ptr, old_fa_ptr, sizeof(H5FD_ioc_config_t)); ret_value = (void *)new_fa_ptr; @@ -695,7 +695,7 @@ H5FD__ioc_fapl_free(void *_fapl) H5FD_IOC_LOG_CALL(__func__); /* Check arguments */ - HDassert(fapl); + assert(fapl); /* Free the property list */ fapl = H5FL_FREE(H5FD_ioc_config_t, fapl); @@ -790,7 +790,7 @@ H5FD__ioc_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) } /* Fill in the file config values */ - HDmemcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_ioc_config_t)); + memcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_ioc_config_t)); /* Fully resolve the given filepath and get its dirname */ if (H5_resolve_pathname(name, file_ptr->comm, &file_ptr->file_path) < 0) @@ -904,7 +904,7 @@ H5FD__ioc_close_int(H5FD_ioc_t *file_ptr) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(file_ptr); + assert(file_ptr); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalized failed", mpi_code); @@ -936,7 +936,7 @@ H5FD__ioc_close_int(H5FD_ioc_t *file_ptr) } done: - HDfree(file_ptr->file_path); + free(file_ptr->file_path); file_ptr->file_path = NULL; H5MM_free(file_ptr->file_dir); @@ -990,8 +990,8 @@ H5FD__ioc_cmp(const H5FD_t *_f1, const H5FD_t *_f2) H5FD_IOC_LOG_CALL(__func__); - HDassert(f1); - HDassert(f2); + assert(f1); + assert(f2); ret_value = (f1->file_id > f2->file_id) - (f1->file_id < f2->file_id); @@ -1108,7 +1108,7 @@ H5FD__ioc_get_eoa(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) H5FD_IOC_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); ret_value = file->eoa; @@ -1134,7 +1134,7 @@ H5FD__ioc_set_eoa(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, haddr_t addr) H5FD_IOC_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); file->eoa = addr; @@ -1163,7 +1163,7 @@ H5FD__ioc_get_eof(const H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type) H5FD_IOC_LOG_CALL(__func__); /* Sanity check */ - HDassert(file); + assert(file); sf_context = H5_get_subfiling_object(file->context_id); if (sf_context) { @@ -1222,8 +1222,8 @@ H5FD__ioc_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNUS H5FD_IOC_LOG_CALL(__func__); - HDassert(file && file->pub.cls); - HDassert(buf); + assert(file && file->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5F_addr_defined(addr)) @@ -1382,7 +1382,7 @@ H5FD__ioc_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5_ATTR_ H5FD_IOC_LOG_CALL(__func__); - HDassert(file); + assert(file); /* TODO: placeholder for now since Subfiling does the truncation */ if (!H5F_addr_eq(file->eoa, file->last_eoa)) { @@ -1454,7 +1454,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) if (NULL == (plist = H5P_object_verify(fapl, H5P_FILE_ACCESS))) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - HDassert(H5FD_IOC == H5P_peek_driver(plist)); + assert(H5FD_IOC == H5P_peek_driver(plist)); if (H5FD_mpi_self_initialized) { comm = MPI_COMM_WORLD; @@ -1486,7 +1486,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't get file dirname"); /* Try to open the subfiling configuration file and get the number of IOCs */ - if (NULL == (tmp_filename = HDmalloc(PATH_MAX))) + if (NULL == (tmp_filename = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate config file name buffer"); @@ -1498,10 +1498,10 @@ H5FD__ioc_del(const char *name, hid_t fapl) HDsnprintf(tmp_filename, PATH_MAX, "%s/" H5FD_SUBFILING_CONFIG_FILENAME_TEMPLATE, prefix_env ? prefix_env : file_dirname, base_filename, (uint64_t)st.st_ino); - if (NULL == (config_file = HDfopen(tmp_filename, "r"))) { + if (NULL == (config_file = fopen(tmp_filename, "r"))) { if (ENOENT == errno) { #ifdef H5FD_IOC_DEBUG - HDprintf("** WARNING: couldn't delete Subfiling configuration file '%s'\n", tmp_filename); + printf("** WARNING: couldn't delete Subfiling configuration file '%s'\n", tmp_filename); #endif H5_SUBFILING_GOTO_DONE(SUCCEED); @@ -1540,7 +1540,7 @@ H5FD__ioc_del(const char *name, hid_t fapl) if (HDremove(tmp_filename) < 0) { #ifdef H5FD_IOC_DEBUG - HDprintf("** WARNING: couldn't delete subfile '%s'\n", tmp_filename); + printf("** WARNING: couldn't delete subfile '%s'\n", tmp_filename); #endif if (ENOENT != errno) @@ -1576,7 +1576,7 @@ done: if (H5_mpi_info_free(&info) < 0) H5_SUBFILING_DONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "unable to free MPI info object"); - HDfree(tmp_filename); + free(tmp_filename); H5MM_free(file_dirname); H5MM_free(base_filename); @@ -1610,10 +1610,10 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT int64_t sf_context_id = -1; herr_t ret_value = SUCCEED; - HDassert(_file); - HDassert(addrs); - HDassert(sizes); - HDassert(bufs); + assert(_file); + assert(addrs); + assert(sizes); + assert(bufs); if (count == 0) H5_SUBFILING_GOTO_DONE(SUCCEED); @@ -1622,7 +1622,7 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT if (NULL == (sf_context = H5_get_subfiling_object(sf_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); + assert(sf_context->topology); /* * Allocate an array of I/O requests and an array twice that size for @@ -1633,9 +1633,9 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT * that blocking write calls do not return early before the data is * actually written. */ - if (NULL == (sf_io_reqs = HDcalloc((size_t)count, sizeof(*sf_io_reqs)))) + if (NULL == (sf_io_reqs = calloc((size_t)count, sizeof(*sf_io_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate I/O request array"); - if (NULL == (mpi_reqs = HDmalloc(2 * (size_t)count * sizeof(*mpi_reqs)))) + if (NULL == (mpi_reqs = malloc(2 * (size_t)count * sizeof(*mpi_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate MPI request array"); /* Each pass thru the following should queue an MPI write @@ -1669,12 +1669,12 @@ H5FD__ioc_write_vector_internal(H5FD_t *_file, uint32_t count, H5FD_mem_t H5_ATT H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't complete I/O requests"); done: - HDfree(mpi_reqs); + free(mpi_reqs); if (sf_io_reqs) { for (size_t i = 0; i < count; i++) - HDfree(sf_io_reqs[i]); - HDfree(sf_io_reqs); + free(sf_io_reqs[i]); + free(sf_io_reqs); } H5_SUBFILING_FUNC_LEAVE; @@ -1691,10 +1691,10 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s int64_t sf_context_id = -1; herr_t ret_value = SUCCEED; - HDassert(_file); - HDassert(addrs); - HDassert(sizes); - HDassert(bufs); + assert(_file); + assert(addrs); + assert(sizes); + assert(bufs); if (count == 0) H5_SUBFILING_GOTO_DONE(SUCCEED); @@ -1703,7 +1703,7 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s if (NULL == (sf_context = H5_get_subfiling_object(sf_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); + assert(sf_context->topology); /* * Allocate an array of I/O requests and an array for MPI_Request @@ -1712,9 +1712,9 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s * that the actual I/O call (currently, HDpread) has completed and * the data read from the file has been transferred to the caller. */ - if (NULL == (sf_io_reqs = HDcalloc((size_t)count, sizeof(*sf_io_reqs)))) + if (NULL == (sf_io_reqs = calloc((size_t)count, sizeof(*sf_io_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate I/O request array"); - if (NULL == (mpi_reqs = HDmalloc((size_t)count * sizeof(*mpi_reqs)))) + if (NULL == (mpi_reqs = malloc((size_t)count * sizeof(*mpi_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate MPI request array"); for (size_t i = 0; i < (size_t)count; i++) { @@ -1741,12 +1741,12 @@ H5FD__ioc_read_vector_internal(H5FD_t *_file, uint32_t count, haddr_t addrs[], s H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't complete I/O requests"); done: - HDfree(mpi_reqs); + free(mpi_reqs); if (sf_io_reqs) { for (size_t i = 0; i < count; i++) - HDfree(sf_io_reqs[i]); - HDfree(sf_io_reqs); + free(sf_io_reqs[i]); + free(sf_io_reqs); } H5_SUBFILING_FUNC_LEAVE; diff --git a/src/H5FDsubfiling/H5FDioc_int.c b/src/H5FDsubfiling/H5FDioc_int.c index ce5a000..fdde752 100644 --- a/src/H5FDsubfiling/H5FDioc_int.c +++ b/src/H5FDsubfiling/H5FDioc_int.c @@ -32,12 +32,12 @@ calculate_target_ioc(int64_t file_offset, int64_t stripe_size, int num_io_concen int64_t subfile_row; int64_t subfile_idx; - HDassert(stripe_size > 0); - HDassert(num_io_concentrators > 0); - HDassert(num_subfiles > 0); - HDassert(target_ioc); - HDassert(ioc_file_offset); - HDassert(ioc_subfile_idx); + assert(stripe_size > 0); + assert(num_io_concentrators > 0); + assert(num_subfiles > 0); + assert(target_ioc); + assert(ioc_file_offset); + assert(ioc_subfile_idx); stripe_idx = file_offset / stripe_size; subfile_row = stripe_idx / num_subfiles; @@ -111,12 +111,12 @@ ioc__write_independent_async(int64_t context_id, int64_t offset, int64_t element int mpi_code; herr_t ret_value = SUCCEED; - HDassert(io_req); + assert(io_req); if (NULL == (sf_context = H5_get_subfiling_object(context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); - HDassert(sf_context->topology->io_concentrators); + assert(sf_context->topology); + assert(sf_context->topology->io_concentrators); io_concentrators = sf_context->topology->io_concentrators; num_io_concentrators = sf_context->topology->n_io_concentrators; @@ -167,7 +167,7 @@ ioc__write_independent_async(int64_t context_id, int64_t offset, int64_t element * Allocate the I/O request object that will * be returned to the caller */ - if (NULL == (sf_io_request = HDmalloc(sizeof(io_req_t)))) + if (NULL == (sf_io_request = malloc(sizeof(io_req_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_WRITEERROR, FAIL, "couldn't allocate I/O request"); H5_CHECK_OVERFLOW(ioc_start, int64_t, int); @@ -228,7 +228,7 @@ done: } } - HDfree(sf_io_request); + free(sf_io_request); *io_req = NULL; } @@ -283,14 +283,14 @@ ioc__read_independent_async(int64_t context_id, int64_t offset, int64_t elements int mpi_code; herr_t ret_value = SUCCEED; - HDassert(io_req); + assert(io_req); H5_CHECK_OVERFLOW(elements, int64_t, int); if (NULL == (sf_context = H5_get_subfiling_object(context_id))) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "can't get subfiling context from ID"); - HDassert(sf_context->topology); - HDassert(sf_context->topology->io_concentrators); + assert(sf_context->topology); + assert(sf_context->topology->io_concentrators); io_concentrators = sf_context->topology->io_concentrators; num_io_concentrators = sf_context->topology->n_io_concentrators; @@ -320,7 +320,7 @@ ioc__read_independent_async(int64_t context_id, int64_t offset, int64_t elements * Allocate the I/O request object that will * be returned to the caller */ - if (NULL == (sf_io_request = HDmalloc(sizeof(io_req_t)))) + if (NULL == (sf_io_request = malloc(sizeof(io_req_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_READERROR, FAIL, "couldn't allocate I/O request"); H5_CHECK_OVERFLOW(ioc_start, int64_t, int); @@ -402,7 +402,7 @@ done: } } - HDfree(sf_io_request); + free(sf_io_request); *io_req = NULL; } @@ -426,7 +426,7 @@ ioc__async_completion(MPI_Request *mpi_reqs, size_t num_reqs) herr_t ret_value = SUCCEED; int mpi_code; - HDassert(mpi_reqs); + assert(mpi_reqs); H5_CHECK_OVERFLOW(num_reqs, size_t, int); if (MPI_SUCCESS != (mpi_code = MPI_Waitall((int)num_reqs, mpi_reqs, MPI_STATUSES_IGNORE))) diff --git a/src/H5FDsubfiling/H5FDioc_priv.h b/src/H5FDsubfiling/H5FDioc_priv.h index 8dec1a8..cac2806 100644 --- a/src/H5FDsubfiling/H5FDioc_priv.h +++ b/src/H5FDsubfiling/H5FDioc_priv.h @@ -79,15 +79,15 @@ #define H5FD_IOC__Q_APPEND(q_ptr, entry_ptr) \ do { \ - HDassert(q_ptr); \ - HDassert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ - HDassert((((q_ptr)->q_len == 0) && ((q_ptr)->q_head == NULL) && ((q_ptr)->q_tail == NULL)) || \ + assert(q_ptr); \ + assert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ + assert((((q_ptr)->q_len == 0) && ((q_ptr)->q_head == NULL) && ((q_ptr)->q_tail == NULL)) || \ (((q_ptr)->q_len > 0) && ((q_ptr)->q_head != NULL) && ((q_ptr)->q_tail != NULL))); \ - HDassert(entry_ptr); \ - HDassert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ - HDassert((entry_ptr)->next == NULL); \ - HDassert((entry_ptr)->prev == NULL); \ - HDassert((entry_ptr)->in_progress == FALSE); \ + assert(entry_ptr); \ + 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); \ \ if ( ((q_ptr)->q_head) == NULL ) \ { \ @@ -105,15 +105,15 @@ do { #define H5FD_IOC__Q_REMOVE(q_ptr, entry_ptr) \ do { \ - HDassert(q_ptr); \ - HDassert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ - HDassert((((q_ptr)->q_len == 1) && ((q_ptr)->q_head ==((q_ptr)->q_tail)) && ((q_ptr)->q_head == (entry_ptr))) || \ + assert(q_ptr); \ + assert((q_ptr)->magic == H5FD_IOC__IO_Q_MAGIC); \ + assert((((q_ptr)->q_len == 1) && ((q_ptr)->q_head ==((q_ptr)->q_tail)) && ((q_ptr)->q_head == (entry_ptr))) || \ (((q_ptr)->q_len > 0) && ((q_ptr)->q_head != NULL) && ((q_ptr)->q_tail != NULL))); \ - HDassert(entry_ptr); \ - HDassert((entry_ptr)->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); \ - HDassert((((q_ptr)->q_len == 1) && ((entry_ptr)->next == NULL) && ((entry_ptr)->prev == NULL)) || \ + assert(entry_ptr); \ + 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)))); \ - HDassert((entry_ptr)->in_progress == TRUE); \ + assert((entry_ptr)->in_progress == TRUE); \ \ { \ if ( (((q_ptr)->q_head)) == (entry_ptr) ) \ diff --git a/src/H5FDsubfiling/H5FDioc_threads.c b/src/H5FDsubfiling/H5FDioc_threads.c index abf816d..4e72d39 100644 --- a/src/H5FDsubfiling/H5FDioc_threads.c +++ b/src/H5FDsubfiling/H5FDioc_threads.c @@ -119,13 +119,13 @@ initialize_ioc_threads(void *_sf_context) double t_start = 0.0, t_end = 0.0; #endif - HDassert(sf_context); + assert(sf_context); /* * Allocate and initialize IOC data that will be passed * to the IOC main thread */ - if (NULL == (ioc_data = HDmalloc(sizeof(*ioc_data)))) + if (NULL == (ioc_data = malloc(sizeof(*ioc_data)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, (-1), "can't allocate IOC data for IOC main thread"); ioc_data->sf_context_id = sf_context->sf_context_id; @@ -171,7 +171,7 @@ initialize_ioc_threads(void *_sf_context) /* Allow experimentation with the number of helper threads */ if ((env_value = HDgetenv(H5FD_IOC_THREAD_POOL_SIZE)) != NULL) { - int value_check = HDatoi(env_value); + int value_check = atoi(env_value); if (value_check > 0) { thread_pool_size = (unsigned int)value_check; } @@ -195,8 +195,8 @@ initialize_ioc_threads(void *_sf_context) #ifdef H5FD_IOC_DEBUG if (sf_context->topology->ioc_idx == 0) { - HDprintf("%s: time = %lf seconds\n", __func__, (t_end - t_start)); - HDfflush(stdout); + printf("%s: time = %lf seconds\n", __func__, (t_end - t_start)); + fflush(stdout); } #endif @@ -213,12 +213,12 @@ finalize_ioc_threads(void *_sf_context) ioc_data_t *ioc_data = NULL; int ret_value = 0; - HDassert(sf_context); - HDassert(sf_context->topology->rank_is_ioc); + assert(sf_context); + assert(sf_context->topology->rank_is_ioc); ioc_data = sf_context->ioc_data; if (ioc_data) { - HDassert(0 == atomic_load(&ioc_data->sf_shutdown_flag)); + assert(0 == atomic_load(&ioc_data->sf_shutdown_flag)); /* Shutdown the main IOC thread */ atomic_store(&ioc_data->sf_shutdown_flag, 1); @@ -229,7 +229,7 @@ finalize_ioc_threads(void *_sf_context) } while (0 != atomic_load(&ioc_data->sf_shutdown_flag)); /* Tear down IOC worker thread pool */ - HDassert(0 == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(0 == atomic_load(&ioc_data->sf_io_ops_pending)); hg_thread_pool_destroy(ioc_data->io_thread_pool); hg_thread_mutex_destroy(&ioc_data->io_queue.q_mutex); @@ -242,7 +242,7 @@ finalize_ioc_threads(void *_sf_context) H5_SUBFILING_DONE_ERROR(H5E_IO, H5E_CLOSEERROR, -1, "%" PRId32 " I/O requests failed", ioc_data->io_queue.num_failed); - HDfree(ioc_data); + free(ioc_data); sf_context->ioc_data = NULL; H5_SUBFILING_FUNC_LEAVE; @@ -345,10 +345,10 @@ ioc_main(ioc_data_t *ioc_data) int shutdown_requested; int ret_value = 0; - HDassert(ioc_data); + assert(ioc_data); context = H5_get_subfiling_object(ioc_data->sf_context_id); - HDassert(context); + assert(context); /* We can't have opened any files at this point.. * The file open approach has changed so that the normal @@ -398,7 +398,7 @@ ioc_main(ioc_data_t *ioc_data) * Zero out work request, since the received message should * be smaller than sizeof(sf_work_request_t) */ - HDmemset(&wk_req, 0, sizeof(sf_work_request_t)); + memset(&wk_req, 0, sizeof(sf_work_request_t)); if (MPI_SUCCESS != (mpi_code = MPI_Recv(&wk_req, count, MPI_BYTE, source, tag, context->sf_msg_comm, MPI_STATUS_IGNORE))) @@ -416,7 +416,7 @@ ioc_main(ioc_data_t *ioc_data) ioc_io_queue_add_entry(ioc_data, &wk_req); - HDassert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); + assert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); } else { struct timespec sleep_spec = {0, IOC_MAIN_SLEEP_DELAY}; @@ -501,15 +501,15 @@ handle_work_request(void *arg) int op_ret; hg_thread_ret_t ret_value = 0; - HDassert(q_entry_ptr); - HDassert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); - HDassert(q_entry_ptr->in_progress); + assert(q_entry_ptr); + assert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(q_entry_ptr->in_progress); sf_context = H5_get_subfiling_object(file_context_id); - HDassert(sf_context); + assert(sf_context); ioc_data = sf_context->ioc_data; - HDassert(ioc_data); + assert(ioc_data); atomic_fetch_add(&ioc_data->sf_work_pending, 1); @@ -559,14 +559,14 @@ handle_work_request(void *arg) #ifdef H5FD_IOC_DEBUG { int curr_io_ops_pending = atomic_load(&ioc_data->sf_io_ops_pending); - HDassert(curr_io_ops_pending > 0); + assert(curr_io_ops_pending > 0); } #endif /* complete the I/O request */ ioc_io_queue_complete_entry(ioc_data, q_entry_ptr); - HDassert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); + assert(atomic_load(&ioc_data->sf_io_ops_pending) >= 0); /* Check the I/O Queue to see if there are any dispatchable entries */ ioc_io_queue_dispatch_eligible_entries(ioc_data, 1); @@ -617,7 +617,7 @@ send_ack_to_client(int ack_val, int dest_rank, int source_rank, int msg_tag, MPI int mpi_code; herr_t ret_value = SUCCEED; - HDassert(ack_val > 0); + assert(ack_val > 0); (void)source_rank; @@ -697,7 +697,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; @@ -712,7 +712,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ } sf_context = H5_get_subfiling_object(file_context_id); - HDassert(sf_context); + assert(sf_context); stripe_id = file_offset + data_size; sf_eof = (haddr_t)(stripe_id % sf_context->sf_stripe_size); @@ -739,7 +739,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ #endif /* Allocate space to receive data sent from the client */ - if (NULL == (recv_buf = HDmalloc((size_t)data_size))) { + if (NULL == (recv_buf = malloc((size_t)data_size))) { send_nack = TRUE; H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, -1, "couldn't allocate receive buffer for data"); } @@ -751,7 +751,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ * allows us to distinguish between multiple concurrent * writes from a single rank. */ - HDassert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); + assert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); rcv_tag = (int)(counter % (INT_MAX - IO_TAG_BASE)); rcv_tag %= (*H5FD_IOC_tag_ub_val_ptr - IO_TAG_BASE); rcv_tag += IO_TAG_BASE; @@ -787,7 +787,7 @@ ioc_file_queue_write_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_ #endif - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); sf_fid = sf_context->sf_fids[subfile_idx]; #ifdef H5_SUBFILING_DEBUG @@ -836,7 +836,7 @@ done: H5_SUBFILING_DONE_ERROR(H5E_IO, H5E_WRITEERROR, -1, "couldn't send NACK to client"); } - HDfree(recv_buf); + free(recv_buf); H5_SUBFILING_FUNC_LEAVE; } /* ioc_file_queue_write_indep() */ @@ -883,12 +883,12 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; sf_context = H5_get_subfiling_object(file_context_id); - HDassert(sf_context); + assert(sf_context); /* * If we are using 1 subfile per IOC, we can optimize reads @@ -935,7 +935,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C #endif /* Allocate space to send data read from file to client */ - if (NULL == (send_buf = HDmalloc((size_t)data_size))) { + if (NULL == (send_buf = malloc((size_t)data_size))) { if (need_data_tag) { send_nack = TRUE; send_empty_buf = FALSE; @@ -952,7 +952,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C * reads from a single rank, which can happen when a rank * owns multiple subfiles. */ - HDassert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); + assert(H5FD_IOC_tag_ub_val_ptr && (*H5FD_IOC_tag_ub_val_ptr >= IO_TAG_BASE)); send_tag = (int)(counter % (INT_MAX - IO_TAG_BASE)); send_tag %= (*H5FD_IOC_tag_ub_val_ptr - IO_TAG_BASE); send_tag += IO_TAG_BASE; @@ -964,7 +964,7 @@ ioc_file_queue_read_indep(sf_work_request_t *msg, int ioc_idx, int source, MPI_C } /* Read data from the subfile */ - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); sf_fid = sf_context->sf_fids[subfile_idx]; if (sf_fid < 0) H5_SUBFILING_GOTO_ERROR(H5E_IO, H5E_BADVALUE, -1, "subfile file descriptor %d is invalid", sf_fid); @@ -1010,7 +1010,7 @@ done: H5_SUBFILING_MPI_DONE_ERROR(-1, "MPI_Send failed", mpi_code); } - HDfree(send_buf); + free(send_buf); return ret_value; } /* end ioc_file_queue_read_indep() */ @@ -1047,8 +1047,8 @@ ioc_file_write_data(int fd, int64_t file_offset, void *data_buffer, int64_t data bytes_remaining -= bytes_written; #ifdef H5FD_IOC_DEBUG - HDprintf("[ioc(%d) %s]: wrote %ld bytes, remaining=%ld, file_offset=%" PRId64 "\n", ioc_idx, - __func__, bytes_written, bytes_remaining, file_offset); + printf("[ioc(%d) %s]: wrote %ld bytes, remaining=%ld, file_offset=%" PRId64 "\n", ioc_idx, + __func__, bytes_written, bytes_remaining, file_offset); #endif this_data += bytes_written; @@ -1099,25 +1099,25 @@ ioc_file_read_data(int fd, int64_t file_offset, void *data_buffer, int64_t data_ bytes_remaining -= bytes_read; #ifdef H5FD_IOC_DEBUG - HDprintf("[ioc(%d) %s]: read %ld bytes, remaining=%ld, file_offset=%" PRId64 "\n", ioc_idx, - __func__, bytes_read, bytes_remaining, file_offset); + printf("[ioc(%d) %s]: read %ld bytes, remaining=%ld, file_offset=%" PRId64 "\n", ioc_idx, + __func__, bytes_read, bytes_remaining, file_offset); #endif this_buffer += bytes_read; file_offset += bytes_read; } else if (bytes_read == 0) { - HDassert(bytes_remaining > 0); + assert(bytes_remaining > 0); /* end of file but not end of format address space */ - HDmemset(this_buffer, 0, (size_t)bytes_remaining); + memset(this_buffer, 0, (size_t)bytes_remaining); break; } else { if (retries == 0) { #ifdef H5FD_IOC_DEBUG - HDprintf("[ioc(%d) %s]: TIMEOUT: file_offset=%" PRId64 ", data_size=%ld\n", ioc_idx, __func__, - file_offset, data_size); + printf("[ioc(%d) %s]: TIMEOUT: file_offset=%" PRId64 ", data_size=%ld\n", ioc_idx, __func__, + file_offset, data_size); #endif H5_SUBFILING_SYS_GOTO_ERROR(H5E_IO, H5E_READERROR, -1, "HDpread failed"); @@ -1145,7 +1145,7 @@ ioc_file_truncate(sf_work_request_t *msg) int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; ioc_idx = msg->ioc_idx; @@ -1160,7 +1160,7 @@ ioc_file_truncate(sf_work_request_t *msg) if (NULL == (sf_context = H5_get_subfiling_object(file_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_CANTGET, -1, "couldn't retrieve subfiling context"); - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); fd = sf_context->sf_fids[subfile_idx]; @@ -1176,9 +1176,9 @@ ioc_file_truncate(sf_work_request_t *msg) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Send failed", mpi_code); #ifdef H5FD_IOC_DEBUG - HDprintf("[ioc(%d) %s]: truncated subfile to %lld bytes. ret = %d\n", ioc_idx, __func__, - (long long)length, errno); - HDfflush(stdout); + printf("[ioc(%d) %s]: truncated subfile to %lld bytes. ret = %d\n", ioc_idx, __func__, (long long)length, + errno); + fflush(stdout); #endif done: @@ -1219,7 +1219,7 @@ ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm) int mpi_code; int ret_value = 0; - HDassert(msg); + assert(msg); file_context_id = msg->context_id; source = msg->source; @@ -1230,7 +1230,7 @@ ioc_file_report_eof(sf_work_request_t *msg, MPI_Comm comm) if (NULL == (sf_context = H5_get_subfiling_object(file_context_id))) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_CANTGET, -1, "couldn't retrieve subfiling context"); - HDassert(subfile_idx < sf_context->sf_num_fids); + assert(subfile_idx < sf_context->sf_num_fids); fd = sf_context->sf_fids[subfile_idx]; @@ -1273,7 +1273,7 @@ ioc_io_queue_alloc_entry(void) { ioc_io_queue_entry_t *q_entry_ptr = NULL; - q_entry_ptr = (ioc_io_queue_entry_t *)HDmalloc(sizeof(ioc_io_queue_entry_t)); + q_entry_ptr = (ioc_io_queue_entry_t *)malloc(sizeof(ioc_io_queue_entry_t)); if (q_entry_ptr) { @@ -1326,21 +1326,21 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) { ioc_io_queue_entry_t *entry_ptr = NULL; - HDassert(ioc_data); - HDassert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); - HDassert(wk_req_ptr); + assert(ioc_data); + assert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); + assert(wk_req_ptr); entry_ptr = ioc_io_queue_alloc_entry(); - HDassert(entry_ptr); - HDassert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(entry_ptr); + assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); - HDmemcpy((void *)(&(entry_ptr->wk_req)), (const void *)wk_req_ptr, sizeof(sf_work_request_t)); + memcpy((void *)(&(entry_ptr->wk_req)), (const void *)wk_req_ptr, sizeof(sf_work_request_t)); /* must obtain io_queue mutex before appending */ hg_thread_mutex_lock(&ioc_data->io_queue.q_mutex); - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); entry_ptr->counter = ioc_data->io_queue.req_counter++; @@ -1360,7 +1360,7 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) atomic_load(&ioc_data->sf_io_ops_pending)); #endif - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); #ifdef H5FD_IOC_COLLECT_STATS entry_ptr->q_time = H5_now_usec(); @@ -1398,7 +1398,7 @@ ioc_io_queue_add_entry(ioc_data_t *ioc_data, sf_work_request_t *wk_req_ptr) } #endif - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); hg_thread_mutex_unlock(&ioc_data->io_queue.q_mutex); @@ -1457,8 +1457,8 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) ioc_io_queue_entry_t *entry_ptr = NULL; ioc_io_queue_entry_t *scan_ptr = NULL; - HDassert(ioc_data); - HDassert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); + assert(ioc_data); + assert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); if (try_lock) { if (hg_thread_mutex_try_lock(&ioc_data->io_queue.q_mutex) < 0) @@ -1470,11 +1470,11 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) entry_ptr = ioc_data->io_queue.q_head; /* sanity check on first element in the I/O queue */ - HDassert((entry_ptr == NULL) || (entry_ptr->prev == NULL)); + assert((entry_ptr == NULL) || (entry_ptr->prev == NULL)); while ((entry_ptr) && (ioc_data->io_queue.num_pending > 0)) { - HDassert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); /* Check for a get EOF or truncate operation at head of queue */ if (ioc_data->io_queue.q_head->in_progress) { @@ -1499,7 +1499,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) scan_ptr = entry_ptr->prev; - HDassert((scan_ptr == NULL) || (scan_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC)); + assert((scan_ptr == NULL) || (scan_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC)); if ((entry_ptr->wk_req.tag == TRUNC_OP) || (entry_ptr->wk_req.tag == GET_EOF_OP)) { @@ -1539,18 +1539,18 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) if (!conflict_detected) { /* dispatch I/O request */ - HDassert(scan_ptr == NULL); - HDassert(!entry_ptr->in_progress); + assert(scan_ptr == NULL); + assert(!entry_ptr->in_progress); entry_ptr->in_progress = TRUE; - HDassert(ioc_data->io_queue.num_pending > 0); + assert(ioc_data->io_queue.num_pending > 0); ioc_data->io_queue.num_pending--; ioc_data->io_queue.num_in_progress++; - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == - ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == + ioc_data->io_queue.q_len); entry_ptr->thread_wk.func = handle_work_request; entry_ptr->thread_wk.args = entry_ptr; @@ -1583,7 +1583,7 @@ ioc_io_queue_dispatch_eligible_entries(ioc_data_t *ioc_data, hbool_t try_lock) entry_ptr = entry_ptr->next; } - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); hg_thread_mutex_unlock(&ioc_data->io_queue.q_mutex); } /* ioc_io_queue_dispatch_eligible_entries() */ @@ -1616,16 +1616,16 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt uint64_t execution_time; #endif - HDassert(ioc_data); - HDassert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); - HDassert(entry_ptr); - HDassert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(ioc_data); + assert(ioc_data->io_queue.magic == H5FD_IOC__IO_Q_MAGIC); + assert(entry_ptr); + assert(entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); /* must obtain io_queue mutex before deleting and updating stats */ hg_thread_mutex_lock(&ioc_data->io_queue.q_mutex); - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); - HDassert(ioc_data->io_queue.num_in_progress > 0); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_in_progress > 0); if (entry_ptr->wk_ret < 0) ioc_data->io_queue.num_failed++; @@ -1634,7 +1634,7 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt ioc_data->io_queue.num_in_progress--; - HDassert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); + assert(ioc_data->io_queue.num_pending + ioc_data->io_queue.num_in_progress == ioc_data->io_queue.q_len); atomic_fetch_sub(&ioc_data->sf_io_ops_pending, 1); @@ -1652,10 +1652,10 @@ ioc_io_queue_complete_entry(ioc_data_t *ioc_data, ioc_io_queue_entry_t *entry_pt * there aren't other operations in progress */ if ((entry_ptr->wk_req.tag == GET_EOF_OP) || (entry_ptr->wk_req.tag == TRUNC_OP)) - HDassert(ioc_data->io_queue.num_in_progress == 0); + assert(ioc_data->io_queue.num_in_progress == 0); #endif - HDassert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); + assert(ioc_data->io_queue.q_len == atomic_load(&ioc_data->sf_io_ops_pending)); #ifdef H5FD_IOC_COLLECT_STATS /* Compute the queued and execution time */ @@ -1696,14 +1696,14 @@ static void ioc_io_queue_free_entry(ioc_io_queue_entry_t *q_entry_ptr) { /* use assertions for error checking, since the following should never fail. */ - HDassert(q_entry_ptr); - HDassert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); - HDassert(q_entry_ptr->next == NULL); - HDassert(q_entry_ptr->prev == NULL); + assert(q_entry_ptr); + assert(q_entry_ptr->magic == H5FD_IOC__IO_Q_ENTRY_MAGIC); + assert(q_entry_ptr->next == NULL); + assert(q_entry_ptr->prev == NULL); q_entry_ptr->magic = 0; - HDfree(q_entry_ptr); + free(q_entry_ptr); q_entry_ptr = NULL; diff --git a/src/H5FDsubfiling/H5FDsubfile_int.c b/src/H5FDsubfiling/H5FDsubfile_int.c index 4c583e8..b8b2725 100644 --- a/src/H5FDsubfiling/H5FDsubfile_int.c +++ b/src/H5FDsubfiling/H5FDsubfile_int.c @@ -101,10 +101,10 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, num_subfiles_owned = sf_context->sf_num_fids; - if (NULL == (recv_reqs = HDmalloc((size_t)num_subfiles_owned * sizeof(*recv_reqs)))) + if (NULL == (recv_reqs = malloc((size_t)num_subfiles_owned * sizeof(*recv_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive requests array"); - if (NULL == (recv_msgs = HDmalloc((size_t)num_subfiles_owned * 3 * sizeof(*recv_msgs)))) + if (NULL == (recv_msgs = malloc((size_t)num_subfiles_owned * 3 * sizeof(*recv_msgs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate message array"); /* @@ -175,7 +175,7 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, } } - HDassert(test_file_eof == logical_file_eof); + assert(test_file_eof == logical_file_eof); } #endif /* NDEBUG */ } @@ -186,8 +186,8 @@ H5FD__subfiling__truncate_sub_files(hid_t context_id, int64_t logical_file_eof, H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code); done: - HDfree(recv_msgs); - HDfree(recv_reqs); + free(recv_msgs); + free(recv_reqs); H5_SUBFILING_FUNC_LEAVE; } /* H5FD__subfiling__truncate_sub_files() */ @@ -295,24 +295,24 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(logical_eof_ptr); + assert(logical_eof_ptr); if (NULL == (sf_context = (subfiling_context_t *)H5_get_subfiling_object(context_id))) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "can't get subfile context"); - HDassert(sf_context->topology); + assert(sf_context->topology); n_io_concentrators = sf_context->topology->n_io_concentrators; num_subfiles = sf_context->sf_num_subfiles; - HDassert(n_io_concentrators > 0); - HDassert(num_subfiles >= n_io_concentrators); + assert(n_io_concentrators > 0); + assert(num_subfiles >= n_io_concentrators); - if (NULL == (sf_eofs = HDmalloc((size_t)num_subfiles * sizeof(int64_t)))) + if (NULL == (sf_eofs = malloc((size_t)num_subfiles * sizeof(int64_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile EOFs array"); - if (NULL == (recv_reqs = HDmalloc((size_t)num_subfiles * sizeof(*recv_reqs)))) + if (NULL == (recv_reqs = malloc((size_t)num_subfiles * sizeof(*recv_reqs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive requests array"); - if (NULL == (recv_msg = HDmalloc((size_t)num_subfiles * sizeof(msg)))) + if (NULL == (recv_msg = malloc((size_t)num_subfiles * sizeof(msg)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate message array"); for (int i = 0; i < num_subfiles; i++) { @@ -352,9 +352,9 @@ H5FD__subfiling__get_real_eof(hid_t context_id, int64_t *logical_eof_ptr) for (int i = 0; i < num_subfiles; i++) { int ioc_rank = (int)recv_msg[3 * i]; - HDassert(ioc_rank >= 0); - HDassert(ioc_rank < n_io_concentrators); - HDassert(sf_eofs[i] == -1); + assert(ioc_rank >= 0); + assert(ioc_rank < n_io_concentrators); + assert(sf_eofs[i] == -1); sf_eofs[i] = recv_msg[(3 * i) + 1]; } @@ -405,9 +405,9 @@ done: } } - HDfree(recv_msg); - HDfree(recv_reqs); - HDfree(sf_eofs); + free(recv_msg); + free(recv_reqs); + free(sf_eofs); H5_SUBFILING_FUNC_LEAVE; } /* H5FD__subfiling__get_real_eof() */ diff --git a/src/H5FDsubfiling/H5FDsubfiling.c b/src/H5FDsubfiling/H5FDsubfiling.c index 64c92ed..2371895 100644 --- a/src/H5FDsubfiling/H5FDsubfiling.c +++ b/src/H5FDsubfiling/H5FDsubfiling.c @@ -393,8 +393,8 @@ H5FD__subfiling_term(void) } #ifdef H5FD_SUBFILING_DEBUG else - HDprintf("** WARNING **: HDF5 is terminating the Subfiling VFD after MPI_Finalize() was " - "called - an HDF5 ID was probably left unclosed\n"); + printf("** WARNING **: HDF5 is terminating the Subfiling VFD after MPI_Finalize() was " + "called - an HDF5 ID was probably left unclosed\n"); #endif } @@ -468,7 +468,7 @@ H5Pset_fapl_subfiling(hid_t fapl_id, const H5FD_subfiling_config_t *vfd_config) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); if (vfd_config == NULL) { - if (NULL == (subfiling_conf = HDcalloc(1, sizeof(*subfiling_conf)))) + if (NULL == (subfiling_conf = calloc(1, sizeof(*subfiling_conf)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfiling VFD configuration"); subfiling_conf->ioc_fapl_id = H5I_INVALID_HID; @@ -516,7 +516,7 @@ done: if (subfiling_conf) { if (subfiling_conf->ioc_fapl_id >= 0 && H5I_dec_ref(subfiling_conf->ioc_fapl_id) < 0) H5_SUBFILING_DONE_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't close IOC FAPL"); - HDfree(subfiling_conf); + free(subfiling_conf); } H5_SUBFILING_FUNC_LEAVE_API; @@ -566,7 +566,7 @@ H5Pget_fapl_subfiling(hid_t fapl_id, H5FD_subfiling_config_t *config_out) } else { /* Copy the subfiling fapl data out */ - HDmemcpy(config_out, config_ptr, sizeof(H5FD_subfiling_config_t)); + memcpy(config_out, config_ptr, sizeof(H5FD_subfiling_config_t)); /* Copy the driver info value */ if (H5FD__copy_plist(config_ptr->ioc_fapl_id, &(config_out->ioc_fapl_id)) < 0) @@ -585,9 +585,9 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi char *h5_require_ioc; herr_t ret_value = SUCCEED; - HDassert(config_out); + assert(config_out); - HDmemset(config_out, 0, sizeof(*config_out)); + memset(config_out, 0, sizeof(*config_out)); config_out->magic = H5FD_SUBFILING_FAPL_MAGIC; config_out->version = H5FD_SUBFILING_CURR_FAPL_VERSION; @@ -599,7 +599,7 @@ H5FD__subfiling_get_default_config(hid_t fapl_id, H5FD_subfiling_config_t *confi config_out->shared_cfg.stripe_count = H5FD_SUBFILING_DEFAULT_STRIPE_COUNT; if ((h5_require_ioc = HDgetenv("H5_REQUIRE_IOC")) != NULL) { - int value_check = HDatoi(h5_require_ioc); + int value_check = atoi(h5_require_ioc); if (value_check == 0) config_out->require_ioc = FALSE; } @@ -668,7 +668,7 @@ H5FD__subfiling_validate_config(const H5FD_subfiling_config_t *fa) { herr_t ret_value = SUCCEED; - HDassert(fa != NULL); + assert(fa != NULL); if (fa->version != H5FD_SUBFILING_CURR_FAPL_VERSION) H5_SUBFILING_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown H5FD_subfiling_config_t version"); @@ -706,7 +706,7 @@ H5FD__subfiling_sb_size(H5FD_t *_file) H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; hsize_t ret_value = 0; - HDassert(file); + assert(file); /* Configuration structure magic number */ ret_value += sizeof(uint32_t); @@ -824,7 +824,7 @@ H5FD__subfiling_sb_encode(H5FD_t *_file, char *name, unsigned char *buf) /* Encode config file prefix string */ if (sf_context->config_file_prefix) { - HDmemcpy(p, sf_context->config_file_prefix, prefix_len); + memcpy(p, sf_context->config_file_prefix, prefix_len); p += prefix_len; } @@ -832,14 +832,14 @@ H5FD__subfiling_sb_encode(H5FD_t *_file, char *name, unsigned char *buf) if (file->sf_file) { char ioc_name[9]; - HDmemset(ioc_name, 0, sizeof(ioc_name)); + memset(ioc_name, 0, sizeof(ioc_name)); if (H5FD_sb_encode(file->sf_file, ioc_name, p + 9) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTENCODE, FAIL, "unable to encode IOC VFD's superblock information"); /* Copy the IOC VFD's name into our buffer */ - HDmemcpy(p, ioc_name, 9); + memcpy(p, ioc_name, 9); } done: @@ -902,11 +902,11 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char * /* Decode config file prefix string */ if (tmpu64 > 0) { if (!sf_context->config_file_prefix) { - if (NULL == (sf_context->config_file_prefix = HDmalloc(tmpu64))) + if (NULL == (sf_context->config_file_prefix = malloc(tmpu64))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate space for config file prefix string"); - HDmemcpy(sf_context->config_file_prefix, p, tmpu64); + memcpy(sf_context->config_file_prefix, p, tmpu64); /* Just in case.. */ sf_context->config_file_prefix[tmpu64 - 1] = '\0'; @@ -918,7 +918,7 @@ H5FD__subfiling_sb_decode(H5FD_t *_file, const char *name, const unsigned char * if (file->sf_file) { char ioc_name[9]; - HDmemcpy(ioc_name, p, 9); + memcpy(ioc_name, p, 9); p += 9; if (H5FD_sb_load(file->sf_file, ioc_name, p) < 0) @@ -976,7 +976,7 @@ H5FD__subfiling_fapl_get(H5FD_t *_file) } /* Copy the fields of the structure */ - HDmemcpy(fa, &(file->fa), sizeof(H5FD_subfiling_config_t)); + memcpy(fa, &(file->fa), sizeof(H5FD_subfiling_config_t)); /* Copy the driver info value */ if (H5FD__copy_plist(file->fa.ioc_fapl_id, &(fa->ioc_fapl_id)) < 0) @@ -1012,7 +1012,7 @@ H5FD__copy_plist(hid_t fapl_id, hid_t *id_out_ptr) int ret_value = 0; H5P_genplist_t *plist_ptr = NULL; - HDassert(id_out_ptr != NULL); + assert(id_out_ptr != NULL); 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"); @@ -1055,7 +1055,7 @@ H5FD__subfiling_fapl_copy(const void *_old_fa) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); } - HDmemcpy(new_fa, old_fa, sizeof(H5FD_subfiling_config_t)); + memcpy(new_fa, old_fa, sizeof(H5FD_subfiling_config_t)); if (H5FD__copy_plist(old_fa->ioc_fapl_id, &(new_fa->ioc_fapl_id)) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy the IOC FAPL"); @@ -1091,7 +1091,7 @@ H5FD__subfiling_fapl_free(void *_fa) H5FD_subfiling_config_t *fa = (H5FD_subfiling_config_t *)_fa; herr_t ret_value = SUCCEED; - HDassert(fa != NULL); /* sanity check */ + assert(fa != NULL); /* sanity check */ if (fa->ioc_fapl_id >= 0 && H5I_dec_ref(fa->ioc_fapl_id) < 0) H5_SUBFILING_DONE_ERROR(H5E_PLIST, H5E_CANTDEC, FAIL, "can't close IOC FAPL"); @@ -1193,7 +1193,7 @@ H5FD__subfiling_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t ma config_ptr = &default_config; } - HDmemcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_subfiling_config_t)); + memcpy(&file_ptr->fa, config_ptr, sizeof(H5FD_subfiling_config_t)); if (H5FD__copy_plist(config_ptr->ioc_fapl_id, &(file_ptr->fa.ioc_fapl_id)) < 0) { file_ptr->fa.ioc_fapl_id = H5I_INVALID_HID; H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "can't copy FAPL"); @@ -1318,7 +1318,7 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(file_ptr); + assert(file_ptr); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Finalized failed", mpi_code); @@ -1346,7 +1346,7 @@ H5FD__subfiling_close_int(H5FD_subfiling_t *file_ptr) file_ptr->fail_to_encode = FALSE; done: - HDfree(file_ptr->file_path); + free(file_ptr->file_path); file_ptr->file_path = NULL; H5MM_free(file_ptr->file_dir); @@ -1404,8 +1404,8 @@ H5FD__subfiling_cmp(const H5FD_t *_f1, const H5FD_t *_f2) const H5FD_subfiling_t *f2 = (const H5FD_subfiling_t *)_f2; int ret_value = 0; - HDassert(f1); - HDassert(f2); + assert(f1); + assert(f2); ret_value = H5FD_cmp(f1->sf_file, f2->sf_file); @@ -1585,8 +1585,8 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i int num_subfiles; herr_t ret_value = SUCCEED; - HDassert(file_ptr && file_ptr->pub.cls); - HDassert(buf); + assert(file_ptr && file_ptr->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5F_addr_defined(addr)) @@ -1636,8 +1636,8 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i * underlying I/O operations. */ sf_context = (subfiling_context_t *)H5_get_subfiling_object(file_ptr->context_id); - HDassert(sf_context); - HDassert(sf_context->topology); + assert(sf_context); + assert(sf_context->topology); num_subfiles = sf_context->sf_num_subfiles; @@ -1675,14 +1675,14 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i * to contain the translation of the I/O request into a collection of * I/O requests. */ - if (NULL == (source_data_offset = - HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) + if (NULL == + (source_data_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate source data offset I/O vector"); - if (NULL == (sf_data_size = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) + if (NULL == (sf_data_size = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile data size I/O vector"); - if (NULL == (sf_offset = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) + if (NULL == (sf_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile offset I/O vector"); @@ -1713,16 +1713,16 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i H5_CHECKED_ASSIGN(vector_len, uint32_t, num_subfiles_used, int); /* Allocate I/O vectors */ - if (NULL == (io_types = HDmalloc(vector_len * sizeof(*io_types)))) + if (NULL == (io_types = malloc(vector_len * sizeof(*io_types)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O types vector"); - if (NULL == (io_addrs = HDmalloc(vector_len * sizeof(*io_addrs)))) + if (NULL == (io_addrs = malloc(vector_len * sizeof(*io_addrs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O addresses vector"); - if (NULL == (io_sizes = HDmalloc(vector_len * sizeof(*io_sizes)))) + if (NULL == (io_sizes = malloc(vector_len * sizeof(*io_sizes)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O sizes vector"); - if (NULL == (io_bufs = HDmalloc(vector_len * sizeof(*io_bufs)))) + if (NULL == (io_bufs = malloc(vector_len * sizeof(*io_bufs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O buffers vector"); @@ -1774,13 +1774,13 @@ H5FD__subfiling_read(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_i file_ptr->op = OP_READ; done: - HDfree(io_bufs); - HDfree(io_sizes); - HDfree(io_addrs); - HDfree(io_types); - HDfree(sf_offset); - HDfree(sf_data_size); - HDfree(source_data_offset); + free(io_bufs); + free(io_sizes); + free(io_addrs); + free(io_types); + free(sf_offset); + free(sf_data_size); + free(source_data_offset); if (ret_value < 0) { /* Reset last file I/O information */ @@ -1820,8 +1820,8 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ int num_subfiles; herr_t ret_value = SUCCEED; - HDassert(file_ptr && file_ptr->pub.cls); - HDassert(buf); + assert(file_ptr && file_ptr->pub.cls); + assert(buf); /* Check for overflow conditions */ if (!H5F_addr_defined(addr)) @@ -1868,8 +1868,8 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ * underlying I/O operations. */ sf_context = (subfiling_context_t *)H5_get_subfiling_object(file_ptr->context_id); - HDassert(sf_context); - HDassert(sf_context->topology); + assert(sf_context); + assert(sf_context->topology); num_subfiles = sf_context->sf_num_subfiles; @@ -1918,14 +1918,14 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ * to contain the translation of the I/O request into a collection of * I/O requests. */ - if (NULL == (source_data_offset = - HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) + if (NULL == + (source_data_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*source_data_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate source data offset I/O vector"); - if (NULL == (sf_data_size = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) + if (NULL == (sf_data_size = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_data_size)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile data size I/O vector"); - if (NULL == (sf_offset = HDcalloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) + if (NULL == (sf_offset = calloc(1, (size_t)num_subfiles * max_depth * sizeof(*sf_offset)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile offset I/O vector"); @@ -1956,16 +1956,16 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ H5_CHECKED_ASSIGN(vector_len, uint32_t, num_subfiles_used, int); /* Allocate I/O vectors */ - if (NULL == (io_types = HDmalloc(vector_len * sizeof(*io_types)))) + if (NULL == (io_types = malloc(vector_len * sizeof(*io_types)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O types vector"); - if (NULL == (io_addrs = HDmalloc(vector_len * sizeof(*io_addrs)))) + if (NULL == (io_addrs = malloc(vector_len * sizeof(*io_addrs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O addresses vector"); - if (NULL == (io_sizes = HDmalloc(vector_len * sizeof(*io_sizes)))) + if (NULL == (io_sizes = malloc(vector_len * sizeof(*io_sizes)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O sizes vector"); - if (NULL == (io_bufs = HDmalloc(vector_len * sizeof(*io_bufs)))) + if (NULL == (io_bufs = malloc(vector_len * sizeof(*io_bufs)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate subfile I/O buffers vector"); @@ -2031,13 +2031,13 @@ H5FD__subfiling_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_ file_ptr->local_eof = file_ptr->pos; done: - HDfree(io_bufs); - HDfree(io_sizes); - HDfree(io_addrs); - HDfree(io_types); - HDfree(sf_offset); - HDfree(sf_data_size); - HDfree(source_data_offset); + free(io_bufs); + free(io_sizes); + free(io_addrs); + free(io_types); + free(sf_offset); + free(sf_data_size); + free(source_data_offset); if (ret_value < 0) { /* Reset last file I/O information */ @@ -2137,8 +2137,8 @@ H5FD__subfiling_read_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_m H5FD_mem_t type; haddr_t eoa; - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); if (H5CX_get_io_xfer_mode(&xfer_mode) < 0) H5_SUBFILING_GOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, @@ -2254,7 +2254,7 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_INDEPENDENT; herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file_ptr != NULL); /* sanity check */ + assert(file_ptr != NULL); /* sanity check */ /* Check arguments * RAW - Do we really need to check arguments once again? @@ -2297,8 +2297,8 @@ H5FD__subfiling_write_vector(H5FD_t *_file, hid_t dxpl_id, uint32_t count, H5FD_ H5FD_mem_t type; haddr_t eoa; - HDassert((count == 0) || (sizes[0] != 0)); - HDassert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); + assert((count == 0) || (sizes[0] != 0)); + assert((count == 0) || (types[0] != H5FD_MEM_NOLIST)); if (H5CX_get_io_xfer_mode(&xfer_mode) < 0) H5_SUBFILING_GOTO_ERROR(H5E_CONTEXT, H5E_CANTGET, FAIL, @@ -2390,7 +2390,7 @@ H5FD__subfiling_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t H5 H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file); + assert(file); /* Extend the file to make sure it's large enough */ if (!H5F_addr_eq(file->eoa, file->last_eoa)) { @@ -2469,7 +2469,7 @@ H5FD__subfiling_lock(H5FD_t *_file, hbool_t rw) H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file); + assert(file); if (file->fa.require_ioc) { #ifdef VERBOSE @@ -2502,7 +2502,7 @@ H5FD__subfiling_unlock(H5FD_t *_file) H5FD_subfiling_t *file = (H5FD_subfiling_t *)_file; /* VFD file struct */ herr_t ret_value = SUCCEED; /* Return value */ - HDassert(file); + assert(file); if (H5FD_unlock(file->sf_file) < 0) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, FAIL, "unable to lock file"); @@ -2581,14 +2581,14 @@ H5FD__subfiling_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void herr_t ret_value = SUCCEED; /* Return value */ /* Sanity checks */ - HDassert(file); - HDassert(H5FD_SUBFILING == file->pub.driver_id); + assert(file); + assert(H5FD_SUBFILING == file->pub.driver_id); switch (op_code) { case H5FD_CTL_GET_MPI_COMMUNICATOR_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); /* * Return a separate MPI communicator to the caller so @@ -2603,14 +2603,14 @@ H5FD__subfiling_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, const void break; case H5FD_CTL_GET_MPI_RANK_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((int **)output) = file->mpi_rank; break; case H5FD_CTL_GET_MPI_SIZE_OPCODE: - HDassert(output); - HDassert(*output); + assert(output); + assert(*output); **((int **)output) = file->mpi_size; break; @@ -2740,17 +2740,17 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne int num_subfiles = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(sf_context->sf_stripe_size > 0); - HDassert(sf_context->sf_blocksize_per_stripe > 0); - HDassert(sf_context->sf_num_subfiles > 0); - HDassert(sf_context->topology); - HDassert(mem_buf_offset); - HDassert(target_file_offset); - HDassert(io_block_len); - HDassert(first_subfile_index); - HDassert(n_subfiles_used); - HDassert(max_io_req_per_subfile); + assert(sf_context); + assert(sf_context->sf_stripe_size > 0); + assert(sf_context->sf_blocksize_per_stripe > 0); + assert(sf_context->sf_num_subfiles > 0); + assert(sf_context->topology); + assert(mem_buf_offset); + assert(target_file_offset); + assert(io_block_len); + assert(first_subfile_index); + assert(n_subfiles_used); + assert(max_io_req_per_subfile); *first_subfile_index = 0; *n_subfiles_used = 0; @@ -2808,8 +2808,8 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne /* Determine the size of data written to the first and last stripes */ start_length = MIN(data_size, (stripe_size - offset_in_stripe)); final_length = (start_length == data_size ? 0 : final_offset % stripe_size); - HDassert(start_length <= stripe_size); - HDassert(final_length <= stripe_size); + assert(start_length <= stripe_size); + assert(final_length <= stripe_size); /* * Determine which subfile the I/O request begins in and which @@ -2895,9 +2895,9 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne _target_file_offset = target_file_offset + output_offset; _io_block_len = io_block_len + output_offset; - HDmemset(_mem_buf_offset, 0, (max_iovec_len * sizeof(*_mem_buf_offset))); - HDmemset(_target_file_offset, 0, (max_iovec_len * sizeof(*_target_file_offset))); - HDmemset(_io_block_len, 0, (max_iovec_len * sizeof(*_io_block_len))); + memset(_mem_buf_offset, 0, (max_iovec_len * sizeof(*_mem_buf_offset))); + memset(_target_file_offset, 0, (max_iovec_len * sizeof(*_target_file_offset))); + memset(_io_block_len, 0, (max_iovec_len * sizeof(*_io_block_len))); if (total_bytes == data_size) { *n_subfiles_used = i; @@ -2960,8 +2960,8 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne } if (thin_uniform_section) { - HDassert(iovec_depth > 1); - HDassert(num_full_stripes > 1); + assert(iovec_depth > 1); + assert(num_full_stripes > 1); iovec_depth--; num_full_stripes--; @@ -3033,7 +3033,7 @@ init_indep_io(subfiling_context_t *sf_context, int64_t file_offset, size_t io_ne row_offset += block_size; } - HDassert(offset_in_block <= block_size); + assert(offset_in_block <= block_size); } if (total_bytes != data_size) @@ -3077,11 +3077,11 @@ iovec_fill_first(subfiling_context_t *sf_context, int64_t iovec_depth, int64_t t int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert(iovec_depth > 0); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert(iovec_depth > 0); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; @@ -3176,11 +3176,11 @@ iovec_fill_last(subfiling_context_t *sf_context, int64_t iovec_depth, int64_t ta int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert(iovec_depth > 0); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert(iovec_depth > 0); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; @@ -3308,11 +3308,11 @@ iovec_fill_first_last(subfiling_context_t *sf_context, int64_t iovec_depth, int6 int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert(iovec_depth > 0); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert(iovec_depth > 0); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; @@ -3418,11 +3418,11 @@ iovec_fill_uniform(subfiling_context_t *sf_context, int64_t iovec_depth, int64_t int64_t total_bytes = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(mem_offset_out); - HDassert(target_file_offset_out); - HDassert(io_block_len_out); - HDassert((iovec_depth > 0) || (target_datasize == 0)); + assert(sf_context); + assert(mem_offset_out); + assert(target_file_offset_out); + assert(io_block_len_out); + assert((iovec_depth > 0) || (target_datasize == 0)); stripe_size = sf_context->sf_stripe_size; block_size = sf_context->sf_blocksize_per_stripe; diff --git a/src/H5FDsubfiling/H5subfiling_common.c b/src/H5FDsubfiling/H5subfiling_common.c index 131f3ce..ea9bafb 100644 --- a/src/H5FDsubfiling/H5subfiling_common.c +++ b/src/H5FDsubfiling/H5subfiling_common.c @@ -154,7 +154,7 @@ H5_get_subfiling_object(int64_t object_id) /* Create subfiling context cache if it doesn't exist */ if (!sf_context_cache) { - if (NULL == (sf_context_cache = HDcalloc(DEFAULT_CONTEXT_CACHE_SIZE, sizeof(*sf_context_cache)))) + if (NULL == (sf_context_cache = calloc(DEFAULT_CONTEXT_CACHE_SIZE, sizeof(*sf_context_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling context cache"); sf_context_cache_size = DEFAULT_CONTEXT_CACHE_SIZE; @@ -171,7 +171,7 @@ H5_get_subfiling_object(int64_t object_id) new_size = (sf_context_cache_size * 3) / 2; - if (NULL == (tmp_realloc = HDrealloc(sf_context_cache, new_size * sizeof(*sf_context_cache)))) + if (NULL == (tmp_realloc = realloc(sf_context_cache, new_size * sizeof(*sf_context_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling context cache"); @@ -179,14 +179,14 @@ H5_get_subfiling_object(int64_t object_id) sf_context_cache_size = new_size; /* Clear newly-allocated entries */ - HDmemset(&sf_context_cache[old_num_entries], 0, - (sf_context_cache_size - old_num_entries) * sizeof(*sf_context_cache)); + memset(&sf_context_cache[old_num_entries], 0, + (sf_context_cache_size - old_num_entries) * sizeof(*sf_context_cache)); /* * If we had to make more space, the given object index * should always fall within range after a single re-allocation */ - HDassert((size_t)obj_index < sf_context_cache_size); + assert((size_t)obj_index < sf_context_cache_size); } /* @@ -194,14 +194,14 @@ H5_get_subfiling_object(int64_t object_id) * application exit, context entry indices should just be * consecutive */ - HDassert((size_t)obj_index <= sf_context_cache_num_entries); + assert((size_t)obj_index <= sf_context_cache_num_entries); if ((size_t)obj_index < sf_context_cache_num_entries) ret_value = sf_context_cache[obj_index]; else { - HDassert(!sf_context_cache[sf_context_cache_num_entries]); + assert(!sf_context_cache[sf_context_cache_num_entries]); /* Allocate a new subfiling context object */ - if (NULL == (ret_value = HDcalloc(1, sizeof(subfiling_context_t)))) + if (NULL == (ret_value = calloc(1, sizeof(subfiling_context_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate subfiling context object"); @@ -211,8 +211,7 @@ H5_get_subfiling_object(int64_t object_id) else if (obj_type == SF_TOPOLOGY) { /* Create subfiling topology cache if it doesn't exist */ if (!sf_topology_cache) { - if (NULL == - (sf_topology_cache = HDcalloc(DEFAULT_TOPOLOGY_CACHE_SIZE, sizeof(*sf_topology_cache)))) + if (NULL == (sf_topology_cache = calloc(DEFAULT_TOPOLOGY_CACHE_SIZE, sizeof(*sf_topology_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling topology cache"); sf_topology_cache_size = DEFAULT_TOPOLOGY_CACHE_SIZE; @@ -229,7 +228,7 @@ H5_get_subfiling_object(int64_t object_id) new_size = (sf_topology_cache_size * 3) / 2; - if (NULL == (tmp_realloc = HDrealloc(sf_topology_cache, new_size * sizeof(*sf_topology_cache)))) + if (NULL == (tmp_realloc = realloc(sf_topology_cache, new_size * sizeof(*sf_topology_cache)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate space for subfiling topology cache"); @@ -237,14 +236,14 @@ H5_get_subfiling_object(int64_t object_id) sf_topology_cache_size = new_size; /* Clear newly-allocated entries */ - HDmemset(&sf_topology_cache[old_num_entries], 0, - (sf_topology_cache_size - old_num_entries) * sizeof(*sf_topology_cache)); + memset(&sf_topology_cache[old_num_entries], 0, + (sf_topology_cache_size - old_num_entries) * sizeof(*sf_topology_cache)); /* * If we had to make more space, the given object index * should always fall within range after a single re-allocation */ - HDassert((size_t)obj_index < sf_topology_cache_size); + assert((size_t)obj_index < sf_topology_cache_size); } /* @@ -252,14 +251,14 @@ H5_get_subfiling_object(int64_t object_id) * application exit, topology entry indices should just be * consecutive */ - HDassert((size_t)obj_index <= sf_topology_cache_num_entries); + assert((size_t)obj_index <= sf_topology_cache_num_entries); if ((size_t)obj_index < sf_topology_cache_num_entries) ret_value = sf_topology_cache[obj_index]; else { - HDassert(!sf_topology_cache[sf_topology_cache_num_entries]); + assert(!sf_topology_cache[sf_topology_cache_num_entries]); /* Allocate a new subfiling topology object */ - if (NULL == (ret_value = HDmalloc(sizeof(sf_topology_t)))) + if (NULL == (ret_value = malloc(sizeof(sf_topology_t)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "couldn't allocate subfiling topology object"); @@ -268,7 +267,7 @@ H5_get_subfiling_object(int64_t object_id) } #ifdef H5_SUBFILING_DEBUG else - HDprintf("%s: Unknown subfiling object type for ID %" PRId64 "\n", __func__, object_id); + printf("%s: Unknown subfiling object type for ID %" PRId64 "\n", __func__, object_id); #endif done: @@ -308,15 +307,15 @@ H5_free_subfiling_object(int64_t object_id) if (H5_free_subfiling_object_int(sf_context) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling object"); - HDassert(sf_context_cache_num_entries > 0); - HDassert(sf_context == sf_context_cache[sf_context_cache_num_entries - 1]); + assert(sf_context_cache_num_entries > 0); + assert(sf_context == sf_context_cache[sf_context_cache_num_entries - 1]); sf_context_cache[sf_context_cache_num_entries - 1] = NULL; sf_context_cache_num_entries--; } else { sf_topology_t *sf_topology; - HDassert(obj_type == SF_TOPOLOGY); + assert(obj_type == SF_TOPOLOGY); if (NULL == (sf_topology = H5_get_subfiling_object(object_id))) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, @@ -325,8 +324,8 @@ H5_free_subfiling_object(int64_t object_id) if (H5_free_subfiling_topology(sf_topology) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "couldn't free subfiling topology"); - HDassert(sf_topology_cache_num_entries > 0); - HDassert(sf_topology == sf_topology_cache[sf_topology_cache_num_entries - 1]); + assert(sf_topology_cache_num_entries > 0); + assert(sf_topology == sf_topology_cache[sf_topology_cache_num_entries - 1]); sf_topology_cache[sf_topology_cache_num_entries - 1] = NULL; sf_topology_cache_num_entries--; } @@ -342,7 +341,7 @@ H5_free_subfiling_object_int(subfiling_context_t *sf_context) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(sf_context); + assert(sf_context); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) { /* Assume MPI is finalized or worse, and try to clean up what we can */ @@ -400,16 +399,16 @@ H5_free_subfiling_object_int(subfiling_context_t *sf_context) sf_context->sf_group_size = -1; sf_context->sf_group_rank = -1; - HDfree(sf_context->subfile_prefix); + free(sf_context->subfile_prefix); sf_context->subfile_prefix = NULL; - HDfree(sf_context->config_file_prefix); + free(sf_context->config_file_prefix); sf_context->config_file_prefix = NULL; - HDfree(sf_context->h5_filename); + free(sf_context->h5_filename); sf_context->h5_filename = NULL; - HDfree(sf_context->sf_fids); + free(sf_context->sf_fids); sf_context->sf_fids = NULL; /* @@ -420,7 +419,7 @@ H5_free_subfiling_object_int(subfiling_context_t *sf_context) */ sf_context->topology = NULL; - HDfree(sf_context); + free(sf_context); H5_SUBFILING_FUNC_LEAVE; } @@ -432,7 +431,7 @@ H5_free_subfiling_topology(sf_topology_t *topology) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(topology); + assert(topology); if (MPI_SUCCESS != (mpi_code = MPI_Finalized(&mpi_finalized))) { /* Assume MPI is finalized or worse, but clean up what we can */ @@ -448,7 +447,7 @@ H5_free_subfiling_topology(sf_topology_t *topology) for (size_t i = 0; i < sf_topology_cache_num_entries; i++) if (topology == sf_topology_cache[i]) topology_cached = TRUE; - HDassert(topology_cached); + assert(topology_cached); } #endif @@ -456,25 +455,25 @@ H5_free_subfiling_topology(sf_topology_t *topology) topology->n_io_concentrators = 0; if (topology->app_layout) { - HDfree(topology->app_layout->layout); + free(topology->app_layout->layout); topology->app_layout->layout = NULL; - HDfree(topology->app_layout->node_ranks); + free(topology->app_layout->node_ranks); topology->app_layout->node_ranks = NULL; - HDfree(topology->app_layout); + free(topology->app_layout); } topology->app_layout = NULL; - HDfree(topology->io_concentrators); + free(topology->io_concentrators); topology->io_concentrators = NULL; if (!mpi_finalized) if (H5_mpi_comm_free(&topology->app_comm) < 0) H5_SUBFILING_DONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free MPI communicator"); - HDfree(topology); + free(topology); H5_SUBFILING_FUNC_LEAVE; } @@ -674,7 +673,7 @@ H5_open_subfiles(const char *base_filename, uint64_t file_id, H5FD_subfiling_par HDsnprintf(sf_context->sf_logfile_name, PATH_MAX, "%s.log.%d", sf_context->h5_filename, mpi_rank); - if (NULL == (sf_context->sf_logfile = HDfopen(sf_context->sf_logfile_name, "a"))) + if (NULL == (sf_context->sf_logfile = fopen(sf_context->sf_logfile_name, "a"))) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't open subfiling debug logfile"); @@ -758,7 +757,7 @@ init_subfiling(const char *base_filename, uint64_t file_id, H5FD_subfiling_param int mpi_code; herr_t ret_value = SUCCEED; - HDassert(context_id_out); + assert(context_id_out); if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); @@ -960,11 +959,11 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ int mpi_code; herr_t ret_value = SUCCEED; - HDassert(subfiling_config); - HDassert(MPI_COMM_NULL != comm); - HDassert(MPI_COMM_NULL != node_comm); - HDassert(app_topology_out); - HDassert(!*app_topology_out); + assert(subfiling_config); + assert(MPI_COMM_NULL != comm); + assert(MPI_COMM_NULL != node_comm); + assert(app_topology_out); + assert(!*app_topology_out); if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &comm_rank))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); @@ -990,7 +989,7 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ errno = 0; ioc_select_val = HDstrtol(env_value, NULL, 0); if ((ERANGE == errno)) { - HDprintf("invalid value '%s' for " H5FD_SUBFILING_IOC_PER_NODE "\n", env_value); + printf("invalid value '%s' for " H5FD_SUBFILING_IOC_PER_NODE "\n", env_value); ioc_select_val = 1; } @@ -1017,9 +1016,9 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ errno = 0; ioc_select_val = HDstrtol(ioc_sel_str, NULL, 0); if ((ERANGE == errno) || (ioc_select_val <= 0)) { - HDprintf("invalid IOC selection strategy string '%s' for strategy " - "SELECT_IOC_EVERY_NTH_RANK; defaulting to SELECT_IOC_ONE_PER_NODE\n", - ioc_sel_str); + printf("invalid IOC selection strategy string '%s' for strategy " + "SELECT_IOC_EVERY_NTH_RANK; defaulting to SELECT_IOC_ONE_PER_NODE\n", + ioc_sel_str); ioc_select_val = 1; ioc_selection_type = SELECT_IOC_ONE_PER_NODE; @@ -1053,9 +1052,9 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ errno = 0; ioc_select_val = HDstrtol(ioc_sel_str, NULL, 0); if ((ERANGE == errno) || (ioc_select_val <= 0)) { - HDprintf("invalid IOC selection strategy string '%s' for strategy SELECT_IOC_TOTAL; " - "defaulting to SELECT_IOC_ONE_PER_NODE\n", - ioc_sel_str); + printf("invalid IOC selection strategy string '%s' for strategy SELECT_IOC_TOTAL; " + "defaulting to SELECT_IOC_ONE_PER_NODE\n", + ioc_sel_str); ioc_select_val = 1; ioc_selection_type = SELECT_IOC_ONE_PER_NODE; @@ -1099,7 +1098,7 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ if (find_cached_topology_info(comm, subfiling_config, iocs_per_node, &app_topology) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't check for cached subfiling topology object"); - HDassert(!app_topology || (app_topology->selection_type == ioc_selection_type)); + assert(!app_topology || (app_topology->selection_type == ioc_selection_type)); if (!app_topology) { /* Generate an ID for the application topology object */ @@ -1122,10 +1121,10 @@ init_app_topology(H5FD_subfiling_params_t *subfiling_config, MPI_Comm comm, MPI_ if (init_app_layout(app_topology, comm, node_comm) < 0) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "couldn't initialize application layout"); - HDassert(app_topology->app_layout); - HDassert(app_topology->app_layout->layout); - HDassert(app_topology->app_layout->node_ranks); - HDassert(app_topology->app_layout->node_count > 0); + assert(app_topology->app_layout); + assert(app_topology->app_layout->layout); + assert(app_topology->app_layout->node_ranks); + assert(app_topology->app_layout->node_count > 0); /* * Now that the application node count has been determined, adjust the @@ -1187,8 +1186,8 @@ get_ioc_selection_criteria_from_env(H5FD_subfiling_ioc_select_t *ioc_selection_t char *env_value = HDgetenv(H5FD_SUBFILING_IOC_SELECTION_CRITERIA); herr_t ret_value = SUCCEED; - HDassert(ioc_selection_type); - HDassert(ioc_sel_info_str); + assert(ioc_selection_type); + assert(ioc_sel_info_str); *ioc_sel_info_str = NULL; @@ -1260,7 +1259,7 @@ find_cached_topology_info(MPI_Comm comm, H5FD_subfiling_params_t *subf_config, l int32_t stripe_count; herr_t ret_value = SUCCEED; - HDassert(subf_config); + assert(subf_config); ioc_selection_type = subf_config->ioc_selection; stripe_count = subf_config->stripe_count; @@ -1270,7 +1269,7 @@ find_cached_topology_info(MPI_Comm comm, H5FD_subfiling_params_t *subf_config, l int result; int mpi_code; - HDassert(cached_topology); + assert(cached_topology); /* * If the selection types differ, just reject the cached topology @@ -1290,8 +1289,8 @@ find_cached_topology_info(MPI_Comm comm, H5FD_subfiling_params_t *subf_config, l } if (cached_topology->selection_type == SELECT_IOC_ONE_PER_NODE) { - HDassert(iocs_per_node >= 1); - HDassert(cached_topology->app_layout->node_count > 0); + assert(iocs_per_node >= 1); + assert(cached_topology->app_layout->node_count > 0); /* * If a IOCs-per-node setting was set in the environment and would @@ -1333,12 +1332,12 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) int mpi_code; herr_t ret_value = SUCCEED; - HDassert(app_topology); - HDassert(!app_topology->app_layout); - HDassert(MPI_COMM_NULL != comm); - HDassert(MPI_COMM_NULL != node_comm); + assert(app_topology); + assert(!app_topology->app_layout); + assert(MPI_COMM_NULL != comm); + assert(MPI_COMM_NULL != node_comm); - if (NULL == (app_layout = HDcalloc(1, sizeof(*app_layout)))) + if (NULL == (app_layout = calloc(1, sizeof(*app_layout)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate application layout structure"); @@ -1351,7 +1350,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(node_comm, &app_layout->node_local_size))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_size failed", mpi_code); - if (NULL == (app_layout->layout = HDmalloc((size_t)app_layout->world_size * sizeof(*app_layout->layout)))) + if (NULL == (app_layout->layout = malloc((size_t)app_layout->world_size * sizeof(*app_layout->layout)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate application layout array"); @@ -1371,10 +1370,10 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) if (app_layout->layout[i].node_local_rank == 0) app_layout->node_count++; - HDassert(app_layout->node_count > 0); + assert(app_layout->node_count > 0); if (NULL == - (app_layout->node_ranks = HDmalloc((size_t)app_layout->node_count * sizeof(*app_layout->node_ranks)))) + (app_layout->node_ranks = malloc((size_t)app_layout->node_count * sizeof(*app_layout->node_ranks)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate application layout node rank array"); @@ -1384,7 +1383,7 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) */ for (size_t i = 0, node_rank_index = 0; i < (size_t)app_layout->world_size; i++) { if (app_layout->layout[i].node_local_rank == 0) { - HDassert(node_rank_index < (size_t)app_layout->node_count); + assert(node_rank_index < (size_t)app_layout->node_count); app_layout->node_ranks[node_rank_index++] = app_layout->layout[i].rank; } } @@ -1394,9 +1393,9 @@ init_app_layout(sf_topology_t *app_topology, MPI_Comm comm, MPI_Comm node_comm) done: if (ret_value < 0) { if (app_layout) { - HDfree(app_layout->layout); - HDfree(app_layout->node_ranks); - HDfree(app_layout); + free(app_layout->layout); + free(app_layout->node_ranks); + free(app_layout); } } @@ -1429,9 +1428,9 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com int mpi_code; herr_t ret_value = SUCCEED; - HDassert(app_layout); - HDassert(app_layout->layout); - HDassert(MPI_COMM_NULL != comm); + assert(app_layout); + assert(app_layout->layout); + assert(MPI_COMM_NULL != comm); sf_world_rank = app_layout->world_rank; sf_world_size = app_layout->world_size; @@ -1482,7 +1481,7 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com #else int aggr_comm_size = 0; - HDassert(MPI_COMM_NULL != intra_comm); + assert(MPI_COMM_NULL != intra_comm); /* Split the file communicator into a sub-group of one rank per node */ if (MPI_SUCCESS != (mpi_code = MPI_Comm_split(comm, node_local_rank, sf_world_rank, &aggr_comm))) @@ -1494,7 +1493,7 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com /* Allocate a partial layout info array to aggregate into from node-local ranks */ if (node_local_rank == 0) { if (NULL == - (layout_info_partial = HDmalloc((size_t)node_local_size * sizeof(*layout_info_partial)))) + (layout_info_partial = malloc((size_t)node_local_size * sizeof(*layout_info_partial)))) /* Push error, but participate in gather operation */ H5_SUBFILING_DONE_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate layout info array"); @@ -1509,10 +1508,10 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com if (node_local_rank == 0) { int send_size = 4 * node_local_size; - if (NULL == (recv_counts = HDmalloc((size_t)aggr_comm_size * sizeof(*recv_counts)))) + if (NULL == (recv_counts = malloc((size_t)aggr_comm_size * sizeof(*recv_counts)))) H5_SUBFILING_DONE_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive counts array"); - if (NULL == (recv_displs = HDmalloc((size_t)aggr_comm_size * sizeof(*recv_displs)))) + if (NULL == (recv_displs = malloc((size_t)aggr_comm_size * sizeof(*recv_displs)))) H5_SUBFILING_DONE_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate receive displacements array"); @@ -1529,8 +1528,8 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com recv_counts, recv_displs, MPI_INT, aggr_comm))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Allgatherv failed", mpi_code); - HDfree(recv_displs); - HDfree(recv_counts); + free(recv_displs); + free(recv_counts); recv_displs = NULL; recv_counts = NULL; } @@ -1546,9 +1545,9 @@ gather_topology_info(app_layout_t *app_layout, MPI_Comm comm, MPI_Comm intra_com } done: - HDfree(recv_displs); - HDfree(recv_counts); - HDfree(layout_info_partial); + free(recv_displs); + free(recv_counts); + free(layout_info_partial); if (H5_mpi_comm_free(&aggr_comm) < 0) H5_SUBFILING_DONE_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free MPI communicator"); @@ -1613,19 +1612,19 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) int max_iocs = 0; herr_t ret_value = SUCCEED; - HDassert(app_topology); - HDassert(!app_topology->io_concentrators); - HDassert(app_topology->n_io_concentrators > 0); - HDassert(app_topology->app_layout); - HDassert(app_topology->app_layout->layout); - HDassert(app_topology->app_layout->node_count > 0); + assert(app_topology); + assert(!app_topology->io_concentrators); + assert(app_topology->n_io_concentrators > 0); + assert(app_topology->app_layout); + assert(app_topology->app_layout->layout); + assert(app_topology->app_layout->node_count > 0); app_layout = app_topology->app_layout; max_iocs = app_topology->n_io_concentrators; - if (NULL == (app_topology->io_concentrators = - HDmalloc((size_t)max_iocs * sizeof(*app_topology->io_concentrators)))) + if (NULL == + (app_topology->io_concentrators = malloc((size_t)max_iocs * sizeof(*app_topology->io_concentrators)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate array of I/O concentrator ranks"); @@ -1639,13 +1638,13 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) if (app_topology->n_io_concentrators > app_layout->node_count) iocs_per_node = app_topology->n_io_concentrators / app_layout->node_count; - HDassert(app_layout->node_ranks); + assert(app_layout->node_ranks); for (size_t i = 0; i < (size_t)app_layout->node_count; i++) { int node_index = app_layout->node_ranks[i]; int local_size = app_layout->layout[node_index].node_local_size; - HDassert(total_ioc_count < app_topology->n_io_concentrators); + assert(total_ioc_count < app_topology->n_io_concentrators); io_concentrators[total_ioc_count] = app_layout->layout[node_index++].rank; if (app_layout->world_rank == io_concentrators[total_ioc_count]) { @@ -1661,7 +1660,7 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) if (j >= (size_t)local_size) break; - HDassert(total_ioc_count < app_topology->n_io_concentrators); + assert(total_ioc_count < app_topology->n_io_concentrators); io_concentrators[total_ioc_count] = app_layout->layout[node_index++].rank; if (app_layout->world_rank == io_concentrators[total_ioc_count]) { @@ -1687,7 +1686,7 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) int num_iocs_assigned = 0; int world_size = app_layout->world_size; - HDassert(rank_stride > 0); + assert(rank_stride > 0); for (int i = 0; num_iocs_assigned < max_iocs; num_iocs_assigned++) { int ioc_index = rank_stride * i++; @@ -1721,7 +1720,7 @@ identify_ioc_ranks(sf_topology_t *app_topology, int rank_stride) done: if (ret_value < 0) { if (app_topology) - HDfree(app_topology->io_concentrators); + free(app_topology->io_concentrators); } H5_SUBFILING_FUNC_LEAVE; @@ -1751,15 +1750,15 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam int mpi_code; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(sf_context->topology == NULL); - HDassert(sf_context->sf_context_id >= 0); - HDassert(base_filename); - HDassert(file_id != UINT64_MAX); - HDassert(subfiling_config); - HDassert(app_topology); - HDassert(app_topology->n_io_concentrators > 0); - HDassert(MPI_COMM_NULL != file_comm); + assert(sf_context); + assert(sf_context->topology == NULL); + assert(sf_context->sf_context_id >= 0); + assert(base_filename); + assert(file_id != UINT64_MAX); + assert(subfiling_config); + assert(app_topology); + assert(app_topology->n_io_concentrators > 0); + assert(MPI_COMM_NULL != file_comm); sf_context->h5_file_id = file_id; sf_context->sf_fids = NULL; @@ -1835,7 +1834,7 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam sf_context->sf_num_fids++; if (NULL == - (sf_context->sf_fids = HDmalloc((size_t)sf_context->sf_num_fids * sizeof(*sf_context->sf_fids)))) + (sf_context->sf_fids = malloc((size_t)sf_context->sf_num_fids * sizeof(*sf_context->sf_fids)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate subfile IDs array"); for (int i = 0; i < sf_context->sf_num_fids; i++) @@ -1890,7 +1889,7 @@ init_subfiling_context(subfiling_context_t *sf_context, const char *base_filenam H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_BADVALUE, FAIL, "invalid subfiling stripe count (%d)", sf_context->sf_num_subfiles); - HDassert(sf_context->sf_num_subfiles >= app_topology->n_io_concentrators); + assert(sf_context->sf_num_subfiles >= app_topology->n_io_concentrators); done: H5_SUBFILING_FUNC_LEAVE; @@ -1934,8 +1933,8 @@ open_subfile_with_context(subfiling_context_t *sf_context, int file_acc_flags) { herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(sf_context->h5_file_id != UINT64_MAX); + assert(sf_context); + assert(sf_context->h5_file_id != UINT64_MAX); /* * Save the HDF5 file ID (e.g., inode) to subfile context mapping. @@ -1998,8 +1997,7 @@ record_fid_to_subfile(uint64_t file_id, int64_t subfile_context_id, int *next_in herr_t ret_value = SUCCEED; if (!sf_open_file_map) { - if (NULL == - (sf_open_file_map = HDmalloc((size_t)DEFAULT_FILE_MAP_ENTRIES * sizeof(*sf_open_file_map)))) + if (NULL == (sf_open_file_map = malloc((size_t)DEFAULT_FILE_MAP_ENTRIES * sizeof(*sf_open_file_map)))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate open file mapping"); sf_file_map_size = DEFAULT_FILE_MAP_ENTRIES; @@ -2028,8 +2026,8 @@ record_fid_to_subfile(uint64_t file_id, int64_t subfile_context_id, int *next_in if (index == sf_file_map_size) { void *tmp_realloc; - if (NULL == (tmp_realloc = HDrealloc(sf_open_file_map, - ((size_t)(sf_file_map_size * 2) * sizeof(*sf_open_file_map))))) + if (NULL == (tmp_realloc = realloc(sf_open_file_map, + ((size_t)(sf_file_map_size * 2) * sizeof(*sf_open_file_map))))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't reallocate open file mapping"); @@ -2133,13 +2131,13 @@ ioc_open_files(int64_t file_context_id, int file_acc_flags) H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTOPENFILE, FAIL, "couldn't get subfiling object from context ID"); - HDassert(sf_context->h5_file_id != UINT64_MAX); - HDassert(sf_context->h5_filename); - HDassert(sf_context->sf_fids); - HDassert(sf_context->sf_num_subfiles > 0); - HDassert(sf_context->sf_num_fids > 0); - HDassert(sf_context->topology); - HDassert(sf_context->topology->ioc_idx >= 0); /* Only IOC ranks should be here */ + assert(sf_context->h5_file_id != UINT64_MAX); + assert(sf_context->h5_filename); + assert(sf_context->sf_fids); + assert(sf_context->sf_num_subfiles > 0); + assert(sf_context->sf_num_fids > 0); + assert(sf_context->topology); + assert(sf_context->topology->ioc_idx >= 0); /* Only IOC ranks should be here */ /* Get the basename of the full HDF5 filename */ if (H5_basename(sf_context->h5_filename, &base) < 0) @@ -2160,7 +2158,7 @@ ioc_open_files(int64_t file_context_id, int file_acc_flags) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't get HDF5 file dirname"); } - if (NULL == (filepath = HDmalloc(PATH_MAX))) + if (NULL == (filepath = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for subfile filename"); @@ -2233,7 +2231,7 @@ done: H5MM_free(base); H5MM_free(subfile_dir); - HDfree(filepath); + free(filepath); H5_SUBFILING_FUNC_LEAVE; } @@ -2266,10 +2264,10 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c int ret = 0; herr_t ret_value = SUCCEED; - HDassert(sf_context); - HDassert(base_filename); - HDassert(config_dir); - HDassert(subfile_dir); + assert(sf_context); + assert(base_filename); + assert(config_dir); + assert(subfile_dir); if (sf_context->h5_file_id == UINT64_MAX) H5_SUBFILING_GOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "invalid HDF5 file ID %" PRIu64, @@ -2282,7 +2280,7 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c if (*subfile_dir == '\0') subfile_dir = "."; - if (NULL == (config_filename = HDmalloc(PATH_MAX))) + if (NULL == (config_filename = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for subfiling configuration filename"); @@ -2309,11 +2307,11 @@ create_config_file(subfiling_context_t *sf_context, const char *base_filename, c int n_subfiles = sf_context->sf_num_subfiles; int num_digits; - if (NULL == (config_file = HDfopen(config_filename, "w+"))) + if (NULL == (config_file = fopen(config_filename, "w+"))) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't create/truncate subfiling configuration file"); - if (NULL == (line_buf = HDmalloc(PATH_MAX))) + if (NULL == (line_buf = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate buffer for writing to subfiling configuration file"); @@ -2366,8 +2364,8 @@ done: "couldn't close subfiling configuration file"); } - HDfree(line_buf); - HDfree(config_filename); + free(line_buf); + free(config_filename); H5_SUBFILING_FUNC_LEAVE; } @@ -2396,11 +2394,11 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil int ret = 0; herr_t ret_value = SUCCEED; - HDassert(base_filename); - HDassert(config_dir); - HDassert(file_id != UINT64_MAX); - HDassert(mode); - HDassert(config_file_out); + assert(base_filename); + assert(config_dir); + assert(file_id != UINT64_MAX); + assert(mode); + assert(config_file_out); *config_file_out = NULL; @@ -2410,7 +2408,7 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil if (*config_dir == '\0') config_dir = "."; - if (NULL == (config_filename = HDmalloc(PATH_MAX))) + if (NULL == (config_filename = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for subfiling configuration filename"); @@ -2430,7 +2428,7 @@ open_config_file(const char *base_filename, const char *config_dir, uint64_t fil H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't check existence of subfiling configuration file"); - if (NULL == (config_file = HDfopen(config_filename, mode))) + if (NULL == (config_file = fopen(config_filename, mode))) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "couldn't open subfiling configuration file"); @@ -2443,7 +2441,7 @@ done: "couldn't close subfiling configuration file"); } - HDfree(config_filename); + free(config_filename); H5_SUBFILING_FUNC_LEAVE; } @@ -2468,7 +2466,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 long config_file_len = 0; herr_t ret_value = SUCCEED; - HDassert(config_file); + assert(config_file); if (HDfseek(config_file, 0, SEEK_END) < 0) H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_SEEKERROR, FAIL, @@ -2482,7 +2480,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 H5_SUBFILING_SYS_GOTO_ERROR(H5E_FILE, H5E_SEEKERROR, FAIL, "couldn't seek to beginning of subfiling configuration file"); - if (NULL == (config_buf = HDmalloc((size_t)config_file_len + 1))) + if (NULL == (config_buf = malloc((size_t)config_file_len + 1))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "couldn't allocate space for reading from subfiling configuration file"); @@ -2528,7 +2526,7 @@ H5_get_subfiling_config_from_file(FILE *config_file, int64_t *stripe_size, int64 } done: - HDfree(config_buf); + free(config_buf); H5_SUBFILING_FUNC_LEAVE; } @@ -2542,7 +2540,7 @@ done: * between MPI ranks. * * The resolved filepath returned through `resolved_filepath` - * must be freed by the caller with HDfree. + * must be freed by the caller with free. * * Return Non-negative on success/Negative on failure * @@ -2563,8 +2561,8 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat int mpi_code; herr_t ret_value = SUCCEED; - HDassert(filepath); - HDassert(resolved_filepath); + assert(filepath); + assert(resolved_filepath); if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(comm, &mpi_rank))) H5_SUBFILING_MPI_GOTO_ERROR(FAIL, "MPI_Comm_rank failed", mpi_code); @@ -2579,12 +2577,12 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat /* If filepath is just the filename, set up path using CWD */ if (!HDstrcmp(file_dirname, ".")) { - if (NULL == (resolved_path = HDmalloc(PATH_MAX))) + if (NULL == (resolved_path = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate buffer for filepath"); if (H5_basename(filepath, &file_basename) < 0) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't get file basename"); - if (NULL == (cwd = HDmalloc(PATH_MAX))) + if (NULL == (cwd = malloc(PATH_MAX))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate buffer for CWD"); @@ -2626,7 +2624,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat H5_SUBFILING_GOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "couldn't resolve filepath"); if (mpi_rank != 0) { - if (NULL == (resolved_path = HDmalloc(path_len))) + if (NULL == (resolved_path = malloc(path_len))) H5_SUBFILING_GOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't allocate file name buffer"); } @@ -2641,7 +2639,7 @@ H5_resolve_pathname(const char *filepath, MPI_Comm comm, char **resolved_filepat *resolved_filepath = resolved_path; done: - HDfree(cwd); + free(cwd); H5MM_free(file_basename); H5MM_free(file_dirname); @@ -2656,7 +2654,7 @@ done: H5_SUBFILING_MPI_DONE_ERROR(FAIL, "MPI_Bcast failed", mpi_code); } - HDfree(resolved_path); + free(resolved_path); } H5_SUBFILING_FUNC_LEAVE; @@ -3086,7 +3084,7 @@ H5_subfiling_terminate(void) sf_context_cache_size = 0; sf_context_cache_num_entries = 0; - HDfree(sf_context_cache); + free(sf_context_cache); sf_context_cache = NULL; } if (sf_topology_cache) { @@ -3100,13 +3098,13 @@ H5_subfiling_terminate(void) sf_topology_cache_size = 0; sf_topology_cache_num_entries = 0; - HDfree(sf_topology_cache); + free(sf_topology_cache); sf_topology_cache = NULL; } /* Clean up the file ID to context object mapping */ sf_file_map_size = 0; - HDfree(sf_open_file_map); + free(sf_open_file_map); sf_open_file_map = NULL; done: @@ -3124,7 +3122,7 @@ H5_subfiling_log(int64_t sf_context_id, const char *fmt, ...) /* Retrieve the subfiling object for the newly-created context ID */ if (NULL == (sf_context = H5_get_subfiling_object(sf_context_id))) { - HDprintf("%s: couldn't get subfiling object from context ID\n", __func__); + printf("%s: couldn't get subfiling object from context ID\n", __func__); goto done; } @@ -3133,12 +3131,12 @@ H5_subfiling_log(int64_t sf_context_id, const char *fmt, ...) if (sf_context->sf_logfile) { HDvfprintf(sf_context->sf_logfile, fmt, log_args); HDfputs("\n", sf_context->sf_logfile); - HDfflush(sf_context->sf_logfile); + fflush(sf_context->sf_logfile); } else { HDvprintf(fmt, log_args); HDputs(""); - HDfflush(stdout); + fflush(stdout); } H5FD_ioc_end_thread_exclusive(); |