Skip to content

Commit 60cbad7

Browse files
authored
Merge pull request #8722 from hjelmn/exterminate_all_32_bit_atomic_platform_support
Exterminate all 32 bit platform support from opal atomic (IA32, ARM32, PowerPC32)
2 parents 05693a8 + 12b02dd commit 60cbad7

28 files changed

+95
-948
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,13 @@ base as of this writing (April 2020):
201201

202202
* Open MPI requires a C99-capable compiler to build.
203203

204-
* On platforms other than x86-64, ARM, and PPC, Open MPI requires a
205-
compiler that either supports C11 atomics or the GCC `__atomic`
206-
atomics (e.g., GCC >= v4.7.2).
204+
* On platforms other than x86-64, AArch64 (64-bit ARM), and PPC64,
205+
Open MPI requires a compiler that either supports C11 atomics or
206+
the GCC `__atomic` atomics (e.g., GCC >= v4.7.2).
207+
208+
* 32-bit platforms are only supported with a recent compiler that
209+
supports C11 atomics. This includes gcc 4.9.x+ (gcc 6.x or newer
210+
recommened), icc 16, clang 3.1+, etc.
207211

208212
* Mixing compilers from different vendors when building Open MPI
209213
(e.g., using the C/C++ compiler from one vendor and the Fortran

config/opal_config_asm.m4

Lines changed: 22 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -880,53 +880,6 @@ AC_DEFUN([OPAL_CHECK_POWERPC_REG],[
880880
[Whether r notation is used for ppc registers])
881881
])dnl
882882

883-
884-
dnl #################################################################
885-
dnl
886-
dnl OPAL_CHECK_POWERPC_64BIT
887-
dnl
888-
dnl On some powerpc chips (the PPC970 or G5), the OS usually runs in
889-
dnl 32 bit mode, even though the hardware can do 64bit things. If
890-
dnl the compiler will let us, emit code for 64bit test and set type
891-
dnl operations (on a long long).
892-
dnl
893-
dnl #################################################################
894-
AC_DEFUN([OPAL_CHECK_POWERPC_64BIT],[
895-
if test "$ac_cv_sizeof_long" != "4" ; then
896-
# this function should only be called in the 32 bit case
897-
AC_MSG_ERROR([CHECK_POWERPC_64BIT called on 64 bit platform. Internal error.])
898-
fi
899-
AC_MSG_CHECKING([for 64-bit PowerPC assembly support])
900-
case $host in
901-
*-darwin*)
902-
ppc64_result=0
903-
if test "$opal_cv_asm_powerpc_r_reg" = "1" ; then
904-
ldarx_asm=" ldarx r1,r1,r1";
905-
else
906-
ldarx_asm=" ldarx 1,1,1";
907-
fi
908-
OPAL_TRY_ASSEMBLE([$opal_cv_asm_text
909-
$ldarx_asm],
910-
[ppc64_result=1],
911-
[ppc64_result=0])
912-
;;
913-
*)
914-
ppc64_result=0
915-
;;
916-
esac
917-
918-
if test "$ppc64_result" = "1" ; then
919-
AC_MSG_RESULT([yes])
920-
ifelse([$1],,:,[$1])
921-
else
922-
AC_MSG_RESULT([no])
923-
ifelse([$2],,:,[$2])
924-
fi
925-
926-
unset ppc64_result ldarx_asm
927-
])dnl
928-
929-
930883
dnl #################################################################
931884
dnl
932885
dnl OPAL_CHECK_CMPXCHG16B
@@ -1108,7 +1061,7 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
11081061
AC_MSG_ERROR([Cannot continue])
11091062
elif test "$enable_builtin_atomics" = "yes" ; then
11101063
if test $opal_cv_have___atomic = "yes" ; then
1111-
opal_cv_asm_builtin="BUILTIN_GCC"
1064+
opal_cv_asm_builtin="BUILTIN_GCC"
11121065
else
11131066
AC_MSG_WARN([GCC built-in atomics requested but not found.])
11141067
AC_MSG_ERROR([Cannot continue])
@@ -1129,63 +1082,43 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
11291082
# find our architecture for purposes of assembly stuff
11301083
opal_cv_asm_arch="UNSUPPORTED"
11311084
OPAL_GCC_INLINE_ASSIGN=""
1132-
if test "$opal_cv_have___atomic_64" ; then
1133-
OPAL_ASM_SUPPORT_64BIT=1
1134-
else
1135-
OPAL_ASM_SUPPORT_64BIT=0
1136-
fi
11371085
11381086
case "${host}" in
1139-
x86_64-*x32)
1140-
opal_cv_asm_arch="X86_64"
1141-
OPAL_ASM_SUPPORT_64BIT=1
1142-
OPAL_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)'
1143-
;;
1144-
i?86-*|x86_64*|amd64*)
1087+
x86_64-*x32|i?86-*|x86_64*|amd64*)
11451088
if test "$ac_cv_sizeof_long" = "4" ; then
1146-
opal_cv_asm_arch="IA32"
1147-
else
1148-
opal_cv_asm_arch="X86_64"
1149-
fi
1150-
OPAL_ASM_SUPPORT_64BIT=1
1089+
if test $opal_cv_asm_builtin = BUILTIN_NO ; then
1090+
AC_MSG_ERROR([IA32 atomics are no longer supported. Use a C11 compiler])
1091+
fi
1092+
opal_cv_asm_arch="IA32"
1093+
else
1094+
opal_cv_asm_arch="X86_64"
1095+
OPAL_CHECK_CMPXCHG16B
1096+
fi
11511097
OPAL_GCC_INLINE_ASSIGN='"xaddl %1,%0" : "=m"(ret), "+r"(negone) : "m"(ret)'
1152-
OPAL_CHECK_CMPXCHG16B
11531098
;;
11541099
11551100
aarch64*)
11561101
opal_cv_asm_arch="ARM64"
1157-
OPAL_ASM_SUPPORT_64BIT=1
1158-
OPAL_ASM_ARM_VERSION=8
11591102
OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
11601103
;;
11611104
1162-
armv7*|arm-*-linux-gnueabihf)
1163-
opal_cv_asm_arch="ARM"
1164-
OPAL_ASM_SUPPORT_64BIT=1
1165-
OPAL_ASM_ARM_VERSION=7
1166-
OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
1167-
;;
1105+
armv7*|arm-*-linux-gnueabihf|armv6*)
1106+
if test $opal_cv_asm_builtin = BUILTIN_NO ; then
1107+
AC_MSG_ERROR([32-bit ARM atomics are no longer supported. Use a C11 compiler])
1108+
fi
11681109
1169-
armv6*)
11701110
opal_cv_asm_arch="ARM"
1171-
OPAL_ASM_SUPPORT_64BIT=0
1172-
OPAL_ASM_ARM_VERSION=6
1173-
CCASFLAGS="$CCASFLAGS -march=armv7-a"
11741111
OPAL_GCC_INLINE_ASSIGN='"mov %0, #0" : "=&r"(ret)'
11751112
;;
11761113
11771114
powerpc-*|powerpc64-*|powerpcle-*|powerpc64le-*|rs6000-*|ppc-*)
11781115
OPAL_CHECK_POWERPC_REG
11791116
if test "$ac_cv_sizeof_long" = "4" ; then
1180-
opal_cv_asm_arch="POWERPC32"
1181-
1182-
# Note that on some platforms (Apple G5), even if we are
1183-
# compiling in 32 bit mode (and therefore should assume
1184-
# sizeof(long) == 4), we can use the 64 bit test and set
1185-
# operations.
1186-
OPAL_CHECK_POWERPC_64BIT(OPAL_ASM_SUPPORT_64BIT=1)
1187-
elif test "$ac_cv_sizeof_long" = "8" ; then
1188-
OPAL_ASM_SUPPORT_64BIT=1
1117+
if test $opal_cv_asm_builtin = BUILTIN_NO ; then
1118+
AC_MSG_ERROR([PowerPC 32-bit atomics are no longer supported. Use a C11 compiler])
1119+
fi
1120+
opal_cv_asm_arch="POWERPC32"
1121+
elif test "$ac_cv_sizeof_long" = "8" ; then
11891122
opal_cv_asm_arch="POWERPC64"
11901123
else
11911124
AC_MSG_ERROR([Could not determine PowerPC word size: $ac_cv_sizeof_long])
@@ -1213,20 +1146,10 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
12131146
;;
12141147
esac
12151148
1216-
if ! test -z "$OPAL_ASM_ARM_VERSION" ; then
1217-
AC_DEFINE_UNQUOTED([OPAL_ASM_ARM_VERSION], [$OPAL_ASM_ARM_VERSION],
1218-
[What ARM assembly version to use])
1219-
fi
1220-
12211149
if test "$opal_cv_asm_builtin" = "BUILTIN_GCC" ; then
12221150
AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
12231151
[Whether C compiler supports GCC style inline assembly])
12241152
else
1225-
AC_DEFINE_UNQUOTED([OPAL_ASM_SUPPORT_64BIT],
1226-
[$OPAL_ASM_SUPPORT_64BIT],
1227-
[Whether we can do 64bit assembly operations or not. Should not be used outside of the assembly header files])
1228-
AC_SUBST([OPAL_ASM_SUPPORT_64BIT])
1229-
12301153
opal_cv_asm_inline_supported="no"
12311154
# now that we know our architecture, try to inline assemble
12321155
OPAL_CHECK_INLINE_C_GCC([$OPAL_GCC_INLINE_ASSIGN])
@@ -1239,12 +1162,12 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
12391162
asm_format="${asm_format}-${opal_cv_asm_lsym}"
12401163
asm_format="${asm_format}-${opal_cv_asm_type}-${opal_asm_size}"
12411164
asm_format="${asm_format}-${opal_asm_align_log_result}"
1242-
if test "$opal_cv_asm_arch" = "POWERPC32" || test "$opal_cv_asm_arch" = "POWERPC64" ; then
1165+
if test "$opal_cv_asm_arch" = "POWERPC64" ; then
12431166
asm_format="${asm_format}-${opal_cv_asm_powerpc_r_reg}"
12441167
else
12451168
asm_format="${asm_format}-1"
12461169
fi
1247-
asm_format="${asm_format}-${OPAL_ASM_SUPPORT_64BIT}"
1170+
asm_format="${asm_format}-1"
12481171
opal_cv_asm_format="${asm_format}-${opal_cv_asm_gnu_stack}"
12491172
# For the Makefile, need to escape the $ as $$. Don't display
12501173
# this version, but make sure the Makefile gives the right thing
@@ -1256,7 +1179,7 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
12561179
AC_DEFINE_UNQUOTED([OPAL_ASSEMBLY_FORMAT], ["$OPAL_ASSEMBLY_FORMAT"],
12571180
[Format of assembly file])
12581181
AC_SUBST([OPAL_ASSEMBLY_FORMAT])
1259-
fi # if opal_cv_asm_builtin = BUILTIN_GCC
1182+
fi # if opal_cv_asm_builtin = BUILTIN_GCC
12601183
12611184
result="OPAL_$opal_cv_asm_arch"
12621185
OPAL_ASSEMBLY_ARCH="$opal_cv_asm_arch"

