552c9ca5a0
WHAT: Open our low-level communication infrastructure by moving all necessary components (btl/rcache/allocator/mpool) down in OPAL All the components required for inter-process communications are currently deeply integrated in the OMPI layer. Several groups/institutions have express interest in having a more generic communication infrastructure, without all the OMPI layer dependencies. This communication layer should be made available at a different software level, available to all layers in the Open MPI software stack. As an example, our ORTE layer could replace the current OOB and instead use the BTL directly, gaining access to more reactive network interfaces than TCP. Similarly, external software libraries could take advantage of our highly optimized AM (active message) communication layer for their own purpose. UTK with support from Sandia, developped a version of Open MPI where the entire communication infrastucture has been moved down to OPAL (btl/rcache/allocator/mpool). Most of the moved components have been updated to match the new schema, with few exceptions (mainly BTLs where I have no way of compiling/testing them). Thus, the completion of this RFC is tied to being able to completing this move for all BTLs. For this we need help from the rest of the Open MPI community, especially those supporting some of the BTLs. A non-exhaustive list of BTLs that qualify here is: mx, portals4, scif, udapl, ugni, usnic. This commit was SVN r32317.
203 строки
9.0 KiB
Bash
203 строки
9.0 KiB
Bash
# -*- shell-script -*-
|
|
#
|
|
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
# University Research and Technology
|
|
# Corporation. All rights reserved.
|
|
# Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
# of Tennessee Research Foundation. All rights
|
|
# reserved.
|
|
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
# University of Stuttgart. All rights reserved.
|
|
# Copyright (c) 2004-2005 The Regents of the University of California.
|
|
# All rights reserved.
|
|
# Copyright (c) 2006 Sandia National Laboratories. All rights
|
|
# reserved.
|
|
# Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
|
|
# $COPYRIGHT$
|
|
#
|
|
# Additional copyrights may follow
|
|
#
|
|
# $HEADER$
|
|
#
|
|
|
|
# OPAL_CHECK_LIBNL3(prefix, [action-if-found], [action-if-not-found])
|
|
# --------------------------------------------------------
|
|
# check if libnl3 support can be found. sets prefix_{CPPFLAGS,
|
|
# LDFLAGS, LIBS} as needed and runs action-if-found if there is
|
|
# support, otherwise executes action-if-not-found
|
|
#
|
|
# libnl3 changed its default header location as of v3.2 (released ca. September
|
|
# 2011). It was previously "${prefix}/include/netlink/...". It now is
|
|
# "${prefix}/libnl3/include/netlink/...". The logic below only supports
|
|
# >=v3.2, under the assumption that it is not widely deployed.
|
|
AC_DEFUN([OPAL_CHECK_LIBNL3],[
|
|
AC_ARG_WITH([libnl3],
|
|
[AC_HELP_STRING([--with-libnl3(=DIR)],
|
|
[Build libnl3 support])])
|
|
OPAL_CHECK_WITHDIR([libnl3], [$with_libnl3], [include/libnl3/netlink/netlink.h])
|
|
AC_ARG_WITH([libnl3-libdir],
|
|
[AC_HELP_STRING([--with-libnl3-libdir=DIR],
|
|
[Search for libnl3 libraries in DIR])])
|
|
OPAL_CHECK_WITHDIR([libnl3-libdir], [$with_libnl3_libdir], [libnl-3.*])
|
|
|
|
ompi_check_libnl3_$1_save_CPPFLAGS="$CPPFLAGS"
|
|
ompi_check_libnl3_$1_save_LDFLAGS="$LDFLAGS"
|
|
ompi_check_libnl3_$1_save_LIBS="$LIBS"
|
|
|
|
ompi_check_libnl3_$1_orig_CPPFLAGS="$$1_CPPFLAGS"
|
|
ompi_check_libnl3_$1_orig_LDFLAGS="$$1_LDFLAGS"
|
|
ompi_check_libnl3_$1_orig_LIBS="$$1_LIBS"
|
|
|
|
AS_IF([test "$with_libnl3" != "no"],
|
|
[AS_IF([test ! -z "$with_libnl3" -a "$with_libnl3" != "yes"],
|
|
[ompi_check_libnl3_dir="$with_libnl3"])
|
|
AS_IF([test ! -z "$with_libnl3_libdir" -a "$with_libnl3_libdir" != "yes"],
|
|
[ompi_check_libnl3_libdir="$with_libnl3_libdir"])
|
|
|
|
# OPAL_CHECK_PACKAGE unfortunately can't handle this weird include
|
|
# dir layout
|
|
AS_IF([test -n "$ompi_check_libnl3_dir"],
|
|
[ompi_check_libnl3_includedir="$ompi_check_libnl3_dir/include/libnl3"],
|
|
[ompi_check_libnl3_includedir="/usr/include/libnl3"])
|
|
$1_CPPFLAGS="$$1_CPPFLAGS -I$ompi_check_libnl3_includedir"
|
|
CPPFLAGS="$CPPFLAGS -I$ompi_check_libnl3_includedir"
|
|
|
|
AC_CHECK_HEADER([netlink/netlink.h],
|
|
[# nl_recvmsgs_report appears to be a symbol which
|
|
# is present in libnl-3 but not libnl (v1)
|
|
_OPAL_CHECK_PACKAGE_LIB([$1],
|
|
[nl-3],
|
|
[nl_recvmsgs_report],
|
|
[],
|
|
[$ompi_check_libnl3_dir],
|
|
[$ompi_check_libnl3_libdir],
|
|
[ompi_check_libnl3_happy="yes"],
|
|
[ompi_check_libnl3_happy="no"])],
|
|
[ompi_check_libnl3_happy=no])
|
|
|
|
# make sure that we don't pollute the cache with the results of a
|
|
# test performed under different CPPFLAGS
|
|
AS_UNSET([ac_cv_header_netlink_netlink_h])],
|
|
[ompi_check_libnl3_happy="no"])
|
|
|
|
# restore global flags
|
|
CPPFLAGS="$ompi_check_libnl3_$1_save_CPPFLAGS"
|
|
LDFLAGS="$ompi_check_libnl3_$1_save_LDFLAGS"
|
|
LIBS="$ompi_check_libnl3_$1_save_LIBS"
|
|
|
|
AS_IF([test "$ompi_check_libnl3_happy" = "yes"],
|
|
[$2],
|
|
[AS_IF([test ! -z "$with_libnl3" -a "$with_libnl3" != "no"],
|
|
[AC_MSG_ERROR([libnl3 support requested but not found. Aborting])])
|
|
# restore prefixed flags on failure
|
|
$1_CPPFLAGS="$ompi_check_package_$1_orig_CPPFLAGS"
|
|
$1_LDFLAGS="$ompi_check_package_$1_orig_LDFLAGS"
|
|
$1_LIBS="$ompi_check_package_$1_orig_LIBS"
|
|
$3])
|
|
])
|
|
|
|
# MCA_opal_btl_usnic_POST_CONFIG([should_build])
|
|
# ------------------------------------------
|
|
AC_DEFUN([MCA_opal_btl_usnic_POST_CONFIG], [
|
|
AM_CONDITIONAL([OPAL_BTL_USNIC_BUILD_UNIT_TESTS],
|
|
[test "$1" -eq 1 && test "X$enable_opal_btl_usnic_unit_tests" = "Xyes"])
|
|
AM_CONDITIONAL([OPAL_BTL_USNIC_BUILD_LIBNL1_UTILS],
|
|
[test "$1" -eq 1 && test "X$enable_opal_btl_usnic_libnl1_utils" = "Xyes"])
|
|
AM_CONDITIONAL([OPAL_BTL_USNIC_BUILD_LIBNL3_UTILS],
|
|
[test "$1" -eq 1 && test "X$enable_opal_btl_usnic_libnl3_utils" = "Xyes"])
|
|
])
|
|
|
|
# MCA_btl_usnic_CONFIG([action-if-can-compile],
|
|
# [action-if-cant-compile])
|
|
# ------------------------------------------------
|
|
AC_DEFUN([MCA_opal_btl_usnic_CONFIG],[
|
|
AC_CONFIG_FILES([opal/mca/btl/usnic/Makefile])
|
|
|
|
# see README.test for information about this scheme
|
|
AC_ARG_ENABLE([ompi-btl-usnic-unit-tests],
|
|
[AS_HELP_STRING([--enable-ompi-btl-usnic-unit-tests],
|
|
[build unit tests for the usnic BTL,
|
|
including the test runner program,
|
|
opal_btl_usnic_run_tests])])
|
|
AS_IF([test "X$enable_opal_btl_usnic_unit_tests" = "Xyes"],
|
|
[unit_tests=1
|
|
AC_MSG_NOTICE([enabling usnic BTL unit tests])],
|
|
[unit_tests=0])
|
|
AC_DEFINE_UNQUOTED([OPAL_BTL_USNIC_UNIT_TESTS], [$unit_tests],
|
|
[define to 1 if usnic BTL unit tests are enabled, 0 otherwise])
|
|
unset unit_tests
|
|
|
|
OPAL_CHECK_OPENFABRICS([btl_usnic],
|
|
[btl_usnic_happy="yes"],
|
|
[btl_usnic_happy="no"])
|
|
|
|
# We only want to build on 64 bit Linux.
|
|
AS_IF([test "$btl_usnic_happy" = "yes"],
|
|
[AC_CHECK_SIZEOF([void *])
|
|
AC_MSG_CHECKING([for 64 bit Linux])
|
|
case $host_os in
|
|
*linux*)
|
|
AS_IF([test $ac_cv_sizeof_void_p -eq 8],
|
|
[btl_usnic_happy=yes],
|
|
[btl_usnic_happy=no])
|
|
;;
|
|
*)
|
|
btl_usnic_happy=no
|
|
;;
|
|
esac
|
|
AC_MSG_RESULT([$btl_usnic_happy])
|
|
]
|
|
)
|
|
|
|
AS_IF([test "$btl_usnic_happy" = "yes"],
|
|
[AC_CHECK_DECLS([IBV_EVENT_GID_CHANGE, ibv_event_type_str], [], [],
|
|
[#include <infiniband/verbs.h>
|
|
])
|
|
]
|
|
)
|
|
|
|
# Search for libnl so we can query routing information. We need to
|
|
# distinguish between v1 and v3.
|
|
enable_opal_btl_usnic_libnl1_utils=no
|
|
enable_opal_btl_usnic_libnl3_utils=no
|
|
AS_IF([test "$btl_usnic_happy" = "yes"],
|
|
[OPAL_CHECK_LIBNL3([btl_usnic_libnl],
|
|
[enable_opal_btl_usnic_libnl3_utils=yes],
|
|
[enable_opal_btl_usnic_libnl3_utils=no])
|
|
|
|
# fall back to libnl1 if libnl3 could not be found
|
|
AS_IF([test "X$enable_opal_btl_usnic_libnl3_utils" = "Xno"],
|
|
[OPAL_CHECK_PACKAGE([btl_usnic_libnl],
|
|
[netlink/netlink.h],
|
|
[nl],
|
|
[nl_recvmsgs_default],
|
|
[],
|
|
[],
|
|
[],
|
|
[enable_opal_btl_usnic_libnl1_utils=yes],
|
|
[enable_opal_btl_usnic_libnl1_utils=no])])
|
|
|
|
AS_IF([test "X$enable_opal_btl_usnic_libnl3_utils" = "Xno" &&
|
|
test "X$enable_opal_btl_usnic_libnl1_utils" = "Xno"],
|
|
[AC_MSG_NOTICE([could not find a libnl or libnl-3, disabling the usnic BTL])
|
|
btl_usnic_happy="no"])
|
|
|
|
btl_usnic_CPPFLAGS="$btl_usnic_CPPFLAGS $btl_usnic_libnl_CPPFLAGS"
|
|
btl_usnic_CFLAGS="$btl_usnic_CFLAGS $btl_usnic_libnl_CFLAGS"
|
|
btl_usnic_LDFLAGS="$btl_usnic_LDFLAGS $btl_usnic_libnl_LDFLAGS"
|
|
btl_usnic_LIBS="$btl_usnic_libnl_LIBS $btl_usnic_LIBS"
|
|
])
|
|
|
|
AS_IF([test "$btl_usnic_happy" = "yes"],
|
|
[btl_usnic_WRAPPER_EXTRA_LDFLAGS="$btl_usnic_LDFLAGS"
|
|
btl_usnic_WRAPPER_EXTRA_LIBS="$btl_usnic_LIBS"
|
|
$1],
|
|
[$2])
|
|
|
|
# Substitute in the things needed to build USNIC
|
|
AC_SUBST([btl_usnic_CPPFLAGS])
|
|
AC_SUBST([btl_usnic_CFLAGS])
|
|
AC_SUBST([btl_usnic_LDFLAGS])
|
|
AC_SUBST([btl_usnic_LIBS])
|
|
])dnl
|