From 6e8247d6d132f045d6572bbab7ca6d793c61c6a1 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Thu, 11 Apr 2013 21:54:57 +0200 Subject: [PATCH] parallel: bug with --dryrun and virgin jobs. --- src/parallel | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/parallel b/src/parallel index 424013fc..9200bbb5 100755 --- a/src/parallel +++ b/src/parallel @@ -392,7 +392,7 @@ sub spreadstdin { if(not $anything_written and not eof($in)) { # Nothing was written - maybe the block size < record size? # Increase blocksize exponentially - $blocksize = ceil($blocksize * 1.3); + $blocksize = ceil($blocksize * 1.3 + 1); ::warning("A full record was not matched in a block. Increasing to --blocksize ".$blocksize."\n"); } } @@ -4248,13 +4248,24 @@ sub print { my $self = shift; ::debug(">>joboutput ".$self->replaced()."\n"); + if($opt::pipe and $self->virgin()) { + # Nothing was printed to this job: + # cleanup tmp files if --files was set + unlink $self->{'stdoutfilename'}; + return; + } + if($opt::dryrun) { + # Nothing was printed to this job: + # cleanup tmp files if --files was set + unlink $self->{'stdoutfilename'}; + } # Only relevant for grouping $Global::grouped or return; my $out = $self->stdout(); my $err = $self->stderr(); my $command = $self->sshlogin_wrap(); - if($Global::joblog and not ($opt::pipe and $self->virgin())) { + if($Global::joblog and not $opt::pipe) { my $cmd; if($Global::verbose <= 1) { $cmd = $self->replaced();