From: eyraudl Date: Mon, 27 Aug 2007 14:29:30 +0000 (+0000) Subject: Allow no specification of number of hosts on the command line : uses all available... X-Git-Tag: v3.3~1239 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c32e526741a2dfdb108e056ae1787b1692d7461f?ds=sidebyside Allow no specification of number of hosts on the command line : uses all available hosts. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4121 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/examples/gras/mutual_exclusion/simple_token/make_deployment.pl b/examples/gras/mutual_exclusion/simple_token/make_deployment.pl index 5e69debd6e..e863a89546 100755 --- a/examples/gras/mutual_exclusion/simple_token/make_deployment.pl +++ b/examples/gras/mutual_exclusion/simple_token/make_deployment.pl @@ -3,7 +3,7 @@ use strict; my $input = shift @ARGV || die "Usage: $ARGV[0] platform_file.xml nb_host\n"; -my $nb_hosts = shift @ARGV || die "Usage: $ARGV[0] platform_file.xml nb_host\n"; +my $nb_hosts = shift @ARGV || 0; my @host; @@ -15,6 +15,13 @@ while () { push @host, $1; } +die "No host found in $input. Is it really a SimGrid platform file?\nCheck that you didn't pass a deployment file, for example.\n" + unless (scalar @host); + +if (! $nb_hosts) { + $nb_hosts = scalar @host; +} + # map { print "$_\n" } @host; print "\n";