1
1
openmpi/config/opal_check_pmi.m4

276 строки
12 KiB
Plaintext
Исходник Обычный вид История

# -*- shell-script ; indent-tabs-mode:nil -*-
#
# 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) 2009-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
# reserved.
# Copyright (c) 2014 Intel, Inc. All rights reserved.
# Copyright (c) 2014 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# define an internal function for checking the existence
# and validity of a PMI library
#
# OPAL_CHECK_PMI_LIB(installdir, libdir, pmi, function, [action-if-slurm], [action-if-valid], [action-if-not-valid])
# --------------------------------------------------------
AC_DEFUN([OPAL_CHECK_PMI_LIB],
[
# save flags
opal_check_$3_save_CPPFLAGS=$CPPFLAGS
opal_check_$3_save_LDFLAGS=$LDFLAGS
opal_check_$3_save_LIBS=$LIBS
opal_check_$3_hdr_happy=
opal_check_$3_mycppflags=
# check for the header
AC_MSG_CHECKING([for $3.h in $1/include])
AS_IF([test -f $1/include/$3.h],
[AC_MSG_RESULT([found])
2015-08-11 18:43:45 +03:00
opal_check_$3_mycppflags="-I$1/include"],
[AC_MSG_RESULT([not found])
AC_MSG_CHECKING([for $3.h in $1/include/slurm])
AS_IF([test -f $1/include/slurm/$3.h],
[AC_MSG_RESULT([found])
opal_check_$3_mycppflags="-I$1/include/slurm"
$5],
[AC_MSG_RESULT([not found])
opal_check_$3_hdr_happy=no])])
AS_IF([test "$opal_check_$3_hdr_happy" != "no"],
[CPPFLAGS="$CPPFLAGS $opal_check_$3_mycppflags"
AC_CHECK_HEADER([$3.h],
[opal_check_$3_hdr_happy=yes
$3_CPPFLAGS="$opal_check_$3_mycppflags"],
[opal_check_$3_hdr_happy=no])])
# check for library and function
opal_check_$3_lib_happy=
LIBS="$LIBS -l$3"
# check for the library in the given location in case
# an exact path was given
AC_MSG_CHECKING([for lib$3 in $2])
files=`ls $2/lib$3.* 2> /dev/null | wc -l`
AS_IF([test "$files" -gt "0"],
[AC_MSG_RESULT([found])
LDFLAGS="$LDFLAGS -L$2"
AC_CHECK_LIB([$3], [$4],
[opal_check_$3_lib_happy=yes
$3_LDFLAGS=-L$2
$3_rpath=$2],
[opal_check_$3_lib_happy=no])],
[opal_check_$3_lib_happy=no
AC_MSG_RESULT([not found])])
2015-06-24 06:59:57 +03:00
# check for presence of lib64 directory - if found, see if the
# desired library is present and matches our build requirements
files=`ls $2/lib64/lib$3.* 2> /dev/null | wc -l`
AS_IF([test "$opal_check_$3_lib_happy" != "yes"],
[AC_MSG_CHECKING([for lib$3 in $2/lib64])
AS_IF([test "$files" -gt "0"],
[AC_MSG_RESULT([found])
LDFLAGS="$LDFLAGS -L$2/lib64"
AC_CHECK_LIB([$3], [$4],
[opal_check_$3_lib_happy=yes
$3_LDFLAGS=-L$2/lib64
$3_rpath=$2/lib64],
[opal_check_$3_lib_happy=no])],
[opal_check_$3_lib_happy=no
AC_MSG_RESULT([not found])])])
# if we didn't find lib64, or the library wasn't present or correct,
# then try a lib directory if present
files=`ls $2/lib/lib$3.* 2> /dev/null | wc -l`
AS_IF([test "$opal_check_$3_lib_happy" != "yes"],
[AC_MSG_CHECKING([for lib$3 in $2/lib])
AS_IF([test "$files" -gt "0"],
[AC_MSG_RESULT([found])
LDFLAGS="$LDFLAGS -L$2/lib"
AC_CHECK_LIB([$3], [$4],
[opal_check_$3_lib_happy=yes
$3_LDFLAGS=-L$2/lib
$3_rpath=$2/lib],
[opal_check_$3_lib_happy=no])],
[opal_check_$3_lib_happy=no
AC_MSG_RESULT([not found])])])
# restore flags
CPPFLAGS=$opal_check_$3_save_CPPFLAGS
LDFLAGS=$opal_check_$3_save_LDFLAGS
LIBS=$opal_check_$3_save_LIBS
AS_IF([test "$opal_check_$3_hdr_happy" = "yes" && test "$opal_check_$3_lib_happy" = "yes"],
[$6], [$7])
])
# OPAL_CHECK_PMI()
# --------------------------------------------------------
Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data. A few changes were required to support this move: 1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution). 2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time. 3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering. 4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options. No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework. This commit was SVN r28112.
2013-02-26 21:50:04 +04:00
AC_DEFUN([OPAL_CHECK_PMI],[
OPAL_VAR_SCOPE_PUSH([check_pmi_install_dir check_pmi_lib_dir default_pmi_loc default_pmi_libloc slurm_pmi_found])
AC_ARG_WITH([pmi],
[AC_HELP_STRING([--with-pmi(=DIR)],
[Build PMI support, optionally adding DIR to the search path (default: no)])],
[], with_pmi=no)
AC_ARG_WITH([pmi-libdir],
[AC_HELP_STRING([--with-pmi-libdir(=DIR)],
[Look for libpmi or libpmi2 in the given directory, DIR/lib or DIR/lib64])])
check_pmi_install_dir=
check_pmi_lib_dir=
default_pmi_loc=
default_pmi_libloc=
slurm_pmi_found=
AC_MSG_CHECKING([if user requested PMI support])
AS_IF([test "$with_pmi" = "no"],
[AC_MSG_RESULT([no])
$3],
[AC_MSG_RESULT([yes])
# cannot use OPAL_CHECK_PACKAGE as its backend header
# support appends "include" to the path, which won't
# work with slurm :-(
AS_IF([test ! -z "$with_pmi" && test "$with_pmi" != "yes"],
[check_pmi_install_dir=$with_pmi
default_pmi_loc=no],
[check_pmi_install_dir=/usr
default_pmi_loc=yes])
AS_IF([test ! -z "$with_pmi_libdir"],
[check_pmi_lib_dir=$with_pmi_libdir
default_pmi_libloc=no],
[check_pmi_lib_dir=$check_pmi_install_dir
AS_IF([test "$default_pmi_loc" = "no"],
[default_pmi_libloc=no],
[default_pmi_libloc=yes])])
# check for pmi-1 lib */
slurm_pmi_found=no
OPAL_CHECK_PMI_LIB([$check_pmi_install_dir],
[$check_pmi_lib_dir],
[pmi], [PMI_Init],
[slurm_pmi_found=yes],
[opal_enable_pmi1=yes
opal_pmi1_LIBS="-lpmi"
AC_SUBST(opal_pmi1_LIBS)],
[opal_enable_pmi1=no])
AS_IF([test "$opal_enable_pmi1" = "yes"],
[AS_IF([test "$default_pmi_loc" = "no" || test "$slurm_pmi_found" = "yes"],
[opal_pmi1_CPPFLAGS="$pmi_CPPFLAGS"
AC_SUBST(opal_pmi1_CPPFLAGS)])
AS_IF([test "$default_pmi_libloc" = "no" || test "$slurm_pmi_found" = "yes"],
[opal_pmi1_LDFLAGS="$pmi_LDFLAGS"
AC_SUBST(opal_pmi1_LDFLAGS)
opal_pmi1_rpath="$pmi_rpath"
AC_SUBST(opal_pmi1_rpath)])])
# check for pmi2 lib */
slurm_pmi_found=no
OPAL_CHECK_PMI_LIB([$check_pmi_install_dir],
[$check_pmi_lib_dir],
[pmi2], [PMI2_Init],
[slurm_pmi_found=yes],
[opal_enable_pmi2=yes
opal_pmi2_LIBS="-lpmi2"
AC_SUBST(opal_pmi2_LIBS)],
[opal_enable_pmi2=no])
AS_IF([test "$opal_enable_pmi2" = "yes"],
[AS_IF([test "$default_pmi_loc" = "no" || test "$slurm_pmi_found" = "yes"],
2015-08-11 18:43:45 +03:00
[opal_pmi2_CPPFLAGS="$pmi2_CPPFLAGS"
AC_SUBST(opal_pmi2_CPPFLAGS)])
AS_IF([test "$default_pmi_libloc" = "no" || test "$slurm_pmi_found" = "yes"],
2015-08-11 18:43:45 +03:00
[opal_pmi2_LDFLAGS="$pmi2_LDFLAGS"
AC_SUBST(opal_pmi2_LDFLAGS)
2015-08-11 18:43:45 +03:00
opal_pmi2_rpath="$pmi2_rpath"
AC_SUBST(opal_pmi2_rpath)])])
# since support was explicitly requested, then we should error out
# if we didn't find the required support
AC_MSG_CHECKING([can PMI support be built])
AS_IF([test "$opal_enable_pmi1" != "yes" && test "$opal_enable_pmi2" != "yes"],
[AC_MSG_RESULT([no])
AC_MSG_WARN([PMI support requested (via --with-pmi) but neither pmi.h])
AC_MSG_WARN([nor pmi2.h were found under locations:])
AC_MSG_WARN([ $check_pmi_install_dir])
AC_MSG_WARN([ $check_pmi_install_dir/slurm])
AC_MSG_WARN([Specified path: $with_pmi])
AC_MSG_WARN([OR neither libpmi nor libpmi2 were found under:])
AC_MSG_WARN([ $check_pmi_lib_dir/lib])
AC_MSG_WARN([ $check_pmi_lib_dir/lib64])
AC_MSG_WARN([Specified path: $with_pmi_libdir])
AC_MSG_ERROR([Aborting])],
[AC_MSG_RESULT([yes])])
])
OPAL_VAR_SCOPE_POP
])
AC_DEFUN([OPAL_CHECK_PMIX],[
opal_pmix_ext_CPPFLAGS=
opal_pmix_ext_LDFLAGS=
opal_pmix_ext_LIBS=
OPAL_VAR_SCOPE_PUSH([pmix_ext_install_dir])
AC_ARG_WITH([pmix],
[AC_HELP_STRING([--with-pmix(=DIR)],
[Build PMIx support. DIR can take one of three values: "internal", "external", or a valid directory name. "internal" (or no DIR value) forces Open MPI to use its internal copy of PMIx. "external" forces Open MPI to use an external installation of PMIx. Supplying a valid directory name also forces Open MPI to use an external installation of PMIx, and adds DIR/include, DIR/lib, and DIR/lib64 to the search path for headers and libraries. Note that Open MPI does not support --without-pmix.])])
AS_IF([test "$with_pmix" = "no"],
[AC_MSG_WARN([Open MPI requires PMIx support. It can be built])
AC_MSG_WARN([with either its own internal copy of PMIx, or with])
AC_MSG_WARN([an external copy that you supply.])
AC_MSG_ERROR([Cannot continue])])
AC_MSG_CHECKING([if user requested PMIx support($with_pmix)])
2015-12-29 18:04:28 +03:00
AS_IF([test -z "$with_pmix" || test "$with_pmix" = "yes" || test "$with_pmix" = "internal"],
[AC_MSG_RESULT([no])
opal_external_pmix_happy="no"],
[AC_MSG_RESULT([yes])
# check for external pmix lib */
AS_IF([test "$with_pmix" = "external"],
[pmix_ext_install_dir=/usr],
[pmix_ext_install_dir=$with_pmix])
# cannot use check_package because there are
# external dependencies to make the headers
# build, so just check for presence of header
# and library files - these checks will error
# out if the files aren't found, which is okay
# as we are only executing here if the user
# specified external pmix
OPAL_CHECK_WITHDIR([external-pmix], [$pmix_ext_install_dir/include], [pmix.h])
OPAL_CHECK_WITHDIR([external-libpmix], [$pmix_ext_install_dir/lib], [libpmix.*])
opal_pmix_ext_CPPFLAGS="-I$pmix_ext_install_dir -I$pmix_ext_install_dir/include -I$pmix_ext_install_dir/include/pmix -I$pmix_ext_install_dir/include/pmix/include"
opal_pmix_ext_LDFLAGS="-L$pmix_ext_install_dir/lib"
opal_pmix_ext_LIBS="-lpmix"
opal_external_pmix_happy="yes"
])
AC_SUBST(opal_pmix_ext_CPPFLAGS)
AC_SUBST(opal_pmix_ext_LDFLAGS)
AC_SUBST(opal_pmix_ext_LIBS)
OPAL_VAR_SCOPE_POP
])