From c32e526741a2dfdb108e056ae1787b1692d7461f Mon Sep 17 00:00:00 2001 From: eyraudl Date: Mon, 27 Aug 2007 14:29:30 +0000 Subject: [PATCH] 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 --- .../mutual_exclusion/simple_token/make_deployment.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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"; -- 2.20.1