InfolabClusterComputeHowtoMpi

This HOWTO describes how to run an MPI job on the cluster. Wikipedia would call this article a stub. As I have very little experience with running MPI jobs, I am more or less pasting the script from http://csc.cnsi.ucsb.edu/docs/running-jobs-torque.

The submission script

   1 #!/bin/bash
   2 #PBS -l nodes=2:ppn=4
   3 
   4 # Make sure that we are in the same subdirectory as where the qsub command 
   5 # is issued. 
   6 cd $PBS_O_WORKDIR 
   7 
   8 #  make a list of allocated nodes(cores)
   9 cat $PBS_NODEFILE > nodes
  10 
  11 # How many cores total do we have?
  12 NO_OF_CORES=`cat $PBS_NODEFILE | egrep -v '^#'\|'^$' | wc -l | awk '{print $1}'`
  13 NODE_LIST=`cat $PBS_NODEFILE `
  14 
  15 # Just for kicks, see which nodes we got.
  16 echo $NODE_LIST
  17 
  18 # Run the executable. *DO NOT PUT* a '&' at the end!!
  19 mpirun -np $NO_OF_CORES -machinefile nodes ./pi3 >& log 
last edited 2012-10-17 02:45:36 by akrevl