Skip to content

Instantly share code, notes, and snippets.

@dmmcquay
Created January 21, 2014 18:01
Show Gist options
  • Save dmmcquay/8544868 to your computer and use it in GitHub Desktop.
Save dmmcquay/8544868 to your computer and use it in GitHub Desktop.
#!/bin/bash
ARGV0=$0 # First argument is shell command (as in C)
#echo "Command: $ARGV0"
ARGC=$# # Number of args, not counting $0
#echo "Number of args: $ARGC"
JOB="python temp.py"
if [ $# -eq 1 ]
then
cr_run $JOB &
PID=$!
# JOBID = $SLURM_JOB_ID
else
# scontrol requeue $JOBID
cr_restart $2 &
PID=$!
fi
sleep $1
if ps -p $PID > /dev/null
then
echo "checking pointing"
kill -STOP $PID
cr_checkpoint -p --term $PID
else
echo "not running"
fi
echo "$PID"
#kill -STOP $PID
#cr_checkpoint $PID
#kill -9 $PID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment