parallel: --results test.csv bug incl. testing.

This commit is contained in:
Ole Tange 2018-05-21 10:04:31 +02:00
parent a050662275
commit 94ac9fd72c
8 changed files with 64 additions and 13 deletions

View file

@ -199,7 +199,7 @@ to:parallel@gnu.org, bug-parallel@gnu.org
stable-bcc: Jesse Alama <jessealama@fastmail.fm> stable-bcc: Jesse Alama <jessealama@fastmail.fm>
Subject: GNU Parallel 20180522 ('Korea') released <<[stable]>> Subject: GNU Parallel 20180522 ('Korea/The Great March of Return') released <<[stable]>>
GNU Parallel 20180522 ('') <<[stable]>> has been released. It is available for download at: http://ftpmirror.gnu.org/parallel/ GNU Parallel 20180522 ('') <<[stable]>> has been released. It is available for download at: http://ftpmirror.gnu.org/parallel/
@ -210,6 +210,13 @@ Quote of the month:
<<>> <<>>
New in this release: New in this release:
https://comquest.in/training
https://bash-prompt.net/guides/parallell-bash/
https://blog.uta.edu/xus/2017/09/29/an-easy-way-to-run-parallel-jobs-on-stampede2/
https://opensource.com/article/18/5/gnu-parallel
https://blog.desdelinux.net/gnu-parallel-haz-mas-cosas-simultaneamente-en-el-terminal/
https://www.sans.org/summit-archives/file/summit-archive-1524582079.pdf
「今日から使い切る」ための GNU Parallelによる並列処理入門 「今日から使い切る」ための GNU Parallelによる並列処理入門

View file

