Skip to content

Commit e092034

Browse files
authored
Merge pull request #8708 from awlauria/ppc_atomics_v4.1.x
v4.1.x: Powerpc atomics: Force usage of powerpc assembly.
2 parents 881df53 + 3c7ea15 commit e092034

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

config/opal_config_asm.m4

+12
Original file line numberDiff line numberDiff line change
@@ -1136,6 +1136,18 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
11361136
AC_MSG_ERROR([Could not determine PowerPC word size: $ac_cv_sizeof_long])
11371137
fi
11381138
OPAL_GCC_INLINE_ASSIGN='"1: li %0,0" : "=&r"(ret)'
1139+
1140+
# See the following github PR and some performance numbers/discussion:
1141+
# https://github.com/open-mpi/ompi/pull/8649
1142+
AC_MSG_CHECKING([$opal_cv_asm_arch: Checking if force gcc atomics requested])
1143+
if test $force_gcc_atomics_ppc = 0 ; then
1144+
AC_MSG_RESULT([no])
1145+
opal_cv_asm_builtin="BUILTIN_NO"
1146+
else
1147+
AC_MSG_RESULT([Yes])
1148+
AC_MSG_WARN([$opal_cv_asm_arch: gcc atomics have been known to perform poorly on powerpc.])
1149+
fi
1150+
11391151
;;
11401152
# There is no current difference between s390 and s390x
11411153
# But use two different defines in case some come later

config/opal_configure_options.m4

+7
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ else
8484
WANT_BRANCH_PROBABILITIES=0
8585
fi
8686

87+
AC_ARG_ENABLE([builtin-atomics-for-ppc],[AS_HELP_STRING([--enable-builtin-atomics-for-ppc],
88+
[POWER architectures only: Force use of builtin atomics if available. This could either be gcc builtins or C11 atomics, depending on what is available on your system. Enabling this is known to cause poor performance in atomic operations on Power machines. (default: disabled)])])
89+
if test "x$enable_builtin_atomics_for_ppc" = "xyes" ; then
90+
force_gcc_atomics_ppc=1
91+
else
92+
force_gcc_atomics_ppc=0
93+
fi
8794

8895
#
8996
# Memory debugging

0 commit comments

Comments
 (0)