X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/276f2858f5bb7a929fa20bd754d2d412bf3efbb4..02cf8d9200bd27cb2cc551848069de4803425927:/examples/gras/mutual_exclusion/simple_token/run.sh diff --git a/examples/gras/mutual_exclusion/simple_token/run.sh b/examples/gras/mutual_exclusion/simple_token/run.sh new file mode 100755 index 0000000000..f8aa0bda6c --- /dev/null +++ b/examples/gras/mutual_exclusion/simple_token/run.sh @@ -0,0 +1,30 @@ +#! /bin/bash + +# +# USAGE: run.sh plaform nb_host +# +# This script takes a platform file and a number of hosts as argument. +# +# It generates the right deployment platform and run the experiment, +# only showing the last line of the run, showing the resulting time. + +plat=$1 +nb_host=$2 + +set -e + +if [ -z $plat -o -z $nb_host ] ; then + # invalid argument. Display the comment at the script begining & exit + grep '^#\(\([^!]\)\|$\)' $0 | sed 's/# *//' >&2 + exit 1 +fi +if ! [ -e $plat ] ; then + echo "Platform file not found" >&2 + exit 1 +fi + +echo "Generating the deployment" +./make_deployment.pl $plat $nb_host > tmp_deployment_$nb_host +echo "Running the experiment" +./tokenS_simulator $plat tmp_deployment_$nb_host 2>&1 |tee run.log|grep "Congrat" +rm tmp_deployment_$nb_host