File: readdmtcp.sh

package info (click to toggle)
dmtcp 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,496 kB
  • sloc: cpp: 33,592; ansic: 28,099; sh: 6,735; makefile: 1,950; perl: 1,690; python: 1,241; asm: 138; java: 13
file content (28 lines) | stat: -rwxr-xr-x 656 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

if test "$1" = ""; then
  echo 'Usage:  readdmtcp.sh <CKPT IMAGE>'
  echo 'Example:  util/readdmtcp.sh ckpt_dmtcp1_*.dmtcp'
  exit 0
fi

trap 'rm -f ckpt_tmp.dmtcp' INT QUIT EXIT

if file $1 | grep gzip > /dev/null; then
  echo '***' $1 is a gzipped file.  Will uncompress it into ckpt_tmp.dmcp first.
  gzip -dc $1 > ckpt_tmp.dmtcp
  set ckpt_tmp.dmtcp
fi

dir=`dirname $0`

if which mtcp_restart > /dev/null 2> /dev/null; then
  mtcp_restart --simulate $1 2>&1
  exit 0
fi

# This next one assumes that this script resides in DMTCP_ROOT/util/
if test -x $dir/../bin/mtcp_restart; then
  $dir/../bin/mtcp_restart --simulate $1 2>&1
  exit 0
fi