]> mj.ucw.cz Git - bex.git/commitdiff
Implemented skip_on_fail
authorMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 12:45:10 +0000 (13:45 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 12:45:10 +0000 (13:45 +0100)
brun
lib/BEX/Config.pm

diff --git a/brun b/brun
index 8b6daebae3d976a3529d85b23891f30e295e3144..324f23f6dd58c8dae0042197427503a63af3b098 100755 (executable)
--- 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);
index 24a7967fdbec425b59841b39d5326765f9448360..5779e545cd182a9177f66e884a3bc4899b4567a8 100644 (file)
@@ -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(@);