diff --git a/config/ompi_check_openib.m4 b/config/ompi_check_openib.m4 index 148fc060ce..9b126e1a39 100644 --- a/config/ompi_check_openib.m4 +++ b/config/ompi_check_openib.m4 @@ -30,6 +30,9 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[ OMPI_VAR_SCOPE_PUSH([$1_msg]) + # + # Openfabrics support + # AC_ARG_WITH([openib], [AC_HELP_STRING([--with-openib(=DIR)], [Build OpenFabrics support, searching for libraries in DIR])]) @@ -37,6 +40,28 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[ [AC_HELP_STRING([--with-openib-libdir=DIR], [Search for OpenFabrics libraries in DIR])]) + # + # ConnectX XRC support + # + AC_ARG_ENABLE([connectx-xrc], + [AC_HELP_STRING([--enable-openib-connectx-xrc], + [Enable ConnectX XRC support. If you do not have InfiniBand ConnectX adapters, you may disable the ConnectX XRC support. If you do not know which InfiniBand adapter is installed on your cluster, leave this option enabled (default: enabled)])], + [enable_connectx_xrc="$enableval"], [enable_connectx_xrc="yes"]) + # + # Openfabrics IBCM + # + AC_ARG_ENABLE([openib-ibcm], + [AC_HELP_STRING([--enable-openib-ibcm], + [Enable Open Fabrics IBCM support in openib BTL (default: enabled)])], + [enable_openib_ibcm="$enableval"], [enable_openib_ibcm="yes"]) + # + # Openfabrics RDMACM + # + AC_ARG_ENABLE([openib-rdmacm], + [AC_HELP_STRING([--enable-openib-rdmacm], + [Enable Open Fabrics RDMACM support in openib BTL (default: enabled)])], + [enable_openib_rdmacm="$enableval"], [enable_openib_rdmacm="yes"]) + AS_IF([test ! -z "$with_openib" -a "$with_openib" != "yes"], [ompi_check_openib_dir="$with_openib"]) AS_IF([test ! -z "$with_openib_libdir" -a "$with_openib_libdir" != "yes"], @@ -103,6 +128,7 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[ # Set these up so that we can do an AC_DEFINE below # (unconditionally) + $1_have_xrc=0 $1_have_rdmacm=0 $1_have_ibcm=0 @@ -117,23 +143,27 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[ [#include ]) # ibv_create_xrc_rcv_qp was added in OFED 1.3 - AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp], [$1_have_xrc=1]) + if test "$enable_connectx_xrc" = "yes"; then + AC_CHECK_FUNCS([ibv_create_xrc_rcv_qp], [$1_have_xrc=1]) + fi # Do we have a recent enough RDMA CM? Need to have the # rdma_get_peer_addr (inline) function (originally appeared # in OFED v1.3). - AC_CHECK_HEADERS([rdma/rdma_cma.h], - [AC_CHECK_LIB([rdmacm], [rdma_create_id], - [AC_MSG_CHECKING([for rdma_get_peer_addr]) - $1_msg=no - AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "rdma/rdma_cma.h" -]], [[void *ret = (void*) rdma_get_peer_addr((struct rdma_cm_id*)0);]])], - [$1_have_rdmacm=1 - $1_msg=yes]) - AC_MSG_RESULT([$$1_msg])])]) + if test "$enable_openib_rdmacm" = "yes"; then + AC_CHECK_HEADERS([rdma/rdma_cma.h], + [AC_CHECK_LIB([rdmacm], [rdma_create_id], + [AC_MSG_CHECKING([for rdma_get_peer_addr]) + $1_msg=no + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "rdma/rdma_cma.h" + ]], [[void *ret = (void*) rdma_get_peer_addr((struct rdma_cm_id*)0);]])], + [$1_have_rdmacm=1 + $1_msg=yes]) + AC_MSG_RESULT([$$1_msg])])]) - if test "1" = "$$1_have_rdmacm"; then - $1_LIBS="-lrdmacm $$1_LIBS" + if test "1" = "$$1_have_rdmacm"; then + $1_LIBS="-lrdmacm $$1_LIBS" + fi fi # Do we have IB CM? (note that OFED IB CM depends on RDMA @@ -141,16 +171,40 @@ AC_DEFUN([OMPI_CHECK_OPENIB],[ # argument to AC_CHECK_ LIB). Note that we only want IBCM # starting with OFED 1.2 or so, so check for # ib_cm_open_device (introduced in libibcm 1.0/OFED 1.2). - AC_CHECK_HEADERS([infiniband/cm.h], - [AC_CHECK_LIB([ibcm], [ib_cm_open_device], - [$1_have_ibcm=1 - $1_LIBS="-libcm $$1_LIBS"])]) + if test "$enable_openib_ibcm" = "yes"; then + AC_CHECK_HEADERS([infiniband/cm.h], + [AC_CHECK_LIB([ibcm], [ib_cm_open_device], + [$1_have_ibcm=1 + $1_LIBS="-libcm $$1_LIBS"])]) + fi ]) + AC_MSG_CHECKING([if ConnectX XRC support is enabled]) + AC_DEFINE_UNQUOTED([OMPI_HAVE_CONNECTX_XRC], [$$1_have_xrc], + [Enable features required for ConnectX XRC support]) + if test "1" = "$$1_have_xrc"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([if OpenFabrics RDMACM support is enabled]) AC_DEFINE_UNQUOTED([OMPI_HAVE_RDMACM], [$$1_have_rdmacm], [Whether RDMA CM is available or not]) + if test "1" = "$$1_have_rdmacm"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + + AC_MSG_CHECKING([if OpenFabrics IBCM support is enabled]) AC_DEFINE_UNQUOTED([OMPI_HAVE_IBCM], [$$1_have_ibcm], [Whether IB CM is available or not]) + if test "1" = "$$1_have_ibcm"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi CPPFLAGS="$ompi_check_openib_$1_save_CPPFLAGS" LDFLAGS="$ompi_check_openib_$1_save_LDFLAGS" diff --git a/config/ompi_configure_options.m4 b/config/ompi_configure_options.m4 index e1c505146a..255d38bcb8 100644 --- a/config/ompi_configure_options.m4 +++ b/config/ompi_configure_options.m4 @@ -717,22 +717,4 @@ AC_DEFINE_UNQUOTED([OPAL_IDENT_STRING], ["$with_ident_string"], [ident string for Open MPI]) AC_MSG_RESULT([$with_ident_string]) -# -# ConnectX XRC support -# -AC_MSG_CHECKING([if ConnectX XRC support should be enabled]) -AC_ARG_ENABLE([connectx-xrc], - [AC_HELP_STRING([--enable-connectx-xrc], - [Enable features required for ConnectX XRC support. If you do not have InfiniBand ConnectX adapters, you may disable the ConnectX XRC support. If you do not know which InfiniBand adapter is installed on your cluster, leave this option enabled (default: enabled)])]) -if test "$enable_connectx_xrc" = "no" ; then - AC_MSG_RESULT([no]) - ompi_want_connectx_xrc=0 -else - AC_MSG_RESULT([yes]) - ompi_want_connectx_xrc=1 -fi -AC_DEFINE_UNQUOTED([OMPI_ENABLE_CONNECTX_XRC_SUPPORT], - [$ompi_want_connectx_xrc], - [Enable features required for ConnectX XRC support]) - ]) diff --git a/ompi/mca/btl/openib/btl_openib.h b/ompi/mca/btl/openib/btl_openib.h index 0590605213..cba5dc3d21 100644 --- a/ompi/mca/btl/openib/btl_openib.h +++ b/ompi/mca/btl/openib/btl_openib.h @@ -50,7 +50,7 @@ BEGIN_C_DECLS -#define HAVE_XRC (defined(HAVE_IBV_CREATE_XRC_RCV_QP) && (1 == OMPI_ENABLE_CONNECTX_XRC_SUPPORT)) +#define HAVE_XRC (1 == OMPI_HAVE_CONNECTX_XRC) #define MCA_BTL_IB_LEAVE_PINNED 1 #define IB_DEFAULT_GID_PREFIX 0xfe80000000000000ll diff --git a/ompi/mca/btl/openib/configure.m4 b/ompi/mca/btl/openib/configure.m4 index 85effc45de..dd69825c24 100644 --- a/ompi/mca/btl/openib/configure.m4 +++ b/ompi/mca/btl/openib/configure.m4 @@ -22,7 +22,7 @@ # MCA_btl_openib_POST_CONFIG([should_build]) # ------------------------------------------ AC_DEFUN([MCA_btl_openib_POST_CONFIG], [ - AM_CONDITIONAL([MCA_btl_openib_have_xrc], [test $1 -eq 1 -a "x$btl_openib_have_xrc" = "x1" -a "x$ompi_want_connectx_xrc" = "x1"]) + AM_CONDITIONAL([MCA_btl_openib_have_xrc], [test $1 -eq 1 -a "x$btl_openib_have_xrc" = "x1"]) AM_CONDITIONAL([MCA_btl_openib_have_rdmacm], [test $1 -eq 1 -a "x$btl_openib_have_rdmacm" = "x1"]) AM_CONDITIONAL([MCA_btl_openib_have_ibcm], [test $1 -eq 1 -a "x$btl_openib_have_ibcm" = "x1"]) ]) @@ -56,13 +56,13 @@ AC_DEFUN([MCA_btl_openib_CONFIG],[ AS_IF([test "$btl_openib_happy" = "yes"], - [if test "x$btl_openib_have_xrc" = "x1" -a "x$ompi_want_connectx_xrc" = "x1"; then + [if test "x$btl_openib_have_xrc" = "x1"; then cpcs="$cpcs xoob" fi - if test "x$btl_openib_have_rdma_cm" = "x1"; then - cpcs="$cpcs rdma_cm" + if test "x$btl_openib_have_rdmacm" = "x1"; then + cpcs="$cpcs rdmacm" fi - if test "x$btl_openib_have_ib_cm" = "x1"; then + if test "x$btl_openib_have_ibcm" = "x1"; then cpcs="$cpcs ibcm" fi AC_MSG_CHECKING([which openib btl cpcs will be built])