Skip to content

Commit ae056d9

Browse files
authored
Merge pull request #2545 from kawashima-fj/pr/inactive-persistent-request
ompi/request: Fix a persistent request creation bug
2 parents 1187212 + 6510800 commit ae056d9

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

ompi/mca/pml/bfo/pml_bfo_iprobe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int mca_pml_bfo_iprobe(int src,
3535
recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
3636
recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_IPROBE;
3737

38-
MCA_PML_BFO_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, true);
38+
MCA_PML_BFO_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, false);
3939
MCA_PML_BFO_RECV_REQUEST_START(&recvreq);
4040

4141
if( recvreq.req_recv.req_base.req_ompi.req_complete == true ) {
@@ -65,7 +65,7 @@ int mca_pml_bfo_probe(int src,
6565
recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
6666
recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_PROBE;
6767

68-
MCA_PML_BFO_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, true);
68+
MCA_PML_BFO_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, false);
6969
MCA_PML_BFO_RECV_REQUEST_START(&recvreq);
7070

7171
ompi_request_wait_completion(&recvreq.req_recv.req_base.req_ompi);

ompi/mca/pml/ob1/pml_ob1_iprobe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int mca_pml_ob1_iprobe(int src,
3636
recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
3737
recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_IPROBE;
3838

39-
MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, true);
39+
MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, false);
4040
MCA_PML_OB1_RECV_REQUEST_START(&recvreq);
4141

4242
if( REQUEST_COMPLETE( &(recvreq.req_recv.req_base.req_ompi)) ) {
@@ -66,7 +66,7 @@ int mca_pml_ob1_probe(int src,
6666
recvreq.req_recv.req_base.req_ompi.req_type = OMPI_REQUEST_PML;
6767
recvreq.req_recv.req_base.req_type = MCA_PML_REQUEST_PROBE;
6868

69-
MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, true);
69+
MCA_PML_OB1_RECV_REQUEST_INIT(&recvreq, NULL, 0, &ompi_mpi_char.dt, src, tag, comm, false);
7070
MCA_PML_OB1_RECV_REQUEST_START(&recvreq);
7171

7272
ompi_request_wait_completion(&recvreq.req_recv.req_base.req_ompi);

ompi/request/request.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,14 @@ typedef struct ompi_predefined_request_t ompi_predefined_request_t;
142142
* performance path (since requests may be re-used, it is possible
143143
* that we will have to initialize a request multiple times).
144144
*/
145-
#define OMPI_REQUEST_INIT(request, persistent) \
146-
do { \
147-
(request)->req_complete = REQUEST_PENDING; \
148-
(request)->req_state = OMPI_REQUEST_INACTIVE; \
149-
(request)->req_persistent = (persistent); \
150-
(request)->req_complete_cb = NULL; \
151-
(request)->req_complete_cb_data = NULL; \
145+
#define OMPI_REQUEST_INIT(request, persistent) \
146+
do { \
147+
(request)->req_complete = \
148+
(persistent) ? REQUEST_COMPLETED : REQUEST_PENDING; \
149+
(request)->req_state = OMPI_REQUEST_INACTIVE; \
150+
(request)->req_persistent = (persistent); \
151+
(request)->req_complete_cb = NULL; \
152+
(request)->req_complete_cb_data = NULL; \
152153
} while (0);
153154

154155

0 commit comments

Comments
 (0)