diff options
author | github-actions <41898282+github-actions[bot]@users.noreply.github.com> | 2022-03-16 03:40:38 (GMT) |
---|---|---|
committer | github-actions <41898282+github-actions[bot]@users.noreply.github.com> | 2022-03-16 03:40:38 (GMT) |
commit | c1c4ecd9c8b2616af23d5b58336fb9e44e72b4ae (patch) | |
tree | 1457281c88e2566099c5cf6dfebc659815c1e3c9 | |
parent | 555e61310dda55e54c44b58946c9996c8fb901d4 (diff) | |
download | hdf5-c1c4ecd9c8b2616af23d5b58336fb9e44e72b4ae.zip hdf5-c1c4ecd9c8b2616af23d5b58336fb9e44e72b4ae.tar.gz hdf5-c1c4ecd9c8b2616af23d5b58336fb9e44e72b4ae.tar.bz2 |
Committing clang-format changes
-rw-r--r-- | src/H5FDint.c | 148 | ||||
-rw-r--r-- | src/H5FDmpio.c | 90 | ||||
-rw-r--r-- | src/H5private.h | 2 |
3 files changed, 118 insertions, 122 deletions
diff --git a/src/H5FDint.c b/src/H5FDint.c index fabcedf..8deec48 100644 --- a/src/H5FDint.c +++ b/src/H5FDint.c @@ -741,38 +741,38 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin H5S_t **mem_spaces, H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[], void *bufs[] /* out */) { - hbool_t extend_sizes = FALSE; - hbool_t extend_bufs = FALSE; - uint32_t i; - size_t element_size; - void * buf; - hbool_t use_vector = FALSE; - haddr_t addrs_static[8]; - haddr_t * addrs = addrs_static; - size_t sizes_static[8]; - size_t * sizes = sizes_static; - void * vec_bufs_static[8]; - void ** vec_bufs = vec_bufs_static; - hsize_t file_off[H5FD_SEQ_LIST_LEN]; - size_t file_len[H5FD_SEQ_LIST_LEN]; - hsize_t mem_off[H5FD_SEQ_LIST_LEN]; - size_t mem_len[H5FD_SEQ_LIST_LEN]; - size_t file_seq_i; - size_t mem_seq_i; - size_t file_nseq; - size_t mem_nseq; - size_t io_len; - size_t nelmts; - hssize_t hss_nelmts; - size_t seq_nelem; - H5S_sel_iter_t *file_iter = NULL; - H5S_sel_iter_t *mem_iter = NULL; - hbool_t file_iter_init = FALSE; - hbool_t mem_iter_init = FALSE; - H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST}; - size_t vec_arr_nalloc = sizeof(addrs_static) / sizeof(addrs_static[0]); - size_t vec_arr_nused = 0; - herr_t ret_value = SUCCEED; + hbool_t extend_sizes = FALSE; + hbool_t extend_bufs = FALSE; + uint32_t i; + size_t element_size; + void * buf; + hbool_t use_vector = FALSE; + haddr_t addrs_static[8]; + haddr_t * addrs = addrs_static; + size_t sizes_static[8]; + size_t * sizes = sizes_static; + void * vec_bufs_static[8]; + void ** vec_bufs = vec_bufs_static; + hsize_t file_off[H5FD_SEQ_LIST_LEN]; + size_t file_len[H5FD_SEQ_LIST_LEN]; + hsize_t mem_off[H5FD_SEQ_LIST_LEN]; + size_t mem_len[H5FD_SEQ_LIST_LEN]; + size_t file_seq_i; + size_t mem_seq_i; + size_t file_nseq; + size_t mem_nseq; + size_t io_len; + size_t nelmts; + hssize_t hss_nelmts; + size_t seq_nelem; + H5S_sel_iter_t *file_iter = NULL; + H5S_sel_iter_t *mem_iter = NULL; + hbool_t file_iter_init = FALSE; + hbool_t mem_iter_init = FALSE; + H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST}; + size_t vec_arr_nalloc = sizeof(addrs_static) / sizeof(addrs_static[0]); + size_t vec_arr_nused = 0; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -878,8 +878,8 @@ H5FD__read_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uin /* Fill/refill memory sequence list if necessary */ if (mem_seq_i == H5FD_SEQ_LIST_LEN) { - if (H5S_SELECT_ITER_GET_SEQ_LIST(mem_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &mem_nseq, - &seq_nelem, mem_off, mem_len) < 0) + if (H5S_SELECT_ITER_GET_SEQ_LIST(mem_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &mem_nseq, &seq_nelem, + mem_off, mem_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") HDassert(mem_nseq > 0); @@ -1376,38 +1376,38 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui H5S_t **mem_spaces, H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[], const void *bufs[]) { - hbool_t extend_sizes = FALSE; - hbool_t extend_bufs = FALSE; - uint32_t i; - size_t element_size; - const void * buf; - hbool_t use_vector = FALSE; - haddr_t addrs_static[8]; - haddr_t * addrs = addrs_static; - size_t sizes_static[8]; - size_t * sizes = sizes_static; - const void * vec_bufs_static[8]; - const void ** vec_bufs = vec_bufs_static; - hsize_t file_off[H5FD_SEQ_LIST_LEN]; - size_t file_len[H5FD_SEQ_LIST_LEN]; - hsize_t mem_off[H5FD_SEQ_LIST_LEN]; - size_t mem_len[H5FD_SEQ_LIST_LEN]; - size_t file_seq_i; - size_t mem_seq_i; - size_t file_nseq; - size_t mem_nseq; - size_t io_len; - size_t nelmts; - hssize_t hss_nelmts; - size_t seq_nelem; - H5S_sel_iter_t *file_iter = NULL; - H5S_sel_iter_t *mem_iter = NULL; - hbool_t file_iter_init = FALSE; - hbool_t mem_iter_init = FALSE; - H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST}; - size_t vec_arr_nalloc = sizeof(addrs_static) / sizeof(addrs_static[0]); - size_t vec_arr_nused = 0; - herr_t ret_value = SUCCEED; + hbool_t extend_sizes = FALSE; + hbool_t extend_bufs = FALSE; + uint32_t i; + size_t element_size; + const void * buf; + hbool_t use_vector = FALSE; + haddr_t addrs_static[8]; + haddr_t * addrs = addrs_static; + size_t sizes_static[8]; + size_t * sizes = sizes_static; + const void * vec_bufs_static[8]; + const void ** vec_bufs = vec_bufs_static; + hsize_t file_off[H5FD_SEQ_LIST_LEN]; + size_t file_len[H5FD_SEQ_LIST_LEN]; + hsize_t mem_off[H5FD_SEQ_LIST_LEN]; + size_t mem_len[H5FD_SEQ_LIST_LEN]; + size_t file_seq_i; + size_t mem_seq_i; + size_t file_nseq; + size_t mem_nseq; + size_t io_len; + size_t nelmts; + hssize_t hss_nelmts; + size_t seq_nelem; + H5S_sel_iter_t *file_iter = NULL; + H5S_sel_iter_t *mem_iter = NULL; + hbool_t file_iter_init = FALSE; + hbool_t mem_iter_init = FALSE; + H5FD_mem_t types[2] = {type, H5FD_MEM_NOLIST}; + size_t vec_arr_nalloc = sizeof(addrs_static) / sizeof(addrs_static[0]); + size_t vec_arr_nused = 0; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) @@ -1463,9 +1463,9 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui } /* Allocate sequence lists for memory and file spaces */ - if (NULL == (file_iter = H5FL_MALLOC(H5S_sel_iter_t))) + if (NULL == (file_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "couldn't allocate file selection iterator") - if (NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) + if (NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_VFL, H5E_CANTALLOC, FAIL, "couldn't allocate memory selection iterator") /* Initialize sequence lists for memory and file spaces */ @@ -1513,8 +1513,8 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui /* Fill/refill memory sequence list if necessary */ if (mem_seq_i == H5FD_SEQ_LIST_LEN) { - if (H5S_SELECT_ITER_GET_SEQ_LIST(mem_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &mem_nseq, - &seq_nelem, mem_off, mem_len) < 0) + if (H5S_SELECT_ITER_GET_SEQ_LIST(mem_iter, H5FD_SEQ_LIST_LEN, SIZE_MAX, &mem_nseq, &seq_nelem, + mem_off, mem_len) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_UNSUPPORTED, FAIL, "sequence length generation failed") HDassert(mem_nseq > 0); @@ -1605,7 +1605,6 @@ H5FD__write_selection_translate(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, ui /* Make sure both memory and file sequences terminated at the same time */ if (mem_seq_i < mem_nseq) HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, FAIL, "file selection terminated before memory selection") - } /* Issue vector write call if appropriate */ @@ -2166,8 +2165,8 @@ H5FD__vsrt_tmp_cmp(const void *element_1, const void *element_2) herr_t H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t types[], haddr_t addrs[], - size_t sizes[], H5_flexible_const_ptr_t bufs[], H5FD_mem_t **s_types_ptr, haddr_t **s_addrs_ptr, - size_t **s_sizes_ptr, H5_flexible_const_ptr_t **s_bufs_ptr) + size_t sizes[], H5_flexible_const_ptr_t bufs[], H5FD_mem_t **s_types_ptr, + haddr_t **s_addrs_ptr, size_t **s_sizes_ptr, H5_flexible_const_ptr_t **s_bufs_ptr) { herr_t ret_value = SUCCEED; /* Return value */ size_t count = (size_t)_count; @@ -2268,7 +2267,8 @@ H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t _count, H5FD_mem_t if ((NULL == (*s_types_ptr = (H5FD_mem_t *)HDmalloc(count * sizeof(H5FD_mem_t)))) || (NULL == (*s_addrs_ptr = (haddr_t *)HDmalloc(count * sizeof(haddr_t)))) || (NULL == (*s_sizes_ptr = (size_t *)HDmalloc(count * sizeof(size_t)))) || - (NULL == (*s_bufs_ptr = (H5_flexible_const_ptr_t *)HDmalloc(count * sizeof(H5_flexible_const_ptr_t))))) { + (NULL == + (*s_bufs_ptr = (H5_flexible_const_ptr_t *)HDmalloc(count * sizeof(H5_flexible_const_ptr_t))))) { HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sorted vector(s)") } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 608a315..1d96979 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -99,12 +99,11 @@ static herr_t H5FD__mpio_ctl(H5FD_t *_file, uint64_t op_code, uint64_t flags, c void **output); /* Other functions */ -static herr_t H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], - H5_flexible_const_ptr_t bufs[], haddr_t *s_addrs[], size_t *s_sizes[], - H5_flexible_const_ptr_t *s_bufs[], hbool_t *vector_was_sorted, - MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, - int *size_i, MPI_Datatype *buf_type, hbool_t *buf_type_created, - MPI_Datatype *file_type, hbool_t *file_type_created, char *unused); +static herr_t H5FD__mpio_vector_build_types( + uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[], + haddr_t *s_addrs[], size_t *s_sizes[], H5_flexible_const_ptr_t *s_bufs[], hbool_t *vector_was_sorted, + MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, int *size_i, MPI_Datatype *buf_type, + hbool_t *buf_type_created, MPI_Datatype *file_type, hbool_t *file_type_created, char *unused); /* The MPIO file driver information */ static const H5FD_class_t H5FD_mpio_g = { @@ -1664,24 +1663,24 @@ static herr_t H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[], haddr_t *s_addrs[], size_t *s_sizes[], H5_flexible_const_ptr_t *s_bufs[], hbool_t *vector_was_sorted, - MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, - int *size_i, MPI_Datatype *buf_type, hbool_t *buf_type_created, - MPI_Datatype *file_type, hbool_t *file_type_created, char *unused) + MPI_Offset *mpi_off, H5_flexible_const_ptr_t *mpi_bufs_base, int *size_i, + MPI_Datatype *buf_type, hbool_t *buf_type_created, MPI_Datatype *file_type, + hbool_t *file_type_created, char *unused) { - hsize_t bigio_count; /* Transition point to create derived type */ - hbool_t fixed_size = FALSE; - size_t size; - H5FD_mem_t * s_types = NULL; - int * mpi_block_lengths = NULL; - MPI_Aint mpi_bufs_base_Aint; - MPI_Aint * mpi_bufs = NULL; - MPI_Aint * mpi_displacements = NULL; - MPI_Datatype * sub_types = NULL; - uint8_t * sub_types_created = NULL; - int i; - int j; - int mpi_code; /* MPI return code */ - herr_t ret_value = SUCCEED; + hsize_t bigio_count; /* Transition point to create derived type */ + hbool_t fixed_size = FALSE; + size_t size; + H5FD_mem_t * s_types = NULL; + int * mpi_block_lengths = NULL; + MPI_Aint mpi_bufs_base_Aint; + MPI_Aint * mpi_bufs = NULL; + MPI_Aint * mpi_displacements = NULL; + MPI_Datatype *sub_types = NULL; + uint8_t * sub_types_created = NULL; + int i; + int j; + int mpi_code; /* MPI return code */ + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1714,7 +1713,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ /* Setup s_sizes and s_bufs (needed for incomplete read filling code) */ *s_sizes = sizes; - *s_bufs = bufs; + *s_bufs = bufs; /* some numeric conversions */ if (H5FD_mpi_haddr_to_MPIOff(addrs[0], mpi_off) < 0) @@ -1749,8 +1748,8 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ * are allocated, populated, and returned in s_types, s_addrs, s_sizes, and s_bufs respectively. * In this case, this function must free the memory allocated for the sorted vectors. */ - if (H5FD_sort_vector_io_req(vector_was_sorted, count, types, addrs, sizes, bufs, - &s_types, s_addrs, s_sizes, s_bufs) < 0) + if (H5FD_sort_vector_io_req(vector_was_sorted, count, types, addrs, sizes, bufs, &s_types, s_addrs, + s_sizes, s_bufs) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't sort vector I/O request") if ((NULL == (mpi_block_lengths = (int *)HDmalloc((size_t)count * sizeof(int)))) || @@ -1809,7 +1808,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ if (MPI_SUCCESS != (mpi_code = MPI_Get_address((*s_bufs)[i].cvp, &(mpi_bufs[i])))) HMPI_GOTO_ERROR(FAIL, "MPI_Get_address for s_bufs[] - mpi_bufs_base failed", mpi_code) - /*... and then subtract mpi_bufs_base_Aint from it. */ + /*... and then subtract mpi_bufs_base_Aint from it. */ #if ((MPI_VERSION > 3) || ((MPI_VERSION == 3) && (MPI_SUBVERSION >= 1))) mpi_bufs[i] = MPI_Aint_diff(mpi_bufs[i], mpi_bufs_base_Aint); #else @@ -1832,8 +1831,7 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types array") if (NULL == (sub_types_created = (uint8_t *)HDcalloc((size_t)count, 1))) { sub_types = H5MM_free(sub_types); - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, - "can't alloc sub types created array") + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "can't alloc sub types created array") } /* Initialize sub_types to all MPI_BYTE */ @@ -1860,8 +1858,8 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ sub_types, buf_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct for buf_type failed", mpi_code) } - else if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)count, mpi_block_lengths, - mpi_bufs, MPI_BYTE, buf_type))) + else if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)count, mpi_block_lengths, mpi_bufs, + MPI_BYTE, buf_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed for buf_type failed", mpi_code) *buf_type_created = TRUE; @@ -1872,14 +1870,12 @@ H5FD__mpio_vector_build_types(uint32_t count, H5FD_mem_t types[], haddr_t addrs[ /* create the file MPI derived type */ if (sub_types) { - if (MPI_SUCCESS != - (mpi_code = MPI_Type_create_struct((int)count, mpi_block_lengths, mpi_displacements, - sub_types, file_type))) + if (MPI_SUCCESS != (mpi_code = MPI_Type_create_struct((int)count, mpi_block_lengths, + mpi_displacements, sub_types, file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_struct for file_type failed", mpi_code) } - else if (MPI_SUCCESS != - (mpi_code = MPI_Type_create_hindexed((int)count, mpi_block_lengths, mpi_displacements, - MPI_BYTE, file_type))) + else if (MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)count, mpi_block_lengths, + mpi_displacements, MPI_BYTE, file_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed for file_type failed", mpi_code) *file_type_created = TRUE; @@ -2094,11 +2090,11 @@ H5FD__mpio_read_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t cou if (xfer_mode == H5FD_MPIO_COLLECTIVE) { /* Build MPI types, etc. */ - if (H5FD__mpio_vector_build_types(count, types, addrs, sizes, - (H5_flexible_const_ptr_t *)bufs, &s_addrs, &s_sizes, (H5_flexible_const_ptr_t **) &s_bufs, &vector_was_sorted, &mpi_off, - (H5_flexible_const_ptr_t *)&mpi_bufs_base, &size_i, - &buf_type, &buf_type_created, &file_type, - &file_type_created, &unused) < 0) + if (H5FD__mpio_vector_build_types(count, types, addrs, sizes, (H5_flexible_const_ptr_t *)bufs, + &s_addrs, &s_sizes, (H5_flexible_const_ptr_t **)&s_bufs, + &vector_was_sorted, &mpi_off, + (H5_flexible_const_ptr_t *)&mpi_bufs_base, &size_i, &buf_type, + &buf_type_created, &file_type, &file_type_created, &unused) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't build MPI datatypes for I/O") /* free sorted addrs vector if it exists */ @@ -2491,11 +2487,11 @@ H5FD__mpio_write_vector(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, uint32_t co if (xfer_mode == H5FD_MPIO_COLLECTIVE) { /* Build MPI types, etc. */ - if (H5FD__mpio_vector_build_types(count, types, addrs, sizes, - (H5_flexible_const_ptr_t *)bufs, &s_addrs, &s_sizes, (H5_flexible_const_ptr_t **) &s_bufs, &vector_was_sorted, &mpi_off, - (H5_flexible_const_ptr_t *)&mpi_bufs_base, &size_i, - &buf_type, &buf_type_created, &file_type, - &file_type_created, &unused) < 0) + if (H5FD__mpio_vector_build_types(count, types, addrs, sizes, (H5_flexible_const_ptr_t *)bufs, + &s_addrs, &s_sizes, (H5_flexible_const_ptr_t **)&s_bufs, + &vector_was_sorted, &mpi_off, + (H5_flexible_const_ptr_t *)&mpi_bufs_base, &size_i, &buf_type, + &buf_type_created, &file_type, &file_type_created, &unused) < 0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't build MPI datatypes for I/O") /* Compute max addr writted to */ diff --git a/src/H5private.h b/src/H5private.h index 4a9b203..e1014a9 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2513,7 +2513,7 @@ H5_DLL herr_t H5CX_pop(hbool_t update_dxpl_props); * pointers but do not write to their targets or return pointers to const * specified locations. This helps us avoid compiler warnings. */ typedef union { - void *vp; + void * vp; const void *cvp; } H5_flexible_const_ptr_t; |