Skip to content

Commit

Permalink
romio: skip binding sources if FROM_MPICH
Browse files Browse the repository at this point in the history
MPICH will generate the binding layer.

Now that libromio just supply internal code, we no longer need worry
about libromio vs libpromio. We don't separate man pages and include
mpio.h in mpi.h either.
  • Loading branch information
hzhou committed Dec 5, 2024
1 parent 5e89c62 commit 966f859
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 44 deletions.
21 changes: 5 additions & 16 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ external_libs = @WRAPPER_LIBS@
mpi_convenience_libs =
pmpi_convenience_libs = @mpllib@ @hwloclib@ @jsonlib@ @yaksalib@ @pmilib@

if BUILD_ROMIO
external_subdirs += src/mpi/romio
pmpi_convenience_libs += src/mpi/romio/libromio.la
endif

# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
# The automake manual recommends thinking of DIST_SUBDIRS as the list of all
# *configured* subdirectories. The normal autotools model involves
Expand Down Expand Up @@ -136,12 +141,6 @@ lib_lib@MPILIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
lib_lib@MPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPICH_MPI_FROM_PMPI
lib_lib@MPILIBNAME@_la_LIBADD = lib/lib@[email protected] $(mpi_convenience_libs)

if BUILD_ROMIO
# libpromio contains the PMPI symbols (unlike libpmpi, which contains MPI
# symbols) and should be added to libpmpi
lib_lib@PMPILIBNAME@_la_LIBADD += src/mpi/romio/libpromio.la
lib_lib@MPILIBNAME@_la_LIBADD += src/mpi/romio/libromio.la
endif
else !BUILD_PROFILING_LIB

lib_LTLIBRARIES += lib/lib@[email protected]
Expand All @@ -151,9 +150,6 @@ lib_lib@MPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS)
lib_lib@MPILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(mpi_convenience_libs)
EXTRA_lib_lib@MPILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs) $(mpi_convenience_libs)

if BUILD_ROMIO
lib_lib@MPILIBNAME@_la_LIBADD += src/mpi/romio/libromio.la
endif
endif !BUILD_PROFILING_LIB

if BUILD_ABI_LIB
Expand All @@ -177,10 +173,6 @@ lib_lib@MPIABILIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
lib_lib@MPIABILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPICH_MPI_FROM_PMPI $(abi_cppflags)
lib_lib@MPIABILIBNAME@_la_LIBADD = lib/lib@[email protected] $(mpi_convenience_libs)

if BUILD_ROMIO
lib_lib@PMPIABILIBNAME@_la_LIBADD += src/mpi/romio/libpromio_abi.la
lib_lib@MPIABILIBNAME@_la_LIBADD += src/mpi/romio/libromio_abi.la
endif
else !BUILD_PROFILING_LIB

lib_LTLIBRARIES += lib/lib@[email protected]
Expand All @@ -190,9 +182,6 @@ lib_lib@MPIABILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) $(abi_cppflags)
lib_lib@MPIABILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(mpi_convenience_libs)
EXTRA_lib_lib@MPIABILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs) $(mpi_convenience_libs)

if BUILD_ROMIO
lib_lib@MPIABILIBNAME@_la_LIBADD += src/mpi/romio/libromio_abi.la
endif
endif !BUILD_PROFILING_LIB
endif BUILD_ABI_LIB

Expand Down
1 change: 0 additions & 1 deletion maint/gen_binding_c.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ def dump_io_funcs(do_abi=False):

if not do_abi:
dump_out(c_dir + "/io.c")
G.mpi_sources.pop()
else:
abi_file_path = abi_dir + "/io_abi.c"
G.check_write_path(abi_file_path)
Expand Down
25 changes: 0 additions & 25 deletions src/mpi/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,5 @@ include $(top_srcdir)/src/mpi/topo/Makefile.mk
include $(top_srcdir)/src/mpi/stream/Makefile.mk
include $(top_srcdir)/src/mpi/threadcomm/Makefile.mk

if BUILD_ROMIO
SUBDIRS += src/mpi/romio
DIST_SUBDIRS += src/mpi/romio
MANDOC_SUBDIRS += src/mpi/romio
HTMLDOC_SUBDIRS += src/mpi/romio

