星期四, 12月 02, 2004

pbs 的job sample

simple serial job
#!/bin/sh
#PBS -N serial
#PBS -o serial.out
#PBS -e serial.err
#PBS -m abe
#PBS -M deumens@qtp.ufl.edu
#PBS -q quick
#PBS -l nodes=1
echo Testing...
hostname
echo run a serial program...
echo done
parallel job to run a LAM MPI program

#!/bin/sh
#PBS -N para
#PBS -o para.out
#PBS -e para.err
#PBS -m abe
#PBS -M deumens@qtp.ufl.edu
#PBS -q quick
#PBS -l nodes=4:bc2:ppn=2
cleanup() {
lamhalt -v
echo job killed
exit
}
echo Testing parallel...
hostname
echo PBS_NODEFILE
cat $PBS_NODEFILE
N=`wc -l $PBS_NODEFILE awk '{print $1}'`
echo Nr nodes $N
lamboot -v $PBS_NODEFILE
# Catch TERM and KILL signals to shut down MPI
trap cleanup TERM KILL
echo starting hello...
mpirun -np $N hello > para.log 2>&1
lamhalt -v
echo done.
This job sample linked from http://www.qtp.ufl.edu/slaterlab/doc/openpbs.html


沒有留言: