diff --git a/Makefile.in b/Makefile.in index f12b60193..33d666e59 100644 --- a/Makefile.in +++ b/Makefile.in @@ -54,10 +54,42 @@ MANPAGES_AUTOGEN=dmtcp_nocheckpoint.1.gz mtcp_restart.1.gz \ MANPAGES=dmtcp.1.gz dmtcp_coordinator.1.gz dmtcp_command.1.gz \ dmtcp_launch.1.gz dmtcp_restart.1.gz mana.1.gz +# Version header. +include Makefile.versions + +VERSION_HEADER := contrib/mpi-proxy-split/mana-version.h +GITID_FILE := .gitid +GITID := $(shell if [ -d ".git" ]; then git describe --always; fi) + +# Git repository wasn't inited in MANA folder +ifeq ($(GITID),) + GITID := 0 +else + GITID_FILE_VALUE := $(shell if [ -f '$(GITID_FILE)' ]; then if [ `cat '$(GITID_FILE)'` = $(GITID) ]; then echo y; fi; fi) + ifneq ($(GITID_FILE_VALUE),y) + .PHONY: $(GITID_FILE) + endif +endif + +$(GITID_FILE): + echo "$(GITID)" > $(GITID_FILE) + +$(VERSION_HEADER): Makefile.versions $(GITID_FILE) .FORCE + echo "/* Autogenerated, do not edit */" > $@ + echo "#ifndef __MANA_VERSION_H__" >> $@ + echo "# define __MANA_VERSION_H__" >> $@ + echo "# define MANA_VERSION " $(MANA_VERSION) >> $@ + echo "# define MANA_VERSION_MAJOR " $(MANA_VERSION_MAJOR) >> $@ + echo "# define MANA_VERSION_MINOR " $(MANA_VERSION_MINOR) >> $@ + echo "# define MANA_VERSION_GITID " $(GITID) >> $@ + echo "#endif /* __MANA_VERSION_H__ */" >> $@ + +.FORCE: + # Macros TEST and XTERM_E used on command line by check1, check2, ...: # make TEST=readline XTERM_E="xterm -e" check-readline -default: display-build-env add-git-hooks build +default: display-build-env add-git-hooks build $(VERSION_HEADER) mkdirs: $(MKDIR_P) $(targetdir)/bin @@ -281,6 +313,8 @@ clean: tidy - cd contrib && $(MAKE) clean - cd test && $(MAKE) clean - cd manpages && ${MAKE} clean + - rm -f .gitid + - rm -f include/mana-version.h - if test -z "$$DMTCP_TMPDIR"; then \ if test -z "$$TMPDIR"; then \ DMTCP_TMPDIR=/tmp/dmtcp-$$USER@`/bin/hostname`; \ diff --git a/Makefile.versions b/Makefile.versions new file mode 100644 index 000000000..0fd230223 --- /dev/null +++ b/Makefile.versions @@ -0,0 +1,7 @@ +# +# MANA version. +MANA_VERSION_MAJOR := 0 +MANA_VERSION_MINOR := 1 +MANA_VERSION := $(MANA_VERSION_MAJOR)$(if $(MANA_VERSION_MINOR),.$(MANA_VERSION_MINOR)) + +export MANA_VERSION_MAJOR MANA_VERSION_MINOR MANA_VERSION diff --git a/README.md b/README.md index a14029e60..a84371d3d 100644 --- a/README.md +++ b/README.md @@ -37,13 +37,19 @@ MANA is an implementation of transparent checkpointing for MPI. It is built as a plugin on top of DMTCP. We are currently concentrating on making MANA robust (especially on Cori -and Perlmutter at NERSC). We plan to roll this ot to other platforms +and Perlmutter at NERSC). We plan to roll this out to other platforms (CentOS 7 with MPICH, etc.), over time. If you have the technical expertise to help in this rollout, help is appreciated. Please see the INSTALL file, below, for further details. Note that MANA currently requires the ability to create a statically linked MPI executable (using libmpi.a). In a later phase, this restriction will be lifted. +As MANA is in constant development, it can be handy to keep track of its +version, as well as identify what changes may have caused potential bugs. As of +Jan 2022, version tracking has been implemented - simply refer to +`include/mana-version.h` after building MANA, or use the `--version` flag with +any of the MANA commands. + ** WARNING: ** MANA currently may have large runtime overhead or loss of accuracy on restart. This is still under development. Please test your application on MANA first, before using MANA. @@ -52,3 +58,4 @@ For details of installing and using MANA, please see: - [the MANA README file](https://github.com/mpickpt/mana/blob/master/contrib/mpi-proxy-split/README) - [the MANA INSTALL file](https://github.com/mpickpt/mana/blob/master/contrib/mpi-proxy-split/INSTALL) - [the MANA 'man' page](https://github.com/mpickpt/mana/blob/master/manpages/mana.1) (or 'nroff -man mana.1') +- [a tutorial for installing MANA on CentOS 7 and 8 Stream](https://github.com/mpickpt/mana/blob/master/doc/mana-centos-tutorial.txt) diff --git a/contrib/mpi-proxy-split/Makefile b/contrib/mpi-proxy-split/Makefile index f6db0d42c..7dfb18c2f 100644 --- a/contrib/mpi-proxy-split/Makefile +++ b/contrib/mpi-proxy-split/Makefile @@ -107,13 +107,14 @@ ${DMTCP_ROOT}/bin/mana_p2p_update_logs: ${WRAPPERS_SRCDIR}/mana_p2p_update_logs. # which is a prerequisite for ${DMTCP_ROOT}/lib/dmtcp/libmana.so # Always do 'make default' or 'make install' -- not 'make libmana.so' # MANA_COORD_OBJS needed for 'make mana' at top level. -install: ${MANA_COORD_OBJS} +install: ${MANA_COORD_OBJS} ./mana-version.h make -C ${WRAPPERS_SRCDIR} libmpiwrappers.a make ${DMTCP_ROOT}/lib/dmtcp/libmana.so make ${DMTCP_ROOT}/lib/dmtcp/libmpidummy.so make ${DMTCP_ROOT}/bin/lh_proxy make ${DMTCP_ROOT}/bin/gethostbyname_proxy make ${DMTCP_ROOT}/bin/mana_p2p_update_logs + cp -f ./mana-version.h ${DMTCP_ROOT}/include tidy: rm -f *~ .*.swp dmtcp_restart_script*.sh ckpt_*.dmtcp @@ -123,6 +124,7 @@ clean: tidy rm -f ${LIBOBJS} ${MANA_COORD_OBJS} rm -f libmana.so rm -f ${DMTCP_ROOT}/lib/dmtcp/libmana.so + rm -f ./mana-version.h @cd ${LOWER_HALF_SRCDIR} && make clean @cd ${WRAPPERS_SRCDIR} && make clean diff --git a/src/mana_coordinator.sh b/src/mana_coordinator.sh index 684180fe6..b8a5f06cc 100755 --- a/src/mana_coordinator.sh +++ b/src/mana_coordinator.sh @@ -13,11 +13,14 @@ dir=`dirname $0` options="" verbose=0 help=0 +version=0 while [ -n "$1" ]; do if [ "$1" == --verbose ]; then verbose=1 elif [ "$1" == --help ]; then help=1 + elif [ "$1" == --version ]; then + version=1 else options="$options $1" fi @@ -29,6 +32,13 @@ if [ "$help" -eq 1 ]; then exit 0 fi +if [ "$version" -eq 1 ]; then + MANA_VERSION_FILE=$dir/../include/mana-version.h + MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE` + echo "`basename $0` (MANA) ${MANA_VERSION}" + exit 0 +fi + SITE=unknown if [ "$NERSC_HOST" = "cori" ]; then SITE=nersc diff --git a/src/mana_launch.sh b/src/mana_launch.sh index 2a4e8219a..f38cd57fa 100755 --- a/src/mana_launch.sh +++ b/src/mana_launch.sh @@ -31,11 +31,14 @@ options="" help=0 verbose=0 srun_sbatch_found=0 +version=0 while [ -n "$1" ]; do if [ "$1" == --verbose ]; then verbose=1 elif [ "$1" == --help ]; then help=1 + elif [ "$1" == --version ]; then + version=1 elif [ "$1" == srun ] || [ "$1" == sbatch ]; then srun_sbatch_found=1 elif [ "$1" == --ckptdir ]; then @@ -55,6 +58,13 @@ if [ "$help" -eq 1 ]; then exit 0 fi +if [ "$version" -eq 1 ]; then + MANA_VERSION_FILE=$dir/../include/mana-version.h + MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE` + echo "`basename $0` (MANA) ${MANA_VERSION}" + exit 0 +fi + SITE=unknown if [ "$NERSC_HOST" = "cori" ]; then SITE=nersc diff --git a/src/mana_restart.sh b/src/mana_restart.sh index 14c52c2b6..c8bbce940 100755 --- a/src/mana_restart.sh +++ b/src/mana_restart.sh @@ -34,11 +34,14 @@ options="" restartdir="" verbose=0 help=0 +version=0 while [ -n "$1" ]; do if [ "$1" == --verbose ]; then verbose=1 elif [ "$1" == --help ]; then help=1 + elif [ "$1" == --version ]; then + version=1 elif [ "$1" == --restartdir ]; then restartdir="$2" if [ ! -d "$restartdir" ]; then @@ -57,6 +60,13 @@ if [ "$help" -eq 1 ]; then exit 0 fi +if [ "$version" -eq 1 ]; then + MANA_VERSION_FILE=$dir/../include/mana-version.h + MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE` + echo "`basename $0` (MANA) ${MANA_VERSION}" + exit 0 +fi + SITE=unknown if [ "$NERSC_HOST" = "cori" ]; then SITE=nersc diff --git a/src/mana_status.sh b/src/mana_status.sh index 0ac9b2217..8ea6ae039 100755 --- a/src/mana_status.sh +++ b/src/mana_status.sh @@ -20,11 +20,14 @@ submissionPort=`grep Port: $HOME/.mana | sed -e 's%Port: %%'|sed -e 's% .*$%%'` options="" verbose=0 help=0 +version=0 while [ -n "$1" ]; do if [ "$1" == --verbose ]; then verbose=1 elif [ "$1" == --help ]; then help=1 + elif [ "$1" == --version ]; then + version=1 else options="$options $1" fi @@ -36,6 +39,13 @@ if [ "$help" -eq 1 ]; then exit 0 fi +if [ "$version" -eq 1 ]; then + MANA_VERSION_FILE=$dir/../include/mana-version.h + MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE` + echo "`basename $0` (MANA) ${MANA_VERSION}" + exit 0 +fi + coordinator_found=0 $dir/dmtcp_command -s -h $submissionHost -p $submissionPort 1>/dev/null \ && coordinator_found=1