From 416e5b5f6a7fcb1397b03d643d4d0f009fd8c1ed Mon Sep 17 00:00:00 2001 From: George Bosilca Date: Fri, 29 Dec 2006 00:31:32 +0000 Subject: [PATCH] Enable the MX extensions if and only if the mx_extensions.h header is installed on the system. This commit was SVN r12937. --- config/ompi_check_mx.m4 | 17 +++++++++++++++++ ompi/mca/btl/mx/btl_mx.c | 2 -- ompi/mca/btl/mx/btl_mx.h | 4 ++++ ompi/mca/btl/mx/btl_mx_component.c | 4 ---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/config/ompi_check_mx.m4 b/config/ompi_check_mx.m4 index dc330b61f9..94addc3f92 100644 --- a/config/ompi_check_mx.m4 +++ b/config/ompi_check_mx.m4 @@ -89,6 +89,23 @@ AC_DEFUN([_OMPI_CHECK_MX_CONFIG],[ $2], [$3]) AC_MSG_RESULT([$mx_api_ver]) + # Check for the mx_extensions.h + AC_MSG_CHECKING([for mx_extensions.h header]) + AC_TRY_COMPILE([#include ], + [return 0;], + [have_mx_extensions="yes"], + [have_mx_extensions="no"]) + AS_IF([test x"$have_mx_extensions" = "xyes"], + [have_mx_extensions=1], + [have_mx_extensions=0 + AC_MSG_WARN([The MX support for Open MPI will be compiled without the + MX extensions. This will result on lower performances. + Please install the MX library > 1.2.0 to increase the + performance of your cluster]) + ]) + AC_DEFINE_UNQUOTED([MX_HAVE_EXTENSIONS_H], [$have_mx_extensions], + [The MX library have support for the mx_extensions.h]) + unset have_recent_api have_mx_extensions ])dnl # OMPI_CHECK_MX(prefix, [action-if-found], [action-if-not-found]) diff --git a/ompi/mca/btl/mx/btl_mx.c b/ompi/mca/btl/mx/btl_mx.c index c992ffec08..2933215c9a 100644 --- a/ompi/mca/btl/mx/btl_mx.c +++ b/ompi/mca/btl/mx/btl_mx.c @@ -26,8 +26,6 @@ #include "ompi/datatype/convertor.h" #include "opal/prefetch.h" -#include "mx_extensions.h" - /** * */ diff --git a/ompi/mca/btl/mx/btl_mx.h b/ompi/mca/btl/mx/btl_mx.h index 12479c4f67..60831091d9 100644 --- a/ompi/mca/btl/mx/btl_mx.h +++ b/ompi/mca/btl/mx/btl_mx.h @@ -36,7 +36,11 @@ #include "ompi/mca/btl/base/base.h" #include "ompi/mca/mpool/mpool.h" +#if MX_HAVE_EXTENSIONS_H +#include "mx_extensions.h" +#else #include "myriexpress.h" +#endif /* MX_HAVE_EXTENSIONS_H */ #if defined(c_plusplus) || defined(__cplusplus) extern "C" { diff --git a/ompi/mca/btl/mx/btl_mx_component.c b/ompi/mca/btl/mx/btl_mx_component.c index 16ae07bae5..7e959f1db9 100644 --- a/ompi/mca/btl/mx/btl_mx_component.c +++ b/ompi/mca/btl/mx/btl_mx_component.c @@ -32,10 +32,6 @@ #include "btl_mx_frag.h" #include "btl_mx_endpoint.h" -#if MX_HAVE_UNEXPECTED_HANDLER -#include "mx_extensions.h" -#endif /* MX_HAVE_UNEXPECTED_HANDLER */ - extern char** environ; mca_btl_mx_component_t mca_btl_mx_component = {