Logo AND Algorithmique Numérique Distribuée

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