From 6a34b10f1a57e759d956330986fa4eff7c51f0d3 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Mon, 31 Oct 2011 13:02:51 +0100 Subject: [PATCH] bprun: Maximum number of parallel jobs is configurable in BEX::Config An additional command-line switch could be handy, though. --- bprun | 2 +- lib/BEX/Config.pm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bprun b/bprun index 47ca569..0949c4a 100755 --- 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) { diff --git a/lib/BEX/Config.pm b/lib/BEX/Config.pm index 45eebf5..24a7967 100644 --- a/lib/BEX/Config.pm +++ b/lib/BEX/Config.pm @@ -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(@); -- 2.39.2