Skip to content

Commit d844442

Browse files
committed
Merge pull request #1738 from hjelmn/ob1_req_fix
pml/ob1: fix race on pml completion of send requests
2 parents 873cebb + 086ffc1 commit d844442

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

ompi/mca/pml/ob1/pml_ob1_sendreq.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -262,17 +262,18 @@ send_request_pml_complete(mca_pml_ob1_send_request_t *sendreq)
262262
mca_pml_base_bsend_request_fini((ompi_request_t*)sendreq);
263263
}
264264

265-
sendreq->req_send.req_base.req_pml_complete = true;
265+
if (!sendreq->req_send.req_base.req_free_called) {
266+
sendreq->req_send.req_base.req_pml_complete = true;
266267

267-
if( !REQUEST_COMPLETE( &((sendreq->req_send).req_base.req_ompi)) ) {
268-
/* Should only be called for long messages (maybe synchronous) */
269-
MCA_PML_OB1_SEND_REQUEST_MPI_COMPLETE(sendreq, true);
270-
} else {
271-
if( MPI_SUCCESS != sendreq->req_send.req_base.req_ompi.req_status.MPI_ERROR ) {
272-
ompi_mpi_abort(&ompi_mpi_comm_world.comm, MPI_ERR_REQUEST);
268+
if( !REQUEST_COMPLETE( &((sendreq->req_send).req_base.req_ompi)) ) {
269+
/* Should only be called for long messages (maybe synchronous) */
270+
MCA_PML_OB1_SEND_REQUEST_MPI_COMPLETE(sendreq, true);
271+
} else {
272+
if( MPI_SUCCESS != sendreq->req_send.req_base.req_ompi.req_status.MPI_ERROR ) {
273+
ompi_mpi_abort(&ompi_mpi_comm_world.comm, MPI_ERR_REQUEST);
274+
}
273275
}
274-
}
275-
if(true == sendreq->req_send.req_base.req_free_called) {
276+
} else {
276277
MCA_PML_OB1_SEND_REQUEST_RETURN(sendreq);
277278
}
278279
}

0 commit comments

Comments
 (0)