#! /bin/sh

# This shell script works for a quad board machine with quad core CPUs
# running OpenMPI Version 1.2.

echo "localhost cpu=16" > OpenMPIhosts

test -f snp_mpi.err  && mv -f snp_mpi.err  snp_mpi.err.bak
test -f snp_mpi.out  && mv -f snp_mpi.out  snp_mpi.out.bak 

rm -f core core.*

make -f makefile.mpi.OpenMPI_1.2 >snp_mpi.out 2>&1 && \
  mpirun --hostfile OpenMPIhosts ${PWD}/snp_mpi >>snp_mpi.out 2>snp_mpi.err

RC=$?

case $RC in
  0) exit 0 ;;
  esac
exit 1;
~
