Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f8aa0bda6c8fb45cb6b04c84477e6d955bc99808
[simgrid.git] / examples / gras / mutual-exclusion / simple-token / run.sh
1 #! /bin/bash
2
3 #
4 # USAGE: run.sh  plaform  nb_host 
5 #
6 # This script takes a platform file and a number of hosts as argument.
7 #
8 # It generates the right deployment platform and run the experiment, 
9 #  only showing the last line of the run, showing the resulting time.
10
11 plat=$1
12 nb_host=$2
13
14 set -e
15
16 if [ -z $plat -o -z $nb_host ] ; then
17   # invalid argument. Display the comment at the script begining & exit
18   grep '^#\(\([^!]\)\|$\)' $0 | sed 's/# *//' >&2
19   exit 1
20 fi
21 if ! [ -e $plat ] ; then
22   echo "Platform file not found" >&2
23   exit 1
24 fi
25
26 echo "Generating the deployment"
27 ./make_deployment.pl $plat $nb_host > tmp_deployment_$nb_host
28 echo "Running the experiment"
29 ./tokenS_simulator $plat tmp_deployment_$nb_host 2>&1 |tee run.log|grep "Congrat"
30 rm tmp_deployment_$nb_host