testsuite: more testing of --halt.

This commit is contained in:
Ole Tange 2015-05-07 00:40:36 +02:00
parent fc0c6cee08
commit 5306f0f396
14 changed files with 648 additions and 24 deletions

View file

@ -59,4 +59,4 @@ upload:
pushd; \
sudo cp /usr/local/bin/parallel /usr/local/bin/parallel-$(YYYYMMDD)
EXTRA_DIST = CITATION
EXTRA_DIST = CITATION CREDITS

View file

@ -263,7 +263,7 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = src
EXTRA_DIST = CITATION
EXTRA_DIST = CITATION CREDITS
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

View file

@ -228,8 +228,12 @@ New in this release:
* <<afventer opdatering>> GNU Parallel was used (unfortunately without citation) in: MUGBAS: a species free gene-based programme suite for post-GWAS analysis http://www.ncbi.nlm.nih.gov/pubmed/25765345
http://biorxiv.org/content/biorxiv/early/2015/05/05/018085.full.pdf
taxator-tk http://algbio.cs.uni-duesseldorf.de/webapps/wa-download/ (check it)
* <<har ikke svaret og accepteret ansvar>> GNU Parallel was used in: Large Scale Author Name Disambiguation in Digital Libraries http://ieeexplore.ieee.org/xpl/abstractReferences.jsp?tp=&arnumber=7004487&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D7004487
* << afventer svar fra Rachel >> GNU Parallel was used in: SISRS: Site Identification from Short Read Sequences https://github.com/rachelss/SISRS/
* GNU Parallel was cited in: Toward Enhanced Metadata Quality of Large-Scale Digital Libraries: Estimating Volume Time Range https://www.ideals.illinois.edu/bitstream/handle/2142/73656/186_ready.pdf

View file

