Skip to content

Commit

Permalink
btl/uct: add support for UCX 1.10.x
Browse files Browse the repository at this point in the history
This commit adjusts for yet another API break in UCT. This time it is the removal of
a parameter to a callback function. This change should allow btl/uct to be used with
1.10 so bumping to allow version to reflect the change.

Signed-off-by: Nathan Hjelm <[email protected]>
  • Loading branch information
hjelmn committed Jun 16, 2021
1 parent b6d7bf1 commit 8fbee98
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
10 changes: 10 additions & 0 deletions opal/mca/btl/uct/btl_uct_endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,22 @@ struct mca_btl_uct_conn_completion_t {
};
typedef struct mca_btl_uct_conn_completion_t mca_btl_uct_conn_completion_t;

#if UCT_API >= ((1L<<UCT_MAJOR_BIT)|(10L << UCT_MINOR_BIT))
static void mca_btl_uct_endpoint_flush_complete(uct_completion_t *self)
{
mca_btl_uct_conn_completion_t *completion = (mca_btl_uct_conn_completion_t *) self;
BTL_VERBOSE(("connection flush complete"));
completion->complete = true;
}
#else
static void mca_btl_uct_endpoint_flush_complete(uct_completion_t *self, ucs_status_t status)
{
mca_btl_uct_conn_completion_t *completion = (mca_btl_uct_conn_completion_t *) self;
(void) status;
BTL_VERBOSE(("connection flush complete"));
completion->complete = true;
}
#endif

static int mca_btl_uct_endpoint_send_conn_req(mca_btl_uct_module_t *uct_btl,
mca_btl_base_endpoint_t *endpoint,
Expand Down
12 changes: 11 additions & 1 deletion opal/mca/btl/uct/btl_uct_frag.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "btl_uct_frag.h"

static void mca_btl_uct_frag_completion(uct_completion_t *uct_comp, ucs_status_t status)
static void mca_btl_uct_frag_completion_compat(uct_completion_t *uct_comp, ucs_status_t status)
{
mca_btl_uct_uct_completion_t *comp = (mca_btl_uct_uct_completion_t
*) ((uintptr_t) uct_comp
Expand All @@ -24,6 +24,16 @@ static void mca_btl_uct_frag_completion(uct_completion_t *uct_comp, ucs_status_t
opal_fifo_push(&comp->dev_context->completion_fifo, &comp->super.super);
}

#if UCT_API >= ((1L<<UCT_MAJOR_BIT)|(10L << UCT_MINOR_BIT))
static void mca_btl_uct_frag_completion(uct_completion_t *uct_comp) {
mca_btl_uct_frag_completion_compat(uct_comp, uct_comp->status);
}
#else
static void mca_btl_uct_frag_completion(uct_completion_t *uct_comp, ucs_status_t status) {
mca_btl_uct_frag_completion_compat(uct_comp, status);
}
#endif

static void mca_btl_uct_base_frag_constructor(mca_btl_uct_base_frag_t *frag)
{
mca_btl_uct_reg_t *reg = (mca_btl_uct_reg_t *) frag->base.super.registration;
Expand Down
12 changes: 11 additions & 1 deletion opal/mca/btl/uct/btl_uct_rdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "btl_uct_device_context.h"

void mca_btl_uct_uct_completion(uct_completion_t *uct_comp, ucs_status_t status)
static void mca_btl_uct_uct_completion_compat(uct_completion_t *uct_comp, ucs_status_t status)
{
mca_btl_uct_uct_completion_t *comp = (mca_btl_uct_uct_completion_t
*) ((uintptr_t) uct_comp
Expand All @@ -24,6 +24,16 @@ void mca_btl_uct_uct_completion(uct_completion_t *uct_comp, ucs_status_t status)
opal_fifo_push(&comp->dev_context->completion_fifo, &comp->super.super);
}

#if UCT_API >= ((1L<<UCT_MAJOR_BIT)|(10L << UCT_MINOR_BIT))
static void mca_btl_uct_uct_completion(uct_completion_t *uct_comp) {
mca_btl_uct_uct_completion_compat(uct_comp, uct_comp->status);
}
#else
static void mca_btl_uct_uct_completion(uct_completion_t *uct_comp, ucs_status_t status) {
mca_btl_uct_uct_completion_compat(uct_comp, status);
}
#endif

static void mca_btl_uct_uct_completion_construct(mca_btl_uct_uct_completion_t *comp)
{
comp->frag = NULL;
Expand Down
2 changes: 0 additions & 2 deletions opal/mca/btl/uct/btl_uct_rdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ mca_btl_uct_uct_completion_t *mca_btl_uct_uct_completion_alloc(
*/
void mca_btl_uct_uct_completion_release(mca_btl_uct_uct_completion_t *comp);

void mca_btl_uct_uct_completion(uct_completion_t *uct_comp, ucs_status_t status);

/**
* @brief unpack the registration key and ensure the endpoint is connected
*
Expand Down

0 comments on commit 8fbee98

Please sign in to comment.