#!/bin/sh
#set -x

#
# This program is a wrapper which enables using mpich2 mpiexec with
# valgrind
#

if [ $1 !=  "-np" ]; then
echo "Error in  mpiexec command"
exit 1
fi
shift
np=$1
shift
progname=$1
shift
options=$*
#
# modify the following path to point to the correct locations
#
mpiexec=/home/petsc/soft/linux-rh73-mpich2/mpich2-0.971-CVS-200408131639/bin/mpiexec
valgrind=/usr/bin/valgrind
mpisupp=/home/petsc/soft/linux-rh73-mpich2/valgrind-2.1.2/lib/valgrind/mpich2-0.97.supp
#
# Now execute the mpiexec command
#
#$mpiexec -np $np $valgrind -q --suppressions=$mpisupp --tool=memcheck --num-callers=20 $progname $options
$mpiexec -np $np $valgrind -q --tool=memcheck --num-callers=20 $progname $options

