mirror of
https://git.savannah.gnu.org/git/parallel.git
synced 2024-11-22 05:57:54 +00:00
parallel: Prototypes on most functions added.
parallel: Control flow for --roundrobin simplyfied.
This commit is contained in:
parent
036319dc09
commit
48b1743b84
1074
src/parallel
1074
src/parallel
File diff suppressed because it is too large
Load diff
|
@ -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'
|
||||
|
|
|
@ -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'
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue