From 1cc9c990a43181a0a9eb6a7ff1e99991a968a4c2 Mon Sep 17 00:00:00 2001 From: Ole Tange Date: Wed, 5 Jan 2011 18:10:58 +0100 Subject: [PATCH] parallel: fixed: seq 9 | parallel -N 10 echo --- doc/release_new_version | 10 ++++++++-- src/parallel | 6 +++--- testsuite/tests-to-run/test48.sh | 7 +++++++ testsuite/wanted-results/test39 | 3 ++- testsuite/wanted-results/test48 | 5 +++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/doc/release_new_version b/doc/release_new_version index 98aff01a..99b5ad8f 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -136,16 +136,22 @@ cc:Peter Simons , Sandro Cazzaniga , ryoichiro.suzuki@gmail.com,kerick@shiftedbit.net, Christian Faulhammer -Subject: GNU Parallel 2010XXXX released +Subject: GNU Parallel 2011XXXX released -GNU Parallel 2010XXXX has been released. It is available for +GNU Parallel 2011XXXX has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/ New in this release: +* Review in Spanish (in print). + https://www.linux-magazine.es/issue/67/moreinfo.html + * Review in French. Thanks to Denis Dordoigne. http://linuxfr.org/2010/12/29/27715.html +* Use case for memcache. + http://www.dctrwatson.com/2010/12/how-to-dump-memcache-keyvalue-pairs-fast/ + * Bug fixes and man page updates. = About GNU Parallel = diff --git a/src/parallel b/src/parallel index 0eee4231..32198302 100755 --- a/src/parallel +++ b/src/parallel @@ -2784,9 +2784,9 @@ sub populate { } } } - if($self->{'arg_queue'}->empty() and not $CommandLine::already_spread) { - # EOF => Spread the arguments over all jobslots (unless they - # are already spread) + if(($::opt_m or $::opt_X) and not $CommandLine::already_spread and $self->{'arg_queue'}->empty()) { + # -m or -X and EOF => Spread the arguments over all jobslots + # (unless they are already spread) $CommandLine::already_spread++; if($self->number_of_args() > 1) { $self->{'max_number_of_args'} = diff --git a/testsuite/tests-to-run/test48.sh b/testsuite/tests-to-run/test48.sh index 87e3ffbd..b8d0aac0 100644 --- a/testsuite/tests-to-run/test48.sh +++ b/testsuite/tests-to-run/test48.sh @@ -9,5 +9,12 @@ seq 1 92 | parallel -j+3 -kX -s 100 echo echo '### Test distribute arguments at EOF to infinity jobslots' seq 1 92 | parallel -j0 -kX -s 100 echo +echo '### Test -N is not broken by distribution - single line' +seq 9 | parallel -N 10 echo + +echo '### Test -N is not broken by distribution - two lines' +seq 19 | parallel -N 10 echo + + diff --git a/testsuite/wanted-results/test39 b/testsuite/wanted-results/test39 index 24184ff9..1bc259f5 100644 --- a/testsuite/wanted-results/test39 +++ b/testsuite/wanted-results/test39 @@ -49,7 +49,8 @@ a_b_c_{4} a_b_c_d ### Test empty input ### Test -m -1 2 +1 +2 ### Test ::: 1 ### Test context_replace diff --git a/testsuite/wanted-results/test48 b/testsuite/wanted-results/test48 index 7d12cdd9..29b9f73e 100644 --- a/testsuite/wanted-results/test48 +++ b/testsuite/wanted-results/test48 @@ -41,3 +41,8 @@ 90 91 92 +### Test -N is not broken by distribution - single line +1 2 3 4 5 6 7 8 9 +### Test -N is not broken by distribution - two lines +1 2 3 4 5 6 7 8 9 10 +11 12 13 14 15 16 17 18 19