Grid Engine Job Script Example MVAPICH

Grid Engine Job Script Example MVAPICH

#!/bin/bash
#
# Script to submit an mpi job
 
# ----------------------------
# Replace these with the name of the executable 
# and the parameters it needs
#$ -S /bin/bash
 
export MYAPP=/home/myname/codes/mycode
export MYAPP_FLAGS='1 2 3' 
 
# ---------------------------
# set the name of the job
#$ -N MVAPICH_JOB 
 
# request between 2 and 8 slots
#$ -pe mvapich 2-8
 
 
#################################################################
#################################################################
# there shouldn't be a need to change anything below this line
 
export MPICH_PROCESS_GROUP=no
 
 
# ---------------------------
# set up the mpich version to use
# ---------------------------
# load the module
. /etc/profile.d/modules.sh
module load sge
module load mvapich/gcc/64/1.1
# module load mvapich/intel/64/1.1
# module load mvapich/psc/64/1.1
# module load mvapich/pgi/64/1.1
 
 
#----------------------------
# set up the parameters for qsub
# ---------------------------
 
#  Mail to user at beginning/end/abort/on suspension
#$ -m beas
#  By default, mail is sent to the submitting user 
#  Use  $ -M username    to direct mail to another userid 
 
# Execute the job from the current working directory
# Job output will appear in this directory
#$ -cwd
#   can use -o dirname to redirect stdout 
#   can use -e dirname to redirect stderr
 
#  Export these environment variables
 
 
# Gridengine allocates the max number of free slots and sets the
# variable $NSLOTS.
echo "Got $NSLOTS slots."
 
# ---------------------------
# run the job
# ---------------------------
echo "Will run command: mpirun_rsh -np $NSLOTS -machinefile $TMPDIR/machines  $MYAPP $MYAPP_FLAGS" 
 
cm-launcher mpirun_rsh -np $NSLOTS -hostfile $TMPDIR/machines  $MYAPP $MYAPP_FLAGS

Copyright 2002-2014 ClusterVision BV