ompi/mca/osc/rdma/osc_rdma_frag.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ static inline void ompi_osc_rdma_frag_complete (ompi_osc_rdma_frag_t *frag)
2525
opal_atomic_rmb ();
2626

2727
(void) opal_atomic_swap_32 (&frag->pending, 1);
28-
#if OPAL_HAVE_ATOMIC_MATH_64
2928
(void) opal_atomic_swap_64 (&frag->curr_index, 0);
30-
#else
31-
(void) opal_atomic_swap_32 (&frag->curr_index, 0);
32-
#endif
3329
}
3430
}
3531

@@ -88,11 +84,7 @@ static inline int ompi_osc_rdma_frag_alloc (ompi_osc_rdma_module_t *module, size
8884
OSC_RDMA_VERBOSE(MCA_BASE_VERBOSE_INFO, "allocating frag. pending = %d", curr->pending);
8985
OPAL_THREAD_ADD_FETCH32(&curr->pending, 1);
9086

91-
#if OPAL_HAVE_ATOMIC_MATH_64
9287
my_index = opal_atomic_fetch_add_64 (&curr->curr_index, request_len);
93-
#else
94-
my_index = opal_atomic_fetch_add_32 (&curr->curr_index, request_len);
95-
#endif
9688
if (my_index + request_len > mca_osc_rdma_component.buffer_size) {
9789
if (my_index <= mca_osc_rdma_component.buffer_size) {
9890
/* this thread caused the buffer to spill over */

ompi/mca/osc/rdma/osc_rdma_types.h

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,13 @@ struct ompi_osc_rdma_frag_t;
2121
struct ompi_osc_rdma_sync_t;
2222
struct ompi_osc_rdma_peer_t;
2323

24-
#if OPAL_HAVE_ATOMIC_MATH_64
25-
2624
typedef int64_t osc_rdma_base_t;
2725
typedef uint64_t osc_rdma_size_t;
2826
typedef int64_t osc_rdma_counter_t;
2927
typedef opal_atomic_int64_t osc_rdma_atomic_counter_t;
3028

3129
#define ompi_osc_rdma_counter_add opal_atomic_add_fetch_64
3230

33-
#else
34-
35-
typedef int32_t osc_rdma_base_t;
36-
typedef uint32_t osc_rdma_size_t;
37-
typedef int32_t osc_rdma_counter_t;
38-
typedef opal_atomic_int32_t osc_rdma_atomic_counter_t;
39-
40-
#define ompi_osc_rdma_counter_add opal_atomic_add_fetch_32
41-
42-
#endif
43-
44-
#if OPAL_HAVE_ATOMIC_MATH_64
45-
4631
#define OMPI_OSC_RDMA_LOCK_EXCLUSIVE 0x8000000000000000l
4732

4833
typedef int64_t ompi_osc_rdma_lock_t;
@@ -70,38 +55,6 @@ static inline int ompi_osc_rdma_lock_compare_exchange (opal_atomic_int64_t *p, i
7055
return ret;
7156
}
7257

73-
#else
74-
75-
#define OMPI_OSC_RDMA_LOCK_EXCLUSIVE 0x80000000l
76-
77-
typedef int32_t ompi_osc_rdma_lock_t;
78-
typedef opal_atomic_int32_t ompi_osc_rdma_atomic_lock_t;
79-
80-
static inline int32_t ompi_osc_rdma_lock_add (opal_atomic_int32_t *p, int32_t value)
81-
{
82-
int32_t new;
83-
84-
opal_atomic_mb ();
85-
/* opal_atomic_add_fetch_32 differs from normal atomics in that is returns the new value */
86-
new = opal_atomic_add_fetch_32 (p, value) - value;
87-
opal_atomic_mb ();
88-
89-
return new;
90-
}
91-
92-
static inline int ompi_osc_rdma_lock_compare_exchange (opal_atomic_int32_t *p, int32_t *comp, int32_t value)
93-
{
94-
int ret;
95-
96-
opal_atomic_mb ();
97-
ret = opal_atomic_compare_exchange_strong_32 (p, comp, value);
98-
opal_atomic_mb ();
99-
100-
return ret;
101-
}
102-
103-
#endif /* OPAL_HAVE_ATOMIC_MATH_64 */
104-
10558
/**
10659
* @brief structure describing a window memory region
10760
*/
@@ -219,11 +172,7 @@ struct ompi_osc_rdma_frag_t {
219172

220173
/* Number of operations which have started writing into the frag, but not yet completed doing so */
221174
opal_atomic_int32_t pending;
222-
#if OPAL_HAVE_ATOMIC_MATH_64
223175
opal_atomic_int64_t curr_index;
224-
#else
225-
opal_atomic_int32_t curr_index;
226-
#endif
227176

228177
struct ompi_osc_rdma_module_t *module;
229178
mca_btl_base_registration_handle_t *handle;

ompi/mca/osc/sm/osc_sm.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,11 @@
1818

1919
#include "opal/mca/shmem/base/base.h"
2020

21-
#if OPAL_HAVE_ATOMIC_MATH_64
22-
2321
typedef uint64_t osc_sm_post_type_t;
2422
typedef opal_atomic_uint64_t osc_sm_post_atomic_type_t;
2523
#define OSC_SM_POST_BITS 6
2624
#define OSC_SM_POST_MASK 0x3f
2725

28-
#else
29-
30-
typedef uint32_t osc_sm_post_type_t;
31-
typedef opal_atomic_uint32_t osc_sm_post_atomic_type_t;
32-
#define OSC_SM_POST_BITS 5
33-
#define OSC_SM_POST_MASK 0x1f
34-
35-
#endif
36-
3726
/* data shared across all peers */
3827
struct ompi_osc_sm_global_state_t {
3928
int use_barrier_for_fence;

ompi/mca/osc/sm/osc_sm_active_target.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,7 @@ ompi_osc_sm_start(struct ompi_group_t *group,
161161

162162
opal_atomic_rmb ();
163163

164-
#if OPAL_HAVE_ATOMIC_MATH_64
165164
(void) opal_atomic_fetch_xor_64 ((opal_atomic_int64_t *) module->posts[my_rank] + rank_byte, rank_bit);
166-
#else
167-
(void) opal_atomic_fetch_xor_32 ((opal_atomic_int32_t *) module->posts[my_rank] + rank_byte, rank_bit);
168-
#endif
169165
}
170166

171167
free (ranks);
@@ -247,11 +243,7 @@ ompi_osc_sm_post(struct ompi_group_t *group,
247243

248244
gsize = ompi_group_size(module->post_group);
249245
for (int i = 0 ; i < gsize ; ++i) {
250-
#if OPAL_HAVE_ATOMIC_MATH_64
251246
(void) opal_atomic_fetch_add_64 ((opal_atomic_int64_t *) module->posts[ranks[i]] + my_byte, my_bit);
252-
#else
253-
(void) opal_atomic_fetch_add_32 ((opal_atomic_int32_t *) module->posts[ranks[i]] + my_byte, my_bit);
254-
#endif
255247
}
256248

257249
opal_atomic_wmb ();

opal/include/opal/sys/Makefile.am

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# reserved.
1616
# Copyright (c) 2017 Research Organization for Information Science
1717
# and Technology (RIST). All rights reserved.
18-
# Copyright (c) 2020 Google, LLC. All rights reserved.
18+
# Copyright (c) 2020-2021 Google, LLC. All rights reserved.
1919
# $COPYRIGHT$
2020
#
2121
# Additional copyrights may follow
@@ -34,8 +34,6 @@ headers += \
3434
opal/sys/cma.h
3535

3636
include opal/sys/x86_64/Makefile.am
37-
include opal/sys/arm/Makefile.am
3837
include opal/sys/arm64/Makefile.am
39-
include opal/sys/ia32/Makefile.am
4038
include opal/sys/powerpc/Makefile.am
4139
include opal/sys/gcc_builtin/Makefile.am

0 commit comments

Comments
 (0)