summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpio.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2021-05-28 12:36:46 (GMT)
committerGitHub <noreply@github.com>2021-05-28 12:36:46 (GMT)
commit4454fca02a57663ea0dbcca01016788bd11703b9 (patch)
treecc0309a481b1d0abfbd5fc7d7e383e335d9f02ba /src/H5FDmpio.c
parentdfe4575914e7998e266b3a56c3acee321662ab20 (diff)
downloadhdf5-4454fca02a57663ea0dbcca01016788bd11703b9.zip
hdf5-4454fca02a57663ea0dbcca01016788bd11703b9.tar.gz
hdf5-4454fca02a57663ea0dbcca01016788bd11703b9.tar.bz2
Fix H5FD_mpio_Debug="rw" can report MPI_count instead of bytes (#699)
* fixed missed closing of a dataset * fixed missed closing of a dataset * fixed typo in error return * Committing clang-format changes * minor edits * code format * Committing clang-format changes * code format * minor edit * switched from using MPI_count, to actual bytes written for H5FD_mpio_debug rw debugging * Committing clang-format changes * changed size_i in printf to reflect the I/O. * Committing clang-format changes Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r--src/H5FDmpio.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 08bd52a..7567376 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1195,12 +1195,6 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if ((hsize_t)size_i != size)
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from size to size_i")
-#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_debug_r_flag)
- HDfprintf(stderr, "%s: (%d) mpi_off = %ld size_i = %d\n", FUNC, file->mpi_rank, (long)mpi_off,
- size_i);
-#endif
-
/* Only look for MPI views for raw data transfers */
if (type == H5FD_MEM_DRAW) {
H5FD_mpio_xfer_t xfer_mode; /* I/O transfer mode */
@@ -1349,6 +1343,12 @@ H5FD__mpio_read(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UNU
if (bytes_read < 0 || bytes_read > io_size)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file read failed")
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_debug_r_flag)
+ HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_read = %lld\n", FUNC, file->mpi_rank, (long)mpi_off,
+ bytes_read);
+#endif
+
/*
* This gives us zeroes beyond end of physical MPI file.
*/
@@ -1436,12 +1436,6 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "can't convert from haddr to MPI off")
size_i = (int)size;
-#ifdef H5FDmpio_DEBUG
- if (H5FD_mpio_debug_w_flag)
- HDfprintf(stderr, "%s: (%d) mpi_off = %ld size_i = %d\n", FUNC, file->mpi_rank, (long)mpi_off,
- size_i);
-#endif
-
/* Get the transfer mode from the API context */
if (H5CX_get_io_xfer_mode(&xfer_mode) < 0)
HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode")
@@ -1566,6 +1560,12 @@ H5FD__mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t H5_ATTR_UNUSED dxpl_id, h
if (bytes_written != io_size || bytes_written < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
+#ifdef H5FDmpio_DEBUG
+ if (H5FD_mpio_debug_w_flag)
+ HDfprintf(stderr, "%s: (%d) mpi_off = %ld bytes_written = %lld\n", FUNC, file->mpi_rank,
+ (long)mpi_off, bytes_written);
+#endif
+
/* Each process will keep track of its perceived EOF value locally, and
* ultimately we will reduce this value to the maximum amongst all
* processes, but until then keep the actual eof at HADDR_UNDEF just in