parallel: killall() reaps children without doing anything else.

--tmux max length adjusted.
Run each testscript in its own $TMPDIR.
This commit is contained in:
Ole Tange 2015-04-21 00:08:08 +02:00
parent d8a1dc1880
commit fb41b2384c
15 changed files with 220 additions and 158 deletions

View file

@ -1051,7 +1051,7 @@ sub parse_options {
sub init_globals { sub init_globals {
# Defaults: # Defaults:
$Global::version = 20150416; $Global::version = 20150419;
$Global::progname = 'parallel'; $Global::progname = 'parallel';
$Global::infinity = 2**31; $Global::infinity = 2**31;
$Global::debug = 0; $Global::debug = 0;
@ -3046,28 +3046,47 @@ sub killall {
# before we start the blood bath # before we start the blood bath
my @family_pids = family_pids(keys %Global::running); my @family_pids = family_pids(keys %Global::running);
# Send jobs TERM # Send jobs TERM
::debug("kill","TERM ", join(' ',keys %Global::running),"\n");
kill "TERM", keys %Global::running; kill "TERM", keys %Global::running;
# Wait up to 200 ms # Wait up to 200 ms
# Send jobs TERM (again)
my $sleepsum = 0; my $sleepsum = 0;
my $sleep = 0; my $sleep = 0.001;
for (; kill(0, keys %Global::running) and $sleepsum < 200; for (; kill(0, keys %Global::running) and $sleepsum < 200;
$sleepsum += $sleep) { $sleepsum += $sleep) {
# This can change %Global::running # This can change %Global::running
$sleep = ::reap_usleep($sleep); ::debug("kill","Slept $sleepsum\n");
if((my $stiff = waitpid(-1, &WNOHANG)) > 0) {
::debug("kill","reaped $stiff\n");
$Global::total_running--;
delete $Global::running{$stiff};
$sleep = $sleep/2+0.001;
}
$sleep *= 1.1;
::usleep($sleep);
} }
# Send jobs TERM (again)
::debug("kill","TERM ", join(' ',keys %Global::running),"\n");
kill "TERM", keys %Global::running; kill "TERM", keys %Global::running;
# Wait up to 200 ms # Wait up to 200 ms
# Send jobs KILL $sleepsum = 0;
$sleepsum = 0; $sleep = 0.001;
$sleep = 0;
for (; kill(0, keys %Global::running) and $sleepsum < 200; for (; kill(0, keys %Global::running) and $sleepsum < 200;
$sleepsum += $sleep) { $sleepsum += $sleep) {
# This can change %Global::running # This can change %Global::running
$sleep = ::reap_usleep($sleep); if((my $stiff = waitpid(-1, &WNOHANG)) > 0) {
$Global::total_running--;
delete $Global::running{$stiff};
$sleep = $sleep/2+0.001;
}
$sleep *= 1.1;
::usleep($sleep);
} }
# Send jobs KILL
::debug("kill","KILL ", join(' ',keys %Global::running),"\n");
kill "KILL", keys %Global::running; kill "KILL", keys %Global::running;
# Send all (grand*)children KILL (if there are any left) # Send all (grand*)children KILL (if there are any left)
::debug("kill","KILL @family_pids\n");
kill "KILL", @family_pids; kill "KILL", @family_pids;
} }
@ -7410,55 +7429,63 @@ sub set_exitsignal {
} }
{
my $status_printed;
sub should_we_halt { sub should_we_halt {
# Should we halt? Immediately? Gracefully? # Should we halt? Immediately? Gracefully?
# Returns: N/A # Returns: N/A
my $job = shift; my $job = shift;
if($job->exitstatus()) { if($job->exitstatus() or $job->exitsignal()) {
$Global::exitstatus++; $Global::exitstatus++;
$Global::total_failed++; $Global::total_failed++;
if($opt::halt) { if($opt::halt) {
if($opt::halt == 1 if($opt::halt == 1
or or
($opt::halt > 0 and $opt::halt < 1 and $Global::total_failed > 3 ($opt::halt > 0 and $opt::halt < 1 and $Global::total_failed > 3
and and
$Global::total_failed / $Global::total_started > $opt::halt)) { $Global::total_failed / $Global::total_started > $opt::halt)) {
# If halt on error == 1 or --halt 10% # If halt on error == 1 or --halt 10%
# we should gracefully exit # we should gracefully exit
::status ::status
("$Global::progname: Starting no more jobs. ", ("$Global::progname: Starting no more jobs. ",
"Waiting for ", scalar(keys %Global::running), "Waiting for ", scalar(keys %Global::running),
" jobs to finish. This job failed:\n", " jobs to finish. This job failed:\n",
$job->replaced(),"\n"); $job->replaced(),"\n");
$Global::start_no_new_jobs ||= 1; $Global::start_no_new_jobs ||= 1;
$Global::halt_exitstatus = $job->exitstatus(); $Global::halt_exitstatus = $job->exitstatus();
} elsif($opt::halt == 2) { } elsif($opt::halt == 2) {
# If halt on error == 2 we should exit immediately # If halt on error == 2 we should exit immediately
::status if(not $status_printed++) {
("$Global::progname: This job failed:\n", ::status
$job->replaced(),"\n"); ("$Global::progname: This job failed:\n",
exit ($job->exitstatus()); $job->replaced(),"\n");
}
my $status = $job->exitstatus();
::killall();
::wait_and_exit($status);
}
} }
} } else {
} else { if($opt::halt) {
if($opt::halt) { if($opt::halt == -1) {
if($opt::halt == -1) { # If halt on error == -1
# If halt on error == -1 # we should gracefully exit
# we should gracefully exit ::status
::status ("$Global::progname: Starting no more jobs. ",
("$Global::progname: Starting no more jobs. ", "Waiting for ", scalar(keys %Global::running),
"Waiting for ", scalar(keys %Global::running), " jobs to finish. This job succeeded:\n",
" jobs to finish. This job succeeded:\n", $job->replaced(),"\n");
$job->replaced(),"\n"); $Global::start_no_new_jobs ||= 1;
$Global::start_no_new_jobs ||= 1; $Global::halt_exitstatus = $job->exitstatus();
$Global::halt_exitstatus = $job->exitstatus(); } elsif($opt::halt == -2) {
} elsif($opt::halt == -2) { # If halt on error == -2 we should exit immediately
# If halt on error == -2 we should exit immediately ::status
::status ("$Global::progname: This job succeeded:\n",
("$Global::progname: This job succeeded:\n", $job->replaced(),"\n");
$job->replaced(),"\n"); ::killall();
exit ($job->exitstatus()); ::wait_and_exit($job->exitstatus());
}
} }
} }
} }
@ -8404,9 +8431,10 @@ sub tmux_length {
::debug("tmux","tmux-length ",@out); ::debug("tmux","tmux-length ",@out);
chomp @out; chomp @out;
# The arguments is given 3 times on the command line # The arguments is given 3 times on the command line
# and the wrapping is around 50 chars # and the wrapping is around 30 chars
# (29 for tmux1.9, 33 for tmux1.8)
my $tmux_len = (::max(@out)); my $tmux_len = (::max(@out));
$len = ::min($len,int($tmux_len/4-28)); $len = ::min($len,int($tmux_len/4-33));
::debug("tmux","tmux-length ",$len); ::debug("tmux","tmux-length ",$len);
} }
return $len; return $len;

View file

@ -234,7 +234,7 @@ You can map the bad limits using:
perl -e 'map { $a=$_; print map { "$a,$_\n" } (1..17000) } (1..17000)' | shuf > ab; perl -e 'map { $a=$_; print map { "$a,$_\n" } (1..17000) } (1..17000)' | shuf > ab;
cat ab | parallel --colsep , --tagstring '{1}{=$_="\t"=}{2}' cat ab | parallel --colsep , --tagstring '{1}{=$_="\t"=}{2}'
tmux -S /tmp/p{%} new-session -d -n '{=1 $_="O"x$_ =}' true'\ {=2 $_="O"x$_ =};echo $?;rm /tmp/p{%}' tmux -S /tmp/p{%}-'{=1 $_="O"x(rand(200)) =}' new-session -d -n '{=1 $_="O"x$_ =}' true'\ {=2 $_="O"x$_ =};echo $?;rm /tmp/p{%}-O*'
> value.csv 2>/dev/null > value.csv 2>/dev/null
R -e 'a<-read.table("value.csv");X11();plot(a[,1],a[,2],col=a[,3]+5,cex=0.1);Sys.sleep(1000)' R -e 'a<-read.table("value.csv");X11();plot(a[,1],a[,2],col=a[,3]+5,cex=0.1);Sys.sleep(1000)'

View file

@ -10,6 +10,7 @@ export TIMEOUT=$MAX_SEC_PER_TEST
run_test() { run_test() {
script="$1" script="$1"
base=`basename "$script" .sh` base=`basename "$script" .sh`
export TMPDIR=/tmp/$base
if [ "$TRIES" = "3" ] ; then if [ "$TRIES" = "3" ] ; then
# Try 3 times # Try 3 times
bash $script > actual-results/$base bash $script > actual-results/$base

View file

@ -143,7 +143,13 @@ echo '### bug #44614: --pipepart --header off by one'
echo '### TMUX not found' echo '### TMUX not found'
TMUX=not-existing parallel --tmux echo ::: 1 TMUX=not-existing parallel --tmux echo ::: 1
echo '**'
parallel --halt 2 ::: 'sleep 1' burnP6 false; killall burnP6 && echo ERROR: burnP6 should be killed
parallel --halt -2 ::: 'sleep 1' burnP5 true; killall burnP5 && echo ERROR: burnP5 should be killed
EOF EOF
echo '### 1 .par file from --files expected' echo '### 1 .par file from --files expected'
ls /tmp/par*.par /var/tmp/par*.par /tmp/*.tms /tmp/*.tmx 2>/dev/null | wc -l find /tmp{/*,}/*.{par,tms,tmx} 2>/dev/null -mmin -10 | wc -l
find /tmp/par*.par /var/tmp/par*.par /tmp/*.tms /tmp/*.tmx -mmin -10 2>/dev/null | parallel rm find /tmp{/*,}/*.{par,tms,tmx} 2>/dev/null -mmin -10 | parallel rm

View file

@ -1,5 +1,8 @@
#!/bin/bash #!/bin/bash
# /tmp/parallel-local-ssh2 will by default be owned by me and should be writable by *@localhost
chmod 777 "$TMPDIR" 2>/dev/null
cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | stdout parallel -vj5 -k --joblog /tmp/jl-`basename $0` -L1 cat <<'EOF' | sed -e s/\$SERVER1/$SERVER1/\;s/\$SERVER2/$SERVER2/ | stdout parallel -vj5 -k --joblog /tmp/jl-`basename $0` -L1
echo "### bug #43518: GNU Parallel doesn't obey servers' jobs capacity when an ssh login file is reloaded" echo "### bug #43518: GNU Parallel doesn't obey servers' jobs capacity when an ssh login file is reloaded"
# Pre-20141106 Would reset the number of jobs run on all sshlogin if --slf changed # Pre-20141106 Would reset the number of jobs run on all sshlogin if --slf changed
@ -42,8 +45,8 @@ echo '2bug #43358: shellshock breaks exporting functions using --env'
echo '### bug #42999: --pipepart with remote does not work' echo '### bug #42999: --pipepart with remote does not work'
seq 100 > /tmp/bug42999; chmod 600 /tmp/bug42999; seq 100 > /tmp/bug42999; chmod 600 /tmp/bug42999;
parallel --sshdelay 0.3 --pipepart --block 31 -a /tmp/bug42999 -k -S parallel@lo wc; parallel --sshdelay 0.3 --pipepart --block 31 -a /tmp/bug42999 -k -S parallel@lo wc;
parallel --sshdelay 0.2 --pipepart --block 31 -a /tmp/bug42999 -k --fifo -S parallel@lo wc | perl -pe 's:/tmp/fifo\d+:/tmp/fifo0000:' ; parallel --sshdelay 0.2 --pipepart --block 31 -a /tmp/bug42999 -k --fifo -S parallel@lo wc | perl -pe 's:(/tmp\S+fifo)\d+:${1}0000:' ;
parallel --sshdelay 0.1 --pipepart --block 31 -a /tmp/bug42999 -k --cat -S parallel@lo wc | perl -pe 's:/tmp/cat\d+:/tmp/cat0000:' ; parallel --sshdelay 0.1 --pipepart --block 31 -a /tmp/bug42999 -k --cat -S parallel@lo wc | perl -pe 's:(/tmp\S+cat)\d+:${1}0000:' ;
rm /tmp/bug42999 rm /tmp/bug42999
echo '### --cat gives incorrect exit value in csh' echo '### --cat gives incorrect exit value in csh'

View file

@ -46,8 +46,8 @@ echo '### bug #42041: Implement $PARALLEL_JOBSLOT'
echo '### bug #42363: --pipepart and --fifo/--cat does not work' echo '### bug #42363: --pipepart and --fifo/--cat does not work'
seq 100 > /tmp/bug42363; seq 100 > /tmp/bug42363;
parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe 's:/tmp/fifo\d+:/tmp/fifo0000:'; parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe 's:(/tmp\S+fifo)\d+:${1}0000:';
parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe 's:/tmp/cat\d+:/tmp/cat0000:'; parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe 's:(/tmp\S+cat)\d+:${1}0000:';
rm /tmp/bug42363 rm /tmp/bug42363
echo '### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile' echo '### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile'
@ -120,7 +120,7 @@ echo '### added transfersize/returnsize to local jobs'
echo '### --tmux test - check termination' echo '### --tmux test - check termination'
perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' |
stdout parallel --tmux echo {} :::: - ::: a b | stdout parallel --tmux echo {} :::: - ::: a b |
perl -pe 's:/tmp/par......tms:/tmp/parXXXXX.tms:;' perl -pe 's:(/tmp\S+par)......tms:$1XXXXX.tms:;'
EOF EOF

View file

@ -9,7 +9,6 @@ par_tmux() {
(stdout parallel --timeout 3 --tmux --delay .3 echo '{}{=$_="\\"x$_=}'; echo $?) | par_tmux_filter (stdout parallel --timeout 3 --tmux --delay .3 echo '{}{=$_="\\"x$_=}'; echo $?) | par_tmux_filter
} }
export -f par_tmux export -f par_tmux
#j8
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 --retries 2 -k --joblog /tmp/jl-`basename $0` -L1 cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 --retries 2 -k --joblog /tmp/jl-`basename $0` -L1
echo '### tmux1.9' echo '### tmux1.9'
seq 000 100 | TMUX=tmux1.9 par_tmux seq 000 100 | TMUX=tmux1.9 par_tmux
@ -32,8 +31,11 @@ echo '### tmux1.9'
seq 1700 1800 | TMUX=tmux1.9 par_tmux seq 1700 1800 | TMUX=tmux1.9 par_tmux
seq 1800 1900 | TMUX=tmux1.9 par_tmux seq 1800 1900 | TMUX=tmux1.9 par_tmux
seq 1900 2000 | TMUX=tmux1.9 par_tmux seq 1900 2000 | TMUX=tmux1.9 par_tmux
seq 2000 2021 | TMUX=tmux1.9 par_tmux seq 2000 2018 | TMUX=tmux1.9 par_tmux
echo '### tmux1.9 fails' echo '### tmux1.9 fails'
echo 2019 | TMUX=tmux1.9 par_tmux
echo 2020 | TMUX=tmux1.9 par_tmux
echo 2021 | TMUX=tmux1.9 par_tmux
echo 2022 | TMUX=tmux1.9 par_tmux echo 2022 | TMUX=tmux1.9 par_tmux
echo '### tmux1.8' echo '### tmux1.8'
@ -41,8 +43,9 @@ echo '### tmux1.8'
seq 51 100 | TMUX=tmux1.8 par_tmux seq 51 100 | TMUX=tmux1.8 par_tmux
seq 101 150 | TMUX=tmux1.8 par_tmux seq 101 150 | TMUX=tmux1.8 par_tmux
seq 151 200 | TMUX=tmux1.8 par_tmux seq 151 200 | TMUX=tmux1.8 par_tmux
seq 201 232 | TMUX=tmux1.8 par_tmux seq 201 231 | TMUX=tmux1.8 par_tmux
echo '### tmux1.8 fails' echo '### tmux1.8 fails'
echo 232 | TMUX=tmux1.8 par_tmux
echo 233 | TMUX=tmux1.8 par_tmux echo 233 | TMUX=tmux1.8 par_tmux
echo 234 | TMUX=tmux1.8 par_tmux echo 234 | TMUX=tmux1.8 par_tmux
echo 235 | TMUX=tmux1.8 par_tmux echo 235 | TMUX=tmux1.8 par_tmux

0
testsuite/tests-to-run/parallel-polarhome.sh Normal file → Executable file
View file

View file

@ -23,9 +23,9 @@ perl -ne '$/="\n\n"; /^Output/../^[^O]\S/ and next; /^ / and print;' ../../src/
stdout parallel -j7 -vd'\n\n' | stdout parallel -j7 -vd'\n\n' |
perl -pe '$|=1; perl -pe '$|=1;
# --tmux # --tmux
s:/tmp/........../t\d+:/tmp/tmuxtmp:; s:(/tmp\S+par).....(/tms):$1XXXXX$2:;
# --files # --files
s:/tmp/par......(...):/tmp/parXXXXX.$1:; s:(/tmp\S+par).....(....):$1XXXXX$2:;
# --eta --progress # --eta --progress
s/ETA.*//g; s/local:.*//g; s/ETA.*//g; s/local:.*//g;
# Sat Apr 4 11:55:40 CEST 2015 # Sat Apr 4 11:55:40 CEST 2015

View file

@ -307,5 +307,15 @@ echo '### TMUX not found'
### TMUX not found ### TMUX not found
TMUX=not-existing parallel --tmux echo ::: 1 TMUX=not-existing parallel --tmux echo ::: 1
parallel: Error: not-existing not found in $PATH. parallel: Error: not-existing not found in $PATH.
echo '**'
**
parallel --halt 2 ::: 'sleep 1' burnP6 false; killall burnP6 && echo ERROR: burnP6 should be killed
parallel: This job failed:
false
burnP6: no process found
parallel --halt -2 ::: 'sleep 1' burnP5 true; killall burnP5 && echo ERROR: burnP5 should be killed
parallel: This job succeeded:
true
burnP5: no process found
### 1 .par file from --files expected ### 1 .par file from --files expected
1 1

View file

@ -44,7 +44,7 @@ shellshock-hardened to non-shellshock-hardened
Function non-shellshock-hardened Function non-shellshock-hardened
echo '### bug #42999: --pipepart with remote does not work' echo '### bug #42999: --pipepart with remote does not work'
### bug #42999: --pipepart with remote does not work ### bug #42999: --pipepart with remote does not work
seq 100 > /tmp/bug42999; chmod 600 /tmp/bug42999; parallel --sshdelay 0.3 --pipepart --block 31 -a /tmp/bug42999 -k -S parallel@lo wc; parallel --sshdelay 0.2 --pipepart --block 31 -a /tmp/bug42999 -k --fifo -S parallel@lo wc | perl -pe 's:/tmp/fifo\d+:/tmp/fifo0000:' ; parallel --sshdelay 0.1 --pipepart --block 31 -a /tmp/bug42999 -k --cat -S parallel@lo wc | perl -pe 's:/tmp/cat\d+:/tmp/cat0000:' ; rm /tmp/bug42999 seq 100 > /tmp/bug42999; chmod 600 /tmp/bug42999; parallel --sshdelay 0.3 --pipepart --block 31 -a /tmp/bug42999 -k -S parallel@lo wc; parallel --sshdelay 0.2 --pipepart --block 31 -a /tmp/bug42999 -k --fifo -S parallel@lo wc | perl -pe 's:(/tmp\S+fifo)\d+:${1}0000:' ; parallel --sshdelay 0.1 --pipepart --block 31 -a /tmp/bug42999 -k --cat -S parallel@lo wc | perl -pe 's:(/tmp\S+cat)\d+:${1}0000:' ; rm /tmp/bug42999
14 14 33 14 14 33
11 11 33 11 11 33
11 11 33 11 11 33
@ -54,24 +54,24 @@ echo '### bug #42999: --pipepart with remote does not work'
11 11 33 11 11 33
11 11 33 11 11 33
9 9 28 9 9 28
14 14 33 /tmp/fifo0000 14 14 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local-ssh2/fifo0000
9 9 28 /tmp/fifo0000 9 9 28 /tmp/parallel-local-ssh2/fifo0000
14 14 33 /tmp/cat0000 14 14 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local-ssh2/cat0000
9 9 28 /tmp/cat0000 9 9 28 /tmp/parallel-local-ssh2/cat0000
echo '### --cat gives incorrect exit value in csh' echo '### --cat gives incorrect exit value in csh'
### --cat gives incorrect exit value in csh ### --cat gives incorrect exit value in csh
echo false | parallel --pipe --cat -Scsh@lo 'cat {}; false' ; echo $?; echo false | parallel --pipe --cat -Stcsh@lo 'cat {}; false' ; echo $?; echo true | parallel --pipe --cat -Scsh@lo 'cat {}; true' ; echo $?; echo true | parallel --pipe --cat -Stcsh@lo 'cat {}; true' ; echo $?; echo '### --cat and --fifo exit value in bash' echo false | parallel --pipe --cat -Scsh@lo 'cat {}; false' ; echo $?; echo false | parallel --pipe --cat -Stcsh@lo 'cat {}; false' ; echo $?; echo true | parallel --pipe --cat -Scsh@lo 'cat {}; true' ; echo $?; echo true | parallel --pipe --cat -Stcsh@lo 'cat {}; true' ; echo $?; echo '### --cat and --fifo exit value in bash'

View file

@ -48,7 +48,7 @@ echo '### works'
### works ### works
stdout parallel -Sparallel@lo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Sparallel@lo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output'
stdout parallel -Sparallel@lo --tmux echo ::: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | grep -v 'See output' stdout parallel -Sparallel@lo --tmux echo ::: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx | grep -v 'See output'
parallel: Error: Command line too long (402 >= 238) at input 0: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx... parallel: Error: Command line too long (402 >= 236) at input 0: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
echo '### These blocked due to length' echo '### These blocked due to length'
### These blocked due to length ### These blocked due to length
stdout parallel -Slo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output' stdout parallel -Slo --tmux echo ::: \\\\\\\"\\\\\\\"\\\;\@ | grep -v 'See output'

View file

@ -43,25 +43,25 @@ echo '### bug #42041: Implement $PARALLEL_JOBSLOT'
2 2
echo '### bug #42363: --pipepart and --fifo/--cat does not work' echo '### bug #42363: --pipepart and --fifo/--cat does not work'
### bug #42363: --pipepart and --fifo/--cat does not work ### bug #42363: --pipepart and --fifo/--cat does not work
seq 100 > /tmp/bug42363; parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe 's:/tmp/fifo\d+:/tmp/fifo0000:'; parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe 's:/tmp/cat\d+:/tmp/cat0000:'; rm /tmp/bug42363 seq 100 > /tmp/bug42363; parallel --pipepart --block 31 -a /tmp/bug42363 -k --fifo wc | perl -pe 's:(/tmp\S+fifo)\d+:${1}0000:'; parallel --pipepart --block 31 -a /tmp/bug42363 -k --cat wc | perl -pe 's:(/tmp\S+cat)\d+:${1}0000:'; rm /tmp/bug42363
14 14 33 /tmp/fifo0000 14 14 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
11 11 33 /tmp/fifo0000 11 11 33 /tmp/parallel-local22/fifo0000
9 9 28 /tmp/fifo0000 9 9 28 /tmp/parallel-local22/fifo0000
14 14 33 /tmp/cat0000 14 14 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
11 11 33 /tmp/cat0000 11 11 33 /tmp/parallel-local22/cat0000
9 9 28 /tmp/cat0000 9 9 28 /tmp/parallel-local22/cat0000
echo '### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile' echo '### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile'
### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile ### bug #42055: --pipepart -a bigfile should not require sequential reading of bigfile
parallel --pipepart -a /etc/passwd -L 1 should not be run parallel --pipepart -a /etc/passwd -L 1 should not be run
@ -353,5 +353,5 @@ Send Receive Exitval
Send Receive Exitval Send Receive Exitval
echo '### --tmux test - check termination' echo '### --tmux test - check termination'
### --tmux test - check termination ### --tmux test - check termination
perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | stdout parallel --tmux echo {} :::: - ::: a b | perl -pe 's:/tmp/par......tms:/tmp/parXXXXX.tms:;' perl -e 'map {printf "$_%o%c\n",$_,$_}1..255' | stdout parallel --tmux echo {} :::: - ::: a b | perl -pe 's:(/tmp\S+par)......tms:$1XXXXX.tms:;'
See output with: tmux -S /tmp/parXXXXX.tms attach See output with: tmux -S /tmp/parallel-local22/parXXXXX.tms attach

View file

@ -1,127 +1,138 @@
echo '### tmux1.9' echo '### tmux1.9'
### tmux1.9 ### tmux1.9
seq 000 100 | TMUX=tmux1.9 par_tmux seq 000 100 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 100 200 | TMUX=tmux1.9 par_tmux seq 100 200 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 200 300 | TMUX=tmux1.9 par_tmux seq 200 300 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 300 400 | TMUX=tmux1.9 par_tmux seq 300 400 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 400 500 | TMUX=tmux1.9 par_tmux seq 400 500 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 500 600 | TMUX=tmux1.9 par_tmux seq 500 600 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 600 700 | TMUX=tmux1.9 par_tmux seq 600 700 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 700 800 | TMUX=tmux1.9 par_tmux seq 700 800 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 800 900 | TMUX=tmux1.9 par_tmux seq 800 900 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 900 1000 | TMUX=tmux1.9 par_tmux seq 900 1000 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1000 1100 | TMUX=tmux1.9 par_tmux seq 1000 1100 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1100 1200 | TMUX=tmux1.9 par_tmux seq 1100 1200 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1200 1300 | TMUX=tmux1.9 par_tmux seq 1200 1300 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1300 1400 | TMUX=tmux1.9 par_tmux seq 1300 1400 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1400 1500 | TMUX=tmux1.9 par_tmux seq 1400 1500 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1500 1600 | TMUX=tmux1.9 par_tmux seq 1500 1600 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1600 1700 | TMUX=tmux1.9 par_tmux seq 1600 1700 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1700 1800 | TMUX=tmux1.9 par_tmux seq 1700 1800 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1800 1900 | TMUX=tmux1.9 par_tmux seq 1800 1900 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 1900 2000 | TMUX=tmux1.9 par_tmux seq 1900 2000 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 2000 2021 | TMUX=tmux1.9 par_tmux seq 2000 2018 | TMUX=tmux1.9 par_tmux
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
echo '### tmux1.9 fails' echo '### tmux1.9 fails'
### tmux1.9 fails ### tmux1.9 fails
echo 2019 | TMUX=tmux1.9 par_tmux
parallel: Error: Command line too long (4047 >= 4047) at input 0: 2019
255
echo 2020 | TMUX=tmux1.9 par_tmux
parallel: Error: Command line too long (4049 >= 4047) at input 0: 2020
255
echo 2021 | TMUX=tmux1.9 par_tmux
parallel: Error: Command line too long (4051 >= 4047) at input 0: 2021
255
echo 2022 | TMUX=tmux1.9 par_tmux echo 2022 | TMUX=tmux1.9 par_tmux
parallel: Error: Command line too long (4053 >= 4052) at input 0: 2022 parallel: Error: Command line too long (4053 >= 4047) at input 0: 2022
255 255
echo '### tmux1.8' echo '### tmux1.8'
### tmux1.8 ### tmux1.8
seq 1 50 | TMUX=tmux1.8 par_tmux seq 1 50 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 51 100 | TMUX=tmux1.8 par_tmux seq 51 100 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 101 150 | TMUX=tmux1.8 par_tmux seq 101 150 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 151 200 | TMUX=tmux1.8 par_tmux seq 151 200 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
seq 201 232 | TMUX=tmux1.8 par_tmux seq 201 231 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
echo '### tmux1.8 fails' echo '### tmux1.8 fails'
### tmux1.8 fails ### tmux1.8 fails
echo 232 | TMUX=tmux1.8 par_tmux
parallel: Error: Command line too long (472 >= 472) at input 0: 232
255
echo 233 | TMUX=tmux1.8 par_tmux echo 233 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach parallel: Error: Command line too long (474 >= 472) at input 0: 233
0 255
echo 234 | TMUX=tmux1.8 par_tmux echo 234 | TMUX=tmux1.8 par_tmux
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach parallel: Error: Command line too long (476 >= 472) at input 0: 234
command too long 255
1
echo 235 | TMUX=tmux1.8 par_tmux echo 235 | TMUX=tmux1.8 par_tmux
parallel: Error: Command line too long (478 >= 477) at input 0: 235 parallel: Error: Command line too long (478 >= 472) at input 0: 235
255 255
echo 236 | TMUX=tmux1.8 par_tmux echo 236 | TMUX=tmux1.8 par_tmux
parallel: Error: Command line too long (480 >= 477) at input 0: 236 parallel: Error: Command line too long (480 >= 472) at input 0: 236
255 255
echo '### tmux1.8 0..255 ascii' echo '### tmux1.8 0..255 ascii'
### tmux1.8 0..255 ascii ### tmux1.8 0..255 ascii
perl -e 'print map { ($_, map { pack("c*",$_) } grep { $_>=1 && $_!=10 } 0..$_),"\n" } 0..255' | TMUX=tmux1.8 stdout parallel --tmux --timeout 3 echo | par_tmux_filter; echo $? perl -e 'print map { ($_, map { pack("c*",$_) } grep { $_>=1 && $_!=10 } 0..$_),"\n" } 0..255' | TMUX=tmux1.8 stdout parallel --tmux --timeout 3 echo | par_tmux_filter; echo $?
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
echo '### tmux1.9 0..255 ascii' echo '### tmux1.9 0..255 ascii'
### tmux1.9 0..255 ascii ### tmux1.9 0..255 ascii
perl -e 'print map { ($_, map { pack("c*",$_) } grep { $_>=1 && $_!=10 } 0..$_),"\n" } 0..255' | TMUX=tmux1.9 stdout parallel --tmux --timeout 3 echo | par_tmux_filter; echo $? perl -e 'print map { ($_, map { pack("c*",$_) } grep { $_>=1 && $_!=10 } 0..$_),"\n" } 0..255' | TMUX=tmux1.9 stdout parallel --tmux --timeout 3 echo | par_tmux_filter; echo $?
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
0 0
echo '### Test output ascii' echo '### Test output ascii'
### Test output ascii ### Test output ascii
rm -f /tmp/paralocal7*; perl -e 'print map { ($_, map { pack("c*",$_) } grep { $_!=10 } 1..$_),"\n" } 1..255' | stdout parallel --tmux echo {}'>>/tmp/paralocal7{%}' | par_tmux_filter; sort /tmp/paralocal7* | md5sum rm -f /tmp/paralocal7*; perl -e 'print map { ($_, map { pack("c*",$_) } grep { $_!=10 } 1..$_),"\n" } 1..255' | stdout parallel --tmux echo {}'>>/tmp/paralocal7{%}' | par_tmux_filter; sort /tmp/paralocal7* | md5sum
See output with: tmux -S /tmp/parXXXXX.tms attach See output with: tmux -S /tmp/parallel-local7/parXXXXX.tms attach
a7ee232967c8aab2edf227169e8cdce0 - a7ee232967c8aab2edf227169e8cdce0 -
echo '### Test critical lengths. Must not block' echo '### Test critical lengths. Must not block'
### Test critical lengths. Must not block ### Test critical lengths. Must not block
seq 70 130 | TMUX=tmux1.8 stdout parallel --tmux echo '{}{=$_="&"x$_=}' | par_tmux_filter seq 70 130 | TMUX=tmux1.8 stdout parallel --tmux echo '{}{=$_="&"x$_=}' | par_tmux_filter
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
seq 70 130 | TMUX=tmux1.9 stdout parallel --tmux echo '{}{=$_="&"x$_=}' | par_tmux_filter seq 70 130 | TMUX=tmux1.9 stdout parallel --tmux echo '{}{=$_="&"x$_=}' | par_tmux_filter
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach
seq 280 425 | TMUX=tmux1.8 stdout parallel --tmux echo '{}{=$_="a"x$_=}' | par_tmux_filter seq 280 425 | TMUX=tmux1.8 stdout parallel --tmux echo '{}{=$_="a"x$_=}' | par_tmux_filter
See output with: tmux1.8 -S /tmp/parXXXXX.tms attach See output with: tmux1.8 -S /tmp/parallel-local7/parXXXXX.tms attach
seq 280 425 | TMUX=tmux1.9 stdout parallel --tmux echo '{}{=$_="a"x$_=}' | par_tmux_filter seq 280 425 | TMUX=tmux1.9 stdout parallel --tmux echo '{}{=$_="a"x$_=}' | par_tmux_filter
See output with: tmux1.9 -S /tmp/parXXXXX.tms attach See output with: tmux1.9 -S /tmp/parallel-local7/parXXXXX.tms attach

View file

@ -345,9 +345,9 @@ echo C
1-middle 1-middle
1-end 1-end
parallel --files echo ::: A B C parallel --files echo ::: A B C
/tmp/parXXXXX.par /tmp/parallel-tutorial/parXXXXX.par
/tmp/parXXXXX.par /tmp/parallel-tutorial/parXXXXX.par
/tmp/parXXXXX.par /tmp/parallel-tutorial/parXXXXX.par
parallel --tmpdir /var/tmp --files echo ::: A B C parallel --tmpdir /var/tmp --files echo ::: A B C
/var/tmp/parXXXXX.par /var/tmp/parXXXXX.par
/var/tmp/parXXXXX.par /var/tmp/parXXXXX.par
@ -406,7 +406,7 @@ B D
parallel --use-cpus-instead-of-cores -N0 sleep 1 :::: num8 parallel --use-cpus-instead-of-cores -N0 sleep 1 :::: num8
seq 10 20 | parallel --tmux 'echo start {}; sleep {}; echo done {}' seq 10 20 | parallel --tmux 'echo start {}; sleep {}; echo done {}'
See output with: tmux -S /tmp/parXXXXX.tmux attach See output with: tmux -S /tmp/parallel-tutorial/parXXXXX.tms attach
tmux -S /tmp/parXXXXX.tms attach tmux -S /tmp/parXXXXX.tms attach
no sessions no sessions
parallel --delay 2.5 echo Starting {}\;date ::: 1 2 3 parallel --delay 2.5 echo Starting {}\;date ::: 1 2 3