@ -1876,7 +1876,7 @@ sub open_csv {
::die_bug("Can't >/dev/null in csv: $!"); ::die_bug("Can't >/dev/null in csv: $!");
$Global::fd{1} = $fd; $Global::fd{1} = $fd;
$Global::fd{2} = $fd; $Global::fd{2} = $fd;
} elsif($Global::csv) { } elsif($Global::csvsep) {
if(not open($Global::csv_fh,">",$opt::results)) { if(not open($Global::csv_fh,">",$opt::results)) {
::error("Cannot open results file `$opt::results': ". ::error("Cannot open results file `$opt::results': ".
"$!."); "$!.");

View file

@ -52,11 +52,15 @@ often be used as a substitute for B<xargs> or B<cat | bash>.
=head2 Reader's guide =head2 Reader's guide
Start by watching the intro videos for a quick introduction: If you prefer reading a book buy B<GNU Parallel 2018> at
http://www.lulu.com/shop/ole-tange/gnu-parallel-2018/paperback/product-23558902.html
or download it at: https://doi.org/10.5281/zenodo.1146014
Otherwise start by watching the intro videos for a quick introduction:
http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1 http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1
Then look at the B<EXAMPLE>s after the list of B<OPTIONS> (Use Then look at the B<EXAMPLE>s after the list of B<OPTIONS> (Use
B<LESS=+/EXAMPLE\: man parallel>). That will give you an idea of what B<LESS=+/EXAMPLE: man parallel>). That will give you an idea of what
GNU B<parallel> is capable of. GNU B<parallel> is capable of.
Then spend an hour walking through the tutorial (B<man Then spend an hour walking through the tutorial (B<man
@ -1513,10 +1517,11 @@ Default: config
=item B<-q> =item B<-q>
Quote I<command>. This will quote the command line so special Quote I<command>. The command must be a simple command (see B<man
characters are not interpreted by the shell. See the section bash>) without redirections and without variable assignments. This
QUOTING. Most people will never need this. Quoting is disabled by will quote the command line and arguments so special characters are
default. not interpreted by the shell. See the section QUOTING. Most people
will never need this. Quoting is disabled by default.
=item B<--no-run-if-empty> =item B<--no-run-if-empty>
@ -4323,7 +4328,8 @@ using -q:
Prints: B<test $VAR> Prints: B<test $VAR>
This is particularly useful if you have lots of quoting. If you want to run a perl script like this: This is particularly useful if you have lots of quoting. If you want
to run a perl script like this:
perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' file perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' file
@ -4351,6 +4357,7 @@ If you get errors like:
sh: Syntax error: Unterminated quoted string sh: Syntax error: Unterminated quoted string
sh: -c: line 0: unexpected EOF while looking for matching `'' sh: -c: line 0: unexpected EOF while looking for matching `''
sh: -c: line 1: syntax error: unexpected end of file sh: -c: line 1: syntax error: unexpected end of file
zsh:1: no matches found:
then you might try using B<-q>. then you might try using B<-q>.

View file

@ -840,6 +840,25 @@ B<--sqlmaster> be the part that shuffles the jobs. The B<--sqlworker>s
simply executes according to Seq number. simply executes according to Seq number.
=head --csv
B<--pipepart> is incompatible with B<--csv> because you can have
records like:
a,b,c
a,"
a,b,c
a,b,c
a,b,c
",c
a,b,c
Here the second record contains a multi-line field that looks like
records. Since B<--pipepart> does not read then whole file when
searching for record endings, it may start reading in this multi-line
field, which would be wrong.
=head2 Buffering on disk =head2 Buffering on disk
GNU B<parallel> buffers output, because if output is not buffered you GNU B<parallel> buffers output, because if output is not buffered you

View file

@ -13,7 +13,7 @@ Start by watching the intro videos for a quick introduction:
http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1 http://www.youtube.com/playlist?list=PL284C9FF2488BC6D1
Then look at the B<EXAMPLE>s after the list of B<OPTIONS> in B<man Then look at the B<EXAMPLE>s after the list of B<OPTIONS> in B<man
parallel> (Use B<LESS=+/EXAMPLE\: man parallel>). That will give you parallel> (Use B<LESS=+/EXAMPLE: man parallel>). That will give you
an idea of what GNU B<parallel> is capable of. an idea of what GNU B<parallel> is capable of.
Then spend a couple of hours walking through this tutorial (B<man Then spend a couple of hours walking through this tutorial (B<man

View file

@ -772,14 +772,16 @@ par_csv_pipe() {
print join",", map {"\"$_\n$_\""} $b*1000..$b*1000+1000; print join",", map {"\"$_\n$_\""} $b*1000..$b*1000+1000;
print "\n" print "\n"
}' | }' |
stdout parallel --pipe --csv -k --block 10k tail -n1 stdout parallel --pipe --csv -k --block 10k tail -n1 |
sort -n
echo 'More records in single block' echo 'More records in single block'
perl -e 'for $b(1..10) { perl -e 'for $b(1..10) {
print join",", map {"\"$_\n$_\""} $b*1000..$b*1000+1000; print join",", map {"\"$_\n$_\""} $b*1000..$b*1000+1000;
print "\n" print "\n"
}' | }' |
stdout parallel --pipe --csv -k --block 100k tail -n1 stdout parallel --pipe --csv -k --block 100k tail -n1 |
sort -n
} }
par_slow_pipe_regexp() { par_slow_pipe_regexp() {
@ -789,6 +791,12 @@ par_slow_pipe_regexp() {
timeout -k 1 60 parallel -N1000 --regexp --pipe --recstart 4 --recend 5 -k wc timeout -k 1 60 parallel -N1000 --regexp --pipe --recstart 4 --recend 5 -k wc
} }
par_results() {
echo "### --results test.csv"
parallel -k --results /tmp/$$.csv echo ::: a b c
rm /tmp/$$.csv
}
export -f $(compgen -A function | grep par_) export -f $(compgen -A function | grep par_)
compgen -A function | grep par_ | sort | compgen -A function | grep par_ | sort |
parallel -j6 --tag -k --joblog +/tmp/jl-`basename $0` '{} 2>&1' parallel -j6 --tag -k --joblog +/tmp/jl-`basename $0` '{} 2>&1'

View file

@ -7,6 +7,12 @@ test -d "parallel-00000000" || mkdir "parallel-00000000"
(cd src && make top_distdir=../parallel-00000000 distdir=../parallel-00000000/src \ (cd src && make top_distdir=../parallel-00000000 distdir=../parallel-00000000/src \
am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir) am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[0]: Entering directory '~/privat/parallel/src' make[0]: Entering directory '~/privat/parallel/src'
pod2man --release='00000000' --center='parallel' \
--section=7 ./parallel_design.pod > ./parallel_design.7n \
&& mv ./parallel_design.7n ./parallel_design.7 \
|| echo "Warning: pod2man not found. Using old parallel_design.7"
/bin/bash: pod2man: command not found
Warning: pod2man not found. Using old parallel_design.7
make[0]: Leaving directory '~/privat/parallel/src' make[0]: Leaving directory '~/privat/parallel/src'
test -n "" \ test -n "" \
|| find "parallel-00000000" -type d ! -perm -755 \ || find "parallel-00000000" -type d ! -perm -755 \

View file

@ -1369,6 +1369,7 @@ par_csv 2"x3" board-Value with ,-Column 3
par_csv_pipe Only pass full records to tail par_csv_pipe Only pass full records to tail
par_csv_pipe Too small block size par_csv_pipe Too small block size
par_csv_pipe parallel: Warning: A record was longer than 10000. Increasing to --blocksize 13001. par_csv_pipe parallel: Warning: A record was longer than 10000. Increasing to --blocksize 13001.
par_csv_pipe parallel: Warning: A record was longer than 13001. Increasing to --blocksize 16903.
par_csv_pipe 2000" par_csv_pipe 2000"
par_csv_pipe 3000" par_csv_pipe 3000"
par_csv_pipe 4000" par_csv_pipe 4000"
@ -1377,7 +1378,6 @@ par_csv_pipe 6000"
par_csv_pipe 7000" par_csv_pipe 7000"
par_csv_pipe 8000" par_csv_pipe 8000"
par_csv_pipe 9000" par_csv_pipe 9000"
par_csv_pipe parallel: Warning: A record was longer than 13001. Increasing to --blocksize 16903.
par_csv_pipe 10000" par_csv_pipe 10000"
par_csv_pipe 11000" par_csv_pipe 11000"
par_csv_pipe More records in single block par_csv_pipe More records in single block
@ -1527,6 +1527,10 @@ par_pipepart_recend_recstart 8
par_pipepart_recend_recstart 9 par_pipepart_recend_recstart 9
par_pipepart_recend_recstart 10 par_pipepart_recend_recstart 10
par_python_children ### bug #49970: Python child process dies if --env is used par_python_children ### bug #49970: Python child process dies if --env is used
par_results ### --results test.csv
par_results a
par_results b
par_results c
par_retries_replacement_string 11 par_retries_replacement_string 11
par_retries_replacement_string 22 par_retries_replacement_string 22
par_retries_replacement_string 22 par_retries_replacement_string 22