1
1

Fixing atomics selection issue, to be CMR'd after it passes the nightly tests

This commit was SVN r31393.
Этот коммит содержится в:
Ryan Grant 2014-04-15 13:17:04 +00:00
родитель f06953236e
Коммит e67ca81dca
3 изменённых файлов: 24 добавлений и 13 удалений

Просмотреть файл

@ -766,14 +766,17 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
[Enable use of OSX builtin atomics (default: disabled)])]) [Enable use of OSX builtin atomics (default: disabled)])])
if test "$enable_builtin_atomics" = "yes" ; then if test "$enable_builtin_atomics" = "yes" ; then
OPAL_CHECK_SYNC_BUILTINS([ompi_cv_asm_arch="SYNC_BUILTIN"], OPAL_CHECK_SYNC_BUILTINS([ompi_cv_asm_builtin="SYNC_BUILTIN"],
[AC_MSG_ERROR([__sync builtin atomics requested but not found.])]) [AC_MSG_ERROR([__sync builtin atomics requested but not found.])])
AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1], AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
[Whether C compiler supports GCC style inline assembly]) [Whether C compiler supports GCC style inline assembly])
elif test "$enable_osx_builtin_atomics" = "yes" ; then elif test "$enable_osx_builtin_atomics" = "yes" ; then
AC_CHECK_HEADER([libkern/OSAtomic.h],[ompi_cv_asm_arch="OSX_BUILTIN"], AC_CHECK_HEADER([libkern/OSAtomic.h],[ompi_cv_asm_builtin="OSX_BUILTIN"],
[AC_MSG_ERROR([OSX builtin atomics requested but not found.])]) [AC_MSG_ERROR([OSX builtin atomics requested but not found.])])
else else
ompi_cv_asm_builtin="NO_BUILTIN"
fi
OMPI_CHECK_ASM_PROC OMPI_CHECK_ASM_PROC
OMPI_CHECK_ASM_TEXT OMPI_CHECK_ASM_TEXT
OMPI_CHECK_ASM_GLOBAL OMPI_CHECK_ASM_GLOBAL
@ -898,12 +901,12 @@ AC_MSG_ERROR([Can not continue.])
;; ;;
*) *)
OPAL_CHECK_SYNC_BUILTINS([ompi_cv_asm_arch="SYNC_BUILTIN"], OPAL_CHECK_SYNC_BUILTINS([ompi_cv_asm_builtin="SYNC_BUILTIN"],
[AC_MSG_ERROR([No atomic primitives available for $host])]) [AC_MSG_ERROR([No atomic primitives available for $host])])
;; ;;
esac esac
if test "$ompi_cv_asm_arch" = "SYNC_BUILTIN" ; then if test "$ompi_cv_asm_builtin" = "SYNC_BUILTIN" ; then
AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1], AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
[Whether C compiler supports GCC style inline assembly]) [Whether C compiler supports GCC style inline assembly])
else else
@ -954,17 +957,24 @@ AC_MSG_ERROR([Can not continue.])
AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_FORMAT], ["$OPAL_ASSEMBLY_FORMAT"], AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_FORMAT], ["$OPAL_ASSEMBLY_FORMAT"],
[Format of assembly file]) [Format of assembly file])
AC_SUBST([OPAL_ASSEMBLY_FORMAT]) AC_SUBST([OPAL_ASSEMBLY_FORMAT])
fi # if ompi_cv_asm_arch = SYNC_BUILTIN fi # if ompi_cv_asm_builtin = SYNC_BUILTIN
fi # if cv_c_compiler_vendor = microsoft
result="OMPI_$ompi_cv_asm_arch" result="OMPI_$ompi_cv_asm_arch"
OPAL_ASSEMBLY_ARCH="$ompi_cv_asm_arch" OPAL_ASSEMBLY_ARCH="$ompi_cv_asm_arch"
AC_MSG_CHECKING([for asssembly architecture]) AC_MSG_CHECKING([for asssembly architecture])
AC_MSG_RESULT([$ompi_cv_asm_arch]) AC_MSG_RESULT([$ompi_cv_asm_arch])
AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_ARCH], [$result], AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_ARCH], [$result],
[Architecture type of assembly to use for atomic operations]) [Architecture type of assembly to use for atomic operations and CMA])
AC_SUBST([OPAL_ASSEMBLY_ARCH]) AC_SUBST([OPAL_ASSEMBLY_ARCH])
result="OMPI_$ompi_cv_asm_builtin"
OPAL_ASSEMBLY_BUILTIN="$ompi_cv_asm_builtin"
AC_MSG_CHECKING([for builtin atomics])
AC_MSG_RESULT([$ompi_cv_asm_builtin])
AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_BUILTIN], [$result],
[Whether to use builtin atomics])
AC_SUBST([OPAL_ASSEMBLY_BUILTIN])
OMPI_ASM_FIND_FILE OMPI_ASM_FIND_FILE
unset result asm_format unset result asm_format
@ -983,7 +993,7 @@ AC_DEFUN([OMPI_ASM_FIND_FILE], [
AC_REQUIRE([AC_PROG_GREP]) AC_REQUIRE([AC_PROG_GREP])
AC_REQUIRE([AC_PROG_FGREP]) AC_REQUIRE([AC_PROG_FGREP])
if test "$ompi_cv_asm_arch" != "WINDOWS" -a "$ompi_cv_asm_arch" != "SYNC_BUILTIN" -a "$ompi_cv_asm_arch" != "OSX_BUILTIN" ; then if test "$ompi_cv_asm_arch" != "WINDOWS" -a "$ompi_cv_asm_builtin" != "SYNC_BUILTIN" -a "$ompi_cv_asm_builtin" != "OSX_BUILTIN" ; then
AC_CHECK_PROG([PERL], [perl], [perl]) AC_CHECK_PROG([PERL], [perl], [perl])
# see if we have a pre-built one already # see if we have a pre-built one already

Просмотреть файл

@ -39,6 +39,7 @@
#define OMPI_ARM 0100 #define OMPI_ARM 0100
#define OMPI_SYNC_BUILTIN 0200 #define OMPI_SYNC_BUILTIN 0200
#define OMPI_OSX_BUILTIN 0400 #define OMPI_OSX_BUILTIN 0400
#define OMPI_NO_BUILTIN 0800
/* Formats */ /* Formats */
#define OMPI_DEFAULT 1000 /* standard for given architecture */ #define OMPI_DEFAULT 1000 /* standard for given architecture */

Просмотреть файл

@ -139,6 +139,10 @@ typedef struct opal_atomic_lock_t opal_atomic_lock_t;
*********************************************************************/ *********************************************************************/
#if defined(DOXYGEN) #if defined(DOXYGEN)
/* don't include system-level gorp when generating doxygen files */ /* don't include system-level gorp when generating doxygen files */
#elif OPAL_ASSEMBLY_BUILTIN == OMPI_SYNC_BUILTIN
#include "opal/sys/sync_builtin/atomic.h"
#elif OPAL_ASSEMBLY_BUILTIN == OMPI_OSX_BUILTIN
#include "opal/sys/osx/atomic.h"
#elif OPAL_ASSEMBLY_ARCH == OMPI_ALPHA #elif OPAL_ASSEMBLY_ARCH == OMPI_ALPHA
#include "opal/sys/alpha/atomic.h" #include "opal/sys/alpha/atomic.h"
#elif OPAL_ASSEMBLY_ARCH == OMPI_AMD64 #elif OPAL_ASSEMBLY_ARCH == OMPI_AMD64
@ -161,10 +165,6 @@ typedef struct opal_atomic_lock_t opal_atomic_lock_t;
#include "opal/sys/sparcv9/atomic.h" #include "opal/sys/sparcv9/atomic.h"
#elif OPAL_ASSEMBLY_ARCH == OMPI_SPARCV9_64 #elif OPAL_ASSEMBLY_ARCH == OMPI_SPARCV9_64
#include "opal/sys/sparcv9/atomic.h" #include "opal/sys/sparcv9/atomic.h"
#elif OPAL_ASSEMBLY_ARCH == OMPI_SYNC_BUILTIN
#include "opal/sys/sync_builtin/atomic.h"
#elif OPAL_ASSEMBLY_ARCH == OMPI_OSX_BUILTIN
#include "opal/sys/osx/atomic.h"
#endif #endif
#ifndef DOXYGEN #ifndef DOXYGEN