From: Martin Mares Date: Mon, 31 Oct 2011 12:45:10 +0000 (+0100) Subject: Implemented skip_on_fail X-Git-Tag: v3.0~43 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=acb510407eae97c8428cd40dca30fb4dacd726a7;p=bex.git Implemented skip_on_fail --- diff --git a/brun b/brun index 8b6daeb..324f23f 100755 --- a/brun +++ b/brun @@ -105,7 +105,7 @@ for my $mach (@machines) { } update_status($mach, '-', 'INIT', undef); my $ping; - for my $jid (@q) { + while (my $jid = shift @q) { if (defined $given_job) { $jid eq $given_job or next; } @@ -140,6 +140,10 @@ for my $mach (@machines) { $queue->remove($mach, $jid); } else { print "--- $s: $msg\n"; + if ($BEX::Config::skip_on_fail) { + print "### Skipping other jobs on the same host ###\n" if @q; + last; + } } } update_status($mach, '-', 'DONE', undef); diff --git a/lib/BEX/Config.pm b/lib/BEX/Config.pm index 24a7967..5779e54 100644 --- a/lib/BEX/Config.pm +++ b/lib/BEX/Config.pm @@ -40,6 +40,11 @@ our $locking_scheme = 'host'; # Maximum number of simultaneously running jobs in `bprun' our $max_parallel_jobs = 5; +# When a job fails, skip all other jobs on the same host +# (however, when locking_scheme is set to `job', another instance of `brun' +# still could run such jobs in parallel) +our $skip_on_fail = 0; + # Various utility functions sub parse_machine_list(@);