parallel: Prototypes on most functions added.

parallel: Control flow for --roundrobin simplyfied.
This commit is contained in:
Ole Tange 2019-01-01 14:34:04 +01:00
parent 036319dc09
commit 48b1743b84
6 changed files with 580 additions and 535 deletions

File diff suppressed because it is too large Load diff

View file

@ -251,4 +251,4 @@ par_macron() {
export -f $(compgen -A function | grep par_)
compgen -A function | grep par_ | sort |
parallel -j0 --tag -k --joblog /tmp/jl-`basename $0` '{} 2>&1'
parallel --delay 0.3 -j0 --tag -k --joblog /tmp/jl-`basename $0` '{} 2>&1'

View file

@ -245,6 +245,31 @@ par_nice() {
parallel --retries 10 '! kill -TERM' ::: $pid 2>/dev/null
}
par_test_diff_roundrobin_k() {
echo '### test there is difference on -k'
. $(which env_parallel.bash)
mytest() {
K=$1
doit() {
perl -ne 'select(undef, undef, undef, rand()/10000);print' |
md5sum
}
export -f doit
seq 100000 | parallel --block 2k --pipe $K --roundrobin doit | sort
}
export -f mytest
parset a,b,c mytest ::: -k -k ''
# a == b and a != c or error
if [ "$a" == "$b" ]; then
if [ "$a" != "$c" ]; then
echo OK
else
echo error
fi
else
echo error
fi
}
export -f $(compgen -A function | grep par_)
compgen -A function | grep par_ | LC_ALL=C sort | parallel -j6 --tag -k '{} 2>&1'

View file

@ -155,6 +155,8 @@ par_env_parallel_big_env() {
par_no_route_to_host() {
echo '### no route to host with | and -j0 causes inf loop'
# Broken in parallel-20121122 .. parallel-20181022
# parallel-20181022 -j0 -S 185.75.195.218 echo ::: {1..11}
via_parallel() {
seq 11 | stdout parallel -j0 -S $1 echo
}

View file

@ -177,6 +177,8 @@ par_sqlworker_hostname host
par_sqlworker_hostname <hostname>
par_sqlworker_hostname <hostname>
par_sqlworker_hostname <hostname>
par_test_diff_roundrobin_k ### test there is difference on -k
par_test_diff_roundrobin_k OK
par_wrong_slot_rpl_resume ### bug #47644: Wrong slot number replacement when resuming
par_wrong_slot_rpl_resume 1 0
par_wrong_slot_rpl_resume 2 1

View file

@ -92,6 +92,11 @@ X : XXXXXXXXXX.XXX X.XXX X X X X true X
echo '### How do we deal with missing $HOME'
### How do we deal with missing $HOME
unset HOME; stdout perl -w $(which parallel) -k echo ::: 1 2 3
main::shell_quote_scalar() called too early to check prototype at /usr/local/bin/parallel line 2299.
main::Q() called too early to check prototype at /usr/local/bin/parallel line 2306.
main::pQ() called too early to check prototype at /usr/local/bin/parallel line 2353.
Arg::Q() called too early to check prototype at /usr/local/bin/parallel line 11163.
Arg::pQ() called too early to check prototype at /usr/local/bin/parallel line 11169.
parallel: Warning: $HOME not set. Using /tmp.
1
2
@ -99,6 +104,11 @@ parallel: Warning: $HOME not set. Using /tmp.
echo '### How do we deal with missing $SHELL'
### How do we deal with missing $SHELL
unset SHELL; stdout perl -w $(which parallel) -k echo ::: 1 2 3
main::shell_quote_scalar() called too early to check prototype at /usr/local/bin/parallel line 2299.
main::Q() called too early to check prototype at /usr/local/bin/parallel line 2306.
main::pQ() called too early to check prototype at /usr/local/bin/parallel line 2353.
Arg::Q() called too early to check prototype at /usr/local/bin/parallel line 11163.
Arg::pQ() called too early to check prototype at /usr/local/bin/parallel line 11169.
1
2
3