Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@
/aclocal.m4
/autom4te.cache/

# Made by make. bin/ also gets DMTCP's programs and the lower half, but the
# mana_* launchers are sources.
/bin/*
!/bin/mana_*
# Made by make.
/bin/
/lib/
/manpages/mana.1.gz
*.[oa]
Expand Down
47 changes: 27 additions & 20 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@

prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
bindir=@bindir@
libdir=@libdir@
pkglibdir = @libdir@/@PACKAGE@
docdir=@docdir@
includedir=@includedir@
mandir=@mandir@
# DMTCP installs its plugins here too.
pkglibdir = $(libdir)/dmtcp
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
srcdir = @srcdir@
Expand All @@ -37,8 +34,16 @@ default: display-build-env add-git-hooks mana_prereqs

all: default

mana: mana_prereqs dmtcp
cd mpi-proxy-split && $(MAKE) install
MANA_SCRIPTS = mana_coordinator mana_launch mana_restart mana_status

mana: mana_prereqs dmtcp $(MANA_SCRIPTS:%=bin/%)
cd mpi-proxy-split && $(MAKE) stage

# bin/ holds the scripts next to DMTCP's programs and the lower half, which
# the scripts run.
$(MANA_SCRIPTS:%=bin/%): bin/%: scripts/%
@mkdir -p bin
cp -f $< $@

# The end-to-end tests, the example and the benchmarks.
tests:
Expand All @@ -61,23 +66,26 @@ dmtcp: dmtcp/configure
cp -rf ${DMTCP_ROOT}/bin .
cp -rf ${DMTCP_ROOT}/lib .

create-dirs:
$(INSTALL) -d $(DESTDIR)$(bindir)
$(INSTALL) -d $(DESTDIR)$(libdir)
$(INSTALL) -d $(DESTDIR)$(pkglibdir)
$(INSTALL) -d $(DESTDIR)$(includedir)
$(INSTALL) -d $(DESTDIR)$(docdir)
$(INSTALL) -d $(DESTDIR)$(mandir)/man1
# MANA's scripts find the lower half, DMTCP's programs and MANA's libraries
# from their own directory: in it and in ../lib/dmtcp. So MANA works when
# bindir and libdir are configure's defaults, PREFIX/bin and PREFIX/lib.
MANA_LIBS = libmana.so libmpistub.so libmpistub_audit.so

install: all create-dirs
install: all
cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS)
Comment thread
xuyao00 marked this conversation as resolved.
Resolved
cd mpi-proxy-split && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS)
$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(pkglibdir)
$(INSTALL_SCRIPT) $(MANA_SCRIPTS:%=scripts/%) $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) bin/lower-half $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) $(MANA_LIBS:%=lib/dmtcp/%) $(DESTDIR)$(pkglibdir)
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
cd manpages && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS)

# In the reverse order of 'install'. Quote each path: a space in it must
# not split it into other files' names.
uninstall:
cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)
cd mpi-proxy-split && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)
cd manpages && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)
for f in $(MANA_SCRIPTS) lower-half; do rm -f "$(DESTDIR)$(bindir)/$$f"; done
for f in $(MANA_LIBS); do rm -f "$(DESTDIR)$(pkglibdir)/$$f"; done
cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS)

distclean: clean
- cd ${DMTCP_ROOT} && $(MAKE) distclean
Expand All @@ -88,8 +96,7 @@ distclean: clean
mpi-proxy-split/mpi-wrappers/Makefile mpi-proxy-split/test/Makefile \
mpi-proxy-split/examples/Makefile
rm -rf autom4te.cache
rm -rf $(top_builddir)/lib
- cd $(top_builddir)/bin && find . \! -name '*mana*' -delete
rm -rf $(top_builddir)/lib $(top_builddir)/bin

tidy:
rm -rf ckpt_rank*
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ uses (the `dmtcp` submodule). A later `git pull` can change that commit
without changing `dmtcp/`; `make` then warns, and `git submodule update`
checks out the new commit.

`make` puts MANA in the source tree's `bin` and `lib/dmtcp`. To install it,
with DMTCP, into another directory, give that directory to `./configure`:

./configure --prefix=$HOME/mana-install
make -j8
make install # 'make uninstall' removes it

MANA's scripts find its other files from their own directory, so keep the
default `--bindir` and `--libdir` (`PREFIX/bin` and `PREFIX/lib`).

On Debian and Ubuntu, also install the package libc6-dbg: MANA needs the
symbols of the dynamic loader, which these distributions strip.

Expand Down
7 changes: 6 additions & 1 deletion manpages/Makefile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
datarootdir=@datarootdir@
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
mandir=@mandir@
PANDOC=@PANDOC@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

MANPAGES = mana.1.gz
Expand All @@ -20,8 +24,9 @@ install: ${MANPAGES}
$(INSTALL) -d $(DESTDIR)$(mandir)/man1
${INSTALL_DATA} ${MANPAGES} $(DESTDIR)$(mandir)/man1

# Quote each path: a space in it must not split it into other files' names.
uninstall:
cd $(DESTDIR)$(mandir)/man1 && rm -f ${MANPAGES}
for f in $(MANPAGES); do rm -f "$(DESTDIR)$(mandir)/man1/$$f"; done

clean:
rm -f *.1.gz
Expand Down
24 changes: 13 additions & 11 deletions mpi-proxy-split/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ MPICXX = @MPICXX@ -std=c++20
override CFLAGS += -fno-stack-protector
override CXXFLAGS += -fno-stack-protector

# Targets to install:
# Targets to stage:
# libmana.so (using mpi-wrappers/libmpiwrappers.a), libmpistub.so,
# libmpistub_audit.so

# Subdirectories needed to install
# Subdirectories needed to stage
LOWER_HALF_SRCDIR=lower-half
WRAPPERS_SRCDIR=mpi-wrappers

Expand Down Expand Up @@ -45,10 +45,12 @@ override CXXFLAGS += -fPIC -I${DMTCP_INCLUDE} -I${JALIB_INCLUDE} \
# code is in libmpi_cxx.so.
override CXXFLAGS += -DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX

# 'make' does what 'make install' does.
default: install
# 'make' builds libmana.so, the stubs and the lower half, and stages them:
# it copies them into ../lib/dmtcp and ../bin, where MANA's scripts find
# them.
default: stage

# ${WRAPPERS_SRCDIR}/libmpiwrappers.a made in install/default before libmana.so
# ${WRAPPERS_SRCDIR}/libmpiwrappers.a made in stage/default before libmana.so
# libmana.so needs libmpistub.so (in the same directory once installed): with
# Open MPI, it refers to the MPI library's objects (see
# generate-mpi-stub-objects.py), and a program that loads the MPI library
Expand Down Expand Up @@ -85,19 +87,19 @@ ${MANA_ROOT}/lib/dmtcp/libmana.so: libmana.so
cp -f $< $@
${MANA_ROOT}/lib/dmtcp/libmpistub.so: ${WRAPPERS_SRCDIR}/mpi_stub_wrappers.txt \
${WRAPPERS_SRCDIR}/mpi_stub_data.c
$(MAKE) -C ${WRAPPERS_SRCDIR} install
$(MAKE) -C ${WRAPPERS_SRCDIR} stage
${MANA_ROOT}/lib/dmtcp/libmpistub_audit.so: ${WRAPPERS_SRCDIR}/mpi_stub_audit.c
$(MAKE) -C ${WRAPPERS_SRCDIR} install
$(MAKE) -C ${WRAPPERS_SRCDIR} stage

# ${WRAPPERS_SRCDIR}/libmpiwrappers.a ia a prerequisite for libmana.so,
# which is a prerequisite for ${MANA_ROOT}/lib/dmtcp/libmana.so
# Always do 'make default' or 'make install' -- not 'make libmana.so'
install:
# Always do 'make' or 'make stage' -- not 'make libmana.so'
stage:
$(MAKE) -C ${WRAPPERS_SRCDIR} libmpiwrappers.a libmpistub.so
$(MAKE) ${MANA_ROOT}/lib/dmtcp/libmana.so
$(MAKE) ${MANA_ROOT}/lib/dmtcp/libmpistub.so
$(MAKE) ${MANA_ROOT}/lib/dmtcp/libmpistub_audit.so
$(MAKE) -C ${LOWER_HALF_SRCDIR} install
$(MAKE) -C ${LOWER_HALF_SRCDIR} stage

tidy:
rm -f *~ .*.swp dmtcp_restart_script*.sh ckpt_*.dmtcp
Expand All @@ -115,7 +117,7 @@ distclean: clean

FORCE:

.PHONY: default clean distclean tidy check tests install
.PHONY: default clean distclean tidy check tests stage

# Regenerate this Makefile when Makefile.in or config.status is newer.
Makefile: Makefile.in @top_builddir@/config.status
Expand Down
4 changes: 2 additions & 2 deletions mpi-proxy-split/lower-half/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ switch-context.o: switch-context.cpp
lower-half: get-symbol-offset.o build-id-debug.o copy-stack.o patch-trampoline.o lh-func-ptr.o mem-wrapper.o switch-context.o lower-half.o mmap-fixed-noreplace.o ${DMTCP_DEPS}
${MPICXX} ${TEXTSEG_ADDR_FLAG} ${CXXFLAGS} -o $@ $^ -lpthread -ldl -latomic

install: lower-half
stage: lower-half
cp -f $^ ${MANA_ROOT}/bin/

tidy:
Expand All @@ -70,7 +70,7 @@ clean: tidy

distclean: clean

.PHONY: default clean distclean install
.PHONY: default clean distclean stage

# Regenerate this Makefile when Makefile.in or config.status is newer.
Makefile: Makefile.in @top_builddir@/config.status
Expand Down
4 changes: 2 additions & 2 deletions mpi-proxy-split/mpi-wrappers/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ tidy:
rm -rf ckpt_rank_*
rm -f dmtcp_coordinator_db-*.json

install: libmpistub.so libmpistub_audit.so
stage: libmpistub.so libmpistub_audit.so
cp -f libmpistub.so libmpistub_audit.so ${MANA_ROOT}/lib/dmtcp/

clean: tidy
Expand All @@ -126,7 +126,7 @@ clean: tidy

distclean: clean

.PHONY: default clean distclean tidy install
.PHONY: default clean distclean tidy stage

# Regenerate this Makefile when Makefile.in or config.status is newer.
Makefile: Makefile.in @top_builddir@/config.status
Expand Down
2 changes: 1 addition & 1 deletion mpi-proxy-split/test/test-mana-restart.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

ROOT = Path(__file__).resolve().parents[2]
WRAPPER = Path(os.environ.get(
"MANA_RESTART_WRAPPER", ROOT / "bin" / "mana_restart"))
"MANA_RESTART_WRAPPER", ROOT / "scripts" / "mana_restart"))


class ManaRestartTest(unittest.TestCase):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading