#!/bin/bash # PBS script pvm_job.pbs -> pbs script to submit a pvm job. # Submit with "qsub -l nodes=#_of_nodes:ppn=1 pvm_job.pbs" # where #_of_nodes is the number of nodes you are requesting for # your pvm job. ### Job name #PBS -N pvm_job ### Output files #PBS -o pvm_job.out #PBS -e pvm_job.err ### Queue name #PBS -q workq ### Script Commands cd $PBS_O_WORKDIR # echo "I ran on:" cat $PBS_NODEFILE # # generate pvm nodes file echo "* ep=$PBS_O_WORKDIR wd=$PBS_O_WORKDIR" > pvm_nodes cat $PBS_NODEFILE >> pvm_nodes # start pvm daemon & wait for slave daemons to start up pvmd pvm_nodes & sleep 10 # the name of the program to run ./program_name # wait again to make sure everyone's finished # then kill master pvm daemon sleep 5 /usr/bin/killall -TERM pvmd3 # get rid of lock files & nodes file uid=`id -u` tail +2 $PBS_NODEFILE > pvm_nodes /bin/rm -f /tmp/pvm?.$uid crm -f pvm_nodes:/tmp/pvmd.$uid > /dev/null 2>&1 crm -f pvm_nodes:/tmp/pvml.$uid > /dev/null 2>&1 /bin/rm -f pvm_nodes exit 0