#!/bin/bash
# 	./config.status  --file=ff-mpirun:ff-mpirun.in
mpirun=mpirun
prefix="/usr"
exec_prefix="${prefix}"
bindir="${exec_prefix}/bin"
if [ -n "/usr/bin/mpirun"  ] ;then mpirun="/usr/bin/mpirun"  ; fi
ffmpi=FreeFem++-mpi
if [ -d "$bindir" ]  ;then export PATH="${exec_prefix}/bin:$PATH"  ; fi
a[0]="$mpirun"
j=1;
#echo $1 ---
while test -n "$1" ; do
((j=$j+1))
((j1=$j+1))
#echo --- $1 --  $j1 $j
case "$1" in
*.edp) a[$j]="${ffmpi}";a[$j1]="$1";j=j1;;
#if[ ! -f "$1" ]; then echo error file no found "$1"; dry=2; fi;;
-dry) dry=1;; 
*)  a[$j]="$1";;
esac
shift
done
echo "${a[*]}"
if [ -n "$dry" ]; then echo which $ffmpi : `which  "$ffmpi"`; fi
if [ -z "$dry" ]; then eval  "${a[*]}"; fi
