diff --git a/doc/release_new_version b/doc/release_new_version index e0bc5aa9..e62f4b05 100644 --- a/doc/release_new_version +++ b/doc/release_new_version @@ -212,7 +212,7 @@ cc:Tim Cuthbertson , Ryoichiro Suzuki , Jesse Alama -Subject: GNU Parallel 20151022 ('Liquid Water') released <<[stable]>> +Subject: GNU Parallel 20151022 ('Liquid Water / 9N314M') released <<[stable]>> GNU Parallel 20151022 ('Liquid Water') <<[stable]>> has been released. It is available for download at: http://ftp.gnu.org/gnu/parallel/ diff --git a/src/parallel b/src/parallel index e025a4d0..18264851 100755 --- a/src/parallel +++ b/src/parallel @@ -109,20 +109,15 @@ if($opt::nonall or $opt::onall) { $Global::JobQueue = JobQueue->new( \@command,\@input_source_fh,$Global::ContextReplace,$number_of_args,\@Global::ret_files); -if($opt::eta or $opt::bar or $opt::shuf or $Global::halt_pct) { - # Count the number of jobs or shuffle all jobs - # before starting any - $Global::JobQueue->total_jobs(); -} -# Compute $Global::max_jobs_running -for my $sshlogin (values %Global::host) { - $sshlogin->max_jobs_running(); -} if($opt::pipepart) { if($opt::roundrobin) { # Compute size of -a my $size = 0; $size += -s $_ for @opt::a; + # Compute $Global::max_jobs_running + for my $sshlogin (values %Global::host) { + $sshlogin->max_jobs_running(); + } $Global::max_jobs_running or ::die_bug("Global::max_jobs_running not set"); # Set --blocksize = size / no of proc $opt::blocksize = 1 + $size / $Global::max_jobs_running; @@ -133,6 +128,17 @@ if($opt::pipepart) { map { $Global::JobQueue->{'commandlinequeue'}->get() } @Global::cat_partials ); } +if($opt::eta or $opt::bar or $opt::shuf or $Global::halt_pct) { + # Count the number of jobs or shuffle all jobs + # before starting any. + # Must be done after ungetting any --pipepart jobs. + $Global::JobQueue->total_jobs(); +} +# Compute $Global::max_jobs_running +# Must be done after ungetting any --pipepart jobs. +for my $sshlogin (values %Global::host) { + $sshlogin->max_jobs_running(); +} init_run_jobs(); my $sem; diff --git a/src/parallel.pod b/src/parallel.pod index 2655d2e5..2b49aa01 100644 --- a/src/parallel.pod +++ b/src/parallel.pod @@ -666,15 +666,8 @@ cannot be exported: 'my_importer; echo "{}" "${indexed[{}]}" "${assoc[${indexed[{}]}]}"' ::: "${!indexed[@]}" To copy the full environment (both exported and not exported variables -and functions) use this function (e.g. by putting it in .bashrc): +and functions) use env_parallel as described under the option I. - env_parallel() { - export parallel_bash_environment="$(echo "shopt -s expand_aliases 2>/dev/null"; alias;typeset -p | grep -vFf <(readonly; echo GROUPS; echo FUNCNAME; echo DIRSTACK; echo _; echo PIPESTATUS; echo USERNAME) | grep -v BASH_;typeset -f)"; - `which parallel` "$@"; - unset parallel_bash_environment; - } - # call as: - env_parallel [normal parallel options] See also: B<--record-env>. diff --git a/src/parallel_design.pod b/src/parallel_design.pod index 004a3847..809b2c06 100644 --- a/src/parallel_design.pod +++ b/src/parallel_design.pod @@ -125,21 +125,28 @@ templates. Templates can be wrapped in other templates. =item --shellquote -echo <> +echo I =item --nice I -\nice -n I $shell -c <> +\nice -n I I -c I The \ is needed to avoid using the builtin nice command, which does not -support -n in B. B<$shell -c> is needed to nice composed commands +support -n in B. B -c> is needed to nice composed commands command. =item --cat -(cat > {}; <> {}; perl -e '$bash=shift; $csh=shift; for(@ARGV) -{unlink;rmdir;} if($bash=~s/h//) {exit$bash;} exit$csh;' "$?h" -"$status" {}); +cat > {}; I {}; +perl -e '$bash = shift; + $csh = shift; + for(@ARGV) { + unlink;rmdir; + } + if($bash =~ s/h//) { + exit $bash; + } + exit $csh;' "$?h" "$status" {}; {} is set to $PARALLEL_TMP which is a tmpfile. The Perl script saves the exit value, unlinks the tmpfile, and returns the exit value - no @@ -148,30 +155,35 @@ matter if the shell is B (using $?) or B<*csh> (using $status). =item --fifo perl -e '($s,$c,$f) = @ARGV; -system "mkfifo", $f; -$pid = fork || exec $s, "-c", $c; -open($o,">",$f) || die $!; -while(sysread(STDIN,$buf,32768)){ - syswrite $o, $buf; -} -close $o; -waitpid $pid,0; -unlink $f; -exit $?/256;' $shell <> $PARALLEL_TMP + # mkfifo $PARALLEL_TMP + system "mkfifo", $f; + # spawn $shell -c $command & + $pid = fork || exec $s, "-c", $c; + open($o,">",$f) || die $!; + # cat > $PARALLEL_TMP + while(sysread(STDIN,$buf,131072)){ + syswrite $o, $buf; + } + close $o; + # waitpid to get the exit code from $command + waitpid $pid,0; + # Cleanup + unlink $f; + exit $?/256;' I I $PARALLEL_TMP -This is an elaborate way of: mkfifo {}; run <> in the -background using $shell; copying STDIN to {}; waiting for background -to complete; remove {} and exit with the exit code from <>. +This is an elaborate way of: mkfifo {}; run I in the +background using I; copying STDIN to {}; waiting for background +to complete; remove {} and exit with the exit code from I. It is made this way to be compatible with B<*csh>. =item --sshlogin I -ssh I <> +ssh I I =item --transfer -( ssh I mkdir -p ./I;rsync --protocol 30 -rlDzR -essh ./{} I:./I ); <> +( ssh I mkdir -p ./I;rsync --protocol 30 -rlDzR -essh ./{} I:./I ); I Read about B<--protocol 30> in the section B. @@ -181,7 +193,7 @@ Read about B<--protocol 30> in the section B. =item --return I -<>; _EXIT_status=$?; mkdir -p I; rsync --protocol 30 --rsync-path=cd\ ./I\;\ rsync -rlDzR -essh I:./I ./I; exit $_EXIT_status; +I; _EXIT_status=$?; mkdir -p I; rsync --protocol 30 --rsync-path=cd\ ./I\;\ rsync -rlDzR -essh I:./I ./I; exit $_EXIT_status; The B<--rsync-path=cd ...> is needed because old versions of B do not support B<--no-implied-dirs>. @@ -192,7 +204,7 @@ wrapping 'sh -c' is enough? =item --cleanup -<> _EXIT_status=$?; <> +I _EXIT_status=$?; <> ssh I \(rm\ -f\ ./I/{}\;\ rmdir\ ./I\ \>\&/dev/null\;\); exit $_EXIT_status; @@ -201,14 +213,32 @@ B<$_EXIT_status>: see B<--return> above. =item --pipe -sh -c 'dd bs=1 count=1 of=I 2>/dev/null'; test ! -s "I" && rm -f "I" && exec true; (cat I; rm I; cat - ) | ( <> ); +perl -e 'if(sysread(STDIN, $buf, 1)) { + open($fh, "|-", "@ARGV") || die; + syswrite($fh, $buf); + # Align up to 128k block + if($read = sysread(STDIN, $buf, 131071)) { + syswrite($fh, $buf); + } + while($read = sysread(STDIN, $buf, 131072)) { + syswrite($fh, $buf); + } + close $fh; + exit ($?&127 ? 128+($?&127) : 1+$?>>8) + }' I -c I -This small wrapper makes sure that <> will never be run if -there is no data. B is needed to hide stderr if the user's -shell is B (which cannot hide stderr). +This small wrapper makes sure that I will never be run if +there is no data. =item --tmux +<> +mkfifo /tmp/tmx3cMEV && + sh -c 'tmux -S /tmp/tmsaKpv1 new-session -s p334310 -d "sleep .2" >/dev/null 2>&1'; +tmux -S /tmp/tmsaKpv1 new-window -t p334310 -n wc\ 10 \(wc\ 10\)\;\ perl\ -e\ \'while\(\$t++\<3\)\{\ print\ \$ARGV\[0\],\"\\n\"\ \}\'\ \$\?h/\$status\ \>\>\ /tmp/tmx3cMEV\&echo\ wc\\\ 10\;\ echo\ \Job\ finished\ at:\ \`date\`\;sleep\ 10; +exec perl -e '$/="/";$_=<>;$c=<>;unlink $ARGV; /(\d+)h/ and exit($1);exit$c' /tmp/tmx3cMEV + + mkfifo I; tmux -S new-session -s pI -d 'sleep .2' >&/dev/null; tmux -S new-window -t pI -n <> \(<>\)\;\ perl\ -e\ \'while\(\$t++\<3\)\{\ print\ \$ARGV\[0\],\"\\n\"\ \}\'\ \$\?h/\$status\ \>\>\ I\&echo\ <>\;echo\ \Job\ finished\ at:\ \`date\`\;sleep\ 10; diff --git a/testsuite/tests-to-run/parallel-local-10s.sh b/testsuite/tests-to-run/parallel-local-10s.sh index 24ec55aa..b2b08901 100644 --- a/testsuite/tests-to-run/parallel-local-10s.sh +++ b/testsuite/tests-to-run/parallel-local-10s.sh @@ -4,6 +4,25 @@ # Each should be taking 10-30s and be possible to run in parallel # I.e.: No race conditions, no logins cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1 +echo '### bug #46214: Using --pipepart doesnt spawn multiple jobs in version 20150922' + seq 1000000 > /tmp/num1000000; + stdout parallel --pipepart --progress -a /tmp/num1000000 --block 10k -j0 true |grep 1:local + +echo '**' + +testhalt() { + echo '### testhalt --halt '$1; + (yes 0 | head -n 10; seq 10) | stdout parallel -kj4 --halt $1 'sleep {= $_=$_*0.3+1 =}; exit {}'; echo $?; + (seq 10; yes 0 | head -n 10) | stdout parallel -kj4 --halt $1 'sleep {= $_=$_*0.3+1 =}; exit {}'; echo $?; +}; +export -f testhalt; + parallel -kj0 testhalt ::: now,fail=0 now,fail=1 now,fail=2 now,fail=30% now,fail=70% + soon,fail=0 soon,fail=1 soon,fail=2 soon,fail=30% soon,fail=70% + now,success=0 now,success=1 now,success=2 now,success=30% now,success=70% + soon,success=0 soon,success=1 soon,success=2 soon,success=30% now,success=70% + +echo '**' + echo '### Test --halt-on-error 0'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 0; echo $?; @@ -67,23 +86,11 @@ echo '### Test last dying print --halt-on-error -2'; echo '**' -testhalt() { - echo '### testhalt --halt '$1; - (yes 0 | head -n 10; seq 10) | stdout parallel -kj4 --halt $1 'sleep {= $_=$_*0.3+1 =}; exit {}'; echo $?; - (seq 10; yes 0 | head -n 10) | stdout parallel -kj4 --halt $1 'sleep {= $_=$_*0.3+1 =}; exit {}'; echo $?; -}; -export -f testhalt; - parallel -kj0 testhalt ::: now,fail=0 now,fail=1 now,fail=2 now,fail=30% now,fail=70% - soon,fail=0 soon,fail=1 soon,fail=2 soon,fail=30% soon,fail=70% - now,success=0 now,success=1 now,success=2 now,success=30% now,success=70% - soon,success=0 soon,success=1 soon,success=2 soon,success=30% now,success=70% - -echo '**' - echo '### test memfree' parallel --memfree 1k echo Free mem: ::: 1k stdout parallel --timeout 3 --argsep II parallel --memfree 1t echo Free mem: ::: II 1t echo '**' + EOF diff --git a/testsuite/wanted-results/parallel-local-10s b/testsuite/wanted-results/parallel-local-10s index 7b29b3c1..538c3657 100644 --- a/testsuite/wanted-results/parallel-local-10s +++ b/testsuite/wanted-results/parallel-local-10s @@ -1,152 +1,7 @@ -echo '### Test --halt-on-error 0'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 0; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 0; echo $? -### Test --halt-on-error 0 -1 -2 -/bin/bash: non_exist: command not found -echo '**' -** -echo '### Test --halt-on-error 1'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 1; echo $?; (echo "sleep 1;true"; echo "sleep 2; non_exist";echo "sleep 3;true";echo "sleep 4; false") | parallel -j10 --halt 1; echo $? -### Test --halt-on-error 1 -1 -127 -parallel: This job failed: -sleep 2;false -parallel: Starting no more jobs. Waiting for 1 jobs to finish. -/bin/bash: non_exist: command not found -parallel: This job failed: -sleep 2; non_exist -parallel: Starting no more jobs. Waiting for 2 jobs to finish. -parallel: This job failed: -sleep 4; false -echo '**' -** -echo '### Test --halt-on-error 2'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 2; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 2; echo $? -### Test --halt-on-error 2 -1 -1 -parallel: This job failed: -sleep 2;false -parallel: This job failed: -sleep 2;false -echo '**' -** -echo '### Test --halt -1'; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false") | parallel -j10 --halt-on-error -1; echo $?; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false";echo "sleep 4; non_exist") | parallel -j10 --halt -1; echo $? -### Test --halt -1 -0 -0 -parallel: This job succeeded: -sleep 2;true -parallel: Starting no more jobs. Waiting for 1 jobs to finish. -parallel: This job succeeded: -sleep 2;true -parallel: Starting no more jobs. Waiting for 2 jobs to finish. -/bin/bash: non_exist: command not found -echo '**' -** -echo '### Test --halt -2'; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false") | parallel -j10 --halt-on-error -2; echo $?; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false";echo "sleep 4; non_exist") | parallel -j10 --halt -2; echo $? -### Test --halt -2 -0 -0 -parallel: This job succeeded: -sleep 2;true -parallel: This job succeeded: -sleep 2;true -echo '**' -** -echo '### Test first dying print --halt-on-error 1'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt 1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'; echo exit code $? -### Test first dying print --halt-on-error 1 -exit code 1 -0 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 1 -parallel: Starting no more jobs. Waiting for 8 jobs to finish. -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 2 -parallel: Starting no more jobs. Waiting for 7 jobs to finish. -3 -0 -1 -2 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 3 -parallel: Starting no more jobs. Waiting for 6 jobs to finish. -3 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 3 -parallel: Starting no more jobs. Waiting for 5 jobs to finish. -4 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 4 -parallel: Starting no more jobs. Waiting for 4 jobs to finish. -5 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 5 -parallel: Starting no more jobs. Waiting for 3 jobs to finish. -6 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 6 -parallel: Starting no more jobs. Waiting for 2 jobs to finish. -7 -0 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 7 -parallel: Starting no more jobs. Waiting for 1 jobs to finish. -8 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 8 -echo '### Test last dying print --halt-on-error 2'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt 2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'; echo exit code $? -### Test last dying print --halt-on-error 2 -exit code 1 -0 -parallel: This job failed: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 1 -echo '### Test last dying print --halt-on-error -1'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt -1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit not shift'; echo exit code $? -### Test last dying print --halt-on-error -1 -exit code 0 -0 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1 -parallel: Starting no more jobs. Waiting for 8 jobs to finish. -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 2 -parallel: Starting no more jobs. Waiting for 7 jobs to finish. -3 -0 -1 -2 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 3 -parallel: Starting no more jobs. Waiting for 6 jobs to finish. -3 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 3 -parallel: Starting no more jobs. Waiting for 5 jobs to finish. -4 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 4 -parallel: Starting no more jobs. Waiting for 4 jobs to finish. -5 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 5 -parallel: Starting no more jobs. Waiting for 3 jobs to finish. -6 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 6 -parallel: Starting no more jobs. Waiting for 2 jobs to finish. -7 -0 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 7 -parallel: Starting no more jobs. Waiting for 1 jobs to finish. -8 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 8 -echo '### Test last dying print --halt-on-error -2'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt -2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit not shift'; echo exit code $? -### Test last dying print --halt-on-error -2 -exit code 0 -0 -parallel: This job succeeded: -perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1 +echo '### bug #46214: Using --pipepart doesnt spawn multiple jobs in version 20150922' +### bug #46214: Using --pipepart doesnt spawn multiple jobs in version 20150922 + seq 1000000 > /tmp/num1000000; stdout parallel --pipepart --progress -a /tmp/num1000000 --block 10k -j0 true |grep 1:local +1:local / 8 / 252 echo '**' ** testhalt() { echo '### testhalt --halt '$1; (yes 0 | head -n 10; seq 10) | stdout parallel -kj4 --halt $1 'sleep {= $_=$_*0.3+1 =}; exit {}'; echo $?; (seq 10; yes 0 | head -n 10) | stdout parallel -kj4 --halt $1 'sleep {= $_=$_*0.3+1 =}; exit {}'; echo $?; }; export -f testhalt; parallel -kj0 testhalt ::: now,fail=0 now,fail=1 now,fail=2 now,fail=30% now,fail=70% soon,fail=0 soon,fail=1 soon,fail=2 soon,fail=30% soon,fail=70% now,success=0 now,success=1 now,success=2 now,success=30% now,success=70% soon,success=0 soon,success=1 soon,success=2 soon,success=30% now,success=70% @@ -661,6 +516,157 @@ sleep 1; exit 0 50 echo '**' ** +echo '### Test --halt-on-error 0'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 0; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 0; echo $? +### Test --halt-on-error 0 +1 +2 +/bin/bash: non_exist: command not found +echo '**' +** +echo '### Test --halt-on-error 1'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 1; echo $?; (echo "sleep 1;true"; echo "sleep 2; non_exist";echo "sleep 3;true";echo "sleep 4; false") | parallel -j10 --halt 1; echo $? +### Test --halt-on-error 1 +1 +127 +parallel: This job failed: +sleep 2;false +parallel: Starting no more jobs. Waiting for 1 jobs to finish. +/bin/bash: non_exist: command not found +parallel: This job failed: +sleep 2; non_exist +parallel: Starting no more jobs. Waiting for 2 jobs to finish. +parallel: This job failed: +sleep 4; false +echo '**' +** +echo '### Test --halt-on-error 2'; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true") | parallel -j10 --halt-on-error 2; echo $?; (echo "sleep 1;true"; echo "sleep 2;false";echo "sleep 3;true";echo "sleep 4; non_exist") | parallel -j10 --halt 2; echo $? +### Test --halt-on-error 2 +1 +1 +parallel: This job failed: +sleep 2;false +parallel: This job failed: +sleep 2;false +echo '**' +** +echo '### Test --halt -1'; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false") | parallel -j10 --halt-on-error -1; echo $?; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false";echo "sleep 4; non_exist") | parallel -j10 --halt -1; echo $? +### Test --halt -1 +0 +0 +parallel: This job succeeded: +sleep 2;true +parallel: Starting no more jobs. Waiting for 1 jobs to finish. +parallel: This job succeeded: +sleep 2;true +parallel: Starting no more jobs. Waiting for 2 jobs to finish. +/bin/bash: non_exist: command not found +echo '**' +** +echo '### Test --halt -2'; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false") | parallel -j10 --halt-on-error -2; echo $?; (echo "sleep 1;false"; echo "sleep 2;true";echo "sleep 3;false";echo "sleep 4; non_exist") | parallel -j10 --halt -2; echo $? +### Test --halt -2 +0 +0 +parallel: This job succeeded: +sleep 2;true +parallel: This job succeeded: +sleep 2;true +echo '**' +** +echo '### Test first dying print --halt-on-error 1'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt 1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'; echo exit code $? +### Test first dying print --halt-on-error 1 +exit code 1 +0 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 1 +parallel: Starting no more jobs. Waiting for 8 jobs to finish. +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 2 +parallel: Starting no more jobs. Waiting for 7 jobs to finish. +3 +0 +1 +2 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 3 +parallel: Starting no more jobs. Waiting for 6 jobs to finish. +3 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 3 +parallel: Starting no more jobs. Waiting for 5 jobs to finish. +4 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 4 +parallel: Starting no more jobs. Waiting for 4 jobs to finish. +5 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 5 +parallel: Starting no more jobs. Waiting for 3 jobs to finish. +6 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 6 +parallel: Starting no more jobs. Waiting for 2 jobs to finish. +7 +0 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 7 +parallel: Starting no more jobs. Waiting for 1 jobs to finish. +8 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 8 +echo '### Test last dying print --halt-on-error 2'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt 2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit shift'; echo exit code $? +### Test last dying print --halt-on-error 2 +exit code 1 +0 +parallel: This job failed: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ shift 1 +echo '### Test last dying print --halt-on-error -1'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt -1 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit not shift'; echo exit code $? +### Test last dying print --halt-on-error -1 +exit code 0 +0 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1 +parallel: Starting no more jobs. Waiting for 8 jobs to finish. +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 2 +parallel: Starting no more jobs. Waiting for 7 jobs to finish. +3 +0 +1 +2 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 3 +parallel: Starting no more jobs. Waiting for 6 jobs to finish. +3 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 3 +parallel: Starting no more jobs. Waiting for 5 jobs to finish. +4 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 4 +parallel: Starting no more jobs. Waiting for 4 jobs to finish. +5 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 5 +parallel: Starting no more jobs. Waiting for 3 jobs to finish. +6 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 6 +parallel: Starting no more jobs. Waiting for 2 jobs to finish. +7 +0 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 7 +parallel: Starting no more jobs. Waiting for 1 jobs to finish. +8 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 8 +echo '### Test last dying print --halt-on-error -2'; (echo 0; echo 3; seq 0 7;echo 0; echo 8) | parallel -j10 -kq --halt -2 perl -e 'sleep $ARGV[0];print STDERR @ARGV,"\n"; exit not shift'; echo exit code $? +### Test last dying print --halt-on-error -2 +exit code 0 +0 +parallel: This job succeeded: +perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1 +echo '**' +** echo '### test memfree' ### test memfree parallel --memfree 1k echo Free mem: ::: 1k