#!/bin/sh
verbose='n'
if [ ".$1" = ".-v" ]
then
    verbose='y'
    shift 1
fi
if [ -z "$2" ]
then
	echo usage is `basename $0` [-v] np pgm args
	exit 1
fi
if [ -z "$MPI_HOME" ]
then
    echo "first set MPI_HOME (possibly with 'module load')"
	exit 1
fi
np="$1"
pgm="$2"
shift 2
if [ "$verbose" = "y" ]
then
    set -x
fi
hosts=""
# uncomment this to use list of hosts in Hosts-pandora
hosts="--hostfile Hosts-pandora"
mpirun -v \
    --prefix $MPI_HOME \
    -np $np $hosts $pgm $*
