| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
### A script for running bali-phy on the Sun Grid Engine (SGE) ### |
| 4 |
|
| 5 |
#------------------------ qsub options: --------------------# |
| 6 |
# -V: Give the job access to shell environment variables |
| 7 |
# -S /bin/sh: Use /bin/sh as the shell for the job. |
| 8 |
# -cwd: Execute the job from the current working directory. |
| 9 |
# -N <name> Specify job name |
| 10 |
|
| 11 |
QSUB_ARGS='-V -S /bin/sh -cwd -N bali-phy -l mem_free=2G' |
| 12 |
|
| 13 |
#------------------ Locate the programs --------------------# |
| 14 |
QSUB=$(type -p qsub) |
| 15 |
BALI_PHY=$(type -p bali-phy) |
| 16 |
|
| 17 |
if [ ! -x "$BALI_PHY" ] ; then |
| 18 |
echo "bali-phy-sge: I can't find 'bali-phy' to run it!" |
| 19 |
echo 'bali-phy-sge: If it is installed, please add it to your $PATH' |
| 20 |
exit 1 |
| 21 |
fi |
| 22 |
|
| 23 |
if [ ! -x "$QSUB" ] ; then |
| 24 |
echo "bali-phy-sge: I can't find the program 'qsub' to submit your job!" |
| 25 |
echo "bali-phy-sge: Is the Sun Grid Engine installed?" |
| 26 |
exit 1 |
| 27 |
fi |
| 28 |
|
| 29 |
#------ start the sampler |
| 30 |
exec qsub $QSUB_ARGS <<EOF |
| 31 |
#!/bin/sh |
| 32 |
exec $BALI_PHY $@ |
| 33 |
EOF |
| 34 |
|