Skip to content

Commit e77b0ac

Browse files
committed
Remove profile directory infrastructure
Remove the profile/ directory from mpi/c, mpi/tool, shmem/c, and shmem/fortran, along with the symlink infrastructure for building the profiling interface. Instead, use per-target CPPFLAGS to set the needed preprocessor define and have (up to) two helper libraries in the same directory. "Recent" (ie, this decade) Automake is smart enough to rename build the source file twice, with different output object files, and with different defines. This can speed up parallel builds slightly, but also will help with adding count interfaces without duplicating even more code. Note that this patch does not include the MPI fortran interfaces. There is planned work as part of the MPI_Count interface change to autogenerate much of that code, which will require a substantial Makefile.am overhaul anyway. Rather than a bunch of throw-away work to redo the existing Makefile.ams, the plan is to change them with that MPI_Count work. Signed-off-by: Brian Barrett <bbarrett@amazon.com>
1 parent c4405ad commit e77b0ac

File tree

183 files changed

+364
-1221
lines changed

Some content is hidden

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

183 files changed

+364
-1221
lines changed

config/ompi_config_files.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# Copyright (c) 2018 Los Alamos National Security, LLC. All rights
77
# reserved.
88
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
9+
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
10+
# reserved.
911
# $COPYRIGHT$
1012
#
1113
# Additional copyrights may follow
@@ -25,7 +27,6 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
2527
ompi/debuggers/Makefile
2628

2729
ompi/mpi/c/Makefile
28-
ompi/mpi/c/profile/Makefile
2930
ompi/mpi/fortran/base/Makefile
3031
ompi/mpi/fortran/mpif-h/Makefile
3132
ompi/mpi/fortran/mpif-h/profile/Makefile
@@ -47,7 +48,6 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
4748
ompi/mpi/fortran/mpiext-use-mpi/Makefile
4849
ompi/mpi/fortran/mpiext-use-mpi-f08/Makefile
4950
ompi/mpi/tool/Makefile
50-
ompi/mpi/tool/profile/Makefile
5151

5252
ompi/mpi/man/man3/Makefile
5353
ompi/mpi/man/man5/Makefile

