Skip to content

Commit 717ce89

Browse files
authored
Merge pull request #9901 from bwbarrett/bugfix/asm-cleanup
Clean up atomics interface
2 parents a2aae17 + d674d8b commit 717ce89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1700
-2560
lines changed

config/opal_config_asm.m4

Lines changed: 151 additions & 686 deletions
Large diffs are not rendered by default.

config/opal_configure_options.m4

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,6 @@ else
8686
WANT_BRANCH_PROBABILITIES=0
8787
fi
8888

89-
AC_ARG_ENABLE([builtin-atomics-for-ppc],[AS_HELP_STRING([--enable-builtin-atomics-for-ppc],
90-
[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)])])
91-
if test "x$enable_builtin_atomics_for_ppc" = "xyes" ; then
92-
force_gcc_atomics_ppc=1
93-
else
94-
force_gcc_atomics_ppc=0
95-
fi
9689

9790
#
9891
# Memory debugging
@@ -420,6 +413,7 @@ AM_CONDITIONAL([OPAL_WANT_SCRIPT_WRAPPER_COMPILERS], [test "$enable_script_wrapp
420413
#
421414
# Support per-user config files?
422415
#
416+
OPAL_VAR_SCOPE_PUSH([result])
423417
AC_ARG_ENABLE([per-user-config-files],
424418
[AS_HELP_STRING([--enable-per-user-config-files],
425419
[Disable per-user configuration files, to save disk accesses during job start-up. This is likely desirable for large jobs. Note that this can also be achieved by environment variables at run-time. (default: enabled)])])
@@ -430,6 +424,7 @@ else
430424
fi
431425
AC_DEFINE_UNQUOTED([OPAL_WANT_HOME_CONFIG_FILES], [$result],
432426
[Enable per-user config files])
427+
OPAL_VAR_SCOPE_POP
433428

434429
#
435430
# Do we want to enable IPv6 support?

ompi/mca/osc/portals4/osc_portals4_component.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* of Tennessee Research Foundation. All rights
1010
* reserved.
1111
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
12-
* Copyright (c) 2018 Amazon.com, Inc. or its affiliates. All Rights reserved.
12+
* Copyright (c) 2018-2022 Amazon.com, Inc. or its affiliates. All Rights reserved.
1313
* Copyright (c) 2020 High Performance Computing Center Stuttgart,
1414
* University of Stuttgart. All rights reserved.
1515
* $COPYRIGHT$
@@ -24,6 +24,7 @@
2424
#include "opal/util/printf.h"
2525
#include "opal/include/opal/align.h"
2626
#include "opal/mca/mpool/base/base.h"
27+
#include "opal/opal_portable_platform.h"
2728

2829
#include "ompi/mca/osc/base/base.h"
2930
#include "ompi/mca/osc/base/osc_base_obj_convert.h"
@@ -589,7 +590,7 @@ component_select(struct ompi_win_t *win, void **base, size_t size, int disp_unit
589590

590591
module->passive_target_access_epoch = false;
591592

592-
#if OPAL_ASSEMBLY_ARCH == OPAL_X86_64 || OPAL_ASSEMBLY_ARCH == OPAL_IA32
593+
#if defined(PLATFORM_ARCH_X86) || defined(PLATFORM_ARCH_X86_64)
593594
*model = MPI_WIN_UNIFIED;
594595
#else
595596
*model = MPI_WIN_SEPARATE;

ompi/patterns/net/allreduce.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* All rights reserved.
66
* Copyright (c) 2017 IBM Corporation. All rights reserved.
77
* Copyright (c) 2019 Intel, Inc. All rights reserved.
8+
* Copyright (c) 2022 Amazon.com, Inc. or its affiliates.
9+
* All Rights reserved.
810
* $COPYRIGHT$
911
*
1012
* Additional copyrights may follow
@@ -34,7 +36,7 @@ void recv_completion(nt status, struct ompi_process_name_t* peer, struct iovec*
3436
int count, ompi_rml_tag_t tag, void* cbdata)
3537
{
3638
/* set receive completion flag */
37-
MB();
39+
opal_atomic_mb();
3840
*(int *)cbdata=1;
3941
}
4042

@@ -232,7 +234,7 @@ comm_allreduce(void *sbuf, void *rbuf, int count, opal_datatype_t *dtype,
232234
send_buffer^=1;
233235
}
234236

235-
MB();
237+
opal_atomic_mb();
236238
/*
237239
* Signal parent that data is ready
238240
*/
@@ -255,7 +257,7 @@ comm_allreduce(void *sbuf, void *rbuf, int count, opal_datatype_t *dtype,
255257

256258
*recv_done=0;
257259
*send_done=0;
258-
MB();
260+
opal_atomic_mb();
259261

260262
/* post non-blocking receive */
261263
recv_iov.iov_base=scratch_bufers[send_buffer];

opal/include/opal/sys/Makefile.am

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
# Copyright (c) 2017 Research Organization for Information Science
1717
# and Technology (RIST). All rights reserved.
1818
# Copyright (c) 2020-2021 Google, LLC. All rights reserved.
19+
# Copyright (c) 2022 Amazon.com, Inc. or its affiliates.
20+
# All Rights reserved.
1921
# $COPYRIGHT$
2022
#
2123
# Additional copyrights may follow
@@ -26,10 +28,14 @@
2628
# This makefile.am does not stand on its own - it is included from opal/Makefile.am
2729

2830
headers += \
29-
opal/sys/architecture.h \
3031
opal/sys/atomic.h \
3132
opal/sys/atomic_stdc.h \
32-
opal/sys/atomic_impl.h \
33+
opal/sys/atomic_impl_minmax_math.h \
34+
opal/sys/atomic_impl_ptr_cswap.h \
35+
opal/sys/atomic_impl_ptr_llsc.h \
36+
opal/sys/atomic_impl_ptr_swap.h \
37+
opal/sys/atomic_impl_size_t_math.h \
38+
opal/sys/atomic_impl_spinlock.h \
3339
opal/sys/timer.h \
3440
opal/sys/cma.h
3541

opal/include/opal/sys/architecture.h

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)