#!/bin/sh
# 
# EXAMPLE LAM SCRIPT FOR SGE
# Modified by Basement Supercomputing - 1/15/2006
# To use, change "LAM_JOB", "NUMBER_OF_CPUS" 
# and "LAM_PROGRAM_NAME" to real values. 
#
# Your job name 
#$ -N LAM_JOB
#
# Use current working directory
#$ -cwd
#
# Join stdout and stderr
#$ -j y
#
# pe request for LAM. Set your number of processors here. 
# Make sure you use the "lam" parallel environemnt.
#$ -pe lam 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/hostfile
#
# This MUST be in your LAM run script, otherwise
# multiple LAM jobs will NOT RUN 
export LAM_MPI_SOCKET_SUFFIX=$JOB_ID.$JOB_NAME
#
# Use full pathname to make sure we are using the right mpirun
/opt/mpi/tcp/lam-gnu3/bin/mpirun -np $NSLOTS  LAM_PROGRAM_NAME