config/oshmem_config_files.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# Copyright (c) 2013 Cisco Systems, Inc. All rights reserved.
66
# Copyright (c) 2017-2018 Research Organization for Information Science
77
# and Technology (RIST). All rights reserved.
8+
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates.
9+
# All Rights reserved.
810
# $COPYRIGHT$
911
#
1012
# Additional copyrights may follow
@@ -17,10 +19,8 @@ AC_DEFUN([OSHMEM_CONFIG_FILES],[
1719
oshmem/Makefile
1820
oshmem/include/Makefile
1921
oshmem/shmem/c/Makefile
20-
oshmem/shmem/c/profile/Makefile
2122

2223
oshmem/shmem/fortran/Makefile
23-
oshmem/shmem/fortran/profile/Makefile
2424

2525
oshmem/tools/oshmem_info/Makefile
2626
oshmem/tools/wrappers/Makefile

ompi/Makefile.am

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,15 @@
1919
# and Technology (RIST). All rights reserved.
2020
# Copyright (c) 2016 IBM Corporation. All rights reserved.
2121
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
22+
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
23+
# reserved.
2224
# $COPYRIGHT$
2325
#
2426
# Additional copyrights may follow
2527
#
2628
# $HEADER$
2729
#
2830

29-
# We always have C bindings, but do we have profiling?
30-
31-
if BUILD_MPI_BINDINGS_LAYER
32-
c_mpi_lib = mpi/c/libmpi_c_mpi.la mpi/tool/libmpi_mpit.la
33-
else
34-
c_mpi_lib =
35-
endif
36-
c_pmpi_lib = mpi/c/profile/libmpi_c_pmpi.la mpi/tool/profile/libmpi_pmpit.la
37-
3831
# See if we have Fortran mpif.h MPI bindings
3932

4033
if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
@@ -147,7 +140,7 @@ lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
147140
datatype/libdatatype.la \
148141
debuggers/libdebuggers.la \
149142
mpi/c/libmpi_c.la \
150-
mpi/tool/libmpi_mpit_common.la \
143+
mpi/tool/libmpi_mpit.la \
151144
$(c_mpi_lib) \
152145
$(c_pmpi_lib) \
153146
$(mpi_fortran_base_lib) \

ompi/mpi/c/Makefile.am

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,50 +17,49 @@
1717
# reserved.
1818
# Copyright (c) 2015-2020 Research Organization for Information Science
1919
# and Technology (RIST). All rights reserved.
20+
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
21+
# reserved.
2022
# $COPYRIGHT$
2123
#
2224
# Additional copyrights may follow
2325
#
2426
# $HEADER$
2527
#
2628

27-
SUBDIRS = profile
28-
29-
# OMPI_BUILD_MPI_PROFILING is enabled when we want our generated MPI_* symbols
30-
# to be replaced by PMPI_*.
31-
# In this directory, we need it to be 0
32-
33-
AM_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=0
34-
35-
#
36-
# The top directory always builds MPI_* bindings. The bottom directory
37-
# always builds PMPI_* bindings. The cases where the top directory
38-
# needs to be built are:
39-
#
40-
# 1. When profiling is disabled.
41-
# 2. When profiling is enabled but weak symbol support is absent.
42-
#
29+
# The purpose of the profiling layer is to allow intercept libraries
30+
# which override the MPI_ namespace symbols. We potentially compile
31+
# every MPI function twice. We always build the profiling layer,
32+
# because the symbols that are always implemented as functions are the
33+
# PMPI_ namespace symbols. We sometimes also build the non-profiling
34+
# layer, if weak symbols can't be used to alias the MPI_ namespace
35+
# into the PMPI_ namespace.
4336

44-
noinst_LTLIBRARIES = libmpi_c.la
37+
noinst_LTLIBRARIES = libmpi_c.la libmpi_c_profile.la
4538
if BUILD_MPI_BINDINGS_LAYER
46-
noinst_LTLIBRARIES += libmpi_c_mpi.la
39+
noinst_LTLIBRARIES += libmpi_c_noprofile.la
4740
endif
4841

4942
headers = bindings.h
5043

51-
#
52-
# libmpi_c.la is always build because it contains some non-profilied
53-
# functions.
54-
#
55-
44+
# attr_fn.c contains attribute manipulation functions which do not
45+
# profiling implications, and so are always built.
5646
libmpi_c_la_SOURCES = \
5747
attr_fn.c
48+
libmpi_c_la_LIBADD = libmpi_c_profile.la
49+
if BUILD_MPI_BINDINGS_LAYER
50+
libmpi_c_la_LIBADD += libmpi_c_noprofile.la
51+
endif
52+
53+
# Conditionally install the header files
54+
if WANT_INSTALL_HEADERS
55+
ompidir = $(ompiincludedir)/$(subdir)
56+
ompi_HEADERS = $(headers)
57+
endif
5858

5959
#
60-
# libmpi_c_mpi.la is only built in some cases (see above)
60+
# List of all C files that have profile versions
6161
#
62-
63-
libmpi_c_mpi_la_SOURCES = \
62+
interface_profile_sources = \
6463
abort.c \
6564
add_error_class.c \
6665
add_error_code.c \
@@ -469,9 +468,8 @@ libmpi_c_mpi_la_SOURCES = \
469468
win_unlock_all.c \
470469
win_wait.c
471470

472-
473471
if OMPI_ENABLE_MPI1_COMPAT
474-
libmpi_c_mpi_la_SOURCES += \
472+
interface_profile_sources += \
475473
address.c \
476474
errhandler_create.c \
477475
errhandler_get.c \
@@ -484,9 +482,8 @@ libmpi_c_mpi_la_SOURCES += \
484482
type_ub.c
485483
endif
486484

487-
# Conditionally install the header files
485+
libmpi_c_profile_la_SOURCES = $(interface_profile_sources)
486+
libmpi_c_profile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=1
488487

489-
if WANT_INSTALL_HEADERS
490-
ompidir = $(ompiincludedir)/$(subdir)
491-
ompi_HEADERS = $(headers)
492-
endif
488+
libmpi_c_noprofile_la_SOURCES = $(interface_profile_sources)
489+
libmpi_c_noprofile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=0

0 commit comments

Comments
 (0)