]> mj.ucw.cz Git - bex.git/commitdiff
bprun: Maximum number of parallel jobs is configurable in BEX::Config
authorMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 12:02:51 +0000 (13:02 +0100)
committerMartin Mares <mj@ucw.cz>
Mon, 31 Oct 2011 12:02:51 +0000 (13:02 +0100)
An additional command-line switch could be handy, though.

bprun
lib/BEX/Config.pm

diff --git a/bprun b/bprun
index 47ca56962eb3d3c944e2e3c79997dba5757aa06f..0949c4ab28dde28e567767cf84b0d16561db32bb 100755 (executable)
--- a/bprun
+++ b/bprun
@@ -31,7 +31,7 @@ mkfifo $fifo_name, 0700 or die "Cannot create $fifo_name: $!";
 open FIFO, '+<', $fifo_name or die "Cannot open $fifo_name: $!";
 
 my %running = ();
-my $max = 1;   # FIXME
+my $max = $BEX::Config::max_parallel_jobs;
 
 while (%running || @machines) {
        if (@machines && keys %running < $max) {
index 45eebf53e3447b67e9c23506c5baa364993e0a29..24a7967fdbec425b59841b39d5326765f9448360 100644 (file)
@@ -37,6 +37,9 @@ our $ping_hosts = 1;
 #      queue - obtain exclusive access to the whole queue
 our $locking_scheme = 'host';
 
+# Maximum number of simultaneously running jobs in `bprun'
+our $max_parallel_jobs = 5;
+
 # Various utility functions
 
 sub parse_machine_list(@);