Skip to content

Commit 8d53c86

Browse files
committed
Add version flag to MANA commands
1 parent 0022dbf commit 8d53c86

6 files changed

Lines changed: 48 additions & 6 deletions

File tree

Makefile.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ MANPAGES=dmtcp.1.gz dmtcp_coordinator.1.gz dmtcp_command.1.gz \
5757
# Version header.
5858
include Makefile.versions
5959

60-
VERSION_HEADER := include/mana-version.h
61-
GITID_FILE := .gitid
62-
GITID := $(shell if [ -d ".git" ]; then git describe --always; fi)
60+
VERSION_HEADER := contrib/mpi-proxy-split/mana-version.h
61+
GITID_FILE := .gitid
62+
GITID := $(shell if [ -d ".git" ]; then git describe --always; fi)
6363

6464
# Git repository wasn't inited in MANA folder
6565
ifeq ($(GITID),)
@@ -313,8 +313,8 @@ clean: tidy
313313
- cd contrib && $(MAKE) clean
314314
- cd test && $(MAKE) clean
315315
- cd manpages && ${MAKE} clean
316-
- rm .gitid
317-
- rm include/mana-version.h
316+
- rm -f .gitid
317+
- rm -f include/mana-version.h
318318
- if test -z "$$DMTCP_TMPDIR"; then \
319319
if test -z "$$TMPDIR"; then \
320320
DMTCP_TMPDIR=/tmp/dmtcp-$$USER@`/bin/hostname`; \

contrib/mpi-proxy-split/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,14 @@ ${DMTCP_ROOT}/bin/mana_p2p_update_logs: ${WRAPPERS_SRCDIR}/mana_p2p_update_logs.
107107
# which is a prerequisite for ${DMTCP_ROOT}/lib/dmtcp/libmana.so
108108
# Always do 'make default' or 'make install' -- not 'make libmana.so'
109109
# MANA_COORD_OBJS needed for 'make mana' at top level.
110-
install: ${MANA_COORD_OBJS}
110+
install: ${MANA_COORD_OBJS} ./mana-version.h
111111
make -C ${WRAPPERS_SRCDIR} libmpiwrappers.a
112112
make ${DMTCP_ROOT}/lib/dmtcp/libmana.so
113113
make ${DMTCP_ROOT}/lib/dmtcp/libmpidummy.so
114114
make ${DMTCP_ROOT}/bin/lh_proxy
115115
make ${DMTCP_ROOT}/bin/gethostbyname_proxy
116116
make ${DMTCP_ROOT}/bin/mana_p2p_update_logs
117+
cp -f ./mana-version.h ${DMTCP_ROOT}/include
117118

118119
tidy:
119120
rm -f *~ .*.swp dmtcp_restart_script*.sh ckpt_*.dmtcp
@@ -123,6 +124,7 @@ clean: tidy
123124
rm -f ${LIBOBJS} ${MANA_COORD_OBJS}
124125
rm -f libmana.so
125126
rm -f ${DMTCP_ROOT}/lib/dmtcp/libmana.so
127+
rm -f ./mana-version.h
126128
@cd ${LOWER_HALF_SRCDIR} && make clean
127129
@cd ${WRAPPERS_SRCDIR} && make clean
128130

src/mana_coordinator.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ dir=`dirname $0`
1313
options=""
1414
verbose=0
1515
help=0
16+
version=0
1617
while [ -n "$1" ]; do
1718
if [ "$1" == --verbose ]; then
1819
verbose=1
1920
elif [ "$1" == --help ]; then
2021
help=1
22+
elif [ "$1" == --version ]; then
23+
version=1
2124
else
2225
options="$options $1"
2326
fi
@@ -29,6 +32,13 @@ if [ "$help" -eq 1 ]; then
2932
exit 0
3033
fi
3134

35+
if [ "$version" -eq 1 ]; then
36+
MANA_VERSION_FILE=$dir/../include/mana-version.h
37+
MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE`
38+
echo "`basename $0` (MANA) ${MANA_VERSION}"
39+
exit 0
40+
fi
41+
3242
SITE=unknown
3343
if [ "$NERSC_HOST" = "cori" ]; then
3444
SITE=nersc

src/mana_launch.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,14 @@ options=""
3131
help=0
3232
verbose=0
3333
srun_sbatch_found=0
34+
version=0
3435
while [ -n "$1" ]; do
3536
if [ "$1" == --verbose ]; then
3637
verbose=1
3738
elif [ "$1" == --help ]; then
3839
help=1
40+
elif [ "$1" == --version ]; then
41+
version=1
3942
elif [ "$1" == srun ] || [ "$1" == sbatch ]; then
4043
srun_sbatch_found=1
4144
elif [ "$1" == --ckptdir ]; then
@@ -55,6 +58,13 @@ if [ "$help" -eq 1 ]; then
5558
exit 0
5659
fi
5760

61+
if [ "$version" -eq 1 ]; then
62+
MANA_VERSION_FILE=$dir/../include/mana-version.h
63+
MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE`
64+
echo "`basename $0` (MANA) ${MANA_VERSION}"
65+
exit 0
66+
fi
67+
5868
SITE=unknown
5969
if [ "$NERSC_HOST" = "cori" ]; then
6070
SITE=nersc

src/mana_restart.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ options=""
3434
restartdir=""
3535
verbose=0
3636
help=0
37+
version=0
3738
while [ -n "$1" ]; do
3839
if [ "$1" == --verbose ]; then
3940
verbose=1
4041
elif [ "$1" == --help ]; then
4142
help=1
43+
elif [ "$1" == --version ]; then
44+
version=1
4245
elif [ "$1" == --restartdir ]; then
4346
restartdir="$2"
4447
if [ ! -d "$restartdir" ]; then
@@ -57,6 +60,13 @@ if [ "$help" -eq 1 ]; then
5760
exit 0
5861
fi
5962

63+
if [ "$version" -eq 1 ]; then
64+
MANA_VERSION_FILE=$dir/../include/mana-version.h
65+
MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE`
66+
echo "`basename $0` (MANA) ${MANA_VERSION}"
67+
exit 0
68+
fi
69+
6070
SITE=unknown
6171
if [ "$NERSC_HOST" = "cori" ]; then
6272
SITE=nersc

src/mana_status.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,14 @@ submissionPort=`grep Port: $HOME/.mana | sed -e 's%Port: %%'|sed -e 's% .*$%%'`
2020
options=""
2121
verbose=0
2222
help=0
23+
version=0
2324
while [ -n "$1" ]; do
2425
if [ "$1" == --verbose ]; then
2526
verbose=1
2627
elif [ "$1" == --help ]; then
2728
help=1
29+
elif [ "$1" == --version ]; then
30+
version=1
2831
else
2932
options="$options $1"
3033
fi
@@ -36,6 +39,13 @@ if [ "$help" -eq 1 ]; then
3639
exit 0
3740
fi
3841

42+
if [ "$version" -eq 1 ]; then
43+
MANA_VERSION_FILE=$dir/../include/mana-version.h
44+
MANA_VERSION=`awk '/MANA_VERSION / {print $4}' $MANA_VERSION_FILE`
45+
echo "`basename $0` (MANA) ${MANA_VERSION}"
46+
exit 0
47+
fi
48+
3949
coordinator_found=0
4050
$dir/dmtcp_command -s -h $submissionHost -p $submissionPort 1>/dev/null \
4151
&& coordinator_found=1

0 commit comments

Comments
 (0)