# This was previously a hard copy (not a symlink) performed by config.status
# (specified via AC_CONFIG_COMMANDS). Ideally we would eliminate this "copy"
# altogether and just set -Iromio_include_dir, but MPE2's build system uses
# $(top_builddir)/bin/mpicc that can't handle more than one include dir.
#
# Using a symlink allows us to avoid trying to capture the full dependency chain
# of MPICH/mpio.h --> ROMIO/mpio.h --> ROMIO/mpio.h.in --> ROMIO/config.status --> ...MORE_AUTOTOOLS...
BUILT_SOURCES += $(top_builddir)/src/include/mpio.h
$(top_builddir)/src/include/mpio.h: $(top_builddir)/src/mpi/romio/include/mpio.h
if test ! -h $(top_builddir)/src/include/mpio.h ; then \
rm -f $(top_builddir)/src/include/mpio.h ; \
( cd $(top_builddir)/src/include && \
$(LN_S) ../mpi/romio/include/mpio.h ) ; \
fi

DISTCLEANFILES += $(top_builddir)/src/include/mpio.h

endif BUILD_ROMIO

# dir is present but currently intentionally unbuilt
#include $(top_srcdir)/src/mpi/io/Makefile.mk
8 changes: 6 additions & 2 deletions src/mpi/romio/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dnl AC_CONFIG_AUX_DIR(../../../confdb)
dnl Set the directory that contains the required install-sh, config.sub,
dnl and config.guess . Make sure that these are updated (in MPICH, use
dnl the top-level confdb files). This separate directory is used for
dnl the moment to allow ROMIO to be separatedly distributed.
dnl the moment to allow ROMIO to be separately distributed.
dnl scripts.
AC_CONFIG_AUX_DIR([confdb])
AC_CONFIG_MACRO_DIR([confdb])
Expand Down Expand Up @@ -105,6 +105,8 @@ AC_ARG_VAR([FROM_OMPI],[set to "yes" if building ROMIO inside of Open MPI])
FROM_OMPI=${FROM_OMPI:-no}
if test "$FROM_OMPI" = 1 ; then FROM_OMPI=yes ; fi

AM_CONDITIONAL([BUILD_BINDING], [test "$FROM_MPICH" != "yes"])

# MPL
AC_ARG_VAR([MPLLIBNAME],[can be used to override the name of the MPL library (default: "mpl")])
MPLLIBNAME=${MPLLIBNAME:-"mpl"}
Expand Down Expand Up @@ -693,7 +695,9 @@ AM_CONDITIONAL([BUILD_MPIO_ERRHAN],[false])

# if we don't have weak symbol support, we must build a separate convenience
# library in order to provide the "PMPI_" symbols
AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0"])
# MPICH will generate separate binding layer, thus we can skip PROFILING LIB
# if build inside MPICH
AM_CONDITIONAL([BUILD_PROFILING_LIB],[test "x$HAVE_WEAK_SYMBOLS" = "x0" -a "$FROM_MPICH" != "yes"])
# disable visibility if building profiling library
if test "x$HAVE_WEAK_SYMBOLS" = "x0" ; then
VISIBILITY_CFLAGS=""
Expand Down
2 changes: 2 additions & 0 deletions src/mpi/romio/mpi-io/Makefile.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ include $(top_srcdir)/mpi-io/fortran/Makefile.mk
AM_CPPFLAGS += -I$(top_builddir)/mpi-io -I$(top_srcdir)/mpi-io
noinst_HEADERS += mpi-io/mpioimpl.h mpi-io/mpioprof.h

if BUILD_BINDING
romio_mpi_sources += \
mpi-io/close.c \
mpi-io/delete.c \
Expand Down Expand Up @@ -68,6 +69,7 @@ romio_mpi_sources += \
mpi-io/write_ordb.c \
mpi-io/write_orde.c \
mpi-io/write_sh.c
endif BUILD_BINDING


# non-MPI/PMPI sources that will be included in libromio
Expand Down

0 comments on commit 966f859

Please sign in to comment.