From 6ba7dc436a53021ce62e4a6cdb8e7ee3bcaba6cb Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 11 Aug 2023 13:42:37 -0500 Subject: [PATCH 1/3] Fix possible performance regression introduced with in-place type conversion in 1.14.2. --- src/H5Dscatgath.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index cf6b4fd4530..60313030181 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -478,6 +478,10 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ in_place_tconv = dset_info->layout_io_info.contig_piece_info && dset_info->layout_io_info.contig_piece_info->in_place_tconv; + /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized compound read function, if this is not a selection I/O operation (so we have normal size conversion buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a background buffer (and therefore could not do the I/O in one operation with in-palce conversion anyways). */ + if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, FALSE) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) + in_place_tconv = FALSE; + /* Allocate the iterators */ if (NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory iterator"); @@ -653,6 +657,10 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset in_place_tconv = dset_info->layout_io_info.contig_piece_info && dset_info->layout_io_info.contig_piece_info->in_place_tconv; + /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized compound write function, if this is not a selection I/O operation (so we have normal size conversion buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a background buffer (and therefore could not do the I/O in one operation with in-palce conversion anyways). */ + if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_WRITE(dset_info, FALSE) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) + in_place_tconv = FALSE; + /* Allocate the iterators */ if (NULL == (mem_iter = H5FL_MALLOC(H5S_sel_iter_t))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "can't allocate memory iterator"); From d8f3f09bb2d942f3010d9aa1730a5d60c5d1a469 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Aug 2023 18:45:40 +0000 Subject: [PATCH 2/3] Committing clang-format changes --- src/H5Dscatgath.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 60313030181..d3571258422 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -478,8 +478,14 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ in_place_tconv = dset_info->layout_io_info.contig_piece_info && dset_info->layout_io_info.contig_piece_info->in_place_tconv; - /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized compound read function, if this is not a selection I/O operation (so we have normal size conversion buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a background buffer (and therefore could not do the I/O in one operation with in-palce conversion anyways). */ - if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, FALSE) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) + /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized + * compound read function, if this is not a selection I/O operation (so we have normal size conversion + * buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a + * background buffer (and therefore could not do the I/O in one operation with in-palce conversion + * anyways). */ + if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, FALSE) && + (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && + (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) in_place_tconv = FALSE; /* Allocate the iterators */ @@ -657,8 +663,14 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset in_place_tconv = dset_info->layout_io_info.contig_piece_info && dset_info->layout_io_info.contig_piece_info->in_place_tconv; - /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized compound write function, if this is not a selection I/O operation (so we have normal size conversion buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a background buffer (and therefore could not do the I/O in one operation with in-palce conversion anyways). */ - if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_WRITE(dset_info, FALSE) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) + /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized + * compound write function, if this is not a selection I/O operation (so we have normal size conversion + * buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a + * background buffer (and therefore could not do the I/O in one operation with in-palce conversion + * anyways). */ + if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_WRITE(dset_info, FALSE) && + (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && + (dset_info->type_info.need_bkg || (dset_info->nelmts <= dset_info->type_info.request_nelmts))) in_place_tconv = FALSE; /* Allocate the iterators */ From fd3ce715f9486ffa55ee8d7524ecc5fde32cf2b9 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Fri, 11 Aug 2023 16:16:58 -0500 Subject: [PATCH 3/3] Fix spelling in comments --- src/H5Dscatgath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index d3571258422..4516f1fa095 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -481,7 +481,7 @@ H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset_ /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized * compound read function, if this is not a selection I/O operation (so we have normal size conversion * buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a - * background buffer (and therefore could not do the I/O in one operation with in-palce conversion + * background buffer (and therefore could not do the I/O in one operation with in-place conversion * anyways). */ if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_READ(dset_info, FALSE) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) && @@ -666,7 +666,7 @@ H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_dset_io_info_t *dset /* Check if we should disable in-place type conversion for performance. Do so if we can use the optimized * compound write function, if this is not a selection I/O operation (so we have normal size conversion * buffers), and the either entire I/O operation can fit in the type conversion buffer or we need to use a - * background buffer (and therefore could not do the I/O in one operation with in-palce conversion + * background buffer (and therefore could not do the I/O in one operation with in-place conversion * anyways). */ if (in_place_tconv && H5D__SCATGATH_USE_CMPD_OPT_WRITE(dset_info, FALSE) && (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) &&