Skip to content

Commit

Permalink
romio: set status even if zero bytes requested
Browse files Browse the repository at this point in the history
  • Loading branch information
roblatham00 committed Oct 3, 2019
1 parent 7a3ad05 commit 4b7d553
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/mpi/romio/adio/ad_nfs/ad_nfs_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ void ADIOI_NFS_ReadContig(ADIO_File fd, void *buf, int count,
char *p;

if (count == 0) {
*error_code = MPI_SUCCESS;
return;
err = 0;
goto fn_exit;
}

MPI_Type_size_x(datatype, &datatype_size);
Expand Down Expand Up @@ -71,6 +71,8 @@ void ADIOI_NFS_ReadContig(ADIO_File fd, void *buf, int count,
if (file_ptr_type == ADIO_INDIVIDUAL) {
fd->fp_ind += bytes_xfered;
}

fn_exit:
#ifdef HAVE_STATUS_SET_BYTES
if (err != -1)
MPIR_Status_set_bytes(status, datatype, bytes_xfered);
Expand Down
6 changes: 4 additions & 2 deletions src/mpi/romio/adio/ad_nfs/ad_nfs_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ void ADIOI_NFS_WriteContig(ADIO_File fd, const void *buf, int count,
char *p;

if (count == 0) {
*error_code = MPI_SUCCESS;
return;
err = 0;
goto fn_exit;
}

MPI_Type_size_x(datatype, &datatype_size);
Expand Down Expand Up @@ -68,6 +68,8 @@ void ADIOI_NFS_WriteContig(ADIO_File fd, const void *buf, int count,
if (file_ptr_type == ADIO_INDIVIDUAL) {
fd->fp_ind += bytes_xfered;
}

fn_exit:
#ifdef HAVE_STATUS_SET_BYTES
MPIR_Status_set_bytes(status, datatype, bytes_xfered);
#endif
Expand Down
6 changes: 4 additions & 2 deletions src/mpi/romio/adio/common/ad_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count,
#endif

if (count == 0) {
*error_code = MPI_SUCCESS;
return;
err = 0;
goto fn_exit;
}

MPI_Type_size_x(datatype, &datatype_size);
Expand Down Expand Up @@ -102,6 +102,8 @@ void ADIOI_GEN_ReadContig(ADIO_File fd, void *buf, int count,
if (file_ptr_type == ADIO_INDIVIDUAL) {
fd->fp_ind += bytes_xfered;
}

fn_exit:
#ifdef HAVE_STATUS_SET_BYTES
/* what if we only read half a datatype? */
/* bytes_xfered could be larger than int */
Expand Down
5 changes: 3 additions & 2 deletions src/mpi/romio/adio/common/ad_write.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ void ADIOI_GEN_WriteContig(ADIO_File fd, const void *buf, int count,
#endif

if (count == 0) {
*error_code = MPI_SUCCESS;
return;
err = 0;
goto fn_exit;
}

MPI_Type_size_x(datatype, &datatype_size);
Expand Down Expand Up @@ -106,6 +106,7 @@ void ADIOI_GEN_WriteContig(ADIO_File fd, const void *buf, int count,
gpfsmpio_prof_cw[GPFSMPIO_CIO_T_MPIO_RW] += (MPI_Wtime() - io_time);
#endif

fn_exit:
#ifdef HAVE_STATUS_SET_BYTES
/* bytes_xfered could be larger than int */
if (err != -1 && status)
Expand Down

0 comments on commit 4b7d553

Please sign in to comment.