From 1f0122b5308bf080e16c9ae72134609a983fcb7d Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 19 May 2006 10:21:08 +0000 Subject: [PATCH] Roots of the experimentation infrastructure for Ahmed git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2253 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- examples/gras/all2all/.cvsignore | 1 + examples/gras/all2all/make_deployment.pl | 80 ++++++++++++++++++++++++ examples/gras/all2all/run.sh | 29 +++++++++ 3 files changed, 110 insertions(+) create mode 100755 examples/gras/all2all/make_deployment.pl create mode 100755 examples/gras/all2all/run.sh diff --git a/examples/gras/all2all/.cvsignore b/examples/gras/all2all/.cvsignore index 33a2a95f27..9ae05dbc49 100644 --- a/examples/gras/all2all/.cvsignore +++ b/examples/gras/all2all/.cvsignore @@ -3,3 +3,4 @@ all2all_sender all2all_receiver *_simulator test_sg test_rl *.Makefile.am *.Makefile.local *.Makefile.remote *.deploy.sh *.trace +*.log diff --git a/examples/gras/all2all/make_deployment.pl b/examples/gras/all2all/make_deployment.pl new file mode 100755 index 0000000000..cf0e4c063f --- /dev/null +++ b/examples/gras/all2all/make_deployment.pl @@ -0,0 +1,80 @@ +#! /usr/bin/perl + +use strict; + +sub usage { + print STDERR <) { + next unless /\n"; + $it_host ++; + if ($it_host == scalar @host) { + $it_host=0; + $it_port++; + } +} + +# +# and now, really generate the file + +print "\n"; +print "\n"; +print "\n\n"; + +# reset iterators +$it_port=4000; +$it_host=0; + +for (my $i=0; $i<$nb_hosts; $i++) { + print " \n"; + print $receivers; + print " \n"; + + print " \n"; + print " \n"; + print " \n\n"; + + $it_host ++; + if ($it_host == scalar @host) { + $it_host=0; + $it_port++; + } +} + +print "\n"; diff --git a/examples/gras/all2all/run.sh b/examples/gras/all2all/run.sh new file mode 100755 index 0000000000..e27ac159e1 --- /dev/null +++ b/examples/gras/all2all/run.sh @@ -0,0 +1,29 @@ +#! /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" +./all2all_simulator $plat tmp_deployment_$nb_host 2>&1 |tee run.log|grep "Congrat" +rm tmp_deployment_$nb_host -- 2.20.1