Skip to content

Commit 4a886ac

Browse files
committed
pml/ob1: correctly reset receive request type before init
recvreq->req_recv.req_base.req_type should always be set before invoking MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, ...) otherwise, the previous type might be set, and you could end up with MPC_PML_REQUEST_IMPROBE when MCA_PML_REQUEST_RECV is expected. Thanks Chris Pattison for the report and test case. Fixes #2275
1 parent 055df6f commit 4a886ac

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ompi/mca/pml/ob1/pml_ob1_irecv.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* reserved.
1515
* Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
1616
* Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
17-
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
17+
* Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
18+
* Copyright (c) 2016 Research Organization for Information Science
19+
* and Technology (RIST). All rights reserved.
1820
* $COPYRIGHT$
1921
*
2022
* Additional copyrights may follow
@@ -51,6 +53,7 @@ int mca_pml_ob1_irecv_init(void *addr,
5153
if (NULL == recvreq)
5254
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
5355

56+
recvreq->req_recv.req_base.req_type = MCA_PML_REQUEST_RECV;
5457
MCA_PML_OB1_RECV_REQUEST_INIT(recvreq,
5558
addr,
5659
count, datatype, src, tag, comm, true);
@@ -82,6 +85,7 @@ int mca_pml_ob1_irecv(void *addr,
8285
if (NULL == recvreq)
8386
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
8487

88+
recvreq->req_recv.req_base.req_type = MCA_PML_REQUEST_RECV;
8589
MCA_PML_OB1_RECV_REQUEST_INIT(recvreq,
8690
addr,
8791
count, datatype, src, tag, comm, false);
@@ -118,6 +122,7 @@ int mca_pml_ob1_recv(void *addr,
118122
return OMPI_ERR_TEMP_OUT_OF_RESOURCE;
119123
}
120124

125+
recvreq->req_recv.req_base.req_type = MCA_PML_REQUEST_RECV;
121126
MCA_PML_OB1_RECV_REQUEST_INIT(recvreq, addr, count, datatype,
122127
src, tag, comm, false);
123128

0 commit comments

Comments
 (0)