Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 52 additions & 7 deletions config/ompi_check_openfabrics.m4
Original file line number Diff line number Diff line change
Expand Up @@ -164,22 +164,67 @@ AC_DEFUN([OMPI_CHECK_OPENFABRICS],[
AC_CHECK_MEMBERS([struct ibv_device.transport_type], [], [],
[#include <infiniband/verbs.h>])

# We have to check functions both exits *and* are declared
# since some distro ship broken ibverbs devel headers
# IBV_DEVICE_XRC is common to all OFED versions
# ibv_create_xrc_rcv_qp was added in OFED 1.3
# ibv_cmd_open_xrcd (aka XRC Domains) was added in OFED 3.12
if test "$enable_connectx_xrc" = "yes"; then
$1_have_xrc=1
AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp ibv_cmd_open_xrcd],
[], [$1_have_xrc=0])
AC_CHECK_DECLS([IBV_SRQT_XRC],
[], [$1_have_xrc=0],
AC_CHECK_DECLS([IBV_DEVICE_XRC],
[$1_have_xrc=1
$1_have_xrc_domains=1],
[],
[#include <infiniband/verbs.h>])
fi
if test "$enable_connectx_xrc" = "yes" \
&& test $$1_have_xrc -eq 1; then
AC_CHECK_FUNCS([ibv_cmd_open_xrcd], [$1_have_xrc_domains=1])
AC_CHECK_DECLS([ibv_create_xrc_rcv_qp],
[AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp],
[], [$1_have_xrc=0])],
[$1_have_xrc=0],
[#include <infiniband/driver.h>])
fi
if test "$enable_connectx_xrc" = "yes" \
&& test $$1_have_xrc_domains -eq 1; then
AC_CHECK_DECLS([ibv_cmd_open_xrcd],
[AC_CHECK_DECLS([IBV_SRQT_XRC],
[AC_CHECK_FUNCS([ibv_cmd_open_xrcd],
[], [$1_have_xrc_domains=0])],
[$1_have_xrc_domains=0],
[#include <infiniband/verbs.h>])],
[$1_have_xrc_domains=0],
[#include <infiniband/driver.h>])
# XRC and XRC Domains should be considered as exclusive
if test "$$1_have_xrc" -eq 1 && \
test "$$1_have_xrc_domains" -eq 1; then
$1_have_xrc=0
fi
fi


if test "no" != "$enable_openib_dynamic_sl"; then
# We need ib_types.h file, which is installed with opensm-devel
# package. However, ib_types.h has a bad include directive,
# which will cause AC_CHECK_HEADER to fail.
# So instead, we will look for another file that is also
# installed as part of opensm-devel package and included in
# ib_types.h, but it doesn't include any other IB-related files.
AC_CHECK_HEADER([infiniband/complib/cl_types_osd.h],
[AC_CHECK_LIB([osmcomp], [cl_map_init],
[$1_have_opensm_devel=1],[])],
[],
[])
# Abort if dynamic SL support was explicitly requested but opensm-devel
# package wasn't found. Otherwise, OMPI will be built w/o dynamic SL.
AC_MSG_CHECKING([if can use dynamic SL support])
AS_IF([test "$$1_have_opensm_devel" = "1"],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AS_IF([test "$enable_openib_dynamic_sl" = "yes"],
[AC_MSG_WARN([--enable-openib-dynamic-sl was specified but the])
AC_MSG_WARN([appropriate header/library files could not be found])
AC_MSG_WARN([Please install opensm-devel if you need dynamic SL support])
AC_MSG_ERROR([Cannot continue])])])
fi
if test "no" != "$enable_openib_dynamic_sl"; then
# We need ib_types.h file, which is installed with opensm-devel
# package. However, ib_types.h has a bad include directive,
Expand Down
4 changes: 2 additions & 2 deletions ompi/mca/btl/openib/btl_openib.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

BEGIN_C_DECLS

#define HAVE_XRC (1 == OMPI_HAVE_CONNECTX_XRC)
#define ENABLE_DYNAMIC_SL (1 == OMPI_ENABLE_DYNAMIC_SL)
#define HAVE_XRC (OMPI_HAVE_CONNECTX_XRC || OMPI_HAVE_CONNECTX_XRC_DOMAINS)
#define ENABLE_DYNAMIC_SL OMPI_ENABLE_DYNAMIC_SL

#define MCA_BTL_IB_LEAVE_PINNED 1
#define IB_DEFAULT_GID_PREFIX 0xfe80000000000000ll
Expand Down
11 changes: 4 additions & 7 deletions ompi/mca/btl/openib/btl_openib_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static mca_btl_openib_endpoint_t * qp2endpoint(struct ibv_qp *qp, mca_btl_openib
return NULL;
}

#if HAVE_XRC && !OMPI_HAVE_CONNECTX_XRC_DOMAINS
#if OMPI_HAVE_CONNECTX_XRC
/* XRC recive QP to endpoint */
static mca_btl_openib_endpoint_t * xrc_qp2endpoint(uint32_t qp_num, mca_btl_openib_device_t *device)
{
Expand Down Expand Up @@ -350,16 +350,13 @@ static int btl_openib_async_deviceh(struct mca_btl_openib_async_poll *devices_po
}

event_type = event.event_type;
#if HAVE_XRC
#if OMPI_HAVE_CONNECTX_XRC
/* is it XRC event ?*/
#if OMPI_HAVE_CONNECTX_XRC_DOMAINS
#else
if (IBV_XRC_QP_EVENT_FLAG & event.event_type) {
xrc_event = true;
/* Clean the bitnd handel as usual */
event_type ^= IBV_XRC_QP_EVENT_FLAG;
}
#endif
#endif
switch(event_type) {
case IBV_EVENT_PATH_MIG:
Expand All @@ -369,7 +366,7 @@ static int btl_openib_async_deviceh(struct mca_btl_openib_async_poll *devices_po
if (!xrc_event)
mca_btl_openib_load_apm(event.element.qp,
qp2endpoint(event.element.qp, device));
#if HAVE_XRC && !OMPI_HAVE_CONNECTX_XRC_DOMAINS
#if OMPI_HAVE_CONNECTX_XRC
else
mca_btl_openib_load_apm_xrc_rcv(event.element.xrc_qp_num,
xrc_qp2endpoint(event.element.xrc_qp_num, device));
Expand Down Expand Up @@ -651,7 +648,7 @@ void mca_btl_openib_load_apm(struct ibv_qp *qp, mca_btl_openib_endpoint_t *ep)
qp->qp_num, strerror(errno), errno));
}

#if HAVE_XRC && ! OMPI_HAVE_CONNECTX_XRC_DOMAINS
#if OMPI_HAVE_CONNECTX_XRC
void mca_btl_openib_load_apm_xrc_rcv(uint32_t qp_num, mca_btl_openib_endpoint_t *ep)
{
struct ibv_qp_init_attr qp_init_attr;
Expand Down
2 changes: 1 addition & 1 deletion ompi/mca/btl/openib/btl_openib_async.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
int start_async_event_thread(void);
void mca_btl_openib_load_apm(struct ibv_qp *qp, mca_btl_openib_endpoint_t *ep);
int btl_openib_async_command_done(int exp);
#if HAVE_XRC && ! OMPI_HAVE_CONNECTX_XRC_DOMAINS
#if OMPI_HAVE_CONNECTX_XRC
void mca_btl_openib_load_apm_xrc_rcv(uint32_t qp_num, mca_btl_openib_endpoint_t *ep);
#endif

Expand Down