Skip to content

Commit a4c1511

Browse files
jtrongehppritcha
authored andcommitted
Add initial ABI generation code and new libraries
Two external MPI libraries are now created: libmpi.la and libmpi_abi.la. Backend code that was originally in libmpi.la has been extracted into libopen-mpi.la to be linked into both libraries. Parts of the Open MPI C interface are now being generated by a python script (abi.py) from modified source files (named with *.in). This script generates files for both the ompi ABI and the standard ABI from the same source file, also including new bigcount interfaces. To compile standard ABI code, there's a new mpicc_abi compiler wrapper. The standard ABI does not yet include all functions or symbols, so more complicated source files will not compile. ROMIO must be disabled for the code to link, since it's relying on the external MPI interface. Signed-off-by: Jake Tronge <jtronge@lanl.gov>
1 parent 3b92bb1 commit a4c1511

Some content is hidden

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

76 files changed

+1648
-132
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ ompi/tools/ompi_info/ompi_info
271271

272272
ompi/tools/wrappers/mpic++-wrapper-data.txt
273273
ompi/tools/wrappers/mpicc-wrapper-data.txt
274+
ompi/tools/wrappers/mpicc_abi-wrapper-data.txt
274275
ompi/tools/wrappers/mpifort-wrapper-data.txt
275276
ompi/tools/wrappers/ompi_wrapper_script
276277
ompi/tools/wrappers/ompi.pc
@@ -534,6 +535,10 @@ docs/man
534535

535536
# Generated C Bindings
536537
ompi/mpi/c/*_generated*.c
538+
ompi/mpi/c/ompi_*.c
539+
ompi/mpi/c/standard_*.c
540+
ompi/mpi/c/abi.h
541+
ompi/mpi/c/standard_abi
537542

538543
# Generated Fortran Bindings
539544
ompi/mpi/fortran/use-mpi-f08/*_generated.F90

config/ompi_config_files.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
4848
ompi/tools/ompi_info/Makefile
4949
ompi/tools/wrappers/Makefile
5050
ompi/tools/wrappers/mpicc-wrapper-data.txt
51+
ompi/tools/wrappers/mpicc_abi-wrapper-data.txt
5152
ompi/tools/wrappers/mpic++-wrapper-data.txt
5253
ompi/tools/wrappers/mpifort-wrapper-data.txt
5354
ompi/tools/wrappers/ompi.pc

config/ompi_configure_options.m4

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,19 @@ AC_ARG_ENABLE([deprecate-mpif-h],
257257
[AS_HELP_STRING([--enable-deprecate-mpif-h],
258258
[Mark the mpif.h bindings as deprecated (default: enabled)])])
259259

260+
AC_MSG_CHECKING([if want to enable standard ABI library])
261+
AC_ARG_ENABLE([standard-abi],
262+
[AS_HELP_STRING([--enable-standard-abi],
263+
[Enable building the standard ABI library (default: disabled)])])
264+
if test "$enable_standard_abi" = "yes"; then
265+
AC_MSG_RESULT([yes])
266+
ompi_standard_abi=1
267+
else
268+
AC_MSG_RESULT([no])
269+
ompi_standard_abi=0
270+
fi
271+
AC_DEFINE_UNQUOTED([OMPI_STANDARD_ABI],[$ompi_standard_abi],
272+
[Whether we want to build the standard ABI library])
273+
AM_CONDITIONAL(OMPI_STANDARD_ABI,[test "$enable_standard_abi" = "yes"])
274+
260275
])dnl

ompi/Makefile.am

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -126,36 +126,72 @@ DIST_SUBDIRS = \
126126
$(MCA_ompi_FRAMEWORKS_SUBDIRS) \
127127
$(MCA_ompi_FRAMEWORK_COMPONENT_ALL_SUBDIRS)
128128

129-
# Build the main MPI library
130-
129+
noinst_LTLIBRARIES = libopen-mpi.la
131130
lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@.la
132-
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
133-
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
131+
if OMPI_STANDARD_ABI
132+
lib_LTLIBRARIES += libmpi_abi.la
133+
endif
134+
135+
#
136+
# ABI Refactor
137+
#
138+
# As required by the standard ABI, ompi must now provide libmpi_abi.la for
139+
# ABI-specific code. Since we also want to avoid breaking the existing ompi
140+
# ABI, the libraries in this directory are now organized as follows:
141+
#
142+
# +----------------------+----------------------+
143+
# | libmpi_abi.la | libmpi.la |
144+
# +----------------------+----------------------+
145+
# | libopen-mpi.la |
146+
# +----------------------+----------------------+
147+
#
148+
# This includes a new library, libopen-mpi.la, that links in all backend code
149+
# built in this directory or SUBDIRs of this directory. Previously everything
150+
# was just linked directly into libmpi.la (lib@OMPI_LIBMPI_NAME@.la).
151+
#
152+
# libmpi_abi.la and libmpi.la both now link in libopen-mpi.la, the only
153+
# difference between them being that one includes the standard ABI functions
154+
# and the other the ompi-specific versions of those.
155+
#
156+
157+
# Build the Open MPI internal library
158+
libopen_mpi_la_SOURCES =
159+
libopen_mpi_la_LIBADD = \
134160
datatype/libdatatype.la \
135161
debuggers/libdebuggers.la \
162+
$(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_NAME@.la \
163+
$(MCA_ompi_FRAMEWORK_LIBS) \
164+
$(OMPI_LIBMPI_EXTRA_LIBS)
165+
libopen_mpi_la_DEPENDENCIES = $(libopen_mpi_la_LIBADD)
166+
167+
# Build the main MPI library
168+
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
169+
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
170+
libopen-mpi.la \
136171
mpi/c/libmpi_c.la \
137172
mpi/tool/libmpi_mpit.la \
138173
$(c_mpi_lib) \
139174
$(c_pmpi_lib) \
140-
$(mpi_fortran_base_lib) \
141-
$(MCA_ompi_FRAMEWORK_LIBS) \
142175
$(OMPI_MPIEXT_C_LIBS) \
143-
$(OMPI_LIBMPI_EXTRA_LIBS)
176+
$(mpi_fortran_base_lib)
144177

145-
146-
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
147-
$(OMPI_TOP_BUILDDIR)/opal/lib@OPAL_LIB_NAME@.la
148-
lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD)
149178
lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
150179
-version-info $(libmpi_so_version) \
151180
$(OMPI_LIBMPI_EXTRA_LDFLAGS)
152181

182+
# The MPI Standard ABI library
183+
libmpi_abi_la_SOURCES =
184+
libmpi_abi_la_LIBADD = \
185+
libopen-mpi.la \
186+
mpi/c/libmpi_c_abi.la
187+
153188
# included subdirectory Makefile.am's and appended-to variables
154189
headers =
155190
noinst_LTLIBRARIES =
156191
include_HEADERS =
157192
EXTRA_DIST =
158193
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
194+
dist_ompidata_DATA =
159195

160196
# Conditionally install the header files
161197

ompi/attribute/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
headers += \
2323
attribute/attribute.h
2424

25-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
25+
libopen_mpi_la_SOURCES += \
2626
attribute/attribute.c \
2727
attribute/attribute_predefined.c

ompi/class/Makefile.am

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,5 @@
2323
headers += \
2424
class/ompi_seq_tracker.h
2525

26-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
26+
libopen_mpi_la_SOURCES += \
2727
class/ompi_seq_tracker.c
28-

ompi/communicator/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ headers += \
2929
communicator/communicator.h \
3030
communicator/comm_request.h
3131

32-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
32+
libopen_mpi_la_SOURCES += \
3333
communicator/comm_init.c \
3434
communicator/comm.c \
3535
communicator/comm_cid.c \
3636
communicator/comm_request.c
3737

3838
if WANT_FT_MPI
39-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
39+
libopen_mpi_la_SOURCES += \
4040
communicator/ft/comm_ft.c communicator/ft/comm_ft_reliable_bcast.c communicator/ft/comm_ft_propagator.c communicator/ft/comm_ft_detector.c communicator/ft/comm_ft_revoke.c
4141
endif # WANT_FT_MPI
4242

ompi/dpm/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ EXTRA_DIST += dpm/help-dpm.txt
1717
headers += \
1818
dpm/dpm.h
1919

20-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
20+
libopen_mpi_la_SOURCES += \
2121
dpm/dpm.c

ompi/errhandler/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ headers += \
3030
errhandler/errhandler.h \
3131
errhandler/errhandler_predefined.h
3232

33-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
33+
libopen_mpi_la_SOURCES += \
3434
errhandler/errhandler.c \
3535
errhandler/errhandler_invoke.c \
3636
errhandler/errhandler_predefined.c \

ompi/file/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
headers += \
2323
file/file.h
2424

25-
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
25+
libopen_mpi_la_SOURCES += \
2626
file/file.c

0 commit comments

Comments
 (0)