#!/bin/sh # # usage: run-mpi processes program [ "program-parameters" ] # # assumes there is a file MPIhosts in the current directory containing # the names of the machines to use # if [ ".$2" = "." ] then echo "Usage: run-mpi processes program" exit fi if [ ! -r MPIhosts ] then echo "Need file MPIhosts in this directory" exit fi mpipath=/usr/local/mpich-1.2.1/bin cmd="$mpipath/mpirun -np $1 -machinefile MPIhosts $2 $3" echo "running command:" echo "$cmd" $cmd