Skip to content

Commit befe284

Browse files
committed
osc/pt2pt: do not set rdma_frag after start
It is possible for the start call to complete the requests. For this reason the module rdma_frag field should be filled in before start is called. If the request completes the completion callback will reset the rdma_frag field to NULL. Fixes a bug discovered by @tkordenbrock. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent 50952c3 commit befe284

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

ompi/mca/osc/pt2pt/osc_pt2pt_data_move.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,30 +1718,26 @@ int ompi_osc_pt2pt_irecv_w_cb (void *ptr, int count, ompi_datatype_t *datatype,
17181718
ompi_communicator_t *comm, ompi_request_t **request_out,
17191719
ompi_request_complete_fn_t cb, void *ctx)
17201720
{
1721-
ompi_request_t *request;
17221721
int ret;
17231722

17241723
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
17251724
"osc pt2pt: ompi_osc_pt2pt_irecv_w_cb receiving %d bytes from %d with tag %d",
17261725
count, target, tag));
17271726

1728-
ret = MCA_PML_CALL(irecv_init(ptr, count, datatype, target, tag, comm, &request));
1727+
ret = MCA_PML_CALL(irecv_init(ptr, count, datatype, target, tag, comm, request_out));
17291728
if (OMPI_SUCCESS != ret) {
17301729
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
17311730
"error posting receive. ret = %d", ret));
17321731
return ret;
17331732
}
17341733

1735-
request->req_complete_cb = cb;
1736-
request->req_complete_cb_data = ctx;
1734+
(*request_out)->req_complete_cb = cb;
1735+
(*request_out)->req_complete_cb_data = ctx;
17371736

1738-
ret = MCA_PML_CALL(start(1, &request));
1739-
if (request_out && MPI_REQUEST_NULL != request) {
1740-
*request_out = request;
1741-
}
1737+
ret = MCA_PML_CALL(start(1, request_out));
17421738

17431739
OPAL_OUTPUT_VERBOSE((50, ompi_osc_base_framework.framework_output,
1744-
"osc pt2pt: pml start returned %d. state: %d", ret, request->req_state));
1740+
"osc pt2pt: pml start returned %d", ret));
17451741

17461742
return ret;
17471743
}

0 commit comments

Comments
 (0)