Listing 8. Manipulating mpiexec

#PBS -l nodes=8:ppn=4
#PBS -l cput=1:00:00
#PBS -j oe
#PBS -N mpiexec
#PBS -S /bin/ksh
# Compile a program and copy it to $TMPDIR on
#  each node
cd $HOME/Beowulf/multilevel
mpif77 laplace-mpi.F -o laplace-mpi
pbsdcp laplace-mpi $TMPDIR
cd $TMPDIR
# run with 1 MPI process per node (8 total)
mpiexec -pernode ./laplace-mpi
# run with 1 MPI process per Myrinet interface
# (16 total)
mpiexec -perif ./laplace-mpi
# run with 1 MPI process per processor (32 total)
mpiexec ./laplace-mpi