diff --git a/config/ompi_ext.m4 b/config/ompi_ext.m4 index aa798ab3f5..17029a2563 100644 --- a/config/ompi_ext.m4 +++ b/config/ompi_ext.m4 @@ -45,8 +45,11 @@ AC_DEFUN([OMPI_EXT],[ AC_MSG_RESULT([ompi_mpiext_list]) AC_MSG_CHECKING([which MPI extension should be enabled]) - if test "$enable_mpi_ext" = "yes" || test "$enable_mpi_ext" = "all"; then - msg="All Extensions" + if test "$enable_mpi_ext" = "" || \ + test "$enable_mpi_ext" = "yes" || \ + test "$enable_mpi_ext" = "all"; then + enable_mpi_ext=all + msg="All Available Extensions" str="`echo ENABLE_EXT_ALL=1`" eval $str else diff --git a/ompi/mpiext/affinity/c/Makefile.am b/ompi/mpiext/affinity/c/Makefile.am index c0471d46dd..8d8275d925 100644 --- a/ompi/mpiext/affinity/c/Makefile.am +++ b/ompi/mpiext/affinity/c/Makefile.am @@ -48,3 +48,6 @@ nodist_man_MANS = OMPI_Affinity_str.3 # Man page sources EXTRA_DIST = $(nodist_man_MANS:.3=.3in) example.c + +distclean-local: + rm -f $(nodist_man_MANS) diff --git a/ompi/mpiext/affinity/c/mpiext_affinity_str.c b/ompi/mpiext/affinity/c/mpiext_affinity_str.c index de59be38b7..653c91ebb6 100644 --- a/ompi/mpiext/affinity/c/mpiext_affinity_str.c +++ b/ompi/mpiext/affinity/c/mpiext_affinity_str.c @@ -2,14 +2,17 @@ * Copyright (c) 2004-2009 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. + * Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 Los Alamos National Security, LLC. All rights - * reserved. + * reserved. + * reserved. + * Copyright (c) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ - * + * * Additional copyrights may follow - * + * * $HEADER$ * * Simple routine to expose three things to the MPI process: @@ -38,6 +41,44 @@ static const char FUNC_NAME[] = "OMPI_Affinity"; static const char ompi_nobind_str[] = "Open MPI did not bind this process"; static const char not_bound_str[] = "Not bound (i.e., bound to all processors)"; +/************************************************************************** + * Utility routine + **************************************************************************/ + +static void no_hwloc_support(char ompi_bound[OMPI_AFFINITY_STRING_MAX], + char current_binding[OMPI_AFFINITY_STRING_MAX], + char exists[OMPI_AFFINITY_STRING_MAX]) +{ + strncpy(ompi_bound, "Not supported", OMPI_AFFINITY_STRING_MAX); + strncpy(current_binding, "Not supported", OMPI_AFFINITY_STRING_MAX); + strncpy(exists, "Not supported", OMPI_AFFINITY_STRING_MAX); +} + +/************************************************************************** + * If we have no hwloc support compiled in, do almost nothing. + **************************************************************************/ + +#if !OPAL_HAVE_HWLOC +/* + * If hwloc support was not compiled in, then just return "Not + * supported". + */ +int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type, + char ompi_bound[OMPI_AFFINITY_STRING_MAX], + char current_binding[OMPI_AFFINITY_STRING_MAX], + char exists[OMPI_AFFINITY_STRING_MAX]) +{ + no_hwloc_support(ompi_bound, current_binding, exists); + return MPI_SUCCESS; +} +#endif // !OPAL_HAVE_HWLOC + +/************************************************************************** + * If we have hwloc support compiled in, do the actual work. + **************************************************************************/ + +#if OPAL_HAVE_HWLOC + static int get_rsrc_ompi_bound(char str[OMPI_AFFINITY_STRING_MAX]); static int get_rsrc_current_binding(char str[OMPI_AFFINITY_STRING_MAX]); static int get_rsrc_exists(char str[OMPI_AFFINITY_STRING_MAX]); @@ -45,10 +86,9 @@ static int get_layout_ompi_bound(char str[OMPI_AFFINITY_STRING_MAX]); static int get_layout_current_binding(char str[OMPI_AFFINITY_STRING_MAX]); static int get_layout_exists(char str[OMPI_AFFINITY_STRING_MAX]); -/*---------------------------------------------------------------------------*/ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type, - char ompi_bound[OMPI_AFFINITY_STRING_MAX], + char ompi_bound[OMPI_AFFINITY_STRING_MAX], char current_binding[OMPI_AFFINITY_STRING_MAX], char exists[OMPI_AFFINITY_STRING_MAX]) { @@ -59,9 +99,8 @@ int OMPI_Affinity_str(ompi_affinity_fmt_t fmt_type, /* If we have no hwloc support, return nothing */ if (NULL == opal_hwloc_topology) { - strncpy(ompi_bound, "Not supported", OMPI_AFFINITY_STRING_MAX); - strncpy(current_binding, "Not supported", OMPI_AFFINITY_STRING_MAX); - strncpy(exists, "Not supported", OMPI_AFFINITY_STRING_MAX); + no_hwloc_support(ompi_bound, current_binding, exists); + return MPI_SUCCESS; } @@ -275,7 +314,7 @@ static int get_rsrc_exists(char str[OMPI_AFFINITY_STRING_MAX]) } } } - } + } return OMPI_SUCCESS; } @@ -418,3 +457,4 @@ static int get_layout_exists(char str[OMPI_AFFINITY_STRING_MAX]) return OMPI_SUCCESS; } +#endif /* OPAL_HAVE_HWLOC */ diff --git a/ompi/mpiext/affinity/configure.m4 b/ompi/mpiext/affinity/configure.m4 index 5192544342..95a4ca7fe9 100644 --- a/ompi/mpiext/affinity/configure.m4 +++ b/ompi/mpiext/affinity/configure.m4 @@ -2,7 +2,7 @@ # # Copyright (c) 2004-2009 The Trustees of Indiana University. # All rights reserved. -# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -16,6 +16,10 @@ AC_DEFUN([OMPI_MPIEXT_affinity_CONFIG], [ AC_CONFIG_FILES([ompi/mpiext/affinity/Makefile]) AC_CONFIG_FILES([ompi/mpiext/affinity/c/Makefile]) - # This example can always build, so we just execute $1. - $1 + # This example can always build, so we just execute $1 if it was + # requested. + AS_IF([test "$ENABLE_affinity" = "1" || \ + test "$ENABLE_EXT_ALL" = "1"], + [$1], + [$2]) ]) diff --git a/ompi/mpiext/cr/configure.m4 b/ompi/mpiext/cr/configure.m4 index dc228b255d..757118442f 100644 --- a/ompi/mpiext/cr/configure.m4 +++ b/ompi/mpiext/cr/configure.m4 @@ -2,7 +2,7 @@ # # Copyright (c) 2004-2010 The Trustees of Indiana University. # All rights reserved. -# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -16,8 +16,25 @@ AC_DEFUN([OMPI_MPIEXT_cr_CONFIG],[ AC_CONFIG_FILES([ompi/mpiext/cr/Makefile]) AC_CONFIG_FILES([ompi/mpiext/cr/c/Makefile]) - # If we don't want FT, don't compile this component - AS_IF([test "$opal_want_ft_cr" = "1"], - [$1], - [$2]) + OPAL_VAR_SCOPE_PUSH([ompi_mpi_ext_cr_happy]) + + # If we don't want FT, don't compile this extention + AS_IF([test "$ENABLE_cr" = "1" || \ + test "$ENABLE_EXT_ALL" = "1"], + [ompi_mpi_ext_cr_happy=1], + [ompi_mpi_ext_cr_happy=0]) + + AS_IF([test "$ompi_mpi_ext_cr_happy" = "1" && \ + test "$opal_want_ft_cr" = "1"], + [$1], + [ # Error if the user specifically asked for this extension, + # but we can't build it. + AS_IF([test "$ENABLE_cr" = "1"], + [AC_MSG_WARN([Requested "cr" MPI extension, but cannot build it]) + AC_MSG_WARN([because fault tolerance is not enabled.]) + AC_MSG_WARN([Try again with --enable-ft]) + AC_MSG_ERROR([Cannot continue])]) + $2]) + + OPAL_VAR_SCOPE_POP ]) diff --git a/ompi/mpiext/example/configure.m4 b/ompi/mpiext/example/configure.m4 index 1ae1e9f67c..29c1b42885 100644 --- a/ompi/mpiext/example/configure.m4 +++ b/ompi/mpiext/example/configure.m4 @@ -2,7 +2,7 @@ # # Copyright (c) 2004-2009 The Trustees of Indiana University. # All rights reserved. -# Copyright (c) 2012 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -20,8 +20,14 @@ AC_DEFUN([OMPI_MPIEXT_example_CONFIG],[ AC_CONFIG_FILES([ompi/mpiext/example/use-mpi/Makefile]) AC_CONFIG_FILES([ompi/mpiext/example/use-mpi-f08/Makefile]) - # This example can always build, so we just execute $1. - $1 + # If your extension can build, run $1. Otherwise, run $2. For + # the purposes of this example, we don't want it to build in most + # cases. So only build if someone specifies an --enable-mpi-ext + # value that contains the token "example". + AS_IF([test "$ENABLE_example" = "1" || \ + test "$ENABLE_EXT_ALL" = "1"], + [$1], + [$2]) ]) # only need to set this if the component needs init/finalize hooks