Skip to content

Commit 8e51a72

Browse files
authored
Merge pull request #9183 from karasevb/topic/master/ucx_pml_dtype_retain
pml/ucx: fix object retain for predefined data types
2 parents 930b526 + 2719c33 commit 8e51a72

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,12 +697,12 @@ int mca_pml_ucx_isend_init(const void *buf, size_t count, ompi_datatype_t *datat
697697
req->send.mode = mode;
698698
req->send.ep = ep;
699699
req->ompi_datatype = datatype;
700+
OMPI_DATATYPE_RETAIN(datatype);
700701

701702
if (MCA_PML_BASE_SEND_BUFFERED == mode) {
702-
OBJ_RETAIN(datatype);
703+
req->datatype = NULL;
703704
} else {
704705
req->datatype = mca_pml_ucx_get_datatype(datatype);
705-
OMPI_DATATYPE_RETAIN(datatype);
706706
}
707707

708708
*request = &req->ompi;

ompi/mca/pml/ucx/pml_ucx_request.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,7 @@ static int mca_pml_ucx_persistent_request_free(ompi_request_t **rptr)
216216
mca_pml_ucx_persistent_request_detach(preq, tmp_req);
217217
ucp_request_free(tmp_req);
218218
}
219-
if ((preq->flags & MCA_PML_UCX_REQUEST_FLAG_SEND) &&
220-
(MCA_PML_BASE_SEND_BUFFERED == preq->send.mode)) {
221-
OBJ_RELEASE(preq->ompi_datatype);
222-
} else {
223-
OMPI_DATATYPE_RELEASE(preq->ompi_datatype);
224-
}
219+
OMPI_DATATYPE_RELEASE(preq->ompi_datatype);
225220
PML_UCX_FREELIST_RETURN(&ompi_pml_ucx.persistent_reqs, &preq->ompi.super);
226221
*rptr = MPI_REQUEST_NULL;
227222
return OMPI_SUCCESS;

0 commit comments

Comments
 (0)