#!/bin/sh
# 
# EXAMPLE MPICH2 SCRIPT FOR SGE
# Modified by Basement Supercomputing 1/2/2006 DJE
# To use, change "MPICH2_JOB", "NUMBER_OF_CPUS" 
# and "MPICH2_PROGRAM_NAME" to real values. 
#
# Your job name 
#$ -N MPICH2_JOB
#
# Use current working directory
#$ -cwd
#
# Join stdout and stderr
#$ -j y
#
# pe request for MPICH2. Set your number of processors here. 
# Make sure you use the "mpich" parallel environemnt.
#$ -pe mpich2 NUMBER_OF_CPUS 
#
# Run job through bash shell
#$ -S /bin/bash
#
# The following is for reporting only. It is not really needed
# to run the job. It will show up in your output file.
echo "Got $NSLOTS processors."
echo "Machines:"
cat $TMPDIR/machines
#
port=$((JOB_ID % 5000 + 20000))
#
# Use full pathname to make sure we are using the right mpirun
/opt/mpi/tcp/mpich2-gnu3/bin/mpiexec -n $NSLOTS -machinefile $TMPDIR/machines -port $port MPICH2_PROGRAM_NAME



