Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
e27ac159e1f9242dd95e68003cb2e894e8d84a7b
[simgrid.git] / examples / gras / all2all / 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 set -e
14
15 if [ -z $plat -o -z $nb_host ] ; then
16   # invalid argument. Display the comment at the script begining & exit
17   grep '^#\(\([^!]\)\|$\)' $0 | sed 's/# *//' >&2
18   exit 1
19 fi
20 if ! [ -e $plat ] ; then
21   echo "Platform file not found" >&2
22   exit 1
23 fi
24
25 echo "Generating the deployment"
26 ./make_deployment.pl $plat $nb_host > tmp_deployment_$nb_host
27 echo "Running the experiment"
28 ./all2all_simulator $plat tmp_deployment_$nb_host 2>&1 |tee run.log|grep "Congrat"
29 rm tmp_deployment_$nb_host