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
7 changes: 5 additions & 2 deletions config/ompi_ext.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions ompi/mpiext/affinity/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
60 changes: 50 additions & 10 deletions ompi/mpiext/affinity/c/mpiext_affinity_str.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -38,17 +41,54 @@ 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]);
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])
{
Expand All @@ -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;
}

Expand Down Expand Up @@ -275,7 +314,7 @@ static int get_rsrc_exists(char str[OMPI_AFFINITY_STRING_MAX])
}
}
}
}
}

return OMPI_SUCCESS;
}
Expand Down Expand Up @@ -418,3 +457,4 @@ static int get_layout_exists(char str[OMPI_AFFINITY_STRING_MAX])

return OMPI_SUCCESS;
}
#endif /* OPAL_HAVE_HWLOC */
10 changes: 7 additions & 3 deletions ompi/mpiext/affinity/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])
])
27 changes: 22 additions & 5 deletions ompi/mpiext/cr/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
])
12 changes: 9 additions & 3 deletions ompi/mpiext/example/configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down