#!/bin/csh -f
# File revision id: $Id: run_hum_mpi.csh,v 1.1 2010/02/03 18:43:16 trn Exp $
# script for running mpi executable - see help message for details

if ($#argv < 2) goto usage
if ("a$argv[1]" == "ahelp" || "a$argv[1]" == "a-help") goto usage

set np=$1
shift
echo "Running $0 with np=$np, exec and args=$*"
echo PATH=$PATH
echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
echo MPIRUN=$MPIRUN

 $MPIRUN -np $np $*

exit

usage:

echo "$0 aborting because provided args=$argv"
echo "This script is a minimalist script for running MPI jobs"
echo "It needs at least 2 args:"
echo " 1 - no of processors"
echo " 2 - name of MPI executable"
echo " 3... - optional command line args for executable"
echo "It will issue the mpirun -np <np> <exec> <args> command, using"
echo "the MPIRUN environment variable (for integration into PBS)"
echo "On humboldt, use it like: "
echo " qsub_hum -lwalltime=... -lnodes=2:ppn=2 <absolute_path_to_run_hum_mpi.csh> 4 <exec_name> <args...>"
exit 1
