#!/bin/bash # PBS script mpich-mpi_job.pbs -> pbs script to submit a MPICH-MPI job. # Submit with "qsub -l nodes=#_of_nodes:ppn=1 mpich-mpi_job.pbs" # where #_of_nodes is the number of nodes you are requesting for # your MPICH-MPI job. ### Job name #PBS -N mpich-mpi_job ### Output files #PBS -o mpich-mpi_job.out #PBS -e mpich-mpi_job.err ### Queue name #PBS -q workq ### Script Commands cd $PBS_O_WORKDIR echo "Running MPICH-MPI program" # get the number of nodes allocated to MPICH-MPI through PBS NP=`(wc -l < $PBS_NODEFILE) | awk '{print $1}'` # run the MPICH-MPI program mpirun -machinefile $PBS_NODEFILE -np $NP ./mpich-mpi_program exit 0