Skip to content

Commit

Permalink
UTIL: fix rcache merge cb (openucx#1011)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergei-Lebedev authored Aug 22, 2024
1 parent 777df69 commit 2359644
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions config/m4/ucx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ AS_IF([test "x$ucx_checked" != "xyes"],[
[],
[#include <ucs/memory/rcache.h>])
AC_CHECK_MEMBER(ucs_rcache_ops_t.merge,
[AC_DEFINE([UCS_HAVE_RCACHE_MERGE_CB], [1], [flags for ucs_rcache_ops_t])],
[],
[#include <ucs/memory/rcache.h>])
AC_DEFINE([HAVE_UCX], 1, [Enable UCX support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ucs/config/parser.h>
Expand Down
5 changes: 4 additions & 1 deletion src/components/tl/mlx5/mcast/tl_mlx5_mcast_rcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ void ucc_tl_mlx5_mcast_mem_deregister(ucc_tl_mlx5_mcast_coll_context_t *ctx,
static ucc_rcache_ops_t ucc_tl_mlx5_rcache_ops = {
.mem_reg = ucc_tl_mlx5_mcast_rcache_mem_reg_cb,
.mem_dereg = ucc_tl_mlx5_mcast_rcache_mem_dereg_cb,
.dump_region = ucc_tl_mlx5_mcast_rcache_dump_region_cb
.dump_region = ucc_tl_mlx5_mcast_rcache_dump_region_cb,
#ifdef UCS_HAVE_RCACHE_MERGE_CB
.merge = ucc_rcache_merge_cb_empty
#endif
};

ucc_status_t ucc_tl_mlx5_mcast_setup_rcache(ucc_tl_mlx5_mcast_coll_context_t *ctx)
Expand Down
5 changes: 4 additions & 1 deletion src/components/tl/mlx5/tl_mlx5_rcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ static void ucc_tl_mlx5_rcache_dump_region_cb(void *context, //NOLINT
static ucc_rcache_ops_t ucc_tl_mlx5_rcache_ops = {
.mem_reg = rcache_reg_mr,
.mem_dereg = rcache_dereg_mr,
.dump_region = ucc_tl_mlx5_rcache_dump_region_cb
.dump_region = ucc_tl_mlx5_rcache_dump_region_cb,
#ifdef UCS_HAVE_RCACHE_MERGE_CB
.merge = ucc_rcache_merge_cb_empty
#endif
};

ucc_status_t tl_mlx5_rcache_create(ucc_tl_mlx5_context_t *ctx)
Expand Down
5 changes: 4 additions & 1 deletion src/components/tl/sharp/tl_sharp_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ ucc_tl_sharp_rcache_dump_region_cb(void *context, ucs_rcache_t *rcache, //NOLINT
static ucc_rcache_ops_t ucc_tl_sharp_rcache_ops = {
.mem_reg = ucc_tl_sharp_rcache_mem_reg_cb,
.mem_dereg = ucc_tl_sharp_rcache_mem_dereg_cb,
.dump_region = ucc_tl_sharp_rcache_dump_region_cb
.dump_region = ucc_tl_sharp_rcache_dump_region_cb,
#ifdef UCS_HAVE_RCACHE_MERGE_CB
.merge = ucc_rcache_merge_cb_empty
#endif
};

ucc_status_t ucc_tl_sharp_rcache_create(struct sharp_coll_context *context,
Expand Down
7 changes: 7 additions & 0 deletions src/utils/ucc_rcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ static inline void ucc_rcache_set_default_params(ucs_rcache_params_t *rcache_par
#define ucc_rcache_region_put ucs_rcache_region_put
#define ucc_rcache_region_invalidate ucs_rcache_region_invalidate

static inline void
ucc_rcache_merge_cb_empty(void *context, ucs_rcache_t *rcache,
void *arg, ucs_rcache_region_t *region)
{
return;
}

/* Wrapper functions for status conversion */
static inline ucc_status_t
ucc_rcache_create(const ucc_rcache_params_t *params,
Expand Down

0 comments on commit 2359644

Please sign in to comment.