Skip to content

Commit 6185fa1

Browse files
committed
MPIR_Status_set_bytes: fix for large count sizes
Change the ncounts argument to MPI_Count and use MPI_Status_set_elements_x for enabling read/write operations beyond the 2GB limit. Thanks to Richard Warren from the HDF5 group for reporting the issue and providing the suggested fix for romio. Signed-off-by: Edgar Gabriel <[email protected]> (cherry picked from commit 8a3abbf)
1 parent 106109a commit 6185fa1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ompi/mca/io/romio321/src/io_romio321_module.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
* because ROMIO just expects these functions to exist.
3434
*/
3535
int MPIR_Status_set_bytes(ompi_status_public_t *status,
36-
struct ompi_datatype_t *datatype, int size);
36+
struct ompi_datatype_t *datatype, MPI_Count size);
3737
void ADIOI_Datatype_iscontig(MPI_Datatype datatype, int *flag);
3838

3939

@@ -115,7 +115,7 @@ mca_io_base_module_2_0_0_t mca_io_romio321_module = {
115115
* MPI_Status_set_elements (almost like they planned that... hmmm...).
116116
*/
117117
int MPIR_Status_set_bytes(ompi_status_public_t *status,
118-
struct ompi_datatype_t *datatype, int nbytes)
118+
struct ompi_datatype_t *datatype, MPI_Count nbytes)
119119
{
120120
/* Note that ROMIO is going to give a number of *bytes* here, but
121121
MPI_STATUS_SET_ELEMENTS requires a number of *elements*. So
@@ -125,7 +125,7 @@ int MPIR_Status_set_bytes(ompi_status_public_t *status,
125125
we do the right calculations there. This prevents roundoff
126126
errors here, potentially "losing" bytes in the process. */
127127

128-
MPI_Status_set_elements(status, MPI_CHAR, nbytes);
128+
MPI_Status_set_elements_x(status, MPI_CHAR, nbytes);
129129
return MPI_SUCCESS;
130130
}
131131

0 commit comments

Comments
 (0)