Skip to content

Commit 060f129

Browse files
Merge pull request #8895 from ggouaillardet/topic/sendrecv_replace_fix
MPI_Sendrecv_replace: add missing error handling
2 parents 6510f64 + 0b38190 commit 060f129

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ompi/mpi/c/sendrecv_replace.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
114114
OMPI_ERRHANDLER_RETURN(rc, comm, rc, FUNC_NAME);
115115
}
116116

117-
/* initialize convertor to unpack recv buffer */
117+
/* initialize convertor to pack send buffer */
118118
OBJ_CONSTRUCT(&convertor, opal_convertor_t);
119119
opal_convertor_copy_and_prepare_for_send( proc->super.proc_convertor, &(datatype->super),
120120
count, buf, 0, &convertor );
@@ -132,6 +132,9 @@ int MPI_Sendrecv_replace(void * buf, int count, MPI_Datatype datatype,
132132
max_data = packed_size;
133133
iov_count = 1;
134134
rc = opal_convertor_pack(&convertor, &iov, &iov_count, &max_data);
135+
if(OMPI_SUCCESS != rc) {
136+
goto cleanup_and_return;
137+
}
135138

136139
/* receive into the buffer */
137140
rc = MCA_PML_CALL(irecv(buf, count, datatype,

0 commit comments

Comments
 (0)