@ -1053,7 +1053,7 @@ sub parse_options {
sub init_globals {
# Defaults:
$Global::version = 20150426;
$Global::version = 20150503;
$Global::progname = 'parallel';
$Global::infinity = 2**31;
$Global::debug = 0;
@ -1131,7 +1131,7 @@ sub parse_halt {
# Split: soon,fail=5%
my ($when,$fail_success,$pct_count) = split /[,=]/, $opt::halt;
if(not grep { $when eq $_ } qw(never soon now)) {
::error("--halt must have 'never', 'soon', or 'now'");
::error("--halt must have 'never', 'soon', or 'now'\n");
}
$Global::halt_when = $when;
if($when ne "never") {
@ -7495,7 +7495,7 @@ sub set_exitsignal {
if($Global::halt_count and $Global::halt_count == 1) {
$Global::halt_exitstatus = $job->exitstatus();
} else {
$Global::halt_exitstatus = $Global::total_failed;
$Global::halt_exitstatus = ::min($Global::total_failed,254);
}
::debug("halt","Pct: ",$Global::halt_pct,"<=",$Global::total_failed / $Global::total_started," count: ",$Global::halt_count,"\n");
if($Global::halt_when eq "soon"

View file

@ -809,8 +809,9 @@ See also B<--resume> B<--resume-failed>.
=item B<-P> I<N>
Number of jobslots. Run up to N jobs in parallel. 0 means as many as
possible. Default is 100% which will run one job per CPU core.
Number of jobslots on each machine. Run up to N jobs in parallel. 0
means as many as possible. Default is 100% which will run one job per
CPU core on each machine.
If B<--semaphore> is set default is 1 thus making a mutex.
@ -1498,7 +1499,7 @@ to do anything.
Work as a counting semaphore. B<--semaphore> will cause GNU
B<parallel> to start I<command> in the background. When the number of
simultaneous jobs is reached, GNU B<parallel> will wait for one of
jobs given by B<--jobs> is reached, GNU B<parallel> will wait for one of
these to complete before starting another command.
B<--semaphore> implies B<--bg> unless B<--fg> is specified.

View file

@ -1969,7 +1969,19 @@
<p>GNU Parallel can work as a counting semaphore. This is slower and less efficient than its normal mode.</p>
<p>An alias for &#39;parallel --semaphore&#39; is &#39;sem&#39;. The default is to allow only one program to run at a time (technically called a mutex). The program is started in the background. Use --wait for all &#39;sem&#39;s to finish:</p>
<p>A counting semaphore is like a row of toilets. People needing a toilet can use any toilet, but if there are more people than toilets, they will have to wait for one of the toilets to be available.</p>
<p>An alias for &#39;parallel --semaphore&#39; is &#39;sem&#39;.</p>
<p>&#39;sem&#39; will follow a person to the toilets, wait until a toilet is available, leave the person in the toilet and exit.</p>
<p>&#39;sem --fg&#39; will follow a person to the toilets, wait until a toilet is available, stay with the person in the toilet and exit when the person exits.</p>
<p>&#39;sem --wait&#39; will wait for all persons to leave the toilets.</p>
<p>&#39;sem&#39; does not have a queue discipline, so the next person is chosen randomly.</p>
<p>-j sets the number of toilets. The default is to have only one toilet (technically this is called a mutex). The program is started in the background and &#39;sem&#39; exits immediately. Use --wait to wait for all &#39;sem&#39;s to finish:</p>
<pre><code> sem &#39;sleep 1; echo The first finished&#39; &amp;&amp;
echo The first is now running in the background &amp;&amp;
@ -1984,7 +1996,7 @@
The second is now running in the background
The second finished</code></pre>
<p>The command can be run in the foreground with --fg:</p>
<p>The command can be run in the foreground with --fg, which will only exit when the command completes:</p>
<pre><code> sem --fg &#39;sleep 1; echo The first finished&#39; &amp;&amp;
echo The first finished running in the foreground &amp;&amp;

View file

@ -1965,10 +1965,28 @@ This technique can be used for:
GNU Parallel can work as a counting semaphore. This is slower and less
efficient than its normal mode.
An alias for 'parallel --semaphore' is 'sem'. The default is to allow
only one program to run at a time (technically called a mutex). The
program is started in the background. Use --wait for all 'sem's to
finish:
A counting semaphore is like a row of toilets. People needing a toilet
can use any toilet, but if there are more people than toilets, they
will have to wait for one of the toilets to be available.
An alias for 'parallel --semaphore' is 'sem'.
'sem' will follow a person to the toilets, wait until a toilet is
available, leave the person in the toilet and exit.
'sem --fg' will follow a person to the toilets, wait until a toilet is
available, stay with the person in the toilet and exit when the person
exits.
'sem --wait' will wait for all persons to leave the toilets.
'sem' does not have a queue discipline, so the next person is chosen
randomly.
-j sets the number of toilets. The default is to have only one toilet
(technically this is called a mutex). The program is started in the
background and 'sem' exits immediately. Use --wait to wait for all
'sem's to finish:
sem 'sleep 1; echo The first finished' &&
echo The first is now running in the background &&
@ -1983,7 +2001,8 @@ Output:
The second is now running in the background
The second finished
The command can be run in the foreground with --fg:
The command can be run in the foreground with --fg, which will only
exit when the command completes:
sem --fg 'sleep 1; echo The first finished' &&
echo The first finished running in the foreground &&

View file

@ -148,6 +148,12 @@ 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
echo '**'
echo '### bug #44995: parallel echo {#} ::: 1 2 ::: 1 2'
parallel -k echo {#} ::: 1 2 ::: 1 2
EOF
echo '### 1 .par file from --files expected'
find /tmp{/*,}/*.{par,tms,tmx} 2>/dev/null -mmin -10 | wc -l

View file

@ -74,6 +74,19 @@ 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 =}; exit {}'; echo $?;
(seq 10; yes 0 | head -n 10) | stdout parallel -kj4 --halt $1 'sleep {= $_*=0.3 =}; 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 slow arguments generation - https://savannah.gnu.org/bugs/?32834';
seq 1 3 | parallel -j1 "sleep 2; echo {}" | parallel -kj2 echo
@ -83,7 +96,7 @@ echo '### Are children killed if GNU Parallel receives TERM twice? There should
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 &
T=$!;
sleep 1;
sleep 2;
pstree $$;
kill -TERM $T;
sleep 1;
@ -98,7 +111,7 @@ echo '### Are children killed if GNU Parallel receives INT twice? There should b
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 &
T=$!;
sleep 1;
sleep 2;
pstree $$;
kill -INT $T;
sleep 1;

View file

@ -2,7 +2,7 @@
cat <<'EOF' | sed -e 's/;$/; /;s/$SERVER1/'$SERVER1'/;s/$SERVER2/'$SERVER2'/' | stdout parallel -vj0 -k --joblog /tmp/jl-`basename $0` -L1
echo '### bug #36595: silent loss of input with --pipe and --sshlogin'
seq 10000 | xargs | parallel --pipe -S 10/localhost cat | wc
seq 10000 | xargs | parallel --pipe -S 10/localhost cat 2>/dev/null | wc
echo 'bug #36707: --controlmaster eats jobs'
seq 2 | parallel -k --controlmaster --sshlogin localhost echo OK{}

View file

@ -317,5 +317,14 @@ parallel --halt -2 ::: 'sleep 1' burnP5 true; killall burnP5 && echo ERROR: burn
parallel: This job succeeded:
true
burnP5: no process found
echo '**'
**
echo '### bug #44995: parallel echo {#} ::: 1 2 ::: 1 2'
### bug #44995: parallel echo {#} ::: 1 2 ::: 1 2
parallel -k echo {#} ::: 1 2 ::: 1 2
1
2
3
4
### 1 .par file from --files expected
1

View file

@ -157,6 +157,566 @@ parallel: This job succeeded:
perl -e sleep\ \$ARGV\[0\]\;print\ STDERR\ @ARGV,\"\\n\"\;\ exit\ not\ shift 1
echo '**'
**
testhalt() { echo '### testhalt --halt '$1; (yes 0 | head -n 10; seq 10) | stdout parallel -kj4 --halt $1 'sleep {= $_*=0.3 =}; exit {}'; echo $?; (seq 10; yes 0 | head -n 10) | stdout parallel -kj4 --halt $1 'sleep {= $_*=0.3 =}; 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%
### testhalt --halt now,fail=0
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: This job failed:
sleep 2.4; exit 8
parallel: This job failed:
sleep 2.7; exit 9
parallel: This job failed:
sleep 3; exit 10
0
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: This job failed:
sleep 2.4; exit 8
parallel: This job failed:
sleep 2.7; exit 9
parallel: This job failed:
sleep 3; exit 10
0
### testhalt --halt now,fail=1
parallel: This job failed:
sleep 0.3; exit 1
1
parallel: This job failed:
sleep 0.3; exit 1
1
### testhalt --halt now,fail=2
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
2
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
2
### testhalt --halt now,fail=30%
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
6
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
4
### testhalt --halt now,fail=70%
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: This job failed:
sleep 2.4; exit 8
parallel: This job failed:
sleep 2.7; exit 9
parallel: This job failed:
sleep 3; exit 10
0
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
7
### testhalt --halt soon,fail=0
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: This job failed:
sleep 2.4; exit 8
parallel: This job failed:
sleep 2.7; exit 9
parallel: This job failed:
sleep 3; exit 10
0
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: This job failed:
sleep 2.4; exit 8
parallel: This job failed:
sleep 2.7; exit 9
parallel: This job failed:
sleep 3; exit 10
0
### testhalt --halt soon,fail=1
parallel: This job failed:
sleep 0.3; exit 1
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 0.6; exit 2
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 0.9; exit 3
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 1.2; exit 4
4
parallel: This job failed:
sleep 0.3; exit 1
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 0.6; exit 2
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 0.9; exit 3
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 1.2; exit 4
4
### testhalt --halt soon,fail=2
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 0.9; exit 3
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 1.2; exit 4
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 1.5; exit 5
5
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 0.9; exit 3
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 1.2; exit 4
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 1.5; exit 5
5
### testhalt --halt soon,fail=30%
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 2.1; exit 7
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 2.4; exit 8
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 2.7; exit 9
9
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 1.5; exit 5
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 1.8; exit 6
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 2.1; exit 7
7
### testhalt --halt soon,fail=70%
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: This job failed:
sleep 2.4; exit 8
parallel: This job failed:
sleep 2.7; exit 9
parallel: This job failed:
sleep 3; exit 10
0
parallel: This job failed:
sleep 0.3; exit 1
parallel: This job failed:
sleep 0.6; exit 2
parallel: This job failed:
sleep 0.9; exit 3
parallel: This job failed:
sleep 1.2; exit 4
parallel: This job failed:
sleep 1.5; exit 5
parallel: This job failed:
sleep 1.8; exit 6
parallel: This job failed:
sleep 2.1; exit 7
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job failed:
sleep 2.4; exit 8
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job failed:
sleep 2.7; exit 9
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job failed:
sleep 3; exit 10
10
### testhalt --halt now,success=0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
7
### testhalt --halt now,success=1
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
0
### testhalt --halt now,success=2
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
### testhalt --halt now,success=30%
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
### testhalt --halt now,success=70%
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
7
### testhalt --halt soon,success=0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
7
### testhalt --halt soon,success=1
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
0
### testhalt --halt soon,success=2
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
0
### testhalt --halt soon,success=30%
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 2 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 1 jobs to finish.
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: Starting no more jobs. Waiting for 3 jobs to finish.
0
### testhalt --halt now,success=70%
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
parallel: This job succeeded:
sleep 0; exit 0
7
echo '**'
**
echo '### Test slow arguments generation - https://savannah.gnu.org/bugs/?32834'; seq 1 3 | parallel -j1 "sleep 2; echo {}" | parallel -kj2 echo
### Test slow arguments generation - https://savannah.gnu.org/bugs/?32834
1
@ -166,7 +726,7 @@ echo '**'
**
echo '### Are children killed if GNU Parallel receives TERM twice? There should be no sleep at the end'
### Are children killed if GNU Parallel receives TERM twice? There should be no sleep at the end
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 & T=$!; sleep 1; pstree $$; kill -TERM $T; sleep 1; pstree $$; kill -TERM $T; sleep 1; pstree $$; echo '**'
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 & T=$!; sleep 2; pstree $$; kill -TERM $T; sleep 1; pstree $$; kill -TERM $T; sleep 1; pstree $$; echo '**'
bash-+-perl---bash---sleep
`-pstree
bash-+-perl---bash---sleep
@ -178,7 +738,7 @@ parallel: Waiting for these 1 jobs to finish. Send SIGTERM again to stop now.
parallel: bash -c sleep\ 120\ \&\ pid=\$\!\;\ wait\ \$pid 1
echo '### Are children killed if GNU Parallel receives INT twice? There should be no sleep at the end'
### Are children killed if GNU Parallel receives INT twice? There should be no sleep at the end
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 & T=$!; sleep 1; pstree $$; kill -INT $T; sleep 1; pstree $$;
parallel -q bash -c 'sleep 120 & pid=$!; wait $pid' ::: 1 & T=$!; sleep 2; pstree $$; kill -INT $T; sleep 1; pstree $$;
bash-+-perl---bash---sleep
`-pstree
bash---pstree

View file

@ -1,6 +1,6 @@
echo '### bug #36595: silent loss of input with --pipe and --sshlogin'
### bug #36595: silent loss of input with --pipe and --sshlogin
seq 10000 | xargs | parallel --pipe -S 10/localhost cat | wc
seq 10000 | xargs | parallel --pipe -S 10/localhost cat 2>/dev/null | wc
1 10000 48894
echo 'bug #36707: --controlmaster eats jobs'
bug #36707: --controlmaster eats jobs

View file

@ -939,7 +939,7 @@ This helps funding further development; and it won't cost you a cent.
If you pay 10000 EUR you should feel free to use GNU Parallel without citing.
parallel --version
GNU parallel 20150426
GNU parallel 20150502
Copyright (C) 2007,2008,2009,2010,2011,2012,2013,2014,2015 Ole Tange
and Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
@ -951,7 +951,7 @@ Web site: http://www.gnu.org/software/parallel
When using programs that use GNU Parallel to process data for publication
please cite as described in 'parallel --bibtex'.
parallel --minversion 20130722 && echo Your version is at least 20130722.
20150426
20150502
Your version is at least 20130722.
parallel --bibtex
Academic tradition requires you to cite works you base your article on.
@ -997,4 +997,4 @@ C
\nice -n17 /bin/bash -c echo\ A
\nice -n17 /bin/bash -c echo\ B
\nice -n17 /bin/bash -c echo\ C
6
7