#! /bin/bash

while getopts "m:" optkey; do
        case $optkey in
	     m) mapper=$OPTARG;;
        esac
done
shift $((OPTIND-1))

if [ $# -lt 1 ]; then
	echo "usage: imrdenom <project_description_file>"
	exit
fi
Bin="$( readlink -f -- "${0%/*}" )"
des=$1

echo "running IMR"
if [ "$mapper" ]; then
  	$Bin/imr easyrun -m $mapper $des
else
  	$Bin/imr easyrun $des
fi

echo "running DENOM"
$Bin/denom soapinterface $des

echo "running MCMERGE"
$Bin/mcmerge configrun $des
	
