Skip to content

Commit 05e85f7

Browse files
committed
pml/ucx: Add send cancel deprecation warning for MPI 4.0
Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
1 parent 77b06f5 commit 05e85f7

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* reserved.
66
* Copyright (c) 2018-2019 Research Organization for Information Science
77
* and Technology (RIST). All rights reserved.
8-
* Copyright (c) 2018 IBM Corporation. All rights reserved.
8+
* Copyright (c) 2018-2022 IBM Corporation. All rights reserved.
99
* Copyright (c) 2019 Intel, Inc. All rights reserved.
1010
* Copyright (c) 2022 Amazon.com, Inc. or its affiliates.
1111
* All Rights reserved.
@@ -358,6 +358,9 @@ int mca_pml_ucx_init(int enable_mpi_threads)
358358
/* Create a completed request to be returned from isend */
359359
OBJ_CONSTRUCT(&ompi_pml_ucx.completed_send_req, ompi_request_t);
360360
mca_pml_ucx_completed_request_init(&ompi_pml_ucx.completed_send_req);
361+
#if MPI_VERSION >= 4
362+
ompi_pml_ucx.completed_send_req.req_cancel = mca_pml_cancel_send_callback;
363+
#endif
361364

362365
opal_progress_register(mca_pml_ucx_progress);
363366

@@ -924,6 +927,11 @@ int mca_pml_ucx_isend(const void *buf, size_t count, ompi_datatype_t *datatype,
924927
} else if (!UCS_PTR_IS_ERR(req)) {
925928
PML_UCX_VERBOSE(8, "got request %p", (void*)req);
926929
req->req_mpi_object.comm = comm;
930+
#if MPI_VERSION >= 4
931+
if (OPAL_LIKELY(mca_pml_ucx_request_cancel == req->req_cancel)) {
932+
req->req_cancel = mca_pml_ucx_request_cancel_send;
933+
}
934+
#endif
927935
*request = req;
928936
return OMPI_SUCCESS;
929937
} else {

ompi/mca/pml/ucx/pml_ucx_request.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2016 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
6+
* Copyright (c) 2022 IBM Corporation. All rights reserved.
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -14,6 +15,7 @@
1415
#include "ompi/mca/pml/base/pml_base_bsend.h"
1516
#include "ompi/message/message.h"
1617
#include "ompi/runtime/ompi_spc.h"
18+
#include "ompi/request/request.h"
1719
#include <inttypes.h>
1820

1921

@@ -29,12 +31,20 @@ static int mca_pml_ucx_request_free(ompi_request_t **rptr)
2931
return OMPI_SUCCESS;
3032
}
3133

32-
static int mca_pml_ucx_request_cancel(ompi_request_t *req, int flag)
34+
int mca_pml_ucx_request_cancel(ompi_request_t *req, int flag)
3335
{
3436
ucp_request_cancel(ompi_pml_ucx.ucp_worker, req);
3537
return OMPI_SUCCESS;
3638
}
3739

40+
#if MPI_VERSION >= 4
41+
int mca_pml_ucx_request_cancel_send(ompi_request_t *req, int flag)
42+
{
43+
mca_pml_cancel_send_callback(req, flag);
44+
return mca_pml_ucx_request_cancel(req, flag);
45+
}
46+
#endif
47+
3848
__opal_attribute_always_inline__ static inline void
3949
mca_pml_ucx_send_completion_internal(void *request, ucs_status_t status)
4050
{

ompi/mca/pml/ucx/pml_ucx_request.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2016-2021 The University of Tennessee and The University
44
* of Tennessee Research Foundation. All rights
55
* reserved.
6+
* Copyright (c) 2022 IBM Corporation. All rights reserved.
67
* $COPYRIGHT$
78
*
89
* Additional copyrights may follow
@@ -15,6 +16,9 @@
1516

1617
#include "pml_ucx.h"
1718
#include "pml_ucx_datatype.h"
19+
#if MPI_VERSION >= 4
20+
#include "ompi/mca/pml/base/pml_base_sendreq.h"
21+
#endif
1822

1923

2024
enum {
@@ -145,6 +149,11 @@ void mca_pml_ucx_request_init(void *request);
145149

146150
void mca_pml_ucx_request_cleanup(void *request);
147151

152+
int mca_pml_ucx_request_cancel(ompi_request_t *req, int flag);
153+
#if MPI_VERSION >= 4
154+
int mca_pml_ucx_request_cancel_send(ompi_request_t *req, int flag);
155+
#endif
156+
148157

149158
static inline void mca_pml_ucx_request_reset(ompi_request_t *req)
150159
{

0 commit comments

Comments
 (0)