#! /bin/sh
exitstatus=1
if [ "$argsset" = "" ] ; then
   . $MPIRUN_HOME/mpirun.args
   argsset=1
fi
#
. $MPIRUN_HOME/mpirun.pg
#
if [ $nolocal = 0 ] ; then
    cmdline="$cmdline -islocal -host=${MPI_HOST} -pgm=${progname} -numprocs=1 $cmdLineArgsExecer"
fi
for machineName in $machinelist ; do
    cmdline="$cmdline -host=${machineName} -pgm=${progname} -numprocs=1 $cmdLineArgsExecer"
done
#
PWD_LOCAL=$HOME
#
# Tell mpirun that we are using execer
#
MPIRUN_DEVICE=$default_device
export MPIRUN_DEVICE
# No good way to get the exit status
exitstatus=0
#
if [ $just_testing = 1 ] ; then
  echo $EXECER "-jobid=$jobid" $cmdline
  if [ "$mvback" != "" ] ; then
	(cd $PWD_LOCAL ; for file in $mvback ; do \
	if [ -s $file ] ; then echo cp $file $PWD_TRIAL ; \
	echo /bin/rm $file ; \
	fi ; done )
  fi
else
  $EXECER "-jobid=$jobid" $cmdline
  if [ "$mvback" != "" ] ; then
	(cd $PWD_LOCAL ; for file in $mvback ; do \
	if [ -s $file ] ; then cp $file $PWD_TRIAL ; /bin/rm $file ; \
	fi ; done )
  fi
fi

