Skip to content

Commit

Permalink
OSHMEM/MCA/SSHMEM/UCX: Fixed CR - using DECLS auto generated macros
Browse files Browse the repository at this point in the history
Signed-off-by: Roie Danino <[email protected]>
  • Loading branch information
roiedanino committed Aug 22, 2023
1 parent a3945ef commit 4d16347
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
3 changes: 2 additions & 1 deletion config/ompi_check_ucx.m4
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ AC_DEFUN([OMPI_CHECK_UCX],[
UCP_ATOMIC_FETCH_OP_FXOR,
UCP_PARAM_FIELD_ESTIMATED_NUM_PPN,
UCP_WORKER_FLAG_IGNORE_REQUEST_LEAK,
UCP_OP_ATTR_FLAG_MULTI_SEND],
UCP_OP_ATTR_FLAG_MULTI_SEND,
UCS_MEMORY_TYPE_RDMA],
[], [],
[#include <ucp/api/ucp.h>])
AC_CHECK_DECLS([UCP_WORKER_ATTR_FIELD_ADDRESS_FLAGS],
Expand Down
14 changes: 1 addition & 13 deletions oshmem/mca/sshmem/ucx/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,10 @@ AC_DEFUN([MCA_oshmem_sshmem_ucx_CONFIG],[
save_LIBS="$LIBS"
save_CPPFLAGS="$CPPFLAGS"
alloc_dm_LDFLAGS=" -L$ompi_check_ucx_libdir/ucx"
CPPFLAGS+=" $sshmem_ucx_CPPFLAGS"
LDFLAGS+=" $sshmem_ucx_LDFLAGS $alloc_dm_LDFLAGS"
LDFLAGS+=" $sshmem_ucx_LDFLAGS"
LIBS+=" $sshmem_ucx_LIBS"
AC_CHECK_DECL([UCS_MEMORY_TYPE_RDMA],
[
AC_MSG_NOTICE([UCX device memory allocation is supported])
AC_DEFINE([HAVE_UCX_DEVICE_MEM], [1], [Support for device memory allocation])
],
[
AC_MSG_NOTICE([UCX device memory allocation is not supported])
AC_DEFINE([HAVE_UCX_DEVICE_MEM], [0], [Support for device memory allocation])
], [#include <ucp/api/ucp.h>])
CPPFLAGS="$save_CPPFLAGS"
LDFLAGS="$save_LDFLAGS"
LIBS="$save_LIBS"
Expand All @@ -52,4 +41,3 @@ AC_DEFUN([MCA_oshmem_sshmem_ucx_CONFIG],[
AC_SUBST([sshmem_ucx_LDFLAGS])
AC_SUBST([sshmem_ucx_LIBS])
])dnl

8 changes: 5 additions & 3 deletions oshmem/mca/sshmem/ucx/sshmem_ucx_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ segment_create(map_segment_t *ds_buf,
unsigned flags = UCP_MEM_MAP_ALLOCATE;
int status = OSHMEM_SUCCESS;

#if HAVE_UCX_DEVICE_MEM
#if HAVE_DECL_UCS_MEMORY_TYPE_RDMA
if (hint & SHMEM_HINT_DEVICE_NIC_MEM) {
status = segment_create_internal(ds_buf, NULL, size, flags, UCS_MEMORY_TYPE_RDMA);
status = segment_create_internal(ds_buf, NULL, size, flags,
UCS_MEMORY_TYPE_RDMA);
if (status == OSHMEM_SUCCESS) {
ds_buf->alloc_hints = hint;
ds_buf->allocator = &sshmem_ucx_allocator;
Expand All @@ -196,7 +197,8 @@ segment_create(map_segment_t *ds_buf,
if (spml->heap_reg_nb) {
flags |= UCP_MEM_MAP_NONBLOCK;
}
return segment_create_internal(ds_buf, mca_sshmem_base_start_address, size, flags, UCS_MEMORY_TYPE_HOST);
return segment_create_internal(ds_buf, mca_sshmem_base_start_address, size,
flags, UCS_MEMORY_TYPE_HOST);
}

static void *
Expand Down

0 comments on commit 4d16347

Please sign in to comment.