From 995d46344c540dc523cbba44ac800f18f0f71b2c Mon Sep 17 00:00:00 2001 From: Donald Kerr Date: Thu, 17 Feb 2011 04:28:56 +0000 Subject: [PATCH] simplify the way IBV_ACCESS_SO is discovered This commit was SVN r24409. --- ompi/config/ompi_check_openib.m4 | 4 ++-- ompi/mca/btl/openib/btl_openib_component.c | 2 +- ompi/mca/btl/openib/btl_openib_endpoint.c | 2 +- ompi/mca/btl/openib/configure.m4 | 15 +-------------- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/ompi/config/ompi_check_openib.m4 b/ompi/config/ompi_check_openib.m4 index 87f974a9a6..41d04ec4f0 100644 --- a/ompi/config/ompi_check_openib.m4 +++ b/ompi/config/ompi_check_openib.m4 @@ -14,7 +14,7 @@ # Copyright (c) 2006-2007 Los Alamos National Security, LLC. All rights # reserved. # Copyright (c) 2006-2009 Mellanox Technologies. All rights reserved. -# Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010-2011 Oracle and/or its affiliates. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -163,7 +163,7 @@ dnl [enable_openib_ibcm="$enableval"], [enable_openib_ibc # If we have the openib stuff available, find out what we've got AS_IF([test "$ompi_check_openib_happy" = "yes"], - [AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER], [], [], + [AC_CHECK_DECLS([IBV_EVENT_CLIENT_REREGISTER, IBV_ACCESS_SO], [], [], [#include ]) AC_CHECK_FUNCS([ibv_get_device_list ibv_resize_cq]) diff --git a/ompi/mca/btl/openib/btl_openib_component.c b/ompi/mca/btl/openib/btl_openib_component.c index e8433565be..be66af5ed8 100644 --- a/ompi/mca/btl/openib/btl_openib_component.c +++ b/ompi/mca/btl/openib/btl_openib_component.c @@ -530,7 +530,7 @@ static int openib_reg_mr(void *reg_data, void *base, size_t size, enum ibv_access_flags access_flag = IBV_ACCESS_LOCAL_WRITE | IBV_ACCESS_REMOTE_WRITE | IBV_ACCESS_REMOTE_READ; -#if defined(HAVE_IBV_ACCESS_SO) +#if HAVE_DECL_IBV_ACCESS_SO if (reg->flags & MCA_MPOOL_FLAGS_SO_MEM) { access_flag |= IBV_ACCESS_SO; } diff --git a/ompi/mca/btl/openib/btl_openib_endpoint.c b/ompi/mca/btl/openib/btl_openib_endpoint.c index c13c01825e..93001c72eb 100644 --- a/ompi/mca/btl/openib/btl_openib_endpoint.c +++ b/ompi/mca/btl/openib/btl_openib_endpoint.c @@ -926,7 +926,7 @@ void mca_btl_openib_endpoint_connect_eager_rdma( if(NULL == headers_buf) goto unlock_rdma_local; -#if defined(HAVE_IBV_ACCESS_SO) +#if HAVE_DECL_IBV_ACCESS_SO /* Solaris implements the Relaxed Ordering feature defined in the PCI Specification. With this in mind any memory region which relies on a buffer being written in a specific order, for diff --git a/ompi/mca/btl/openib/configure.m4 b/ompi/mca/btl/openib/configure.m4 index c055a564bc..a577ee2372 100644 --- a/ompi/mca/btl/openib/configure.m4 +++ b/ompi/mca/btl/openib/configure.m4 @@ -35,7 +35,7 @@ AC_DEFUN([MCA_ompi_btl_openib_POST_CONFIG], [ AC_DEFUN([MCA_ompi_btl_openib_CONFIG],[ AC_CONFIG_FILES([ompi/mca/btl/openib/Makefile]) - OPAL_VAR_SCOPE_PUSH([cpcs have_threads have_ibv_access_so]) + OPAL_VAR_SCOPE_PUSH([cpcs have_threads]) cpcs="oob" OMPI_CHECK_OPENIB([btl_openib], @@ -79,19 +79,6 @@ AC_DEFUN([MCA_ompi_btl_openib_CONFIG],[ AC_MSG_CHECKING([which openib btl cpcs will be built]) AC_MSG_RESULT([$cpcs])]) - # check for Solaris specific memory access flag - AS_IF([test "$btl_openib_happy" = "yes"], - [if test "`echo $build_os | $GREP solaris`"; then - AC_TRY_COMPILE([#include ], - [int flag = IBV_ACCESS_SO;], - [have_ibv_access_so="yes" - AC_DEFINE_UNQUOTED([HAVE_IBV_ACCESS_SO], - 1,[openib define HAVE_IBV_ACCESS_SO])], - [have_ibv_access_so="no"]) - AC_MSG_CHECKING([for IBV_ACCESS_SO in Solaris]) - AC_MSG_RESULT([$have_ibv_access_so]) - fi]) - # Enable openib device failover. It is disabled by default. AC_ARG_ENABLE([btl-openib-failover], [AC_HELP_STRING([--enable-btl-openib-failover],