#!/bin/sh #PBS -l select=1 #PBS -q P_016 #PBS -N hello # move entire directory to /work area, and go to the directory. DIRNAME=`basename $PBS_O_WORKDIR` WORKDIR=/work/$USER/$PBS_JOBID mkdir -p $WORKDIR cp -raf $PBS_O_WORKDIR $WORKDIR cd $WORKDIR/$DIRNAME # Run a program. # Standard output and error output are redirected to result.out and result.err respectively. aprun echo "Hello world!" > result.out 2> result.err # After running a program, move the results back to the original directory. cd; if cp -raf $WORKDIR/$DIRNAME $PBS_O_WORKDIR/.. ; then rm -rf $WORKDIR; fi