2015-02-24 22:23:18 +00:00
echo '### bug #44358: 2 GB records cause problems for -N2'
### bug #44358: 2 GB records cause problems for -N2
(yes "`echo {1..100}`" | head -c 5000000000; echo FOO; yes "`echo {1..100}`" | head -c 3000000000; echo FOO; yes "`echo {1..100}`" | head -c 1000000000;) | parallel --pipe --recend FOO'\n' --block 1g -k LANG=c wc -c
5000000004
3000000004
1000000000
parallel: Warning: A record was longer than 1000000000. Increasing to --blocksize 1300000001
parallel: Warning: A record was longer than 1300000001. Increasing to --blocksize 1690000003
parallel: Warning: A record was longer than 1690000003. Increasing to --blocksize 2147483647
2014-07-15 00:40:38 +00:00
echo "### --line-buffer"
2014-02-17 21:25:42 +00:00
### --line-buffer
2015-02-01 15:57:31 +00:00
seq 10 | parallel -j20 --line-buffer 'seq {} 10 | pv -qL 10' > /tmp/parallel_l$$; seq 10 | parallel -j20 'seq {} 10 | pv -qL 10' > /tmp/parallel_$$; cat /tmp/parallel_l$$ | wc; diff /tmp/parallel_$$ /tmp/parallel_l$$ >/dev/null ; echo These must diff: $?; rm /tmp/parallel_l$$ /tmp/parallel_$$
2014-02-17 21:25:42 +00:00
55 55 120
These must diff: 1
2014-07-15 00:40:38 +00:00
echo "### --pipe --line-buffer"
2014-02-16 20:53:15 +00:00
### --pipe --line-buffer
2015-02-01 15:57:31 +00:00
seq 200| parallel -N10 -L1 --pipe -j20 --line-buffer --tagstring {#} pv -qL 10 > /tmp/parallel_pl$$; seq 200| parallel -N10 -L1 --pipe -j20 --tagstring {#} pv -qL 10 > /tmp/parallel_p$$; cat /tmp/parallel_pl$$ | wc; diff /tmp/parallel_p$$ /tmp/parallel_pl$$ >/dev/null ; echo These must diff: $?; rm /tmp/parallel_pl$$ /tmp/parallel_p$$
2014-02-16 20:53:15 +00:00
200 400 1202
These must diff: 1
2014-07-15 00:40:38 +00:00
echo "### --pipe --line-buffer --compress"
2014-02-22 10:05:59 +00:00
### --pipe --line-buffer --compress
2014-07-15 00:40:38 +00:00
seq 200| parallel -N10 -L1 --pipe -j20 --line-buffer --compress --tagstring {#} pv -qL 10 | wc
2014-02-22 10:05:59 +00:00
200 400 1202
2014-07-15 00:40:38 +00:00
echo "### bug #41482: --pipe --compress blocks at different -j/seq combinations"
2014-02-17 21:25:42 +00:00
### bug #41482: --pipe --compress blocks at different -j/seq combinations
2014-07-15 00:40:38 +00:00
seq 1 | parallel -k -j2 --compress -N1 -L1 --pipe cat; echo echo 1-4 + 1-4
2014-02-17 21:25:42 +00:00
1
echo 1-4 + 1-4
2014-07-15 00:40:38 +00:00
seq 4 | parallel -k -j3 --compress -N1 -L1 -vv echo; echo 4 times wc to stderr to stdout
2014-02-17 21:25:42 +00:00
echo 1
1
echo 2
2
echo 3
3
echo 4
4
4 times wc to stderr to stdout
2014-07-15 00:40:38 +00:00
(seq 4 | parallel -k -j3 --compress -N1 -L1 --pipe wc '>&2') 2>&1 >/dev/null
2014-02-17 21:25:42 +00:00
1 1 2
1 1 2
1 1 2
1 1 2
2014-07-15 00:40:38 +00:00
echo 1 2 3 4
2014-02-17 21:25:42 +00:00
1 2 3 4
2014-07-15 00:40:38 +00:00
seq 4 | parallel -k -j3 --compress echo; echo 1 2 3 4
2014-02-17 21:25:42 +00:00
1
2
3
4
1 2 3 4
2014-07-15 00:40:38 +00:00
seq 4 | parallel -k -j1 --compress echo; echo 1 2
2014-02-17 21:25:42 +00:00
1
2
3
4
1 2
2014-07-15 00:40:38 +00:00
seq 2 | parallel -k -j1 --compress echo; echo 1 2 3
2014-02-17 21:25:42 +00:00
1
2
1 2 3
2014-07-15 00:40:38 +00:00
seq 3 | parallel -k -j2 --compress -N1 -L1 --pipe cat; echo "### bug #41609: --compress fails"
2014-02-17 21:25:42 +00:00
1
2
3
2014-02-16 20:53:15 +00:00
### bug #41609: --compress fails
2014-07-15 00:40:38 +00:00
seq 12 | parallel --compress --compress-program bzip2 -k seq {} 1000000 | md5sum
2014-02-16 17:57:57 +00:00
24812dd0f24a26d08a780f988b9d5ad2 -
2014-07-15 00:40:38 +00:00
seq 12 | parallel --compress -k seq {} 1000000 | md5sum
2014-02-16 17:57:57 +00:00
24812dd0f24a26d08a780f988b9d5ad2 -
2014-07-15 00:40:38 +00:00
echo "### --compress race condition (use nice): Fewer than 400 would run"
2014-02-21 03:07:56 +00:00
### --compress race condition (use nice): Fewer than 400 would run
2014-07-15 00:40:38 +00:00
seq 400| nice parallel -j200 --compress echo | wc
2014-02-21 03:07:56 +00:00
400 400 1492
2014-07-15 00:40:38 +00:00
echo "### -v --pipe: Dont spawn too many - 1 is enough"
2014-02-21 03:07:56 +00:00
### -v --pipe: Dont spawn too many - 1 is enough
2014-07-15 00:40:38 +00:00
seq 1 | parallel -j10 -v --pipe cat
2014-02-21 03:07:56 +00:00
cat
1
2014-07-15 00:40:38 +00:00
echo "### Test -N0 and --tagstring (fails)"
2014-02-22 10:05:59 +00:00
### Test -N0 and --tagstring (fails)
2014-07-15 00:40:38 +00:00
echo tagstring arg | parallel --tag -N0 echo foo
2014-02-22 10:05:59 +00:00
foo
2014-07-15 00:40:38 +00:00
echo "### Test -I"; seq 1 10 | parallel -k 'seq 1 {} | parallel -k -I :: echo {} ::'
2012-06-14 20:10:39 +00:00
### Test -I
2009-11-10 14:14:15 +00:00
1 1
2 1
2 2
3 1
3 2
3 3
4 1
4 2
4 3
4 4
5 1
5 2
5 3
5 4
5 5
6 1
6 2
6 3
6 4
6 5
6 6
7 1
7 2
7 3
7 4
7 5
7 6
7 7
8 1
8 2
8 3
8 4
8 5
8 6
8 7
8 8
9 1
9 2
9 3
9 4
9 5
9 6
9 7
9 8
9 9
10 1
10 2
10 3
10 4
10 5
10 6
10 7
10 8
10 9
10 10
2014-07-15 00:40:38 +00:00
echo "### Test -X -I"; seq 1 10 | parallel -k 'seq 1 {} | parallel -j1 -X -k -I :: echo a{} b::'
2012-06-14 20:10:39 +00:00
### Test -X -I
2009-11-10 14:14:15 +00:00
a1 b1
a2 b1 b2
a3 b1 b2 b3
a4 b1 b2 b3 b4
a5 b1 b2 b3 b4 b5
a6 b1 b2 b3 b4 b5 b6
a7 b1 b2 b3 b4 b5 b6 b7
a8 b1 b2 b3 b4 b5 b6 b7 b8
a9 b1 b2 b3 b4 b5 b6 b7 b8 b9
a10 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10
2014-07-15 00:40:38 +00:00
echo "### Test -m -I"; seq 1 10 | parallel -k 'seq 1 {} | parallel -j1 -m -k -I :: echo a{} b::'
2012-06-14 20:10:39 +00:00
### Test -m -I
2009-11-10 14:14:15 +00:00
a1 b1
a2 b1 2
a3 b1 2 3
a4 b1 2 3 4
a5 b1 2 3 4 5
a6 b1 2 3 4 5 6
a7 b1 2 3 4 5 6 7
a8 b1 2 3 4 5 6 7 8
a9 b1 2 3 4 5 6 7 8 9
a10 b1 2 3 4 5 6 7 8 9 10
2015-02-01 15:57:31 +00:00
echo "### Test max line length -m -I"
2012-06-14 20:10:39 +00:00
### Test max line length -m -I
2015-02-01 15:57:31 +00:00
seq 1 60000 | parallel -I :: -m -j1 echo a::b::c | tee >(sort |md5sum) >/tmp/114-a$$; export CHAR=$(cat /tmp/114-a$$ | wc -c); export LINES=$(cat /tmp/114-a$$ | wc -l); echo "Chars per line ($CHAR/$LINES): "$(echo "$CHAR/$LINES" | bc); rm /tmp/114-a$$
2012-10-17 00:09:03 +00:00
31d9274be5fdc2de59487cb05ba57776 -
2010-04-13 20:59:39 +00:00
Chars per line (697800/6): 116300
2015-02-01 15:57:31 +00:00
echo "### Test max line length -X -I"
2012-06-14 20:10:39 +00:00
### Test max line length -X -I
2015-02-01 15:57:31 +00:00
seq 1 60000 | parallel -I :: -X -j1 echo a::b::c | tee >(sort |md5sum) >/tmp/114-b$$; export CHAR=$(cat /tmp/114-b$$ | wc -c); export LINES=$(cat /tmp/114-b$$ | wc -l); echo "Chars per line ($CHAR/$LINES): "$(echo "$CHAR/$LINES" | bc); rm /tmp/114-b$$
2012-10-17 00:09:03 +00:00
22074f9acada52462defb18ba912d744 -
2010-04-13 20:59:39 +00:00
Chars per line (817788/7): 116826
2015-02-01 15:57:31 +00:00
echo "### bug #36659: --sshlogin strips leading slash from ssh command"
2012-06-14 20:10:39 +00:00
### bug #36659: --sshlogin strips leading slash from ssh command
2015-02-01 15:57:31 +00:00
parallel --sshlogin '/usr/bin/ssh localhost' echo ::: OK
2012-06-14 20:10:39 +00:00
OK
2015-02-01 15:57:31 +00:00
echo "### bug #36660: --workdir mkdir does not use --sshlogin custom ssh"
2012-06-14 20:19:49 +00:00
### bug #36660: --workdir mkdir does not use --sshlogin custom ssh
2015-02-01 15:57:31 +00:00
rm -rf /tmp/foo36660; cd /tmp; echo OK > parallel_test36660.txt; ssh () { echo Failed; }; export -f ssh; parallel --workdir /tmp/foo36660/bar --transfer --sshlogin '/usr/bin/ssh localhost' cat ::: parallel_test36660.txt; rm -rf /tmp/foo36660 parallel_test36660.txt
2012-06-14 20:19:49 +00:00
OK
2015-02-01 15:57:31 +00:00
echo "bug #36657: --load does not work with custom ssh"
2012-06-14 20:30:24 +00:00
bug #36657: --load does not work with custom ssh
2015-02-01 15:57:31 +00:00
ssh () { echo Failed; }; export -f ssh; parallel --load=1000% -S "/usr/bin/ssh localhost" echo ::: OK
2012-06-14 20:30:24 +00:00
OK
2015-02-01 15:57:31 +00:00
echo "bug #34958: --pipe with record size measured in lines"
2012-06-14 22:46:15 +00:00
bug #34958: --pipe with record size measured in lines
2015-02-01 15:57:31 +00:00
seq 10 | parallel -k --pipe -L 4 cat\;echo bug 34958-1
2012-06-14 22:46:15 +00:00
1
2
3
4
5
6
7
8
2013-02-02 21:20:36 +00:00
bug 34958-1
2012-06-14 22:46:15 +00:00
9
10
2013-02-02 21:20:36 +00:00
bug 34958-1
2015-02-01 15:57:31 +00:00
echo "bug #37325: Inefficiency of --pipe -L"
2012-11-25 23:19:58 +00:00
bug #37325: Inefficiency of --pipe -L
2015-02-01 15:57:31 +00:00
seq 2000 | parallel -k --pipe --block 1k -L 4 wc\;echo FOO | uniq
2013-02-02 21:20:36 +00:00
276 276 996
2012-11-25 23:19:58 +00:00
FOO
2013-02-02 21:20:36 +00:00
248 248 992
2012-11-25 23:19:58 +00:00
FOO
252 252 1008
FOO
2013-02-02 21:20:36 +00:00
244 244 997
2012-11-25 23:19:58 +00:00
FOO
200 200 1000
FOO
200 200 1000
FOO
200 200 1000
FOO
200 200 1000
FOO
2013-02-02 21:20:36 +00:00
180 180 900
2012-11-25 23:19:58 +00:00
FOO
2015-02-01 15:57:31 +00:00
echo "bug #34958: --pipe with record size measured in lines"
2012-06-14 22:46:15 +00:00
bug #34958: --pipe with record size measured in lines
2015-02-01 15:57:31 +00:00
seq 10 | parallel -k --pipe -l 4 cat\;echo bug 34958-2
2012-06-14 21:13:11 +00:00
1
2
3
4
5
6
7
8
2013-02-02 21:20:36 +00:00
bug 34958-2
2012-06-14 21:13:11 +00:00
9
10
2013-02-02 21:20:36 +00:00
bug 34958-2
2015-02-01 15:57:31 +00:00
echo "### Test --results"
2012-09-30 22:04:52 +00:00
### Test --results
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; parallel -k --results /tmp/parallel_results_test/testA echo {1} {2} ::: I II ::: III IIII; ls /tmp/parallel_results_test/testA/*/*/*/*/*; rm -rf /tmp/parallel_results_test/testA*
2012-09-30 22:04:52 +00:00
I III
I IIII
II III
II IIII
2012-12-03 22:28:10 +00:00
/tmp/parallel_results_test/testA/1/I/2/III/stderr
/tmp/parallel_results_test/testA/1/I/2/III/stdout
/tmp/parallel_results_test/testA/1/I/2/IIII/stderr
/tmp/parallel_results_test/testA/1/I/2/IIII/stdout
/tmp/parallel_results_test/testA/1/II/2/III/stderr
/tmp/parallel_results_test/testA/1/II/2/III/stdout
/tmp/parallel_results_test/testA/1/II/2/IIII/stderr
/tmp/parallel_results_test/testA/1/II/2/IIII/stdout
2015-02-01 15:57:31 +00:00
echo "### Test --res"
2012-09-30 22:04:52 +00:00
### Test --res
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; parallel -k --res /tmp/parallel_results_test/testD echo {1} {2} ::: I II ::: III IIII; ls /tmp/parallel_results_test/testD/*/*/*/*/*; rm -rf /tmp/parallel_results_test/testD*
2012-09-30 22:04:52 +00:00
I III
I IIII
II III
II IIII
2012-12-03 22:28:10 +00:00
/tmp/parallel_results_test/testD/1/I/2/III/stderr
/tmp/parallel_results_test/testD/1/I/2/III/stdout
/tmp/parallel_results_test/testD/1/I/2/IIII/stderr
/tmp/parallel_results_test/testD/1/I/2/IIII/stdout
/tmp/parallel_results_test/testD/1/II/2/III/stderr
/tmp/parallel_results_test/testD/1/II/2/III/stdout
/tmp/parallel_results_test/testD/1/II/2/IIII/stderr
/tmp/parallel_results_test/testD/1/II/2/IIII/stdout
2015-02-01 15:57:31 +00:00
echo "### Test --result"
2012-09-30 22:04:52 +00:00
### Test --result
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; parallel -k --result /tmp/parallel_results_test/testE echo {1} {2} ::: I II ::: III IIII; ls /tmp/parallel_results_test/testE/*/*/*/*/*; rm -rf /tmp/parallel_results_test/testE*
2012-09-30 22:04:52 +00:00
I III
I IIII
II III
II IIII
2012-12-03 22:28:10 +00:00
/tmp/parallel_results_test/testE/1/I/2/III/stderr
/tmp/parallel_results_test/testE/1/I/2/III/stdout
/tmp/parallel_results_test/testE/1/I/2/IIII/stderr
/tmp/parallel_results_test/testE/1/I/2/IIII/stdout
/tmp/parallel_results_test/testE/1/II/2/III/stderr
/tmp/parallel_results_test/testE/1/II/2/III/stdout
/tmp/parallel_results_test/testE/1/II/2/IIII/stderr
/tmp/parallel_results_test/testE/1/II/2/IIII/stdout
2015-02-01 15:57:31 +00:00
echo "### Test --results --header :"
2012-09-30 22:04:52 +00:00
### Test --results --header :
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; parallel -k --header : --results /tmp/parallel_results_test/testB echo {1} {2} ::: a I II ::: b III IIII; ls /tmp/parallel_results_test/testB/*/*/*/*/*; rm -rf /tmp/parallel_results_test/testB*
2012-09-30 22:04:52 +00:00
I III
I IIII
II III
II IIII
2012-12-03 22:28:10 +00:00
/tmp/parallel_results_test/testB/a/I/b/III/stderr
/tmp/parallel_results_test/testB/a/I/b/III/stdout
/tmp/parallel_results_test/testB/a/I/b/IIII/stderr
/tmp/parallel_results_test/testB/a/I/b/IIII/stdout
/tmp/parallel_results_test/testB/a/II/b/III/stderr
/tmp/parallel_results_test/testB/a/II/b/III/stdout
/tmp/parallel_results_test/testB/a/II/b/IIII/stderr
/tmp/parallel_results_test/testB/a/II/b/IIII/stdout
2015-02-01 15:57:31 +00:00
echo "### Test --results --header : named - a/b swapped"
2012-12-03 22:28:10 +00:00
### Test --results --header : named - a/b swapped
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; parallel -k --header : --results /tmp/parallel_results_test/testC echo {a} {b} ::: b III IIII ::: a I II; ls /tmp/parallel_results_test/testC/*/*/*/*/*; rm -rf /tmp/parallel_results_test/testC*
2012-09-30 22:04:52 +00:00
I III
II III
2012-12-03 22:28:10 +00:00
I IIII
2012-09-30 22:04:52 +00:00
II IIII
2012-12-03 22:28:10 +00:00
/tmp/parallel_results_test/testC/a/I/b/III/stderr
/tmp/parallel_results_test/testC/a/I/b/III/stdout
/tmp/parallel_results_test/testC/a/I/b/IIII/stderr
/tmp/parallel_results_test/testC/a/I/b/IIII/stdout
/tmp/parallel_results_test/testC/a/II/b/III/stderr
/tmp/parallel_results_test/testC/a/II/b/III/stdout
/tmp/parallel_results_test/testC/a/II/b/IIII/stderr
/tmp/parallel_results_test/testC/a/II/b/IIII/stdout
2015-02-01 15:57:31 +00:00
echo "### Test --results --header : piped"
2012-10-01 09:30:16 +00:00
### Test --results --header : piped
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; (echo Col; perl -e 'print "backslash\\tab\tslash/null\0eof\n"') | parallel --header : --result /tmp/parallel_results_test/testF true; find /tmp/parallel_results_test/testF/*/*/* | sort; rm -rf /tmp/parallel_results_test/testF*
2012-12-28 10:46:35 +00:00
/tmp/parallel_results_test/testF/Col/backslash\\tab/2
/tmp/parallel_results_test/testF/Col/backslash\\tab/2/slash\_null\0eof
/tmp/parallel_results_test/testF/Col/backslash\\tab/2/slash\_null\0eof/stderr
2013-11-22 17:24:09 +00:00
/tmp/parallel_results_test/testF/Col/backslash\\tab/2/slash\_null\0eof/stdout
2015-02-01 15:57:31 +00:00
echo "### Test --results --header : piped - non-existing column header"
2012-12-28 10:46:35 +00:00
### Test --results --header : piped - non-existing column header
2015-02-01 15:57:31 +00:00
mkdir -p /tmp/parallel_results_test; (printf "Col1\t\n"; printf "v1\tv2\tv3\n"; perl -e 'print "backslash\\tab\tslash/null\0eof\n"') | parallel --header : --result /tmp/parallel_results_test/testG true; find /tmp/parallel_results_test/testG/ | sort; rm -rf /tmp/parallel_results_test/testG*
2012-12-28 10:46:35 +00:00
/tmp/parallel_results_test/testG/
/tmp/parallel_results_test/testG/Col1
2013-11-22 17:24:09 +00:00
/tmp/parallel_results_test/testG/Col1/backslash\\tab
/tmp/parallel_results_test/testG/Col1/backslash\\tab/2
/tmp/parallel_results_test/testG/Col1/backslash\\tab/2/slash\_null\0eof
/tmp/parallel_results_test/testG/Col1/backslash\\tab/2/slash\_null\0eof/stderr
/tmp/parallel_results_test/testG/Col1/backslash\\tab/2/slash\_null\0eof/stdout
2012-12-28 10:46:35 +00:00
/tmp/parallel_results_test/testG/Col1/v1
/tmp/parallel_results_test/testG/Col1/v1/2
/tmp/parallel_results_test/testG/Col1/v1/2/v2
/tmp/parallel_results_test/testG/Col1/v1/2/v2/3
/tmp/parallel_results_test/testG/Col1/v1/2/v2/3/v3
/tmp/parallel_results_test/testG/Col1/v1/2/v2/3/v3/stderr
2013-11-22 17:24:09 +00:00
/tmp/parallel_results_test/testG/Col1/v1/2/v2/3/v3/stdout