#!/bin/sh #$ -o parcas.stdout #$ -N parcas #$ -q phys.q #$ -S /bin/bash #$ -V #$ -cwd #$ -m be #$ -j y #$ -M myemailaddress@helsinki.fi #$ -l h_cpu=500:00:00 #$ -notify sdir=`pwd` # Establish the submission work directory. echo "Date is `date`" echo "Submission directory is $sdir" echo "Host is" `hostname` # Check for file space on /tmp space=`df | grep "/tmp" | awk '{ print $5+0.0; }'` echo "Space on /tmp:" $space "%" if test $space -ge 80 then echo "qsub script check: File space on tmp on node" `hostname` echo "is dangerously low. Aborting job." echo "Please ask an administrator to clean up /tmp on that node" echo `df | grep "/tmp"` exit fi cd $sdir # Create the computation work directory. if [ ! -d /tmp/$USER ]; then mkdir /tmp/$USER fi cd /tmp/$USER dir=${sdir/$HOME/} dir=${dir//\//__} mkdir $dir cd $dir # Copy everything from submission directory here cp -f -r $sdir/* . # Copy required executable here cp $HOME/md/parcas . echo "Running on host `hostname`" echo "Time is `date`" echo "Directory is `pwd`" # Run your executable ############################################################################# ./parcas > out.parcas ############################################################################# # Store stdout into backup file (otherwise some parts removed at end) cp $sdir/parcas.stdout $sdir/parcas.stdout.stored # Copy results back to submission work directory. cp -f -r * $sdir/ cd $sdir