#!/bin/sh
#set -x

#
# This program is a wrapper over lam's mpirun. It converts
# the mpich's mpirun formated command to lam's format.
# and invokes lam's mpirun with it.
#

if [ $1 !=  "-np" ]; then
echo "Error in  mpirun command"
exit 1
fi
shift
np=$1
shift
progname=$1
shift
options=$*
#
# Please modify the following path to point to the correct location of LAM's mpirun
#
lam_path=/usr/bin
#
# Now execute the mpirun comman
#
$lam_path/mpirun.lam -w -c $np -s n0 $progname -- $options
$lam_path/lamclean
