X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fbin%2Fbex-prun;h=5c1c93b866f1f858b6775e05b645810987eec493;hb=383a0f4cdc5f698041df99ab2bcf87fc5a33d772;hp=ec573c1534f471b43596642bfcfe0c813996ed2a;hpb=4f371f18a4dfe98e358875c88c6bfe0b37c0c130;p=bex.git diff --git a/lib/bin/bex-prun b/lib/bin/bex-prun index ec573c1..5c1c93b 100755 --- a/lib/bin/bex-prun +++ b/lib/bin/bex-prun @@ -11,7 +11,7 @@ use BEX; my $queue_name; my $text_mode; -my $debug; +my $debug = 0; my $debug_children; sub usage() { @@ -31,7 +31,7 @@ AMEN GetOptions( "q|queue=s" => \$queue_name, "text!" => \$text_mode, - "debug!" => \$debug, + "debug+" => \$debug, "debug-children!" => \$debug_children, "p|parallel=i" => \$BEX::Config::max_parallel_jobs, "help" => \&usage, @@ -266,7 +266,7 @@ sub place_slot($) { my $pri = $state_to_pri{$host_state{$s->{'Host'}}}; my ($best, $besti); - my $bestpri = -1; + my $bestpri = 99; for my $i (0..$nrows-1) { my $r = $by_row[$i]; if (!defined $r) { @@ -275,11 +275,12 @@ sub place_slot($) { last; } my $rpri = $state_to_pri{$host_state{$r->{'Host'}}}; + print STDERR "I: ... considering ", $r->{'Host'}, " (pri $rpri, lu ", $r->{'LastUpdate'}, ")\n" if $debug > 1; next if $rpri > $pri; if ($rpri < $bestpri || $rpri == $bestpri && $r->{'LastUpdate'} < $best->{'LastUpdate'}) { - # Trick: $best must be defined, as otherwise $bestpri == -1 + # Trick: $best must be defined, as otherwise $bestpri == 99 $best = $r; $besti = $i; $bestpri = $rpri;