From 59fd5ed103bda3262614d77617c896f37cce51e5 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Fri, 1 Nov 2013 17:21:36 +0100 Subject: [PATCH] src/parallel: Small --bar bugs. --- src/parallel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/parallel b/src/parallel index 6328e1d0..814237c5 100755 --- a/src/parallel +++ b/src/parallel @@ -323,7 +323,7 @@ if($opt::pipe and @opt::a) { #print ::my_dump($cmd); } -if($opt::eta or $opt::etas) { +if($opt::eta or $opt::bar) { # Count the number of jobs before starting any $Global::JobQueue->total_jobs(); } @@ -1685,12 +1685,14 @@ sub drain_job_queue { $last_header = $progress{'header'}; } print $Global::original_stderr "\r",$progress{'status'}; + flush $Global::original_stderr; } if($Global::total_running < $Global::max_jobs_running and not $Global::JobQueue->empty()) { # These jobs may not be started because of loadavg # or too little time between each ssh login. if(start_more_jobs() > 0) { + # Exponential back-on if jobs were started $sleep = $sleep/2+0.001; } } @@ -1709,6 +1711,7 @@ sub drain_job_queue { if($opt::progress) { my %progress = progress(); print $Global::original_stderr "\r", $progress{'status'}, "\n"; + flush $Global::original_stderr; } }