Released as 20240522 ('Tbilisi')
[parallel.git] / src / parallel.pod
blob231ae767a04c6c6551a98ab1bd510eab888cb7e3
1 #!/usr/bin/perl -w
3 # SPDX-FileCopyrightText: 2021-2024 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
4 # SPDX-License-Identifier: GFDL-1.3-or-later
5 # SPDX-License-Identifier: CC-BY-SA-4.0
7 =encoding utf8
9 =head1 NAME
11 parallel - build and execute shell command lines from standard input
12 in parallel
15 =head1 SYNOPSIS
17 B<parallel> [options] [I<command> [arguments]] < list_of_arguments
19 B<parallel> [options] [I<command> [arguments]] ( B<:::> arguments |
20 B<:::+> arguments | B<::::> argfile(s) | B<::::+> argfile(s) ) ...
22 B<parallel> --semaphore [options] I<command>
24 B<#!/usr/bin/parallel> --shebang [options] [I<command> [arguments]]
26 B<#!/usr/bin/parallel> --shebang-wrap [options] [I<command>
27 [arguments]]
30 =head1 DESCRIPTION
32 STOP!
34 Read the B<Reader's guide> below if you are new to GNU B<parallel>.
36 GNU B<parallel> is a shell tool for executing jobs in parallel using
37 one or more computers. A job can be a single command or a small script
38 that has to be run for each of the lines in the input. The typical
39 input is a list of files, a list of hosts, a list of users, a list of
40 URLs, or a list of tables. A job can also be a command that reads from
41 a pipe. GNU B<parallel> can then split the input into blocks and pipe
42 a block into each command in parallel.
44 If you use xargs and tee today you will find GNU B<parallel> very easy
45 to use as GNU B<parallel> is written to have the same options as
46 xargs. If you write loops in shell, you will find GNU B<parallel> may
47 be able to replace most of the loops and make them run faster by
48 running several jobs in parallel.
50 GNU B<parallel> makes sure output from the commands is the same output
51 as you would get had you run the commands sequentially. This makes it
52 possible to use output from GNU B<parallel> as input for other
53 programs.
55 For each line of input GNU B<parallel> will execute I<command> with
56 the line as arguments. If no I<command> is given, the line of input is
57 executed. Several lines will be run in parallel. GNU B<parallel> can
58 often be used as a substitute for B<xargs> or B<cat | bash>.
61 =head2 Reader's guide
63 GNU B<parallel> includes the 4 types of documentation: Tutorial,
64 how-to, reference and explanation/design.
67 =head3 Tutorial
69 If you prefer reading a book buy B<GNU Parallel 2018> at
70 https://www.lulu.com/shop/ole-tange/gnu-parallel-2018/paperback/product-23558902.html
71 or download it at: https://doi.org/10.5281/zenodo.1146014 Read at
72 least chapter 1+2. It should take you less than 20 minutes.
74 Otherwise start by watching the intro videos for a quick introduction:
75 https://youtube.com/playlist?list=PL284C9FF2488BC6D1
77 If you want to dive deeper: spend a couple of hours walking through
78 the tutorial (B<man parallel_tutorial>). Your command line will love
79 you for it.
82 =head3 How-to
84 You can find a lot of examples of use in B<man
85 parallel_examples>. They will give you an idea of what GNU B<parallel>
86 is capable of, and you may find a solution you can simply adapt to
87 your situation.
89 If the example do not cover your exact needs, the options map
90 (https://www.gnu.org/software/parallel/parallel_options_map.pdf) can
91 help you identify options that are related, so you can look these up
92 in the man page.
95 =head3 Reference
97 If you need a one page printable cheat sheet you can find it on:
98 https://www.gnu.org/software/parallel/parallel_cheat.pdf
100 The man page is the reference for all options, and reading the man
101 page from cover to cover is probably not what you need.
104 =head3 Design discussion
106 If you want to know the design decisions behind GNU B<parallel>, try:
107 B<man parallel_design>. This is also a good intro if you intend to
108 change GNU B<parallel>.
112 =head1 OPTIONS
114 =over 4
116 =item I<command>
118 Command to execute.
120 If I<command> or the following arguments contain
121 replacement strings (such as B<{}>) every instance will be substituted
122 with the input.
124 If I<command> is given, GNU B<parallel> solve the same tasks as
125 B<xargs>. If I<command> is not given GNU B<parallel> will behave
126 similar to B<cat | sh>.
128 The I<command> must be an executable, a script, a composed command, an
129 alias, or a function.
131 B<Bash functions>: B<export -f> the function first or use B<env_parallel>.
133 B<Bash, Csh, or Tcsh aliases>: Use B<env_parallel>.
135 B<Zsh, Fish, Ksh, and Pdksh functions and aliases>: Use B<env_parallel>.
137 =item B<{}>
139 Input line.
141 This replacement string will be replaced by a full line read from the
142 input source. The input source is normally stdin (standard input), but
143 can also be given with B<--arg-file>, B<:::>, or B<::::>.
145 The replacement string B<{}> can be changed with B<-I>.
147 If the command line contains no replacement strings then B<{}> will be
148 appended to the command line.
150 Replacement strings are normally quoted, so special characters are not
151 parsed by the shell. The exception is if the command starts with a
152 replacement string; then the string is not quoted.
154 See also: B<--plus> B<{.}> B<{/}> B<{//}> B<{/.}> B<{#}> B<{%}>
155 B<{>I<n>B<}> B<{=>I<perl expression>B<=}>
158 =item B<{.}>
160 Input line without extension.
162 This replacement string will be replaced by the input with the
163 extension removed. If the input line contains B<.> after the last
164 B</>, the last B<.> until the end of the string will be removed and
165 B<{.}> will be replaced with the remaining. E.g. I<foo.jpg> becomes
166 I<foo>, I<subdir/foo.jpg> becomes I<subdir/foo>,
167 I<sub.dir/foo.jpg> becomes I<sub.dir/foo>, I<sub.dir/bar> remains
168 I<sub.dir/bar>. If the input line does not contain B<.> it will remain
169 unchanged.
171 The replacement string B<{.}> can be changed with B<--extensionreplace>
173 See also: B<{}> B<--extensionreplace>
176 =item B<{/}>
178 Basename of input line.
180 This replacement string will be replaced by the input with the
181 directory part removed.
183 See also: B<{}> B<--basenamereplace>
186 =item B<{//}>
188 Dirname of input line.
190 This replacement string will be replaced by the dir of the input
191 line. See B<dirname>(1).
193 See also: B<{}> B<--dirnamereplace>
196 =item B<{/.}>
198 Basename of input line without extension.
200 This replacement string will be replaced by the input with the
201 directory and extension part removed. B<{/.}> is a combination of
202 B<{/}> and B<{.}>.
204 See also: B<{}> B<--basenameextensionreplace>
207 =item B<{#}>
209 Sequence number of the job to run.
211 This replacement string will be replaced by the sequence number of the
212 job being run. It contains the same number as $PARALLEL_SEQ.
214 See also: B<{}> B<--seqreplace>
217 =item B<{%}>
219 Job slot number.
221 This replacement string will be replaced by the job's slot number
222 between 1 and number of jobs to run in parallel. There will never be 2
223 jobs running at the same time with the same job slot number.
225 If the job needs to be retried (e.g using B<--retries> or
226 B<--retry-failed>) the job slot is not automatically updated. You
227 should then instead use B<$PARALLEL_JOBSLOT>:
229 $ do_test() {
230 id="$3 {%}=$1 PARALLEL_JOBSLOT=$2"
231 echo run "$id";
232 sleep 1
233 # fail if {%} is odd
234 return `echo $1%2 | bc`
236 $ export -f do_test
237 $ parallel -j3 --jl mylog do_test {%} \$PARALLEL_JOBSLOT {} ::: A B C D
238 run A {%}=1 PARALLEL_JOBSLOT=1
239 run B {%}=2 PARALLEL_JOBSLOT=2
240 run C {%}=3 PARALLEL_JOBSLOT=3
241 run D {%}=1 PARALLEL_JOBSLOT=1
242 $ parallel --retry-failed -j3 --jl mylog do_test {%} \$PARALLEL_JOBSLOT {} ::: A B C D
243 run A {%}=1 PARALLEL_JOBSLOT=1
244 run C {%}=3 PARALLEL_JOBSLOT=2
245 run D {%}=1 PARALLEL_JOBSLOT=3
247 Notice how {%} and $PARALLEL_JOBSLOT differ in the retry run of C and D.
249 See also: B<{}> B<--jobs> B<--slotreplace>
252 =item B<{>I<n>B<}>
254 Argument from input source I<n> or the I<n>'th argument.
256 This positional replacement string will be replaced by the input from
257 input source I<n> (when used with B<--arg-file> or B<::::>) or with the
258 I<n>'th argument (when used with B<-N> or B<--colsep>).
260 If I<n> is negative it refers to the I<n>'th last argument.
262 See also: B<{}> B<{>I<n>.B<}> B<{>I<n>/B<}> B<{>I<n>//B<}>
263 B<{>I<n>/.B<}> B<--colsep>
266 =item B<{>I<n>.B<}>
268 Argument from input source I<n> or the I<n>'th argument without
269 extension.
271 B<{>I<n>.B<}> is a combination of B<{>I<n>B<}> and B<{.}>.
273 This positional replacement string will be replaced by the input from
274 input source I<n> (when used with B<--arg-file> or B<::::>) or with the
275 I<n>'th argument (when used with B<-N>). The input will have the
276 extension removed.
278 See also: B<{>I<n>B<}> B<{.}>
281 =item B<{>I<n>/B<}>
283 Basename of argument from input source I<n> or the I<n>'th argument.
285 B<{>I<n>/B<}> is a combination of B<{>I<n>B<}> and B<{/}>.
287 This positional replacement string will be replaced by the input from
288 input source I<n> (when used with B<--arg-file> or B<::::>) or with the
289 I<n>'th argument (when used with B<-N>). The input will have the
290 directory (if any) removed.
292 See also: B<{>I<n>B<}> B<{/}>
295 =item B<{>I<n>//B<}>
297 Dirname of argument from input source I<n> or the I<n>'th argument.
299 B<{>I<n>//B<}> is a combination of B<{>I<n>B<}> and B<{//}>.
301 This positional replacement string will be replaced by the dir of the
302 input from input source I<n> (when used with B<--arg-file> or B<::::>) or with
303 the I<n>'th argument (when used with B<-N>). See B<dirname>(1).
305 See also: B<{>I<n>B<}> B<{//}>
308 =item B<{>I<n>/.B<}>
310 Basename of argument from input source I<n> or the I<n>'th argument
311 without extension.
313 B<{>I<n>/.B<}> is a combination of B<{>I<n>B<}>, B<{/}>, and
314 B<{.}>.
316 This positional replacement string will be replaced by the input from
317 input source I<n> (when used with B<--arg-file> or B<::::>) or with the
318 I<n>'th argument (when used with B<-N>). The input will have the
319 directory (if any) and extension removed.
321 See also: B<{>I<n>B<}> B<{/.}>
324 =item B<{=>I<perl expression>B<=}>
326 Replace with calculated I<perl expression>.
328 B<$_> will contain the same as B<{}>. After evaluating I<perl
329 expression> B<$_> will be used as the value. It is recommended to only
330 change $_ but you have full access to all of GNU B<parallel>'s
331 internal functions and data structures.
333 The expression must give the same result if evaluated twice -
334 otherwise the behaviour is undefined. E.g. in some versions of GNU
335 B<parallel> this will not work as expected:
337 parallel echo '{= $_= ++$wrong_counter =}' ::: a b c
339 A few convenience functions and data structures have been made:
341 =over 2
343 =item Z<> B<Q(>I<string>B<)>
345 Shell quote a string. Example:
347 parallel echo {} is quoted as '{= $_=Q($_) =}' ::: \$PWD
349 =item Z<> B<pQ(>I<string>B<)>
351 Perl quote a string. Example:
353 parallel echo {} is quoted as '{= $_=pQ($_) =}' ::: \$PWD
355 =item Z<> B<uq()> (or B<uq>)
357 Do not quote current replacement string. Example:
359 parallel echo {} has the value '{= uq =}' ::: \$PWD
361 =item Z<> B<hash(val)>
363 Compute B::hash(val). Example:
365 parallel echo Hash of {} is '{= $_=hash($_) =}' ::: a b c
367 =item Z<> B<total_jobs()>
369 Number of jobs in total. Example:
371 parallel echo Number of jobs: '{= $_=total_jobs() =}' ::: a b c
373 =item Z<> B<slot()>
375 Slot number of job. Example:
377 parallel echo Job slot of {} is '{= $_=slot() =}' ::: a b c
379 =item Z<> B<seq()>
381 Sequence number of job. Example:
383 parallel echo Seq number of {} is '{= $_=seq() =}' ::: a b c
385 =item Z<> B<@arg>
387 The arguments counting from 1 ($arg[1] = {1} = first argument). Example:
389 parallel echo {1}+{2}='{=1 $_=$arg[1]+$arg[2] =}' \
390 ::: 1 2 3 ::: 2 3 4
392 ('{=1' forces this to be a positional replacement string, and
393 therefore will not repeat the value for each arg.)
395 =item Z<> B<skip()>
397 Skip this job (see also B<--filter>). Example:
399 parallel echo '{= $arg[1] >= $arg[2] and skip =}' \
400 ::: 1 2 3 ::: 2 3 4
402 =item Z<> B<yyyy_mm_dd_hh_mm_ss(sec)>
404 =item Z<> B<yyyy_mm_dd_hh_mm(sec)>
406 =item Z<> B<yyyy_mm_dd(sec)>
408 =item Z<> B<hh_mm_ss(sec)>
410 =item Z<> B<hh_mm(sec)>
412 =item Z<> B<yyyymmddhhmmss(sec)>
414 =item Z<> B<yyyymmddhhmm(sec)>
416 =item Z<> B<yyyymmdd(sec)>
418 =item Z<> B<hhmmss(sec)>
420 =item Z<> B<hhmm(sec)>
422 Time functions. I<sec> is number of seconds since epoch. If left out
423 it will use current local time. Example:
425 parallel echo 'Now: {= $_=yyyy_mm_dd_hh_mm_ss() =}' ::: Dummy
426 parallel echo 'The end: {= $_=yyyy_mm_dd_hh_mm_ss($_) =}' \
427 ::: 2147483648
429 =back
431 Example:
433 seq 10 | parallel echo {} + 1 is {= '$_++' =}
434 parallel csh -c {= '$_="mkdir ".Q($_)' =} ::: '12" dir'
435 seq 50 | parallel echo job {#} of {= '$_=total_jobs()' =}
437 See also: B<--rpl> B<--parens> B<{}> B<{=>I<n> I<perl expression>B<=}>
438 B<--filter>
441 =item B<{=>I<n> I<perl expression>B<=}>
443 Positional equivalent to B<{=>I<perl expression>B<=}>.
445 To understand positional replacement strings see B<{>I<n>B<}>.
447 See also: B<{=>I<perl expression>B<=}> B<{>I<n>B<}>
450 =item B<:::> I<arguments>
452 Use arguments on the command line as input source.
454 Unlike other options for GNU B<parallel> B<:::> is placed after the
455 I<command> and before the arguments.
457 The following are equivalent:
459 (echo file1; echo file2) | parallel gzip
460 parallel gzip ::: file1 file2
461 parallel gzip {} ::: file1 file2
462 parallel --arg-sep ,, gzip {} ,, file1 file2
463 parallel --arg-sep ,, gzip ,, file1 file2
464 parallel ::: "gzip file1" "gzip file2"
466 To avoid treating B<:::> as special use B<--arg-sep> to set the
467 argument separator to something else.
469 If multiple B<:::> are given, each group will be treated as an input
470 source, and all combinations of input sources will be
471 generated. E.g. ::: 1 2 ::: a b c will result in the combinations
472 (1,a) (1,b) (1,c) (2,a) (2,b) (2,c). This is useful for replacing
473 nested for-loops.
475 B<:::>, B<::::>, and B<--arg-file> can be mixed. So these are equivalent:
477 parallel echo {1} {2} {3} ::: 6 7 ::: 4 5 ::: 1 2 3
478 parallel echo {1} {2} {3} :::: <(seq 6 7) <(seq 4 5) \
479 :::: <(seq 1 3)
480 parallel -a <(seq 6 7) echo {1} {2} {3} :::: <(seq 4 5) \
481 :::: <(seq 1 3)
482 parallel -a <(seq 6 7) -a <(seq 4 5) echo {1} {2} {3} \
483 ::: 1 2 3
484 seq 6 7 | parallel -a - -a <(seq 4 5) echo {1} {2} {3} \
485 ::: 1 2 3
486 seq 4 5 | parallel echo {1} {2} {3} :::: <(seq 6 7) - \
487 ::: 1 2 3
489 See also: B<--arg-sep> B<--arg-file> B<::::> B<:::+> B<::::+> B<--link>
492 =item B<:::+> I<arguments>
494 Like B<:::> but linked like B<--link> to the previous input source.
496 Contrary to B<--link>, values do not wrap: The shortest input source
497 determines the length.
499 Example:
501 parallel echo ::: a b c :::+ 1 2 3 ::: X Y :::+ 11 22
503 See also: B<::::+> B<--link>
506 =item B<::::> I<argfiles>
508 Another way to write B<--arg-file> I<argfile1> B<--arg-file> I<argfile2> ...
510 B<:::> and B<::::> can be mixed.
512 See also: B<--arg-file> B<:::> B<::::+> B<--link>
515 =item B<::::+> I<argfiles>
517 Like B<::::> but linked like B<--link> to the previous input source.
519 Contrary to B<--link>, values do not wrap: The shortest input source
520 determines the length.
522 See also: B<--arg-file> B<:::+> B<--link>
525 =item B<--null>
527 =item B<-0>
529 Use NUL as delimiter.
531 Normally input lines will end in \n (newline). If they end in \0
532 (NUL), then use this option. It is useful for processing arguments
533 that may contain \n (newline).
535 Shorthand for B<--delimiter '\0'>.
537 See also: B<--delimiter>
540 =item B<--arg-file> I<input-file>
542 =item B<-a> I<input-file>
544 Use I<input-file> as input source.
546 If multiple B<--arg-file> are given, each I<input-file> will be treated as an
547 input source, and all combinations of input sources will be
548 generated. E.g. The file B<foo> contains B<1 2>, the file
549 B<bar> contains B<a b c>. B<-a foo> B<-a bar> will result in the combinations
550 (1,a) (1,b) (1,c) (2,a) (2,b) (2,c). This is useful for replacing
551 nested for-loops.
553 If I<input-file> starts with B<+> the file will be linked to the
554 previous B<--arg-file> E.g. The file B<foo> contains B<1 2>, the file
555 B<bar> contains B<a b>. B<-a foo> B<-a +bar> will result in the
556 combinations (1,a) (2,b) like B<--link> instead of generating all
557 combinations.
559 See also: B<--link> B<{>I<n>B<}> B<::::> B<::::+> B<:::>
562 =item B<--arg-file-sep> I<sep-str>
564 Use I<sep-str> instead of B<::::> as separator string between command
565 and argument files.
567 Useful if B<::::> is used for something else by the command.
569 See also: B<::::>
572 =item B<--arg-sep> I<sep-str>
574 Use I<sep-str> instead of B<:::> as separator string.
576 Useful if B<:::> is used for something else by the command.
578 Also useful if you command uses B<:::> but you still want to read
579 arguments from stdin (standard input): Simply change B<--arg-sep> to a
580 string that is not in the command line.
582 See also: B<:::>
585 =item B<--bar>
587 Show progress as a progress bar.
589 In the bar is shown: % of jobs completed, estimated seconds left, and
590 number of jobs started.
592 It is compatible with B<zenity>:
594 seq 1000 | parallel -j30 --bar '(echo {};sleep 0.1)' \
595 2> >(perl -pe 'BEGIN{$/="\r";$|=1};s/\r/\n/g' |
596 zenity --progress --auto-kill) | wc
598 See also: B<--eta> B<--progress> B<--total-jobs>
601 =item B<--basefile> I<file>
603 =item B<--bf> I<file>
605 I<file> will be transferred to each sshlogin before first job is
606 started.
608 It will be removed if B<--cleanup> is active. The file may be a script
609 to run or some common base data needed for the job. Multiple
610 B<--bf> can be specified to transfer more basefiles. The I<file> will be
611 transferred the same way as B<--transferfile>.
613 See also: B<--sshlogin> B<--transfer> B<--return> B<--cleanup>
614 B<--workdir>
616 =item B<--basenamereplace> I<replace-str>
618 =item B<--bnr> I<replace-str>
620 Use the replacement string I<replace-str> instead of B<{/}> for
621 basename of input line.
623 See also: B<{/}>
626 =item B<--basenameextensionreplace> I<replace-str>
628 =item B<--bner> I<replace-str>
630 Use the replacement string I<replace-str> instead of B<{/.}> for basename of input line without extension.
632 See also: B<{/.}>
635 =item B<--bin> I<binexpr>
637 Use I<binexpr> as binning key and bin input to the jobs.
639 I<binexpr> is [column number|column name] [perlexpression] e.g.:
642 Address
643 3 $_%=100
644 Address s/\D//g
646 Each input line is split using B<--colsep>. The value of the column is
647 put into $_, the perl expression is executed, the resulting value is
648 is the job slot that will be given the line. If the value is bigger
649 than the number of jobslots the value will be modulo number of jobslots.
651 This is similar to B<--shard> but the hashing algorithm is a simple
652 modulo, which makes it predictible which jobslot will receive which
653 value.
655 The performance is in the order of 100K rows per second. Faster if the
656 I<bincol> is small (<10), slower if it is big (>100).
658 B<--bin> requires B<--pipe> and a fixed numeric value for B<--jobs>.
660 See also: SPREADING BLOCKS OF DATA B<--group-by> B<--round-robin>
661 B<--shard>
664 =item B<--bg>
666 Run command in background.
668 GNU B<parallel> will normally wait for the completion of a job. With
669 B<--bg> GNU B<parallel> will not wait for completion of the command
670 before exiting.
672 This is the default if B<--semaphore> is set.
674 Implies B<--semaphore>.
676 See also: B<--fg> B<man sem>
679 =cut
681 # You accept to be added to a public hall of shame by
682 # removing this section.
683 =item B<--bibtex>
685 =item B<--citation>
687 Print the citation notice and BibTeX entry for GNU B<parallel>,
688 silence citation notice for all future runs, and exit. It will not run
689 any commands.
691 If it is impossible for you to run B<--citation> you can instead use
692 B<--will-cite>, which will run commands, but which will only silence
693 the citation notice for this single run.
695 If you use B<--will-cite> in scripts to be run by others you are
696 making it harder for others to see the citation notice. The
697 development of GNU B<parallel> is indirectly financed through
698 citations, so if your users do not know they should cite then you are
699 making it harder to finance development. However, if you pay 10000
700 EUR, you have done your part to finance future development and should
701 feel free to use B<--will-cite> in scripts.
703 If you do not want to help financing future development by letting
704 other users see the citation notice or by paying, then please consider
705 using another tool instead of GNU B<parallel>. You can find some of
706 the alternatives in B<man parallel_alternatives>.
709 =item B<--block> I<size>
711 =item B<--block-size> I<size>
713 Size of block in bytes to read at a time.
715 The I<size> can be postfixed with K, M, G, T, P, k, m, g, t, or p.
717 GNU B<parallel> tries to meet the block size but can be off by the
718 length of one record. For performance reasons I<size> should be bigger
719 than a two records. GNU B<parallel> will warn you and automatically
720 increase the size if you choose a I<size> that is too small.
722 If you use B<-N>, B<--block> should be bigger than N+1 records.
724 I<size> defaults to 1M.
726 When using B<--pipe-part> a negative block size is not interpreted as a
727 blocksize but as the number of blocks each jobslot should have. So
728 this will run 10*5 = 50 jobs in total:
730 parallel --pipe-part -a myfile --block -10 -j5 wc
732 This is an efficient alternative to B<--round-robin> because data is
733 never read by GNU B<parallel>, but you can still have very few
734 jobslots process large amounts of data.
736 See also: UNIT PREFIX B<-N> B<--pipe> B<--pipe-part> B<--round-robin>
737 B<--block-timeout>
739 =item B<--block-timeout> I<duration>
741 =item B<--bt> I<duration>
743 Timeout for reading block when using B<--pipe>.
745 If it takes longer than I<duration> to read a full block, use the
746 partial block read so far.
748 I<duration> is in seconds, but can be postfixed with s, m, h, or d.
750 See also: TIME POSTFIXES B<--pipe> B<--block>
753 =item B<--cat>
755 Create a temporary file with content.
757 Normally B<--pipe>/B<--pipe-part> will give data to the program on
758 stdin (standard input). With B<--cat> GNU B<parallel> will create a
759 temporary file with the name in B<{}>, so you can do: B<parallel
760 --pipe --cat wc {}>.
762 Implies B<--pipe> unless B<--pipe-part> is used.
764 See also: B<--pipe> B<--pipe-part> B<--fifo>
767 =item B<--cleanup>
769 Remove transferred files.
771 B<--cleanup> will remove the transferred files on the remote computer
772 after processing is done.
774 find log -name '*gz' | parallel \
775 --sshlogin server.example.com --transferfile {} \
776 --return {.}.bz2 --cleanup "zcat {} | bzip -9 >{.}.bz2"
778 With B<--transferfile {}> the file transferred to the remote computer
779 will be removed on the remote computer. Directories on the remote
780 computer containing the file will be removed if they are empty.
782 With B<--return> the file transferred from the remote computer will be
783 removed on the remote computer. Directories on the remote
784 computer containing the file will be removed if they are empty.
786 B<--cleanup> is ignored when not used with B<--basefile>,
787 B<--transfer>, B<--transferfile> or B<--return>.
789 See also: B<--basefile> B<--transfer> B<--transferfile> B<--sshlogin>
790 B<--return>
793 =item B<--color>
795 Colour output.
797 Colour the output. Each job gets its own colour combination
798 (background+foreground).
800 B<--color> is ignored when using B<-u>.
802 See also: B<--color-failed>
805 =item B<--color-failed>
807 =item B<--cf>
809 Colour the output from failing jobs white on red.
811 Useful if you have a lot of jobs and want to focus on the failing
812 jobs.
814 B<--color-failed> is ignored when using B<-u>, B<--line-buffer> and
815 unreliable when using B<--latest-line>.
817 See also: B<--color>
820 =item B<--colsep> I<regexp>
822 =item B<-C> I<regexp>
824 Column separator.
826 The input will be treated as a table with I<regexp> separating the
827 columns. The n'th column can be accessed using B<{>I<n>B<}> or
828 B<{>I<n>.B<}>. E.g. B<{3}> is the 3rd column.
830 If there are more input sources, each input source will be separated,
831 but the columns from each input source will be linked. Here {4} refers
832 to column 2 in input source 2:
834 parallel --colsep '-' echo {4} {3} {2} {1} \
835 ::: A-B C-D ::: e-f g-h
837 B<--colsep> implies B<--trim rl>, which can be overridden with
838 B<--trim n>.
840 I<regexp> is a Perl Regular Expression:
841 https://perldoc.perl.org/perlre.html
843 See also: B<--csv> B<{>I<n>B<}> B<--trim> B<--link>
846 =item B<--combineexec> I<name>
848 =item B<--combine-executable> I<name>
850 Combine GNU B<parallel> with another program into a single executable.
852 Let us say you have developed I<myprg> which takes a single
853 argument. You do not want to parallelize it yourself.
855 You could write a wrapper that uses GNU B<parallel> called B<myparprg>:
857 #!/bin/sh
859 parallel myprg ::: "$@"
861 But for others to use this, they need to install: GNU B<parallel>,
862 B<myprg>, and B<myparprg>.
864 It would be easier to install if all could be packed into a single
865 executable.
867 If B<myprg> is written in shell, you can use B<--embed>.
869 If B<myprg> is a binary you can use B<--combineexec>.
871 Here we use B<gzip> as example:
873 parallel --combineexec pargzip gzip -9 :::
875 You can now do:
877 ./pargzip foo bar baz
879 If you want to pass options to B<gzip> you can do:
881 parallel --combineexec pargzip gzip
883 Followed by:
885 ./pargzip -1 ::: foo bar baz
887 See also: B<--embed> B<--shebang> B<--shebang-wrap>
890 =item B<--compress>
892 Compress temporary files.
894 If the output is big and very compressible this will take up less disk
895 space in $TMPDIR and possibly be faster due to less disk I/O.
897 GNU B<parallel> will try B<pzstd>, B<lbzip2>, B<pbzip2>, B<zstd>,
898 B<pigz>, B<lz4>, B<lzop>, B<plzip>, B<lzip>, B<lrz>, B<gzip>, B<pxz>,
899 B<lzma>, B<bzip2>, B<xz>, B<clzip>, in that order, and use the first
900 available.
902 GNU B<parallel> will use up to 8 processes per job waiting to be
903 printed. See B<man parallel_design> for details.
905 See also: B<--compress-program>
908 =item B<--compress-program> I<prg>
910 =item B<--decompress-program> I<prg>
912 Use I<prg> for (de)compressing temporary files.
914 It is assumed that I<prg -dc> will decompress stdin (standard input)
915 to stdout (standard output) unless B<--decompress-program> is given.
917 See also: B<--compress>
920 =item B<--csv>
922 Treat input as CSV-format.
924 B<--colsep> sets the field delimiter. It works very much like
925 B<--colsep> except it deals correctly with quoting. Compare:
927 echo '"1 big, 2 small","2""x4"" plank",12.34' |
928 parallel --csv echo {1} of {2} at {3}
930 echo '"1 big, 2 small","2""x4"" plank",12.34' |
931 parallel --colsep ',' echo {1} of {2} at {3}
933 Even quoted newlines are parsed correctly:
935 (echo '"Start of field 1 with newline'
936 echo 'Line 2 in field 1";value 2') |
937 parallel --csv --colsep ';' echo Field 1: {1} Field 2: {2}
939 When used with B<--pipe> only pass full CSV-records.
941 See also: B<--pipe> B<--link> B<{>I<n>B<}> B<--colsep> B<--header>
944 =item B<--ctag> (obsolete: use B<--color> B<--tag>)
946 Color tag.
948 If the values look very similar looking at the output it can be hard
949 to tell when a new value is used. B<--ctag> gives each value a random
950 color.
952 See also: B<--color> B<--tag>
955 =item B<--ctagstring> I<str> (obsolete: use B<--color> B<--tagstring>)
957 Color tagstring.
959 See also: B<--color> B<--ctag> B<--tagstring>
962 =item B<--delay> I<duration>
964 Delay starting next job by I<duration>.
966 GNU B<parallel> will not start another job for the next I<duration>.
968 I<duration> is in seconds, but can be postfixed with s, m, h, or d.
970 If you append 'auto' to I<duration> (e.g. 13m3sauto) GNU B<parallel>
971 will automatically try to find the optimal value: If a job fails,
972 I<duration> is increased by 30%. If a job succeeds, I<duration> is
973 decreased by 10%.
975 See also: TIME POSTFIXES B<--retries> B<--ssh-delay>
978 =item B<--delimiter> I<delim>
980 =item B<-d> I<delim>
982 Input items are terminated by I<delim>.
984 The specified delimiter may be characters, C-style character escapes
985 such as \n, or octal or hexadecimal escape codes. Octal and
986 hexadecimal escape codes are understood as for the printf command.
988 See also: B<--colsep>
991 =item B<--dirnamereplace> I<replace-str>
993 =item B<--dnr> I<replace-str>
995 Use the replacement string I<replace-str> instead of B<{//}> for
996 dirname of input line.
998 See also: B<{//}>
1001 =item B<--dry-run>
1003 Print the job to run on stdout (standard output), but do not run the
1004 job.
1006 Use B<-v -v> to include the wrapping that GNU B<parallel> generates
1007 (for remote jobs, B<--tmux>, B<--nice>, B<--pipe>, B<--pipe-part>,
1008 B<--fifo> and B<--cat>). Do not count on this literally, though, as
1009 the job may be scheduled on another computer or the local computer if
1010 : is in the list.
1012 See also: B<-v>
1015 =item B<-E> I<eof-str>
1017 Set the end of file string to I<eof-str>.
1019 If the end of file string occurs as a line of input, the rest of the
1020 input is not read. If neither B<-E> nor B<-e> is used, no end of file
1021 string is used.
1024 =item B<--eof>[=I<eof-str>]
1026 =item B<-e>[I<eof-str>]
1028 This option is a synonym for the B<-E> option.
1030 Use B<-E> instead, because it is POSIX compliant for B<xargs> while
1031 this option is not. If I<eof-str> is omitted, there is no end of file
1032 string. If neither B<-E> nor B<-e> is used, no end of file string is
1033 used.
1036 =item B<--embed>
1038 Embed GNU B<parallel> in a shell script.
1040 If you need to distribute your script to someone who does not want to
1041 install GNU B<parallel> you can embed GNU B<parallel> in your own
1042 shell script:
1044 parallel --embed > new_script
1046 After which you add your code at the end of B<new_script>. This is tested
1047 on B<ash>, B<bash>, B<dash>, B<ksh>, B<sh>, and B<zsh>.
1050 =item B<--env> I<var>
1052 Copy exported environment variable I<var>.
1054 This will copy I<var> to the environment that the command is run
1055 in. This is especially useful for remote execution.
1057 In Bash I<var> can also be a Bash function - just remember to B<export
1058 -f> the function.
1060 The variable '_' is special. It will copy all exported environment
1061 variables except for the ones mentioned in ~/.parallel/ignored_vars.
1063 To copy the full environment (both exported and not exported
1064 variables, arrays, and functions) use B<env_parallel>.
1066 See also: B<--record-env> B<--session> B<--sshlogin> I<command>
1067 B<env_parallel>
1070 =item B<--eta>
1072 Show the estimated number of seconds before finishing.
1074 This forces GNU B<parallel> to read all jobs before starting to find
1075 the number of jobs (unless you use B<--total-jobs>). GNU B<parallel>
1076 normally only reads the next job to run.
1078 The estimate is based on the runtime of finished jobs, so the first
1079 estimate will only be shown when the first job has finished.
1081 Implies B<--progress>.
1083 See also: B<--bar> B<--progress> B<--total-jobs>
1086 =item B<--fg>
1088 Run command in foreground.
1090 With B<--tmux> and B<--tmuxpane> GNU B<parallel> will start B<tmux> in
1091 the foreground.
1093 With B<--semaphore> GNU B<parallel> will run the command in the
1094 foreground (opposite B<--bg>), and wait for completion of the command
1095 before exiting. Exit code will be that of the command.
1097 See also: B<--bg> B<man sem>
1100 =item B<--fifo>
1102 Create a temporary fifo with content.
1104 Normally B<--pipe> and B<--pipe-part> will give data to the program on
1105 stdin (standard input). With B<--fifo> GNU B<parallel> will create a
1106 temporary fifo with the name in B<{}>, so you can do:
1108 parallel --pipe --fifo wc {}
1110 Beware: If the fifo is never opened for reading, the job will block forever:
1112 seq 1000000 | parallel --fifo echo This will block forever
1113 seq 1000000 | parallel --fifo 'echo This will not block < {}'
1115 By using B<--fifo> instead of B<--cat> you may save I/O as B<--cat>
1116 will write to a temporary file, whereas B<--fifo> will not.
1118 Implies B<--pipe> unless B<--pipe-part> is used.
1120 See also: B<--cat> B<--pipe> B<--pipe-part>
1123 =item B<--filter> I<filter>
1125 Only run jobs where I<filter> is true.
1127 I<filter> can contain replacement strings and Perl code. Example:
1129 parallel --filter '{1}+{2}+{3} < 10' echo {1},{2},{3} \
1130 ::: {1..10} ::: {3..8} ::: {3..10}
1132 Outputs: 1,3,3 1,3,4 1,3,5 1,4,3 1,4,4 1,5,3 2,3,3 2,3,4 2,4,3 3,3,3
1134 parallel --filter '{1} < {2}*{2}' echo {1},{2} \
1135 ::: {1..10} ::: {1..3}
1137 Outputs: 1,2 1,3 2,2 2,3 3,2 3,3 4,3 5,3 6,3 7,3 8,3
1139 parallel --filter '{choose_k}' --plus echo {1},{2},{3} \
1140 ::: {1..5} ::: {1..5} ::: {1..5}
1142 Outputs: 1,2,3 1,2,4 1,2,5 1,3,4 1,3,5 1,4,5 2,3,4 2,3,5 2,4,5 3,4,5
1144 See also: B<skip()> B<--no-run-if-empty> B<{choose_k}>
1147 =item B<--filter-hosts>
1149 Remove down hosts.
1151 For each remote host: check that login through ssh works. If not: do
1152 not use this host.
1154 For performance reasons, this check is performed only at the start and
1155 every time B<--sshloginfile> is changed. If an host goes down after
1156 the first check, it will go undetected until B<--sshloginfile> is
1157 changed; B<--retries> can be used to mitigate this.
1159 Currently you can I<not> put B<--filter-hosts> in a profile,
1160 $PARALLEL, /etc/parallel/config or similar. This is because GNU
1161 B<parallel> uses GNU B<parallel> to compute this, so you will get an
1162 infinite loop. This will likely be fixed in a later release.
1164 See also: B<--sshloginfile> B<--sshlogin> B<--retries>
1167 =item B<--gnu>
1169 Behave like GNU B<parallel>.
1171 This option historically took precedence over B<--tollef>. The
1172 B<--tollef> option is now retired, and therefore may not be
1173 used. B<--gnu> is kept for compatibility, but does nothing.
1176 =item B<--group>
1178 Group output.
1180 Output from each job is grouped together and is only printed when the
1181 command is finished. Stdout (standard output) first followed by stderr
1182 (standard error).
1184 This takes in the order of 0.5ms CPU time per job and depends on the
1185 speed of your disk for larger output.
1187 B<--group> is the default.
1189 See also: B<--line-buffer> B<--ungroup> B<--tag>
1192 =item B<--group-by> I<val>
1194 Group input by value.
1196 Combined with B<--pipe>/B<--pipe-part> B<--group-by> groups lines with
1197 the same value into a record.
1199 The value can be computed from the full line or from a single column.
1201 I<val> can be:
1203 =over 15
1205 =item Z<> column number
1207 Use the value in the column numbered.
1209 =item Z<> column name
1211 Treat the first line as a header and use the value in the column
1212 named.
1214 (Not supported with B<--pipe-part>).
1216 =item Z<> perl expression
1218 Run the perl expression and use $_ as the value.
1220 =item Z<> column number perl expression
1222 Put the value of the column put in $_, run the perl expression, and use $_ as the value.
1224 =item Z<> column name perl expression
1226 Put the value of the column put in $_, run the perl expression, and use $_ as the value.
1228 (Not supported with B<--pipe-part>).
1230 =back
1232 Example:
1234 UserID, Consumption
1235 123, 1
1236 123, 2
1237 12-3, 1
1238 221, 3
1239 221, 1
1240 2/21, 5
1242 If you want to group 123, 12-3, 221, and 2/21 into 4 records and pass
1243 one record at a time to B<wc>:
1245 tail -n +2 table.csv | \
1246 parallel --pipe --colsep , --group-by 1 -kN1 wc
1248 Make GNU B<parallel> treat the first line as a header:
1250 cat table.csv | \
1251 parallel --pipe --colsep , --header : --group-by 1 -kN1 wc
1253 Address column by column name:
1255 cat table.csv | \
1256 parallel --pipe --colsep , --header : --group-by UserID -kN1 wc
1258 If 12-3 and 123 are really the same UserID, remove non-digits in
1259 UserID when grouping:
1261 cat table.csv | parallel --pipe --colsep , --header : \
1262 --group-by 'UserID s/\D//g' -kN1 wc
1264 See also: SPREADING BLOCKS OF DATA B<--pipe> B<--pipe-part> B<--bin>
1265 B<--shard> B<--round-robin>
1268 =item B<--help>
1270 =item B<-h>
1272 Print a summary of the options to GNU B<parallel> and exit.
1275 =item B<--halt-on-error> I<val>
1277 =item B<--halt> I<val>
1279 When should GNU B<parallel> terminate?
1281 In some situations it makes no sense to run all jobs. GNU
1282 B<parallel> should simply stop as soon as a condition is met.
1284 I<val> defaults to B<never>, which runs all jobs no matter what.
1286 I<val> can also take on the form of I<when>,I<why>.
1288 I<when> can be 'now' which means kill all running jobs and halt
1289 immediately, or it can be 'soon' which means wait for all running jobs
1290 to complete, but start no new jobs.
1292 I<why> can be 'fail=X', 'fail=Y%', 'success=X', 'success=Y%',
1293 'done=X', or 'done=Y%' where X is the number of jobs that has to fail,
1294 succeed, or be done before halting, and Y is the percentage of jobs
1295 that has to fail, succeed, or be done before halting.
1297 Example:
1299 =over 23
1301 =item Z<> --halt now,fail=1
1303 exit when a job has failed. Kill running jobs.
1305 =item Z<> --halt soon,fail=3
1307 exit when 3 jobs have failed, but wait for running jobs to complete.
1309 =item Z<> --halt soon,fail=3%
1311 exit when 3% of the jobs have failed, but wait for running jobs to complete.
1313 =item Z<> --halt now,success=1
1315 exit when a job has succeeded. Kill running jobs.
1317 =item Z<> --halt soon,success=3
1319 exit when 3 jobs have succeeded, but wait for running jobs to complete.
1321 =item Z<> --halt now,success=3%
1323 exit when 3% of the jobs have succeeded. Kill running jobs.
1325 =item Z<> --halt now,done=1
1327 exit when a job has finished. Kill running jobs.
1329 =item Z<> --halt soon,done=3
1331 exit when 3 jobs have finished, but wait for running jobs to complete.
1333 =item Z<> --halt now,done=3%
1335 exit when 3% of the jobs have finished. Kill running jobs.
1337 =back
1339 For backwards compatibility these also work:
1341 =over 12
1343 =item Z<>0
1345 never
1347 =item Z<>1
1349 soon,fail=1
1351 =item Z<>2
1353 now,fail=1
1355 =item Z<>-1
1357 soon,success=1
1359 =item Z<>-2
1361 now,success=1
1363 =item Z<>1-99%
1365 soon,fail=1-99%
1367 =back
1370 =item B<--header> I<regexp>
1372 Use regexp as header.
1374 For normal usage the matched header (typically the first line:
1375 B<--header '.*\n'>) will be split using B<--colsep> (which will
1376 default to '\t') and column names can be used as replacement
1377 variables: B<{column name}>, B<{column name/}>, B<{column name//}>,
1378 B<{column name/.}>, B<{column name.}>, B<{=column name perl expression
1379 =}>, ..
1381 For B<--pipe> the matched header will be prepended to each output.
1383 B<--header :> is an alias for B<--header '.*\n'>.
1385 If I<regexp> is a number, it is a fixed number of lines.
1387 B<--header 0> is special: It will make replacement strings for files
1388 given with B<--arg-file> or B<::::>. It will make B<{foo/bar}> for the
1389 file B<foo/bar>.
1391 See also: B<--colsep> B<--pipe> B<--pipe-part> B<--arg-file>
1394 =item B<--hostgroups>
1396 =item B<--hgrp>
1398 Enable hostgroups on arguments.
1400 If an argument contains '@' the string after '@' will be removed and
1401 treated as a list of hostgroups on which this job is allowed to
1402 run. If there is no B<--sshlogin> with a corresponding group, the job
1403 will run on any hostgroup.
1405 Example:
1407 parallel --hostgroups \
1408 --sshlogin @grp1/myserver1 -S @grp1+grp2/myserver2 \
1409 --sshlogin @grp3/myserver3 \
1410 echo ::: my_grp1_arg@grp1 arg_for_grp2@grp2 third@grp1+grp3
1412 B<my_grp1_arg> may be run on either B<myserver1> or B<myserver2>,
1413 B<third> may be run on either B<myserver1> or B<myserver3>,
1414 but B<arg_for_grp2> will only be run on B<myserver2>.
1416 See also: B<--sshlogin> B<$PARALLEL_HOSTGROUPS> B<$PARALLEL_ARGHOSTGROUPS>
1419 =item B<-I> I<replace-str>
1421 Use the replacement string I<replace-str> instead of B<{}>.
1423 See also: B<{}>
1426 =item B<--replace> [I<replace-str>]
1428 =item B<-i> [I<replace-str>]
1430 This option is deprecated; use B<-I> instead.
1432 This option is a synonym for B<-I>I<replace-str> if I<replace-str> is
1433 specified, and for B<-I {}> otherwise.
1435 See also: B<{}>
1438 =item B<--joblog> I<logfile>
1440 =item B<--jl> I<logfile>
1442 Logfile for executed jobs.
1444 Save a list of the executed jobs to I<logfile> in the following TAB
1445 separated format: sequence number, sshlogin, start time as seconds
1446 since epoch, run time in seconds, bytes in files transferred, bytes in
1447 files returned, exit status, signal, and command run.
1449 For B<--pipe> bytes transferred and bytes returned are number of input
1450 and output of bytes.
1452 If B<logfile> is prepended with '+' log lines will be appended to the
1453 logfile.
1455 To convert the times into ISO-8601 strict do:
1457 cat logfile | perl -a -F"\t" -ne \
1458 'chomp($F[2]=`date -d \@$F[2] +%FT%T`); print join("\t",@F)'
1460 If the host is long, you can use B<column -t> to pretty print it:
1462 cat joblog | column -t
1464 See also: B<--resume> B<--resume-failed>
1467 =item B<--jobs> I<num>
1469 =item B<-j> I<num>
1471 =item B<--max-procs> I<num>
1473 =item B<-P> I<num>
1475 Number of jobslots on each machine.
1477 Run up to I<num> jobs in parallel. Default is 100%.
1479 =over 7
1481 =item I<num>
1483 Run up to I<num> jobs in parallel.
1485 =item Z<>0
1487 Run as many as possible (this can take a while to determine).
1489 Due to a bug B<-j 0> will also evaluate replacement strings twice up
1490 to the number of joblots:
1492 # This will not count from 1 but from number-of-jobslots
1493 seq 10000 | parallel -j0 echo '{= $_ = $foo++; =}' | head
1494 # This will count from 1
1495 seq 10000 | parallel -j100 echo '{= $_ = $foo++; =}' | head
1497 =item I<num>%
1499 Multiply the number of CPU threads by I<num> percent. E.g. 100% means
1500 one job per CPU thread on each machine.
1502 =item +I<num>
1504 Add I<num> to the number of CPU threads.
1506 =item -I<num>
1508 Subtract I<num> from the number of CPU threads.
1510 =item I<expr>
1512 Evaluate I<expr>. E.g. '12/2' to get 6, '+25%' gives the same as
1513 '125%', or complex expressions like '+3*log(55)%' which means:
1514 multiply 3 by log(55), multiply that by the number of CPU threads and
1515 divide by 100, add this to the number of CPU threads.
1517 An expression that evalutates to less that 1 is replaced with 1.
1519 =item I<procfile>
1521 Read parameter from file.
1523 Use the content of I<procfile> as parameter for
1524 I<-j>. E.g. I<procfile> could contain the string 100% or +2 or 10.
1526 If I<procfile> is changed when a job completes, I<procfile> is read
1527 again and the new number of jobs is computed. If the number is lower
1528 than before, running jobs will be allowed to finish but new jobs will
1529 not be started until the wanted number of jobs has been reached. This
1530 makes it possible to change the number of simultaneous running jobs
1531 while GNU B<parallel> is running.
1533 =back
1535 If the evaluated number is less than 1 then 1 will be used.
1537 If B<--semaphore> is set, the default is 1 thus making a mutex.
1539 See also: B<--use-cores-instead-of-threads>
1540 B<--use-sockets-instead-of-threads>
1543 =item B<--keep-order>
1545 =item B<-k>
1547 Keep sequence of output same as the order of input.
1549 Normally the output of a job will be printed as soon as the job
1550 completes. Try this to see the difference:
1552 parallel -j4 sleep {}\; echo {} ::: 2 1 4 3
1553 parallel -j4 -k sleep {}\; echo {} ::: 2 1 4 3
1555 If used with B<--onall> or B<--nonall> the output will grouped by
1556 sshlogin in sorted order.
1558 B<--keep-order> cannot keep the output order when used with B<--pipe
1559 --round-robin>. Here it instead means, that the jobslots will get the
1560 same blocks as input in the same order in every run if the input is
1561 kept the same. Run each of these twice and compare:
1563 seq 10000000 | parallel --pipe --round-robin 'sleep 0.$RANDOM; wc'
1564 seq 10000000 | parallel --pipe -k --round-robin 'sleep 0.$RANDOM; wc'
1566 B<-k> only affects the order in which the output is printed - not the
1567 order in which jobs are run.
1569 See also: B<--group> B<--line-buffer>
1572 =item B<-L> I<recsize>
1574 When used with B<--pipe>: Read records of I<recsize>.
1576 When used otherwise: Use at most I<recsize> nonblank input lines per
1577 command line. Trailing blanks cause an input line to be logically
1578 continued on the next input line.
1580 B<-L 0> means read one line, but insert 0 arguments on the command
1581 line.
1583 I<recsize> can be postfixed with K, M, G, T, P, k, m, g, t, or p.
1585 Implies B<-X> unless B<-m>, B<--xargs>, or B<--pipe> is set.
1587 See also: UNIT PREFIX B<-N> B<--max-lines> B<--block> B<-X> B<-m>
1588 B<--xargs> B<--pipe>
1591 =item B<--max-lines> [I<recsize>]
1593 =item B<-l>[I<recsize>]
1595 When used with B<--pipe>: Read records of I<recsize> lines.
1597 When used otherwise: Synonym for the B<-L> option. Unlike B<-L>, the
1598 I<recsize> argument is optional. If I<recsize> is not specified,
1599 it defaults to one. The B<-l> option is deprecated since the POSIX
1600 standard specifies B<-L> instead.
1602 B<-l 0> is an alias for B<-l 1>.
1604 Implies B<-X> unless B<-m>, B<--xargs>, or B<--pipe> is set.
1606 See also: UNIT PREFIX B<-N> B<--block> B<-X> B<-m>
1607 B<--xargs> B<--pipe>
1610 =item B<--limit> "I<command> I<args>"
1612 Dynamic job limit.
1614 Before starting a new job run I<command> with I<args>. The exit value
1615 of I<command> determines what GNU B<parallel> will do:
1617 =over 4
1619 =item Z<>0
1621 Below limit. Start another job.
1623 =item Z<>1
1625 Over limit. Start no jobs.
1627 =item Z<>2
1629 Way over limit. Kill the youngest job.
1631 =back
1633 You can use any shell command. There are 3 predefined commands:
1635 =over 10
1637 =item "io I<n>"
1639 Limit for I/O. The amount of disk I/O will be computed as a value
1640 0-100, where 0 is no I/O and 100 is at least one disk is 100%
1641 saturated.
1643 =item "load I<n>"
1645 Similar to B<--load>.
1647 =item "mem I<n>"
1649 Similar to B<--memfree>.
1651 =back
1653 See also: B<--memfree> B<--load>
1656 =item B<--latest-line>
1658 =item B<--ll>
1660 Print the lastest line. Each job gets a single line that is updated
1661 with the lastest output from the job.
1663 Example:
1665 slow_seq() {
1666 seq "$@" |
1667 perl -ne '$|=1; for(split//){ print; select($a,$a,$a,0.03);}'
1669 export -f slow_seq
1670 parallel --shuf -j99 --ll --tag --bar --color slow_seq {} ::: {1..300}
1672 See also: B<--line-buffer>
1675 =item B<--line-buffer>
1677 =item B<--lb>
1679 Buffer output on line basis.
1681 B<--group> will keep the output together for a whole job. B<--ungroup>
1682 allows output to mixup with half a line coming from one job and half a
1683 line coming from another job. B<--line-buffer> fits between these two:
1684 GNU B<parallel> will print a full line, but will allow for mixing
1685 lines of different jobs.
1687 B<--line-buffer> takes more CPU power than both B<--group> and
1688 B<--ungroup>, but can be much faster than B<--group> if the CPU is not
1689 the limiting factor.
1691 Normally B<--line-buffer> does not buffer on disk, and can thus
1692 process an infinite amount of data, but it will buffer on disk when
1693 combined with: B<--keep-order>, B<--results>, B<--compress>, and
1694 B<--files>. This will make it as slow as B<--group> and will limit
1695 output to the available disk space.
1697 With B<--keep-order> B<--line-buffer> will output lines from the first
1698 job continuously while it is running, then lines from the second job
1699 while that is running. It will buffer full lines, but jobs will not
1700 mix. Compare:
1702 parallel -j0 'echo [{};sleep {};echo {}]' ::: 1 3 2 4
1703 parallel -j0 --lb 'echo [{};sleep {};echo {}]' ::: 1 3 2 4
1704 parallel -j0 -k --lb 'echo [{};sleep {};echo {}]' ::: 1 3 2 4
1706 See also: B<--group> B<--ungroup> B<--keep-order> B<--tag>
1709 =item B<--link>
1711 =item B<--xapply>
1713 Link input sources.
1715 Read multiple input sources like the command B<xapply>. If multiple
1716 input sources are given, one argument will be read from each of the
1717 input sources. The arguments can be accessed in the command as B<{1}>
1718 .. B<{>I<n>B<}>, so B<{1}> will be a line from the first input source,
1719 and B<{6}> will refer to the line with the same line number from the
1720 6th input source.
1722 Compare these two:
1724 parallel echo {1} {2} ::: 1 2 3 ::: a b c
1725 parallel --link echo {1} {2} ::: 1 2 3 ::: a b c
1727 Arguments will be recycled if one input source has more arguments than the others:
1729 parallel --link echo {1} {2} {3} \
1730 ::: 1 2 ::: I II III ::: a b c d e f g
1732 See also: B<--header> B<:::+> B<::::+>
1735 =item B<--load> I<max-load>
1737 Only start jobs if load is less than max-load.
1739 Do not start new jobs on a given computer unless the number of running
1740 processes on the computer is less than I<max-load>. I<max-load> uses
1741 the same syntax as B<--jobs>, so I<100%> for one per CPU is a valid
1742 setting. Only difference is 0 which is interpreted as 0.01.
1744 See also: B<--limit> B<--jobs>
1747 =item B<--controlmaster>
1749 =item B<-M>
1751 Use ssh's ControlMaster to make ssh connections faster.
1753 Useful if jobs run remote and are very fast to run. This is disabled
1754 for sshlogins that specify their own ssh command.
1756 See also: B<--ssh> B<--sshlogin>
1759 =item B<-m>
1761 Multiple arguments.
1763 Insert as many arguments as the command line length permits. If
1764 multiple jobs are being run in parallel: distribute the arguments
1765 evenly among the jobs. Use B<-j1> or B<--xargs> to avoid this.
1767 If B<{}> is not used the arguments will be appended to the
1768 line. If B<{}> is used multiple times each B<{}> will be replaced
1769 with all the arguments.
1771 Support for B<-m> with B<--sshlogin> is limited and may fail.
1773 If in doubt use B<-X> as that will most likely do what is needed.
1775 See also: B<-X> B<--xargs>
1778 =item B<--memfree> I<size> (alpha testing)
1780 Minimum memory free when starting another job.
1782 The I<size> can be postfixed with K, M, G, T, P, k, m, g, t, or p.
1784 If the jobs take up very different amount of RAM, GNU B<parallel> will
1785 only start as many as there is memory for. If less than I<size> bytes
1786 are free, no more jobs will be started. If less than 50% I<size> bytes
1787 are free, the youngest job will be killed (as per B<--term-seq>), and
1788 put back on the queue to be run later.
1790 See also: UNIT PREFIX B<--term-seq> B<--memsuspend>
1793 =item B<--memsuspend> I<size>
1795 Suspend jobs when there is less memory available.
1797 If the available memory falls below 2 * I<size>, GNU B<parallel> will
1798 suspend some of the running jobs. If the available memory falls below
1799 I<size>, only one job will be running.
1801 If a single job fits in the given size, all jobs will complete without
1802 running out of memory. If you have swap available, you can usually
1803 lower I<size> to around half the size of a single job - with the slight
1804 risk of swapping a little.
1806 Jobs will be resumed when more RAM is available - typically when the
1807 oldest job completes.
1809 B<--memsuspend> only works on local jobs because there is no obvious
1810 way to suspend remote jobs.
1812 I<size> can be postfixed with K, M, G, T, P, k, m, g, t, or p.
1814 See also: UNIT PREFIX B<--memfree>
1817 =item B<--minversion> I<version>
1819 Print the version GNU B<parallel> and exit.
1821 If the current version of GNU B<parallel> is less than I<version> the
1822 exit code is 255. Otherwise it is 0.
1824 This is useful for scripts that depend on features only available from
1825 a certain version of GNU B<parallel>:
1827 parallel --minversion 20170422 &&
1828 echo halt done=50% supported from version 20170422 &&
1829 parallel --halt now,done=50% echo ::: {1..100}
1831 See also: B<--version>
1834 =item B<--max-args> I<max-args>
1836 =item B<-n> I<max-args>
1838 Use at most I<max-args> arguments per command line.
1840 Fewer than I<max-args> arguments will be used if the size (see the
1841 B<-s> option) is exceeded, unless the B<-x> option is given, in which
1842 case GNU B<parallel> will exit.
1844 B<-n 0> means read one argument, but insert 0 arguments on the command
1845 line.
1847 I<max-args> can be postfixed with K, M, G, T, P, k, m, g, t, or p (see
1848 UNIT PREFIX).
1850 Implies B<-X> unless B<-m> is set.
1852 See also: B<-X> B<-m> B<--xargs> B<--max-replace-args>
1855 =item B<--max-replace-args> I<max-args>
1857 =item B<-N> I<max-args>
1859 Use at most I<max-args> arguments per command line.
1861 Like B<-n> but also makes replacement strings B<{1}>
1862 .. B<{>I<max-args>B<}> that represents argument 1 .. I<max-args>. If
1863 too few args the B<{>I<n>B<}> will be empty.
1865 B<-N 0> means read one argument, but insert 0 arguments on the command
1866 line.
1868 This will set the owner of the homedir to the user:
1870 tr ':' '\n' < /etc/passwd | parallel -N7 chown {1} {6}
1872 Implies B<-X> unless B<-m> or B<--pipe> is set.
1874 I<max-args> can be postfixed with K, M, G, T, P, k, m, g, t, or p.
1876 When used with B<--pipe> B<-N> is the number of records to read. This
1877 is somewhat slower than B<--block>.
1879 See also: UNIT PREFIX B<--pipe> B<--block> B<-m> B<-X> B<--max-args>
1882 =item B<--nonall> (alpha testing)
1884 B<--onall> with no arguments.
1886 Run the command on all computers given with B<--sshlogin> but take no
1887 arguments. GNU B<parallel> will log into B<--jobs> number of computers
1888 in parallel and run the job on the computer. B<-j> adjusts how many
1889 computers to log into in parallel.
1891 This is useful for running the same command (e.g. uptime) on a list of
1892 servers.
1894 See also: B<--onall> B<--sshlogin>
1897 =item B<--onall> (alpha testing)
1899 Run all the jobs on all computers given with B<--sshlogin>.
1901 GNU B<parallel> will log into B<--jobs> number of computers in
1902 parallel and run one job at a time on the computer. The order of the
1903 jobs will not be changed, but some computers may finish before others.
1905 When using B<--group> the output will be grouped by each server, so
1906 all the output from one server will be grouped together.
1908 B<--joblog> will contain an entry for each job on each server, so
1909 there will be several job sequence 1.
1911 See also: B<--nonall> B<--sshlogin>
1914 =item B<--open-tty>
1916 =item B<-o>
1918 Open terminal tty.
1920 Similar to B<--tty> but does not set B<--jobs> or B<--ungroup>.
1922 See also: B<--tty>
1925 =item B<--output-as-files>
1927 =item B<--outputasfiles>
1929 =item B<--files>
1931 =item B<--files0>
1933 Save output to files.
1935 Instead of printing the output to stdout (standard output) the output
1936 of each job is saved in a file and the filename is then printed.
1938 B<--files0> uses NUL (\0) instead of newline (\n) as separator.
1940 See also: B<--results>
1943 =item B<--pipe>
1945 =item B<--spreadstdin>
1947 Spread input to jobs on stdin (standard input).
1949 Read a block of data from stdin (standard input) and give one block of
1950 data as input to one job.
1952 The block size is determined by B<--block> (default: 1M).
1954 Except for the first and last record GNU B<parallel> only passes full
1955 records to the job. The strings B<--recstart> and B<--recend>
1956 determine where a record starts and ends: The border between two
1957 records is defined as B<--recend> immediately followed by
1958 B<--recstart>. GNU B<parallel> splits exactly after B<--recend> and
1959 before B<--recstart>. The block will have the last partial record
1960 removed before the block is passed on to the job. The partial record
1961 will be prepended to next block.
1963 You can limit the number of records to be passed with B<-N>, and set
1964 the record size with B<-L>.
1966 B<--pipe> maxes out at around 1 GB/s input, and 100 MB/s output. If
1967 performance is important use B<--pipe-part>.
1969 B<--fifo> and B<--cat> will give stdin (standard input) on a fifo or a
1970 temporary file.
1972 If data is arriving slowly, you can use B<--block-timeout> to finish
1973 reading a block early.
1975 The data can be spread between the jobs in specific ways using
1976 B<--round-robin>, B<--bin>, B<--shard>, B<--group-by>. See the
1977 section: SPREADING BLOCKS OF DATA
1979 See also: B<--block> B<--block-timeout> B<--recstart> B<--recend>
1980 B<--fifo> B<--cat> B<--pipe-part> B<-N> B<-L> B<--round-robin>
1983 =item B<--pipe-part>
1985 Pipe parts of a physical file.
1987 B<--pipe-part> works similar to B<--pipe>, but is much faster. 5 GB/s
1988 can easily be delivered.
1990 B<--pipe-part> has a few limitations:
1992 =over 3
1994 =item *
1996 The file must be a normal file or a block device (technically it must
1997 be seekable) and must be given using B<--arg-file> or B<::::>. The file cannot
1998 be a pipe, a fifo, or a stream as they are not seekable.
2000 If using a block device with lot of NUL bytes, remember to set
2001 B<--recend ''>.
2003 =item *
2005 Record counting (B<-N>) and line counting (B<-L>/B<-l>) do not
2006 work. Instead use B<--recstart> and B<--recend> to determine
2007 where records end.
2009 =back
2011 See also: B<--pipe> B<--recstart> B<--recend> B<--arg-file> B<::::>
2014 =item B<--plain>
2016 Ignore B<--profile>, $PARALLEL, and ~/.parallel/config.
2018 Ignore any B<--profile>, $PARALLEL, and ~/.parallel/config to get full
2019 control on the command line (used by GNU B<parallel> internally when
2020 called with B<--sshlogin>).
2022 See also: B<--profile>
2025 =item B<--plus>
2027 Add more replacement strings.
2029 Activate additional replacement strings: {+/} {+.} {+..} {+...} {..}
2030 {...} {/..} {/...} {##}. The idea being that '{+foo}' matches the
2031 opposite of '{foo}' so that:
2033 {} = {+/}/{/} = {.}.{+.} = {+/}/{/.}.{+.} = {..}.{+..} =
2034 {+/}/{/..}.{+..} = {...}.{+...} = {+/}/{/...}.{+...}
2036 B<{##}> is the total number of jobs to be run. It is incompatible with
2037 B<-X>/B<-m>/B<--xargs>.
2039 B<{0%}> zero-padded jobslot.
2041 B<{0#}> zero-padded sequence number.
2043 B<{slot-1}> jobslot - 1 (i.e. counting from 0).
2045 B<{seq-1}> sequence number - 1 (i.e. counting from 0).
2047 B<{choose_k}> is inspired by n choose k: Given a list of n elements,
2048 choose k. k is the number of input sources and n is the number of
2049 arguments in an input source. The content of the input sources must
2050 be the same and the arguments must be unique.
2052 B<{uniq}> skips jobs where values from two input sources are the same.
2054 Shorthands for variables:
2056 {slot} $PARALLEL_JOBSLOT (see {%})
2057 {sshlogin} $PARALLEL_SSHLOGIN
2058 {host} $PARALLEL_SSHHOST
2059 {agrp} $PARALLEL_ARGHOSTGROUPS
2060 {hgrp} $PARALLEL_HOSTGROUPS
2062 The following dynamic replacement strings are also activated. They are
2063 inspired by bash's parameter expansion:
2065 {:-str} str if the value is empty
2066 {:num} remove the first num characters
2067 {:pos:len} substring from position pos length len
2068 {#regexp} remove prefix regexp (non-greedy)
2069 {##regexp} remove prefix regexp (greedy)
2070 {%regexp} remove postfix regexp (non-greedy)
2071 {%%regexp} remove postfix regexp (greedy)
2072 {/regexp/str} replace one regexp with str
2073 {//regexp/str} replace every regexp with str
2074 {^str} uppercase str if found at the start
2075 {^^str} uppercase str
2076 {,str} lowercase str if found at the start
2077 {,,str} lowercase str
2079 See also: B<--rpl> B<{}>
2082 =item B<--process-slot-var> I<varname>
2084 Set the environment variable I<varname> to the jobslot number-1.
2086 seq 10 | parallel --process-slot-var=name echo '$name' {}
2089 =item B<--progress>
2091 Show progress of computations.
2093 List the computers involved in the task with number of CPUs detected
2094 and the max number of jobs to run. After that show progress for each
2095 computer: number of running jobs, number of completed jobs, and
2096 percentage of all jobs done by this computer. The percentage will only
2097 be available after all jobs have been scheduled as GNU B<parallel>
2098 only read the next job when ready to schedule it - this is to avoid
2099 wasting time and memory by reading everything at startup.
2101 By sending GNU B<parallel> SIGUSR2 you can toggle turning on/off
2102 B<--progress> on a running GNU B<parallel> process.
2104 See also: B<--eta> B<--bar>
2107 =item B<--max-line-length-allowed>
2109 Print maximal command line length.
2111 Print the maximal number of characters allowed on the command line and
2112 exit (used by GNU B<parallel> itself to determine the line length
2113 on remote computers).
2115 See also: B<--show-limits>
2118 =item B<--number-of-cpus> (obsolete)
2120 Print the number of physical CPU cores and exit.
2123 =item B<--number-of-cores>
2125 Print the number of physical CPU cores and exit (used by GNU B<parallel> itself
2126 to determine the number of physical CPU cores on remote computers).
2128 See also: B<--number-of-sockets> B<--number-of-threads>
2129 B<--use-cores-instead-of-threads> B<--jobs>
2132 =item B<--number-of-sockets>
2134 Print the number of filled CPU sockets and exit (used by GNU
2135 B<parallel> itself to determine the number of filled CPU sockets on
2136 remote computers).
2138 See also: B<--number-of-cores> B<--number-of-threads>
2139 B<--use-sockets-instead-of-threads> B<--jobs>
2142 =item B<--number-of-threads>
2144 Print the number of hyperthreaded CPU cores and exit (used by GNU
2145 B<parallel> itself to determine the number of hyperthreaded CPU cores
2146 on remote computers).
2148 See also: B<--number-of-cores> B<--number-of-sockets> B<--jobs>
2151 =item B<--no-keep-order>
2153 Overrides an earlier B<--keep-order> (e.g. if set in
2154 B<~/.parallel/config>).
2157 =item B<--nice> I<niceness>
2159 Run the command at this niceness.
2161 By default GNU B<parallel> will run jobs at the same nice level as GNU
2162 B<parallel> is started - both on the local machine and remote servers,
2163 so you are unlikely to ever use this option.
2165 Setting B<--nice> will override this nice level. If the nice level is
2166 smaller than the current nice level, it will only affect remote jobs
2167 (e.g. if current level is 10 then B<--nice 5> will cause local jobs to
2168 be run at level 10, but remote jobs run at nice level 5).
2171 =item B<--interactive>
2173 =item B<-p>
2175 Ask user before running a job.
2177 Prompt the user about whether to run each command line and read a line
2178 from the terminal. Only run the command line if the response starts
2179 with 'y' or 'Y'. Implies B<-t>.
2182 =item B<--_parset> I<type>,I<varname>
2184 Used internally by B<parset>.
2186 Generate shell code to be eval'ed which will set the variable(s)
2187 I<varname>. I<type> can be 'assoc' for associative array or 'var' for
2188 normal variables.
2190 The only supported use is as part of B<parset>.
2193 =item B<--parens> I<parensstring>
2195 Use I<parensstring> instead of B<{==}>.
2197 Define start and end parenthesis for B<{=perl expression=}>. The
2198 left and the right parenthesis can be multiple characters and are
2199 assumed to be the same length. The default is B<{==}> giving B<{=> as
2200 the start parenthesis and B<=}> as the end parenthesis.
2202 Another useful setting is B<,,,,> which would make both parenthesis
2203 B<,,>:
2205 parallel --parens ,,,, echo foo is ,,s/I/O/g,, ::: FII
2207 See also: B<--rpl> B<{=>I<perl expression>B<=}>
2210 =item B<--profile> I<profilename>
2212 =item B<-J> I<profilename>
2214 Use profile I<profilename> for options.
2216 This is useful if you want to have multiple profiles. You could have
2217 one profile for running jobs in parallel on the local computer and a
2218 different profile for running jobs on remote computers.
2220 I<profilename> corresponds to the file ~/.parallel/I<profilename>.
2222 You can give multiple profiles by repeating B<--profile>. If parts of
2223 the profiles conflict, the later ones will be used.
2225 Default: ~/.parallel/config
2227 See also: PROFILE FILES
2230 =item B<--quote>
2232 =item B<-q>
2234 Quote I<command>.
2236 If your command contains special characters that should not be
2237 interpreted by the shell (e.g. ; \ | *), use B<--quote> to escape
2238 these. The command must be a simple command (see B<man bash>) without
2239 redirections and without variable assignments.
2241 Most people will not need this. Quoting is disabled by default.
2243 See also: QUOTING I<command> B<--shell-quote> B<uq()> B<Q()>
2246 =item B<--no-run-if-empty>
2248 =item B<-r>
2250 Do not run empty input.
2252 If the stdin (standard input) only contains whitespace, do not run the
2253 command.
2255 If used with B<--pipe> this is slow.
2257 See also: I<command> B<--pipe> B<--interactive>
2260 =item B<--noswap>
2262 Do not start job is computer is swapping.
2264 Do not start new jobs on a given computer if there is both swap-in and
2265 swap-out activity.
2267 The swap activity is only sampled every 10 seconds as the sampling
2268 takes 1 second to do.
2270 Swap activity is computed as (swap-in)*(swap-out) which in practice is
2271 a good value: swapping out is not a problem, swapping in is not a
2272 problem, but both swapping in and out usually indicates a problem.
2274 B<--memfree> and B<--memsuspend> may give better results, so try using
2275 those first.
2277 See also: B<--memfree> B<--memsuspend>
2280 =item B<--record-env>
2282 Record exported environment.
2284 Record current exported environment variables in
2285 B<~/.parallel/ignored_vars>. This will ignore variables currently set
2286 when using B<--env _>. So you should set the variables/fuctions, you
2287 want to use I<after> running B<--record-env>.
2289 See also: B<--env> B<--session> B<env_parallel>
2292 =item B<--recstart> I<startstring>
2294 =item B<--recend> I<endstring>
2296 Split record between I<endstring> and I<startstring>.
2298 If B<--recstart> is given I<startstring> will be used to split at record start.
2300 If B<--recend> is given I<endstring> will be used to split at record end.
2302 If both B<--recstart> and B<--recend> are given the combined string
2303 I<endstring>I<startstring> will have to match to find a split
2304 position. This is useful if either I<startstring> or I<endstring>
2305 match in the middle of a record.
2307 If neither B<--recstart> nor B<--recend> are given, then B<--recend>
2308 defaults to '\n'. To have no record separator (e.g. for binary files)
2309 use B<--recend "">.
2311 B<--recstart> and B<--recend> are used with B<--pipe>.
2313 Use B<--regexp> to interpret B<--recstart> and B<--recend> as regular
2314 expressions. This is slow, however.
2316 Use B<--remove-rec-sep> to remove B<--recstart> and B<--recend> before
2317 passing the block to the job.
2319 See also: B<--pipe> B<--regexp> B<--remove-rec-sep>
2322 =item B<--regexp>
2324 Use B<--regexp> to interpret B<--recstart> and B<--recend> as regular
2325 expressions. This is slow, however.
2327 See also: B<--pipe> B<--regexp> B<--remove-rec-sep> B<--recstart>
2328 B<--recend>
2331 =item B<--remove-rec-sep>
2333 =item B<--removerecsep>
2335 =item B<--rrs>
2337 Remove record separator.
2339 Remove the text matched by B<--recstart> and B<--recend> before piping
2340 it to the command.
2342 Only used with B<--pipe>/B<--pipe-part>.
2344 See also: B<--pipe> B<--regexp> B<--pipe-part> B<--recstart>
2345 B<--recend>
2348 =item B<--results> I<name>
2350 =item B<--res> I<name>
2352 Save the output into files.
2354 B<Simple string output dir>
2356 If I<name> does not contain replacement strings and does not end in
2357 B<.csv/.tsv>, the output will be stored in a directory tree rooted at
2358 I<name>. Within this directory tree, each command will result in
2359 three files: I<name>/<ARGS>/stdout and I<name>/<ARGS>/stderr,
2360 I<name>/<ARGS>/seq, where <ARGS> is a sequence of directories
2361 representing the header of the input source (if using B<--header :>)
2362 or the number of the input source and corresponding values.
2364 E.g:
2366 parallel --header : --results foo echo {a} {b} \
2367 ::: a I II ::: b III IIII
2369 will generate the files:
2371 foo/a/II/b/III/seq
2372 foo/a/II/b/III/stderr
2373 foo/a/II/b/III/stdout
2374 foo/a/II/b/IIII/seq
2375 foo/a/II/b/IIII/stderr
2376 foo/a/II/b/IIII/stdout
2377 foo/a/I/b/III/seq
2378 foo/a/I/b/III/stderr
2379 foo/a/I/b/III/stdout
2380 foo/a/I/b/IIII/seq
2381 foo/a/I/b/IIII/stderr
2382 foo/a/I/b/IIII/stdout
2386 parallel --results foo echo {1} {2} ::: I II ::: III IIII
2388 will generate the files:
2390 foo/1/II/2/III/seq
2391 foo/1/II/2/III/stderr
2392 foo/1/II/2/III/stdout
2393 foo/1/II/2/IIII/seq
2394 foo/1/II/2/IIII/stderr
2395 foo/1/II/2/IIII/stdout
2396 foo/1/I/2/III/seq
2397 foo/1/I/2/III/stderr
2398 foo/1/I/2/III/stdout
2399 foo/1/I/2/IIII/seq
2400 foo/1/I/2/IIII/stderr
2401 foo/1/I/2/IIII/stdout
2404 B<CSV file output>
2406 If I<name> ends in B<.csv>/B<.tsv> the output will be a CSV-file
2407 named I<name>.
2409 B<.csv> gives a comma separated value file. B<.tsv> gives a TAB
2410 separated value file.
2412 B<-.csv>/B<-.tsv> are special: It will give the file on stdout
2413 (standard output).
2416 B<JSON file output>
2418 If I<name> ends in B<.json> the output will be a JSON-file
2419 named I<name>.
2421 B<-.json> is special: It will give the file on stdout (standard
2422 output).
2425 B<Replacement string output file>
2427 If I<name> contains a replacement string and the replaced result does
2428 not end in /, then the standard output will be stored in a file named
2429 by this result. Standard error will be stored in the same file name
2430 with '.err' added, and the sequence number will be stored in the same
2431 file name with '.seq' added.
2433 E.g.
2435 parallel --results my_{} echo ::: foo bar baz
2437 will generate the files:
2439 my_bar
2440 my_bar.err
2441 my_bar.seq
2442 my_baz
2443 my_baz.err
2444 my_baz.seq
2445 my_foo
2446 my_foo.err
2447 my_foo.seq
2450 B<Replacement string output dir>
2452 If I<name> contains a replacement string and the replaced result ends
2453 in /, then output files will be stored in the resulting dir.
2455 E.g.
2457 parallel --results my_{}/ echo ::: foo bar baz
2459 will generate the files:
2461 my_bar/seq
2462 my_bar/stderr
2463 my_bar/stdout
2464 my_baz/seq
2465 my_baz/stderr
2466 my_baz/stdout
2467 my_foo/seq
2468 my_foo/stderr
2469 my_foo/stdout
2471 See also: B<--output-as-files> B<--tag> B<--header> B<--joblog>
2474 =item B<--resume>
2476 Resumes from the last unfinished job.
2478 By reading B<--joblog> or the
2479 B<--results> dir GNU B<parallel> will figure out the last unfinished
2480 job and continue from there. As GNU B<parallel> only looks at the
2481 sequence numbers in B<--joblog> then the input, the command, and
2482 B<--joblog> all have to remain unchanged; otherwise GNU B<parallel>
2483 may run wrong commands.
2485 See also: B<--joblog> B<--results> B<--resume-failed> B<--retries>
2488 =item B<--resume-failed>
2490 Retry all failed and resume from the last unfinished job.
2492 By reading
2493 B<--joblog> GNU B<parallel> will figure out the failed jobs and run
2494 those again. After that it will resume last unfinished job and
2495 continue from there. As GNU B<parallel> only looks at the sequence
2496 numbers in B<--joblog> then the input, the command, and B<--joblog>
2497 all have to remain unchanged; otherwise GNU B<parallel> may run wrong
2498 commands.
2500 See also: B<--joblog> B<--resume> B<--retry-failed> B<--retries>
2503 =item B<--retry-failed>
2505 Retry all failed jobs in joblog.
2507 By reading B<--joblog> GNU
2508 B<parallel> will figure out the failed jobs and run those again.
2510 B<--retry-failed> ignores the command and arguments on the command
2511 line: It only looks at the joblog.
2513 B<Differences between --resume, --resume-failed, --retry-failed>
2515 In this example B<exit {= $_%=2 =}> will cause every other job to fail.
2517 timeout -k 1 4 parallel --joblog log -j10 \
2518 'sleep {}; exit {= $_%=2 =}' ::: {10..1}
2520 4 jobs completed. 2 failed:
2522 Seq [...] Exitval Signal Command
2523 10 [...] 1 0 sleep 1; exit 1
2524 9 [...] 0 0 sleep 2; exit 0
2525 8 [...] 1 0 sleep 3; exit 1
2526 7 [...] 0 0 sleep 4; exit 0
2528 B<--resume> does not care about the Exitval, but only looks at Seq. If
2529 the Seq is run, it will not be run again. So if needed, you can change
2530 the command for the seqs not run yet:
2532 parallel --resume --joblog log -j10 \
2533 'sleep .{}; exit {= $_%=2 =}' ::: {10..1}
2535 Seq [...] Exitval Signal Command
2536 [... as above ...]
2537 1 [...] 0 0 sleep .10; exit 0
2538 6 [...] 1 0 sleep .5; exit 1
2539 5 [...] 0 0 sleep .6; exit 0
2540 4 [...] 1 0 sleep .7; exit 1
2541 3 [...] 0 0 sleep .8; exit 0
2542 2 [...] 1 0 sleep .9; exit 1
2544 B<--resume-failed> cares about the Exitval, but also only looks at Seq
2545 to figure out which commands to run. Again this means you can change
2546 the command, but not the arguments. It will run the failed seqs and
2547 the seqs not yet run:
2549 parallel --resume-failed --joblog log -j10 \
2550 'echo {};sleep .{}; exit {= $_%=3 =}' ::: {10..1}
2552 Seq [...] Exitval Signal Command
2553 [... as above ...]
2554 10 [...] 1 0 echo 1;sleep .1; exit 1
2555 8 [...] 0 0 echo 3;sleep .3; exit 0
2556 6 [...] 2 0 echo 5;sleep .5; exit 2
2557 4 [...] 1 0 echo 7;sleep .7; exit 1
2558 2 [...] 0 0 echo 9;sleep .9; exit 0
2560 B<--retry-failed> cares about the Exitval, but takes the command from
2561 the joblog. It ignores any arguments or commands given on the command
2562 line:
2564 parallel --retry-failed --joblog log -j10 this part is ignored
2566 Seq [...] Exitval Signal Command
2567 [... as above ...]
2568 10 [...] 1 0 echo 1;sleep .1; exit 1
2569 6 [...] 2 0 echo 5;sleep .5; exit 2
2570 4 [...] 1 0 echo 7;sleep .7; exit 1
2572 See also: B<--joblog> B<--resume> B<--resume-failed> B<--retries>
2575 =item B<--retries> I<n>
2577 Try failing jobs I<n> times.
2579 If a job fails, retry it on another computer on which it has not
2580 failed. Do this I<n> times. If there are fewer than I<n> computers in
2581 B<--sshlogin> GNU B<parallel> will re-use all the computers. This is
2582 useful if some jobs fail for no apparent reason (such as network
2583 failure).
2585 I<n>=0 means infinite.
2587 See also: B<--term-seq> B<--sshlogin>
2590 =item B<--return> I<filename>
2592 Transfer files from remote computers.
2594 B<--return> is used with
2595 B<--sshlogin> when the arguments are files on the remote computers. When
2596 processing is done the file I<filename> will be transferred
2597 from the remote computer using B<rsync> and will be put relative to
2598 the default login dir. E.g.
2600 echo foo/bar.txt | parallel --return {.}.out \
2601 --sshlogin server.example.com touch {.}.out
2603 This will transfer the file I<$HOME/foo/bar.out> from the computer
2604 I<server.example.com> to the file I<foo/bar.out> after running
2605 B<touch foo/bar.out> on I<server.example.com>.
2607 parallel -S server --trc out/./{}.out touch {}.out ::: in/file
2609 This will transfer the file I<in/file.out> from the computer
2610 I<server.example.com> to the files I<out/in/file.out> after running
2611 B<touch in/file.out> on I<server>.
2613 echo /tmp/foo/bar.txt | parallel --return {.}.out \
2614 --sshlogin server.example.com touch {.}.out
2616 This will transfer the file I</tmp/foo/bar.out> from the computer
2617 I<server.example.com> to the file I</tmp/foo/bar.out> after running
2618 B<touch /tmp/foo/bar.out> on I<server.example.com>.
2620 Multiple files can be transferred by repeating the option multiple
2621 times:
2623 echo /tmp/foo/bar.txt | parallel \
2624 --sshlogin server.example.com \
2625 --return {.}.out --return {.}.out2 touch {.}.out {.}.out2
2627 B<--return> is ignored when used with B<--sshlogin :> or when not used
2628 with B<--sshlogin>.
2630 For details on transferring see B<--transferfile>.
2632 See also: B<--transfer> B<--transferfile> B<--sshlogin> B<--cleanup>
2633 B<--workdir>
2636 =item B<--round-robin>
2638 =item B<--round>
2640 Distribute chunks of standard input in a round robin fashion.
2642 Normally B<--pipe> will give a single block to each instance of the
2643 command. With B<--round-robin> all blocks will at random be written to
2644 commands already running. This is useful if the command takes a long
2645 time to initialize.
2647 With B<--keep-order> and B<--round-robin> the jobslots will get the
2648 same blocks as input in the same order in every run if the input is
2649 kept the same. See details under B<--keep-order>.
2651 B<--round-robin> implies B<--pipe>, except if B<--pipe-part> is given.
2653 See the section: SPREADING BLOCKS OF DATA.
2655 See also: B<--bin> B<--group-by> B<--shard>
2658 =item B<--rpl> 'I<tag> I<perl expression>'
2660 Define replacement string.
2662 Use I<tag> as a replacement string for I<perl expression>. This makes
2663 it possible to define your own replacement strings. GNU B<parallel>'s
2664 7 replacement strings are implemented as:
2666 --rpl '{} '
2667 --rpl '{#} 1 $_=$job->seq()'
2668 --rpl '{%} 1 $_=$job->slot()'
2669 --rpl '{/} s:.*/::'
2670 --rpl '{//} $Global::use{"File::Basename"} ||=
2671 eval "use File::Basename; 1;"; $_ = dirname($_);'
2672 --rpl '{/.} s:.*/::; s:\.[^/.]+$::;'
2673 --rpl '{.} s:\.[^/.]+$::'
2675 The B<--plus> replacement strings are implemented as:
2677 --rpl '{+/} s:/[^/]*$:: || s:.*$::'
2678 --rpl '{+.} s:.*\.:: || s:.*$::'
2679 --rpl '{+..} s:.*\.([^/.]+\.[^/.]+)$:$1: || s:.*$::'
2680 --rpl '{+...} s:.*\.([^/.]+\.[^/.]+\.[^/.]+)$:$1: || s:.*$::'
2681 --rpl '{..} s:\.[^/.]+\.[^/.]+$::'
2682 --rpl '{...} s:\.[^/.]+\.[^/.]+\.[^/.]+$::'
2683 --rpl '{/..} s:.*/::; s:\.[^/.]+\.[^/.]+$::'
2684 --rpl '{/...} s:.*/::; s:\.[^/.]+\.[^/.]+\.[^/.]+$::'
2685 --rpl '{choose_k}
2686 for $t (2..$#arg){ if($arg[$t-1] ge $arg[$t]) { skip() } }'
2687 --rpl '{##} 1 $_=total_jobs()'
2688 --rpl '{0%} 1 $f=1+int((log($Global::max_jobs_running||1)/
2689 log(10))); $_=sprintf("%0${f}d",slot())'
2690 --rpl '{0#} 1 $f=1+int((log(total_jobs())/log(10)));
2691 $_=sprintf("%0${f}d",seq())'
2692 --rpl '{seq(.*?)} $_=eval q{$job->seq()}.qq{$$1}'
2693 --rpl '{slot(.*?)} $_=eval q{$job->slot()}.qq{$$1}'
2695 --rpl '{:-([^}]+?)} $_ ||= $$1'
2696 --rpl '{:(\d+?)} substr($_,0,$$1) = ""'
2697 --rpl '{:(\d+?):(\d+?)} $_ = substr($_,$$1,$$2);'
2698 --rpl '{#([^#}][^}]*?)} $nongreedy=::make_regexp_ungreedy($$1);
2699 s/^$nongreedy(.*)/$1/;'
2700 --rpl '{##([^#}][^}]*?)} s/^$$1//;'
2701 --rpl '{%([^}]+?)} $nongreedy=::make_regexp_ungreedy($$1);
2702 s/(.*)$nongreedy$/$1/;'
2703 --rpl '{%%([^}]+?)} s/$$1$//;'
2704 --rpl '{/([^}]+?)/([^}]*?)} s/$$1/$$2/;'
2705 --rpl '{^([^}]+?)} s/^($$1)/uc($1)/e;'
2706 --rpl '{^^([^}]+?)} s/($$1)/uc($1)/eg;'
2707 --rpl '{,([^}]+?)} s/^($$1)/lc($1)/e;'
2708 --rpl '{,,([^}]+?)} s/($$1)/lc($1)/eg;'
2710 --rpl '{slot} 1 $_="\${PARALLEL_JOBSLOT}";uq()'
2711 --rpl '{host} 1 $_="\${PARALLEL_SSHHOST}";uq()'
2712 --rpl '{sshlogin} 1 $_="\${PARALLEL_SSHLOGIN}";uq()'
2713 --rpl '{hgrp} 1 $_="\${PARALLEL_HOSTGROUPS}";uq()'
2714 --rpl '{agrp} 1 $_="\${PARALLEL_ARGHOSTGROUPS}";uq()'
2716 If the user defined replacement string starts with '{' it can also be
2717 used as a positional replacement string (like B<{2.}>).
2719 It is recommended to only change $_ but you have full access to all
2720 of GNU B<parallel>'s internal functions and data structures.
2722 Here are a few examples:
2724 Is the job sequence even or odd?
2725 --rpl '{odd} $_ = seq() % 2 ? "odd" : "even"'
2726 Pad job sequence with leading zeros to get equal width
2727 --rpl '{0#} $f=1+int("".(log(total_jobs())/log(10)));
2728 $_=sprintf("%0${f}d",seq())'
2729 Job sequence counting from 0
2730 --rpl '{#0} $_ = seq() - 1'
2731 Job slot counting from 2
2732 --rpl '{%1} $_ = slot() + 1'
2733 Remove all extensions
2734 --rpl '{:} s:(\.[^/]+)*$::'
2736 You can have dynamic replacement strings by including parenthesis in
2737 the replacement string and adding a regular expression between the
2738 parenthesis. The matching string will be inserted as $$1:
2740 parallel --rpl '{%(.*?)} s/$$1//' echo {%.tar.gz} ::: my.tar.gz
2741 parallel --rpl '{:%(.+?)} s:$$1(\.[^/]+)*$::' \
2742 echo {:%_file} ::: my_file.tar.gz
2743 parallel -n3 --rpl '{/:%(.*?)} s:.*/(.*)$$1(\.[^/]+)*$:$1:' \
2744 echo job {#}: {2} {2.} {3/:%_1} ::: a/b.c c/d.e f/g_1.h.i
2746 You can even use multiple matches:
2748 parallel --rpl '{/(.+?)/(.*?)} s/$$1/$$2/;'
2749 echo {/replacethis/withthis} {/b/C} ::: a_replacethis_b
2751 parallel --rpl '{(.*?)/(.*?)} $_="$$2$_$$1"' \
2752 echo {swap/these} ::: -middle-
2754 See also: B<{=>I<perl expression>B<=}> B<--parens>
2757 =item B<--rsync-opts> I<options>
2759 Options to pass on to B<rsync>.
2761 Setting B<--rsync-opts> takes precedence over setting the environment
2762 variable $PARALLEL_RSYNC_OPTS.
2765 =item B<--max-chars> I<max-chars>
2767 =item B<-s> I<max-chars>
2769 Limit length of command.
2771 Use at most I<max-chars> characters per command line, including the
2772 command and initial-arguments and the terminating nulls at the ends of
2773 the argument strings. The largest allowed value is system-dependent,
2774 and is calculated as the argument length limit for exec, less the size
2775 of your environment. The default value is the maximum.
2777 I<max-chars> can be postfixed with K, M, G, T, P, k, m, g, t, or p
2778 (see UNIT PREFIX).
2780 Implies B<-X> unless B<-m> or B<--xargs> is set.
2782 See also: B<-X> B<-m> B<--xargs> B<--max-line-length-allowed>
2783 B<--show-limits>
2786 =item B<--show-limits>
2788 Display limits given by the operating system.
2790 Display the limits on the command-line length which are imposed by the
2791 operating system and the B<-s> option. Pipe the input from /dev/null
2792 (and perhaps specify --no-run-if-empty) if you don't want GNU B<parallel>
2793 to do anything.
2795 See also: B<--max-chars> B<--max-line-length-allowed> B<--version>
2798 =item B<--semaphore>
2800 Work as a counting semaphore.
2802 B<--semaphore> will cause GNU B<parallel> to start I<command> in the
2803 background. When the number of jobs given by B<--jobs> is reached, GNU
2804 B<parallel> will wait for one of these to complete before starting
2805 another command.
2807 B<--semaphore> implies B<--bg> unless B<--fg> is specified.
2809 The command B<sem> is an alias for B<parallel --semaphore>.
2811 See also: B<man sem> B<--bg> B<--fg> B<--semaphore-name>
2812 B<--semaphore-timeout> B<--wait>
2815 =item B<--semaphore-name> I<name>
2817 =item B<--id> I<name>
2819 Use B<name> as the name of the semaphore.
2821 The default is the name of the controlling tty (output from B<tty>).
2823 The default normally works as expected when used interactively, but
2824 when used in a script I<name> should be set. I<$$> or I<my_task_name>
2825 are often a good value.
2827 The semaphore is stored in ~/.parallel/semaphores/
2829 Implies B<--semaphore>.
2831 See also: B<man sem> B<--semaphore>
2834 =item B<--semaphore-timeout> I<secs>
2836 =item B<--st> I<secs>
2838 If I<secs> > 0: If the semaphore is not released within I<secs>
2839 seconds, take it anyway.
2841 If I<secs> < 0: If the semaphore is not released within I<secs>
2842 seconds, exit.
2844 I<secs> is in seconds, but can be postfixed with s, m, h, or d (see
2845 the section TIME POSTFIXES).
2847 Implies B<--semaphore>.
2849 See also: B<man sem>
2852 =item B<--seqreplace> I<replace-str>
2854 Use the replacement string I<replace-str> instead of B<{#}> for
2855 job sequence number.
2857 See also: B<{#}>
2860 =item B<--session>
2862 Record names in current environment in B<$PARALLEL_IGNORED_NAMES> and
2863 exit.
2865 Only used with B<env_parallel>. Aliases, functions, and variables with
2866 names in B<$PARALLEL_IGNORED_NAMES> will not be copied. So you should
2867 set variables/function you want copied I<after> running B<--session>.
2869 It is similar to B<--record-env>, but only for this session.
2871 Only supported in B<Ash, Bash, Dash, Ksh, Sh, and Zsh>.
2873 See also: B<--env> B<--record-env> B<env_parallel>
2876 =item B<--shard> I<shardexpr>
2878 Use I<shardexpr> as shard key and shard input to the jobs.
2880 I<shardexpr> is [column number|column name] [perlexpression] e.g.:
2883 Address
2884 3 $_%=100
2885 Address s/\d//g
2887 Each input line is split using B<--colsep>. The string of the column
2888 is put into $_, the perl expression is executed, the resulting string
2889 is hashed so that all lines of a given value is given to the same job
2890 slot.
2892 This is similar to sharding in databases.
2894 The performance is in the order of 100K rows per second. Faster if the
2895 I<shardcol> is small (<10), slower if it is big (>100).
2897 B<--shard> requires B<--pipe> and a fixed numeric value for B<--jobs>.
2899 See the section: SPREADING BLOCKS OF DATA.
2901 See also: B<--bin> B<--group-by> B<--round-robin>
2904 =item B<--shebang>
2906 =item B<--hashbang>
2908 GNU B<parallel> can be called as a shebang (#!) command as the first
2909 line of a script. The content of the file will be treated as
2910 inputsource.
2912 Like this:
2914 #!/usr/bin/parallel --shebang -r wget
2916 https://ftpmirror.gnu.org/parallel/parallel-20120822.tar.bz2
2917 https://ftpmirror.gnu.org/parallel/parallel-20130822.tar.bz2
2918 https://ftpmirror.gnu.org/parallel/parallel-20140822.tar.bz2
2920 B<--shebang> must be set as the first option.
2922 On FreeBSD B<env> is needed:
2924 #!/usr/bin/env -S parallel --shebang -r wget
2926 https://ftpmirror.gnu.org/parallel/parallel-20120822.tar.bz2
2927 https://ftpmirror.gnu.org/parallel/parallel-20130822.tar.bz2
2928 https://ftpmirror.gnu.org/parallel/parallel-20140822.tar.bz2
2930 There are many limitations of shebang (#!) depending on your operating
2931 system. See details on https://www.in-ulm.de/~mascheck/various/shebang/
2933 See also: B<--shebang-wrap>
2936 =item B<--shebang-wrap>
2938 GNU B<parallel> can parallelize scripts by wrapping the shebang
2939 line. If the program can be run like this:
2941 cat arguments | parallel the_program
2943 then the script can be changed to:
2945 #!/usr/bin/parallel --shebang-wrap /original/parser --options
2947 E.g.
2949 #!/usr/bin/parallel --shebang-wrap /usr/bin/python
2951 If the program can be run like this:
2953 cat data | parallel --pipe the_program
2955 then the script can be changed to:
2957 #!/usr/bin/parallel --shebang-wrap --pipe /orig/parser --opts
2959 E.g.
2961 #!/usr/bin/parallel --shebang-wrap --pipe /usr/bin/perl -w
2963 B<--shebang-wrap> must be set as the first option.
2965 See also: B<--shebang>
2968 =item B<--shell-completion> I<shell>
2970 Generate shell completion code for interactive shells.
2972 Supported shells: bash zsh.
2974 Use I<auto> as I<shell> to automatically detect running shell.
2976 Activate the completion code with:
2978 zsh% eval "$(parallel --shell-completion auto)"
2979 bash$ eval "$(parallel --shell-completion auto)"
2981 Or put this `/usr/share/zsh/site-functions/_parallel`, then `compinit`
2982 to generate `~/.zcompdump`:
2984 #compdef parallel
2986 (( $+functions[_comp_parallel] )) ||
2987 eval "$(parallel --shell-completion auto)" &&
2988 _comp_parallel
2991 =item B<--shell-quote>
2993 Does not run the command but quotes it. Useful for making quoted
2994 composed commands for GNU B<parallel>.
2996 Multiple B<--shell-quote> with quote the string multiple times, so
2997 B<parallel --shell-quote | parallel --shell-quote> can be written as
2998 B<parallel --shell-quote --shell-quote>.
3000 See also: B<--quote>
3003 =item B<--shuf>
3005 Shuffle jobs.
3007 When having multiple input sources it is hard to randomize
3008 jobs. B<--shuf> will generate all jobs, and shuffle them before
3009 running them. This is useful to get a quick preview of the results
3010 before running the full batch.
3012 Combined with B<--halt soon,done=1%> you can run a random 1% sample of
3013 all jobs:
3015 parallel --shuf --halt soon,done=1% echo ::: {1..100} ::: {1..100}
3017 See also: B<--halt>
3020 =item B<--skip-first-line>
3022 Do not use the first line of input (used by GNU B<parallel> itself
3023 when called with B<--shebang>).
3026 =item B<--sql> I<DBURL> (obsolete)
3028 Use B<--sql-master> instead.
3031 =item B<--sql-master> I<DBURL>
3033 Submit jobs via SQL server. I<DBURL> must point to a table, which will
3034 contain the same information as B<--joblog>, the values from the input
3035 sources (stored in columns V1 .. Vn), and the output (stored in
3036 columns Stdout and Stderr).
3038 If I<DBURL> is prepended with '+' GNU B<parallel> assumes the table is
3039 already made with the correct columns and appends the jobs to it.
3041 If I<DBURL> is not prepended with '+' the table will be dropped and
3042 created with the correct amount of V-columns unless
3044 B<--sqlmaster> does not run any jobs, but it creates the values for
3045 the jobs to be run. One or more B<--sqlworker> must be run to actually
3046 execute the jobs.
3048 If B<--wait> is set, GNU B<parallel> will wait for the jobs to
3049 complete.
3051 The format of a DBURL is:
3053 [sql:]vendor://[[user][:pwd]@][host][:port]/[db]/table
3055 E.g.
3057 sql:mysql://hr:hr@localhost:3306/hrdb/jobs
3058 mysql://scott:tiger@my.example.com/pardb/paralleljobs
3059 sql:oracle://scott:tiger@ora.example.com/xe/parjob
3060 postgresql://scott:tiger@pg.example.com/pgdb/parjob
3061 pg:///parjob
3062 sqlite3:///%2Ftmp%2Fpardb.sqlite/parjob
3063 csv:///%2Ftmp%2Fpardb/parjob
3065 Notice how / in the path of sqlite and CVS must be encoded as
3066 %2F. Except the last / in CSV which must be a /.
3068 It can also be an alias from ~/.sql/aliases:
3070 :myalias mysql:///mydb/paralleljobs
3072 See also: B<--sql-and-worker> B<--sql-worker> B<--joblog>
3075 =item B<--sql-and-worker> I<DBURL>
3077 Shorthand for: B<--sql-master> I<DBURL> B<--sql-worker> I<DBURL>.
3079 See also: B<--sql-master> B<--sql-worker>
3082 =item B<--sql-worker> I<DBURL>
3084 Execute jobs via SQL server. Read the input sources variables from the
3085 table pointed to by I<DBURL>. The I<command> on the command line
3086 should be the same as given by B<--sqlmaster>.
3088 If you have more than one B<--sqlworker> jobs may be run more than
3089 once.
3091 If B<--sqlworker> runs on the local machine, the hostname in the SQL
3092 table will not be ':' but instead the hostname of the machine.
3094 See also: B<--sql-master> B<--sql-and-worker>
3097 =item B<--ssh> I<sshcommand>
3099 GNU B<parallel> defaults to using B<ssh> for remote access. This can
3100 be overridden with B<--ssh>. It can also be set on a per server
3101 basis with B<--sshlogin>.
3103 See also: B<--sshlogin>
3106 =item B<--ssh-delay> I<duration>
3108 Delay starting next ssh by I<duration>.
3110 GNU B<parallel> will not start another ssh for the next I<duration>.
3112 I<duration> is in seconds, but can be postfixed with s, m, h, or d.
3114 See also: TIME POSTFIXES B<--sshlogin> B<--delay>
3117 =item B<--sshlogin> I<[@hostgroups/][ncpus/][[user][:[password]]@]host[:port][,...]>
3119 =item B<--sshlogin> I<@hostgroup>
3121 =item B<-S> I<[@hostgroups/][ncpus/][ssh command][[user][:[password]]@]host[:port][,...]>
3123 =item B<-S> I<@hostgroup>
3125 Distribute jobs to remote computers.
3127 The jobs will be run on a list of remote computers.
3129 =over 15
3131 =item Z<> @I<hostgroups>/
3133 One or more groups this sshlogin belongs to (See
3134 B<--hostgroup>). Multiple groups are separated by '+'. The I<sshlogin>
3135 will always be added to a hostgroup named the same as I<sshlogin>.
3137 If only the I<@hostgroup> is given, only the sshlogins in that
3138 hostgroup will be used. Multiple I<@hostgroup> can be given.
3140 Examples: B<@prod/>, B<@dev+remote/>
3143 =item Z<> I<ncpus>/
3145 Force number of CPU threads.
3147 GNU B<parallel> will determine the number of CPUs on the remote
3148 computers and run the number of jobs as specified by B<-j>. If the
3149 number I<ncpus> is given GNU B<parallel> will use this number for
3150 number of CPU threads on the host. Normally I<ncpus> will not be
3151 needed.
3153 Examples: B<4/>, B<12/>
3156 =item Z<> I<ssh command>
3158 The I<ssh command> to use. The I<ssh command> must be followed by a space.
3160 Example: B</usr/bin/lsh -z >, B<autossh -C >
3163 =item Z<> I<user>
3165 User name to log in as. Defaults to the current user name.
3167 Examples: B<alice>, B<bob>
3170 =item Z<> :I<password>
3172 Use I<password> for authentication (using B<sshpass>). B<password>
3173 cannot contain space. If I<password> is omitted use B<$SSHPASS>. If
3174 B<:> is omitted use B<ssh>'s default authentication. In this case
3175 login must not require a password (B<ssh-agent> and B<ssh-copy-id> may
3176 help with that).
3178 Examples: B<:mypassword>, B<:>
3181 =item Z<> I<host>
3183 Hostname or IP address of server.
3185 Examples: B<server01>, B<10.1.2.3>, B<[2001:470:142:4::a]>,
3186 B<2001:470:142:5::116>.
3188 Ranges of hostnames can be given in [] like this: B<server[1,3,8-10]>
3189 (for B<server1, server3, server8, server9, server10>) or
3190 B<server[001,003,008-010]> (for B<server001, server003, server008,
3191 server009, server010>). With Bash's brace expansion you can do:
3192 B<-S{dev,prod}[001-100]> to get B<-Sdev[001-100] -Sprod[001-100]> More
3193 []'s are allowed: B<server[01-10].cluster[1-5].example.net>
3195 =item Z<> :I<port>
3197 Port number to connect to.
3199 Examples: B<:22>, B<:2222>.
3201 For IPv6 you can use B<p> or B<#> instead of B<:>.
3203 Examples: B<[2001:470:142:4::a]:2222>, B<2001:470:142:5::116p2222>,
3204 B<2001:470:142:5::116#22222>
3206 =back
3208 There are 3 names with special meaning:
3210 =over 4
3212 =item Z<> I<:>
3214 Means 'no ssh' and will therefore run on the local computer.
3216 =item Z<> I<..>
3218 Read sshlogins from B<~/.parallel/sshloginfile> or
3219 B<$XDG_CONFIG_HOME/parallel/sshloginfile>
3221 =item Z<> I<->
3223 Read sshlogins from stdin (standard input).
3225 =back
3227 To specify more sshlogins separate the sshlogins by comma, newline (in
3228 the same string), or repeat the options multiple times.
3230 GNU B<parallel> splits on , (comma) so if your sshlogin contains ,
3231 (comma) you need to replace it with \, or ,,
3233 See B<--sshloginfile> for complete examples.
3235 The remote host must have GNU B<parallel> installed.
3237 B<--sshlogin> is known to cause problems with B<-m> and B<-X>.
3239 See also: B<--basefile> B<--transferfile> B<--return> B<--cleanup>
3240 B<--trc> B<--sshloginfile> B<--workdir> B<--filter-hosts>
3241 B<--ssh>
3244 =item B<--sshloginfile> I<filename>
3246 =item B<--slf> I<filename>
3248 File with sshlogins. The file consists of sshlogins on separate
3249 lines. Empty lines and lines starting with '#' are ignored. Example:
3251 server.example.com
3252 username@server2.example.com
3253 8/my-8-cpu-server.example.com
3254 2/my_other_username@my-dualcore.example.net
3255 # These servers have SSH running on port 2222
3256 ssh -p 2222 server.example.net
3257 server01.example.net:2222
3258 4/ssh -p 2222 quadserver.example.net
3259 # Use a different ssh program
3260 myssh -p 2222 -l myusername hexacpu.example.net
3261 # Use a different ssh program with default number of CPUs
3262 //usr/local/bin/myssh -p 2222 -l myusername hexacpu
3263 # Use a different ssh program with 6 CPUs
3264 6//usr/local/bin/myssh -p 2222 -l myusername hexacpu
3265 # Assume 16 CPUs on the local computer
3266 16/:
3267 # Use password for authentication
3268 user:password@host
3269 # Use $SSHPASS for authentication
3270 user:@host
3271 # Use $SSHPASS for authentication and current username
3272 :@host
3273 # Use password for authentication and current username
3274 :password@host
3275 # Login in as bob with :p@ss:w0rd@ as password
3276 bob::p@ss:w0rd@@host
3277 # Put server1 in hostgroup1
3278 @hostgroup1/server1
3279 # Put myusername@server2 in hostgroup1+hostgroup2
3280 @hostgroup1+hostgroup2/myusername@server2
3281 # Force 4 CPUs and put 'ssh -p 2222 server3' in hostgroup1
3282 @hostgroup1/4/ssh -p 2222 server3
3283 # TODO example with ,,
3285 When using a different ssh program the last argument must be the hostname.
3287 Multiple B<--sshloginfile> are allowed.
3289 GNU B<parallel> will first look for the file in current dir; if that
3290 fails it look for the file in ~/.parallel.
3292 There are 3 names with special meaning:
3294 =over 4
3296 =item Z<> I<..>
3298 Read sshlogins from B<~/.parallel/sshloginfile>
3300 =item Z<> I<.>
3302 Read sshlogins from B</etc/parallel/sshloginfile>
3304 =item Z<> I<->
3306 Read sshlogins from stdin (standard input).
3308 =back
3310 If the sshloginfile is changed it will be re-read when a job finishes
3311 though at most once per second. This makes it possible to add and
3312 remove hosts while running.
3314 This can be used to have a daemon that updates the sshloginfile to
3315 only contain servers that are up:
3317 cp original.slf tmp2.slf
3318 while [ 1 ] ; do
3319 nice parallel --nonall -j0 -k --slf original.slf \
3320 --tag echo | perl 's/\t$//' > tmp.slf
3321 if diff tmp.slf tmp2.slf; then
3322 mv tmp.slf tmp2.slf
3324 sleep 10
3325 done &
3326 parallel --slf tmp2.slf ...
3328 See also: B<--filter-hosts>
3331 =item B<--slotreplace> I<replace-str>
3333 Use the replacement string I<replace-str> instead of B<{%}> for
3334 job slot number.
3336 See also: B<{%}>
3339 =item B<--silent>
3341 Silent.
3343 The job to be run will not be printed. This is the default. Can be
3344 reversed with B<-v>.
3346 See also: B<-v>
3349 =item B<--template> I<file>=I<repl>
3351 =item B<--tmpl> I<file>=I<repl>
3353 Replace replacement strings in I<file> and save it in I<repl>.
3355 All replacement strings in the contents of I<file> will be
3356 replaced. All replacement strings in the name I<repl> will be
3357 replaced.
3359 With B<--cleanup> the new file will be removed when the job is done.
3361 If I<my.tmpl> contains this:
3363 Xval: {x}
3364 Yval: {y}
3365 FixedValue: 9
3366 # x with 2 decimals
3367 DecimalX: {=x $_=sprintf("%.2f",$_) =}
3368 TenX: {=x $_=$_*10 =}
3369 RandomVal: {=1 $_=rand() =}
3371 it can be used like this:
3373 myprog() { echo Using "$@"; cat "$@"; }
3374 export -f myprog
3375 parallel --cleanup --header : --tmpl my.tmpl={#}.t myprog {#}.t \
3376 ::: x 1.234 2.345 3.45678 ::: y 1 2 3
3378 See also: B<{}> B<--cleanup>
3381 =item B<--tty>
3383 Open terminal tty.
3385 If GNU B<parallel> is used for starting a program that accesses the
3386 tty (such as an interactive program) then this option may be
3387 needed. It will default to starting only one job at a time
3388 (i.e. B<-j1>), not buffer the output (i.e. B<-u>), and it will open a
3389 tty for the job.
3391 You can of course override B<-j1> and B<-u>.
3393 Using B<--tty> unfortunately means that GNU B<parallel> cannot kill
3394 the jobs (with B<--timeout>, B<--memfree>, or B<--halt>). This is due
3395 to GNU B<parallel> giving each child its own process group, which is
3396 then killed. Process groups are dependant on the tty.
3398 See also: B<--ungroup> B<--open-tty>
3401 =item B<--tag>
3403 Tag lines with arguments.
3405 Each output line will be prepended with the arguments and TAB
3406 (\t). When combined with B<--onall> or B<--nonall> the lines will be
3407 prepended with the sshlogin instead.
3409 B<--tag> is ignored when using B<-u>.
3411 See also: B<--tagstring> B<--ctag>
3414 =item B<--tagstring> I<str>
3416 Tag lines with a string.
3418 Each output line will be prepended with I<str> and TAB (\t). I<str>
3419 can contain replacement strings such as B<{}>.
3421 B<--tagstring> is ignored when using B<-u>, B<--onall>, and B<--nonall>.
3423 See also: B<--tag> B<--ctagstring>
3426 =item B<--tee>
3428 Pipe all data to all jobs.
3430 Used with B<--pipe>/B<--pipe-part> and B<:::>.
3432 seq 1000 | parallel --pipe --tee -v wc {} ::: -w -l -c
3434 How many numbers in 1..1000 contain 0..9, and how many bytes do they
3435 fill:
3437 seq 1000 | parallel --pipe --tee --tag \
3438 'grep {1} | wc {2}' ::: {0..9} ::: -l -c
3440 How many words contain a..z and how many bytes do they fill?
3442 parallel -a /usr/share/dict/words --pipe-part --tee --tag \
3443 'grep {1} | wc {2}' ::: {a..z} ::: -l -c
3445 See also: B<:::> B<--pipe> B<--pipe-part>
3448 =item B<--term-seq> I<sequence>
3450 Termination sequence.
3452 When a job is killed due to B<--timeout>, B<--memfree>, B<--halt>, or
3453 abnormal termination of GNU B<parallel>, I<sequence> determines how
3454 the job is killed. The default is:
3456 TERM,200,TERM,100,TERM,50,KILL,25
3458 which sends a TERM signal, waits 200 ms, sends another TERM signal,
3459 waits 100 ms, sends another TERM signal, waits 50 ms, sends a KILL
3460 signal, waits 25 ms, and exits. GNU B<parallel> detects if a process
3461 dies before the waiting time is up.
3463 See also: B<--halt> B<--timeout> B<--memfree>
3466 =item B<--total-jobs> I<jobs>
3468 =item B<--total> I<jobs>
3470 Provide the total number of jobs for computing ETA which is also used
3471 for B<--bar>.
3473 Without B<--total-jobs> GNU Parallel will read all jobs before
3474 starting a job. B<--total-jobs> is useful if the input is generated
3475 slowly.
3477 See also: B<--bar> B<--eta>
3480 =item B<--tmpdir> I<dirname>
3482 Directory for temporary files.
3484 GNU B<parallel> normally buffers output into temporary files in
3485 /tmp. By setting B<--tmpdir> you can use a different dir for the
3486 files. Setting B<--tmpdir> is equivalent to setting $TMPDIR.
3488 See also: B<--compress> B<$TMPDIR> B<$PARALLEL_REMOTE_TMPDIR>
3491 =item B<--tmux> (Long beta testing)
3493 Use B<tmux> for output. Start a B<tmux> session and run each job in a
3494 window in that session. No other output will be produced.
3496 See also: B<--tmuxpane>
3499 =item B<--tmuxpane> (Long beta testing)
3501 Use B<tmux> for output but put output into panes in the first window.
3502 Useful if you want to monitor the progress of less than 100 concurrent
3503 jobs.
3505 See also: B<--tmux>
3508 =item B<--timeout> I<duration>
3510 Time out for command. If the command runs for longer than I<duration>
3511 seconds it will get killed as per B<--term-seq>.
3513 If I<duration> is followed by a % then the timeout will dynamically be
3514 computed as a percentage of the median average runtime of successful
3515 jobs. Only values > 100% will make sense.
3517 I<duration> is in seconds, but can be postfixed with s, m, h, or d.
3519 See also: TIME POSTFIXES B<--term-seq> B<--retries>
3522 =item B<--verbose>
3524 =item B<-t>
3526 Print the job to be run on stderr (standard error).
3528 See also: B<-v> B<--interactive>
3531 =item B<--transfer>
3533 Transfer files to remote computers.
3535 Shorthand for: B<--transferfile {}>.
3537 See also: B<--transferfile>.
3540 =item B<--transferfile> I<filename>
3542 =item B<--tf> I<filename>
3544 Transfer I<filename> to remote computers.
3546 B<--transferfile> is used with B<--sshlogin> to transfer files to the
3547 remote computers. The files will be transferred using B<rsync> and
3548 will be put relative to the work dir.
3550 The I<filename> will normally contain a replacement string.
3552 If the path contains /./ the remaining path will be relative to the
3553 work dir (for details: see B<rsync>). If the work dir is
3554 B</home/user>, the transferring will be as follows:
3556 /tmp/foo/bar => /tmp/foo/bar
3557 tmp/foo/bar => /home/user/tmp/foo/bar
3558 /tmp/./foo/bar => /home/user/foo/bar
3559 tmp/./foo/bar => /home/user/foo/bar
3561 I<Examples>
3563 This will transfer the file I<foo/bar.txt> to the computer
3564 I<server.example.com> to the file I<$HOME/foo/bar.txt> before running
3565 B<wc foo/bar.txt> on I<server.example.com>:
3567 echo foo/bar.txt | parallel --transferfile {} \
3568 --sshlogin server.example.com wc
3570 This will transfer the file I</tmp/foo/bar.txt> to the computer
3571 I<server.example.com> to the file I</tmp/foo/bar.txt> before running
3572 B<wc /tmp/foo/bar.txt> on I<server.example.com>:
3574 echo /tmp/foo/bar.txt | parallel --transferfile {} \
3575 --sshlogin server.example.com wc
3577 This will transfer the file I</tmp/foo/bar.txt> to the computer
3578 I<server.example.com> to the file I<foo/bar.txt> before running
3579 B<wc ./foo/bar.txt> on I<server.example.com>:
3581 echo /tmp/./foo/bar.txt | parallel --transferfile {} \
3582 --sshlogin server.example.com wc {= s:.*/\./:./: =}
3584 B<--transferfile> is often used with B<--return> and B<--cleanup>. A
3585 shorthand for B<--transferfile {}> is B<--transfer>.
3587 B<--transferfile> is ignored when used with B<--sshlogin :> or when
3588 not used with B<--sshlogin>.
3590 See also: B<--workdir> B<--sshlogin> B<--basefile> B<--return>
3591 B<--cleanup>
3594 =item B<--trc> I<filename>
3596 Transfer, Return, Cleanup. Shorthand for: B<--transfer> B<--return>
3597 I<filename> B<--cleanup>
3599 See also: B<--transfer> B<--return> B<--cleanup>
3602 =item B<--trim> <n|l|r|lr|rl>
3604 Trim white space in input.
3606 =over 4
3608 =item n
3610 No trim. Input is not modified. This is the default.
3612 =item l
3614 Left trim. Remove white space from start of input. E.g. " a bc " -> "a bc ".
3616 =item r
3618 Right trim. Remove white space from end of input. E.g. " a bc " -> " a bc".
3620 =item lr
3622 =item rl
3624 Both trim. Remove white space from both start and end of input. E.g. "
3625 a bc " -> "a bc". This is the default if B<--colsep> is used.
3627 =back
3629 See also: B<--no-run-if-empty> B<{}> B<--colsep>
3632 =item B<--ungroup>
3634 =item B<-u>
3636 Ungroup output.
3638 Output is printed as soon as possible and bypasses GNU B<parallel>
3639 internal processing. This may cause output from different commands to
3640 be mixed thus should only be used if you do not care about the
3641 output. Compare these:
3643 seq 4 | parallel -j0 \
3644 'sleep {};echo -n start{};sleep {};echo {}end'
3645 seq 4 | parallel -u -j0 \
3646 'sleep {};echo -n start{};sleep {};echo {}end'
3648 It also disables B<--tag>. GNU B<parallel> outputs faster with
3649 B<-u>. Compare the speeds of these:
3651 parallel seq ::: 300000000 >/dev/null
3652 parallel -u seq ::: 300000000 >/dev/null
3653 parallel --line-buffer seq ::: 300000000 >/dev/null
3655 Can be reversed with B<--group>.
3657 See also: B<--line-buffer> B<--group>
3660 =item B<--extensionreplace> I<replace-str>
3662 =item B<--er> I<replace-str>
3664 Use the replacement string I<replace-str> instead of B<{.}> for input
3665 line without extension.
3667 See also: B<{.}>
3670 =item B<--use-sockets-instead-of-threads>
3672 See also: B<--use-cores-instead-of-threads>
3675 =item B<--use-cores-instead-of-threads>
3677 =item B<--use-cpus-instead-of-cores> (obsolete)
3679 Determine how GNU B<parallel> counts the number of CPUs.
3681 GNU B<parallel> uses this number when the number of jobslots
3682 (B<--jobs>) is computed relative to the number of CPUs (e.g. 100% or
3683 +1).
3685 CPUs can be counted in three different ways:
3687 =over 8
3689 =item sockets
3691 The number of filled CPU sockets (i.e. the number of physical chips).
3693 =item cores
3695 The number of physical cores (i.e. the number of physical compute
3696 cores).
3698 =item threads
3700 The number of hyperthreaded cores (i.e. the number of virtual
3701 cores - with some of them possibly being hyperthreaded)
3703 =back
3705 Normally the number of CPUs is computed as the number of CPU
3706 threads. With B<--use-sockets-instead-of-threads> or
3707 B<--use-cores-instead-of-threads> you can force it to be computed as
3708 the number of filled sockets or number of cores instead.
3710 Most users will not need these options.
3712 B<--use-cpus-instead-of-cores> is a (misleading) alias for
3713 B<--use-sockets-instead-of-threads> and is kept for backwards
3714 compatibility.
3716 See also: B<--number-of-threads> B<--number-of-cores>
3717 B<--number-of-sockets>
3720 =item B<-v>
3722 Verbose.
3724 Print the job to be run on stdout (standard output). Can be reversed
3725 with B<--silent>.
3727 Use B<-v> B<-v> to print the wrapping ssh command when running remotely.
3729 See also: B<-t>
3732 =item B<--version>
3734 =item B<-V>
3736 Print the version GNU B<parallel> and exit.
3739 =item B<--workdir> I<mydir>
3741 =item B<--wd> I<mydir>
3743 Jobs will be run in the dir I<mydir>. The default is the current dir
3744 for the local machine, and the login dir for remote computers.
3746 Files transferred using B<--transferfile> and B<--return> will be
3747 relative to I<mydir> on remote computers.
3749 The special I<mydir> value B<...> will create working dirs under
3750 B<~/.parallel/tmp/>. If B<--cleanup> is given these dirs will be
3751 removed.
3753 The special I<mydir> value B<.> uses the current working dir. If the
3754 current working dir is beneath your home dir, the value B<.> is
3755 treated as the relative path to your home dir. This means that if your
3756 home dir is different on remote computers (e.g. if your login is
3757 different) the relative path will still be relative to your home dir.
3759 To see the difference try:
3761 parallel -S server pwd ::: ""
3762 parallel --wd . -S server pwd ::: ""
3763 parallel --wd ... -S server pwd ::: ""
3765 I<mydir> can contain GNU B<parallel>'s replacement strings.
3768 =item B<--wait>
3770 Wait for all commands to complete.
3772 Used with B<--semaphore> or B<--sqlmaster>.
3774 See also: B<man sem>
3777 =item B<-X>
3779 Multiple arguments with context replace. Insert as many arguments as
3780 the command line length permits. If multiple jobs are being run in
3781 parallel: distribute the arguments evenly among the jobs. Use B<-j1>
3782 to avoid this.
3784 If B<{}> is not used the arguments will be appended to the line. If
3785 B<{}> is used as part of a word (like I<pic{}.jpg>) then the whole
3786 word will be repeated. If B<{}> is used multiple times each B<{}> will
3787 be replaced with the arguments.
3789 Normally B<-X> will do the right thing, whereas B<-m> can give
3790 unexpected results if B<{}> is used as part of a word.
3792 Support for B<-X> with B<--sshlogin> is limited and may fail.
3794 See also: B<-m>
3797 =item B<--exit>
3799 =item B<-x>
3801 Exit if the size (see the B<-s> option) is exceeded.
3804 =item B<--xargs>
3806 Multiple arguments. Insert as many arguments as the command line
3807 length permits.
3809 If B<{}> is not used the arguments will be appended to the
3810 line. If B<{}> is used multiple times each B<{}> will be replaced
3811 with all the arguments.
3813 Support for B<--xargs> with B<--sshlogin> is limited and may fail.
3815 See also: B<-X>
3818 =back
3821 =head1 EXAMPLES
3823 See: B<man parallel_examples>
3826 =head1 SPREADING BLOCKS OF DATA
3828 B<--round-robin>, B<--pipe-part>, B<--shard>, B<--bin> and
3829 B<--group-by> are all specialized versions of B<--pipe>.
3831 In the following I<n> is the number of jobslots given by B<--jobs>. A
3832 record starts with B<--recstart> and ends with B<--recend>. It is
3833 typically a full line. A chunk is a number of full records that is
3834 approximately the size of a block. A block can contain half records, a
3835 chunk cannot.
3837 B<--pipe> starts one job per chunk. It reads blocks from stdin
3838 (standard input). It finds a record end near a block border and passes
3839 a chunk to the program.
3841 B<--pipe-part> starts one job per chunk - just like normal
3842 B<--pipe>. It first finds record endings near all block borders in the
3843 file and then starts the jobs. By using B<--block -1> it will set the
3844 block size to size-of-file/I<n>. Used this way it will start I<n>
3845 jobs in total.
3847 B<--round-robin> starts I<n> jobs in total. It reads a block and
3848 passes a chunk to whichever job is ready to read. It does not parse
3849 the content except for identifying where a record ends to make sure it
3850 only passes full records.
3852 B<--shard> starts I<n> jobs in total. It parses each line to read the
3853 string in the given column. Based on this string the line is passed to
3854 one of the I<n> jobs. All lines having this string will be given to the
3855 same jobslot.
3857 B<--bin> works like B<--shard> but the value of the column must be
3858 numeric and is the jobslot number it will be passed to. If the value
3859 is bigger than I<n>, then I<n> will be subtracted from the value until
3860 the value is smaller than or equal to I<n>.
3862 B<--group-by> starts one job per chunk. Record borders are not given
3863 by B<--recend>/B<--recstart>. Instead a record is defined by a group
3864 of lines having the same string in a given column. So the string of a
3865 given column changes at a chunk border. With B<--pipe> every line is
3866 parsed, with B<--pipe-part> only a few lines are parsed to find the
3867 chunk border.
3869 B<--group-by> can be combined with B<--round-robin> or B<--pipe-part>.
3872 =head1 TIME POSTFIXES
3874 Arguments that give a duration are given in seconds, but can be
3875 expressed as floats postfixed with B<s>, B<m>, B<h>, or B<d> which
3876 would multiply the float by 1, 60, 60*60, or 60*60*24. Thus these are
3877 equivalent: 100000 and 1d3.5h16.6m4s.
3880 =head1 UNIT PREFIX
3882 Many numerical arguments in GNU B<parallel> can be postfixed with K,
3883 M, G, T, P, k, m, g, t, or p which would multiply the number with
3884 1024, 1048576, 1073741824, 1099511627776, 1125899906842624, 1000,
3885 1000000, 1000000000, 1000000000000, or 1000000000000000, respectively.
3887 You can even give it as a math expression. E.g. 1000000 can be written
3888 as 1M-12*2.024*2k.
3891 =head1 QUOTING
3893 GNU B<parallel> is very liberal in quoting. You only need to quote
3894 characters that have special meaning in shell:
3896 ( ) $ ` ' " < > ; | \
3898 and depending on context these needs to be quoted, too:
3900 ~ & ! ? space * { #
3902 Therefore most people will never need more quoting than putting '\'
3903 in front of the special characters.
3905 Often you can simply put \' around every ':
3907 perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' file
3909 can be quoted:
3911 parallel perl -ne \''/^\S+\s+\S+$/ and print $ARGV,"\n"'\' ::: file
3913 However, when you want to use a shell variable you need to quote the
3914 $-sign. Here is an example using $PARALLEL_SEQ. This variable is set
3915 by GNU B<parallel> itself, so the evaluation of the $ must be done by
3916 the sub shell started by GNU B<parallel>:
3918 seq 10 | parallel -N2 echo seq:\$PARALLEL_SEQ arg1:{1} arg2:{2}
3920 If the variable is set before GNU B<parallel> starts you can do this:
3922 VAR=this_is_set_before_starting
3923 echo test | parallel echo {} $VAR
3925 Prints: B<test this_is_set_before_starting>
3927 It is a little more tricky if the variable contains more than one space in a row:
3929 VAR="two spaces between each word"
3930 echo test | parallel echo {} \'"$VAR"\'
3932 Prints: B<test two spaces between each word>
3934 If the variable should not be evaluated by the shell starting GNU
3935 B<parallel> but be evaluated by the sub shell started by GNU
3936 B<parallel>, then you need to quote it:
3938 echo test | parallel VAR=this_is_set_after_starting \; echo {} \$VAR
3940 Prints: B<test this_is_set_after_starting>
3942 It is a little more tricky if the variable contains space:
3944 echo test |\
3945 parallel VAR='"two spaces between each word"' echo {} \'"$VAR"\'
3947 Prints: B<test two spaces between each word>
3949 $$ is the shell variable containing the process id of the shell. This
3950 will print the process id of the shell running GNU B<parallel>:
3952 seq 10 | parallel echo $$
3954 And this will print the process ids of the sub shells started by GNU
3955 B<parallel>.
3957 seq 10 | parallel echo \$\$
3959 If the special characters should not be evaluated by the sub shell
3960 then you need to protect it against evaluation from both the shell
3961 starting GNU B<parallel> and the sub shell:
3963 echo test | parallel echo {} \\\$VAR
3965 Prints: B<test $VAR>
3967 GNU B<parallel> can protect against evaluation by the sub shell by
3968 using -q:
3970 echo test | parallel -q echo {} \$VAR
3972 Prints: B<test $VAR>
3974 This is particularly useful if you have lots of quoting. If you want
3975 to run a perl script like this:
3977 perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"' file
3979 It needs to be quoted like one of these:
3981 ls | parallel perl -ne '/^\\S+\\s+\\S+\$/\ and\ print\ \$ARGV,\"\\n\"'
3982 ls | parallel perl -ne \''/^\S+\s+\S+$/ and print $ARGV,"\n"'\'
3984 Notice how spaces, \'s, "'s, and $'s need to be quoted. GNU
3985 B<parallel> can do the quoting by using option -q:
3987 ls | parallel -q perl -ne '/^\S+\s+\S+$/ and print $ARGV,"\n"'
3989 However, this means you cannot make the sub shell interpret special
3990 characters. For example because of B<-q> this WILL NOT WORK:
3992 ls *.gz | parallel -q "zcat {} >{.}"
3993 ls *.gz | parallel -q "zcat {} | bzip2 >{.}.bz2"
3995 because > and | need to be interpreted by the sub shell.
3997 If you get errors like:
3999 sh: -c: line 0: syntax error near unexpected token
4000 sh: Syntax error: Unterminated quoted string
4001 sh: -c: line 0: unexpected EOF while looking for matching `''
4002 sh: -c: line 1: syntax error: unexpected end of file
4003 zsh:1: no matches found:
4005 then you might try using B<-q>.
4007 If you are using B<bash> process substitution like B<<(cat foo)> then
4008 you may try B<-q> and prepending I<command> with B<bash -c>:
4010 ls | parallel -q bash -c 'wc -c <(echo {})'
4012 Or for substituting output:
4014 ls | parallel -q bash -c \
4015 'tar c {} | tee >(gzip >{}.tar.gz) | bzip2 >{}.tar.bz2'
4017 B<Conclusion>: If this is confusing consider avoiding having to deal
4018 with quoting by writing a small script or a function (remember to
4019 B<export -f> the function) and have GNU B<parallel> call that.
4022 =head1 LIST RUNNING JOBS
4024 If you want a list of the jobs currently running you can run:
4026 killall -USR1 parallel
4028 GNU B<parallel> will then print the currently running jobs on stderr
4029 (standard error).
4032 =head1 COMPLETE RUNNING JOBS BUT DO NOT START NEW JOBS
4034 If you regret starting a lot of jobs you can simply break GNU B<parallel>,
4035 but if you want to make sure you do not have half-completed jobs you
4036 should send the signal B<SIGHUP> to GNU B<parallel>:
4038 killall -HUP parallel
4040 This will tell GNU B<parallel> to not start any new jobs, but wait until
4041 the currently running jobs are finished before exiting.
4044 =head1 ENVIRONMENT VARIABLES
4046 =over 9
4048 =item $PARALLEL_HOME
4050 Dir where GNU B<parallel> stores config files, semaphores, and caches
4051 information between invocations. If set to a non-existent dir, the dir
4052 will be created.
4054 Default: $HOME/.parallel.
4057 =item $PARALLEL_ARGHOSTGROUPS
4059 When using B<--hostgroups> GNU B<parallel> sets this to the hostgroups
4060 of the job.
4062 Remember to quote the $, so it gets evaluated by the correct shell. Or
4063 use B<--plus> and {agrp}.
4066 =item $PARALLEL_HOSTGROUPS
4068 When using B<--hostgroups> GNU B<parallel> sets this to the hostgroups
4069 of the sshlogin that the job is run on.
4071 Remember to quote the $, so it gets evaluated by the correct shell. Or
4072 use B<--plus> and {hgrp}.
4075 =item $PARALLEL_JOBSLOT
4077 Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
4078 Remember to quote the $, so it gets evaluated by the correct shell. Or
4079 use B<--plus> and {slot}.
4081 $PARALLEL_JOBSLOT is the jobslot of the job. It is equal to {%} unless
4082 the job is being retried. See {%} for details.
4085 =item $PARALLEL_PID
4087 Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
4088 Remember to quote the $, so it gets evaluated by the correct shell.
4090 This makes it possible for the jobs to communicate directly to GNU
4091 B<parallel>.
4093 B<Example:> If each of the jobs tests a solution and one of jobs finds
4094 the solution the job can tell GNU B<parallel> not to start more jobs
4095 by: B<kill -HUP $PARALLEL_PID>. This only works on the local
4096 computer.
4099 =item $PARALLEL_RSYNC_OPTS
4101 Options to pass on to B<rsync>. Defaults to: -rlDzR.
4104 =item $PARALLEL_SHELL
4106 Use this shell for the commands run by GNU B<parallel>:
4108 =over 2
4110 =item *
4112 $PARALLEL_SHELL. If undefined use:
4114 =item *
4116 The shell that started GNU B<parallel>. If that cannot be determined:
4118 =item *
4120 $SHELL. If undefined use:
4122 =item *
4124 /bin/sh
4126 =back
4129 =item $PARALLEL_SSH
4131 GNU B<parallel> defaults to using the B<ssh> command for remote
4132 access. This can be overridden with $PARALLEL_SSH, which again can be
4133 overridden with B<--ssh>. It can also be set on a per server basis
4134 (see B<--sshlogin>).
4137 =item $PARALLEL_SSHHOST
4139 Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
4140 Remember to quote the $, so it gets evaluated by the correct shell. Or
4141 use B<--plus> and {host}.
4144 $PARALLEL_SSHHOST is the host part of an sshlogin line. E.g.
4146 4//usr/bin/specialssh user@host
4148 becomes:
4150 host
4153 =item $PARALLEL_SSHLOGIN
4155 Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
4156 Remember to quote the $, so it gets evaluated by the correct shell. Or
4157 use B<--plus> and {sshlogin}.
4160 The value is the sshlogin line with number of threads removed. E.g.
4162 4//usr/bin/specialssh user@host
4164 becomes:
4166 /usr/bin/specialssh user@host
4169 =item $PARALLEL_SEQ
4171 Set by GNU B<parallel> and can be used in jobs run by GNU B<parallel>.
4172 Remember to quote the $, so it gets evaluated by the correct shell.
4174 $PARALLEL_SEQ is the sequence number of the job running.
4176 B<Example:>
4178 seq 10 | parallel -N2 \
4179 echo seq:'$'PARALLEL_SEQ arg1:{1} arg2:{2}
4181 {#} is a shorthand for $PARALLEL_SEQ.
4184 =item $PARALLEL_TMUX
4186 Path to B<tmux>. If unset the B<tmux> in $PATH is used.
4189 =item $TMPDIR
4191 Directory for temporary files.
4193 See also: B<--tmpdir>
4196 =item $PARALLEL_REMOTE_TMPDIR
4198 Directory for temporary files on remote servers.
4200 See also: B<--tmpdir>
4203 =item $PARALLEL
4205 The environment variable $PARALLEL will be used as default options for
4206 GNU B<parallel>. If the variable contains special shell characters
4207 (e.g. $, *, or space) then these need to be to be escaped with \.
4209 B<Example:>
4211 cat list | parallel -j1 -k -v ls
4212 cat list | parallel -j1 -k -v -S"myssh user@server" ls
4214 can be written as:
4216 cat list | PARALLEL="-kvj1" parallel ls
4217 cat list | PARALLEL='-kvj1 -S myssh\ user@server' \
4218 parallel echo
4220 Notice the \ after 'myssh' is needed because 'myssh' and 'user@server'
4221 must be one argument.
4223 See also: B<--profile>
4225 =back
4228 =head1 DEFAULT PROFILE (CONFIG FILE)
4230 The global configuration file /etc/parallel/config, followed by user
4231 configuration file ~/.parallel/config (formerly known as .parallelrc)
4232 will be read in turn if they exist. Lines starting with '#' will be
4233 ignored. The format can follow that of the environment variable
4234 $PARALLEL, but it is often easier to simply put each option on its own
4235 line.
4237 Options on the command line take precedence, followed by the
4238 environment variable $PARALLEL, user configuration file
4239 ~/.parallel/config, and finally the global configuration file
4240 /etc/parallel/config.
4242 Note that no file that is read for options, nor the environment
4243 variable $PARALLEL, may contain retired options such as B<--tollef>.
4245 =head1 PROFILE FILES
4247 If B<--profile> set, GNU B<parallel> will read the profile from that
4248 file rather than the global or user configuration files. You can have
4249 multiple B<--profiles>.
4251 Profiles are searched for in B<~/.parallel>. If the name starts with
4252 B</> it is seen as an absolute path. If the name starts with B<./> it
4253 is seen as a relative path from current dir.
4255 Example: Profile for running a command on every sshlogin in
4256 ~/.ssh/sshlogins and prepend the output with the sshlogin:
4258 echo --tag -S .. --nonall > ~/.parallel/nonall_profile
4259 parallel -J nonall_profile uptime
4261 Example: Profile for running every command with B<-j-1> and B<nice>
4263 echo -j-1 nice > ~/.parallel/nice_profile
4264 parallel -J nice_profile bzip2 -9 ::: *
4266 Example: Profile for running a perl script before every command:
4268 echo "perl -e '\$a=\$\$; print \$a,\" \",'\$PARALLEL_SEQ',\" \";';" \
4269 > ~/.parallel/pre_perl
4270 parallel -J pre_perl echo ::: *
4272 Note how the $ and " need to be quoted using \.
4274 Example: Profile for running distributed jobs with B<nice> on the
4275 remote computers:
4277 echo -S .. nice > ~/.parallel/dist
4278 parallel -J dist --trc {.}.bz2 bzip2 -9 ::: *
4281 =head1 EXIT STATUS
4283 Exit status depends on B<--halt-on-error> if one of these is used:
4284 success=X, success=Y%, fail=Y%.
4286 =over 6
4288 =item Z<>0
4290 All jobs ran without error. If success=X is used: X jobs ran without
4291 error. If success=Y% is used: Y% of the jobs ran without error.
4293 =item Z<>1-100
4295 Some of the jobs failed. The exit status gives the number of failed
4296 jobs. If Y% is used the exit status is the percentage of jobs that
4297 failed.
4299 =item Z<>101
4301 More than 100 jobs failed.
4303 =item Z<>255
4305 Other error.
4307 =item Z<>-1 (In joblog and SQL table)
4309 Killed by Ctrl-C, timeout, not enough memory or similar.
4311 =item Z<>-2 (In joblog and SQL table)
4313 skip() was called in B<{= =}>.
4315 =item Z<>-1000 (In SQL table)
4317 Job is ready to run (set by --sqlmaster).
4319 =item Z<>-1220 (In SQL table)
4321 Job is taken by worker (set by --sqlworker).
4323 =back
4325 If fail=1 is used, the exit status will be the exit status of the
4326 failing job.
4329 =head1 DIFFERENCES BETWEEN GNU Parallel AND ALTERNATIVES
4331 See: B<man parallel_alternatives>
4334 =head1 BUGS
4336 =head2 Quoting of newline
4338 Because of the way newline is quoted this will not work:
4340 echo 1,2,3 | parallel -vkd, "echo 'a{}b'"
4342 However, these will all work:
4344 echo 1,2,3 | parallel -vkd, echo a{}b
4345 echo 1,2,3 | parallel -vkd, "echo 'a'{}'b'"
4346 echo 1,2,3 | parallel -vkd, "echo 'a'"{}"'b'"
4349 =head2 Speed
4351 =head3 Startup
4353 GNU B<parallel> is slow at starting up - around 250 ms the first time
4354 and 150 ms after that.
4356 =head3 Job startup
4358 Starting a job on the local machine takes around 3-10 ms. This can be
4359 a big overhead if the job takes very few ms to run. Often you can
4360 group small jobs together using B<-X> which will make the overhead
4361 less significant. Or you can run multiple GNU B<parallel>s as
4362 described in B<EXAMPLE: Speeding up fast jobs>.
4364 =head3 SSH
4366 When using multiple computers GNU B<parallel> opens B<ssh> connections
4367 to them to figure out how many connections can be used reliably
4368 simultaneously (Namely SSHD's MaxStartups). This test is done for each
4369 host in serial, so if your B<--sshloginfile> contains many hosts it may
4370 be slow.
4372 If your jobs are short you may see that there are fewer jobs running
4373 on the remote systems than expected. This is due to time spent logging
4374 in and out. B<-M> may help here.
4376 =head3 Disk access
4378 A single disk can normally read data faster if it reads one file at a
4379 time instead of reading a lot of files in parallel, as this will avoid
4380 disk seeks. However, newer disk systems with multiple drives can read
4381 faster if reading from multiple files in parallel.
4383 If the jobs are of the form read-all-compute-all-write-all, so
4384 everything is read before anything is written, it may be faster to
4385 force only one disk access at the time:
4387 sem --id diskio cat file | compute | sem --id diskio cat > file
4389 If the jobs are of the form read-compute-write, so writing starts
4390 before all reading is done, it may be faster to force only one reader
4391 and writer at the time:
4393 sem --id read cat file | compute | sem --id write cat > file
4395 If the jobs are of the form read-compute-read-compute, it may be
4396 faster to run more jobs in parallel than the system has CPUs, as some
4397 of the jobs will be stuck waiting for disk access.
4399 =head2 --nice limits command length
4401 The current implementation of B<--nice> is too pessimistic in the max
4402 allowed command length. It only uses a little more than half of what
4403 it could. This affects B<-X> and B<-m>. If this becomes a real problem for
4404 you, file a bug-report.
4406 =head2 Aliases and functions do not work
4408 If you get:
4410 Can't exec "command": No such file or directory
4414 open3: exec of by command failed
4418 /bin/bash: command: command not found
4420 it may be because I<command> is not known, but it could also be
4421 because I<command> is an alias or a function. If it is a function you
4422 need to B<export -f> the function first or use B<env_parallel>. An
4423 alias will only work if you use B<env_parallel>.
4425 =head2 Database with MySQL fails randomly
4427 The B<--sql*> options may fail randomly with MySQL. This problem does
4428 not exist with PostgreSQL.
4431 =head1 REPORTING BUGS
4433 Report bugs to <parallel@gnu.org> or
4434 https://savannah.gnu.org/bugs/?func=additem&group=parallel
4436 When you write your report, please keep in mind, that you must give
4437 the reader enough information to be able to run exactly what you
4438 run. So you need to include all data and programs that you use to
4439 show the problem.
4441 See a perfect bug report on
4442 https://lists.gnu.org/archive/html/bug-parallel/2015-01/msg00000.html
4444 Your bug report should always include:
4446 =over 2
4448 =item *
4450 The error message you get (if any). If the error message is not from
4451 GNU B<parallel> you need to show why you think GNU B<parallel> caused
4452 this.
4454 =item *
4456 The complete output of B<parallel --version>. If you are not running
4457 the latest released version (see https://ftp.gnu.org/gnu/parallel/) you
4458 should specify why you believe the problem is not fixed in that
4459 version.
4461 =item *
4463 A minimal, complete, and verifiable example (See description on
4464 https://stackoverflow.com/help/mcve).
4466 It should be a complete example that others can run which shows the
4467 problem including all files needed to run the example. This should
4468 preferably be small and simple, so try to remove as many options as
4469 possible.
4471 A combination of B<yes>, B<seq>, B<cat>, B<echo>, B<wc>, and B<sleep>
4472 can reproduce most errors.
4474 If your example requires large files, see if you can make them with
4475 something like B<seq 100000000> > B<bigfile> or B<yes | head -n
4476 1000000000> > B<file>. If you need multiple columns: B<paste <(seq
4477 1000) <(seq 1000 1999)>
4479 If your example requires remote execution, see if you can use
4480 B<localhost> - maybe using another login.
4482 If you have access to a different system (maybe a VirtualBox on your
4483 own machine), test if your MCVE shows the problem on that system. If
4484 it does not, read below.
4486 =item *
4488 The output of your example. If your problem is not easily reproduced
4489 by others, the output might help them figure out the problem.
4491 =item *
4493 Whether you have watched the intro videos
4494 (https://www.youtube.com/playlist?list=PL284C9FF2488BC6D1), walked
4495 through the tutorial (man parallel_tutorial), and read the examples
4496 (man parallel_examples).
4498 =back
4500 =head2 Bug dependent on environment
4502 If you suspect the error is dependent on your environment or
4503 distribution, please see if you can reproduce the error on one of
4504 these VirtualBox images:
4505 https://sourceforge.net/projects/virtualboximage/files/
4506 https://www.osboxes.org/virtualbox-images/
4508 Specifying the name of your distribution is not enough as you may have
4509 installed software that is not in the VirtualBox images.
4511 If you cannot reproduce the error on any of the VirtualBox images
4512 above, see if you can build a VirtualBox image on which you can
4513 reproduce the error. If not you should assume the debugging will be
4514 done through you. That will put a lot more burden on you and it is
4515 extra important you give any information that help. In general the
4516 problem will be fixed faster and with much less work for you if you
4517 can reproduce the error on a VirtualBox - even if you have to build a
4518 VirtualBox image.
4520 =head2 In summary
4522 Your report must include:
4524 =over 2
4526 =item *
4528 B<parallel --version>
4530 =item *
4532 output + error message
4534 =item *
4536 full example including all files
4538 =item *
4540 VirtualBox image, if you cannot reproduce it on other systems
4542 =back
4546 =head1 AUTHOR
4548 When using GNU B<parallel> for a publication please cite:
4550 O. Tange (2011): GNU Parallel - The Command-Line Power Tool, ;login:
4551 The USENIX Magazine, February 2011:42-47.
4553 This helps funding further development; and it won't cost you a cent.
4554 If you pay 10000 EUR you should feel free to use GNU Parallel without citing.
4556 Copyright (C) 2007-10-18 Ole Tange, http://ole.tange.dk
4558 Copyright (C) 2008-2010 Ole Tange, http://ole.tange.dk
4560 Copyright (C) 2010-2024 Ole Tange, http://ole.tange.dk and Free
4561 Software Foundation, Inc.
4563 Parts of the manual concerning B<xargs> compatibility is inspired by
4564 the manual of B<xargs> from GNU findutils 4.4.2.
4567 =head1 LICENSE
4569 This program is free software; you can redistribute it and/or modify
4570 it under the terms of the GNU General Public License as published by
4571 the Free Software Foundation; either version 3 of the License, or
4572 at your option any later version.
4574 This program is distributed in the hope that it will be useful,
4575 but WITHOUT ANY WARRANTY; without even the implied warranty of
4576 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4577 GNU General Public License for more details.
4579 You should have received a copy of the GNU General Public License
4580 along with this program. If not, see <https://www.gnu.org/licenses/>.
4582 =head2 Documentation license I
4584 Permission is granted to copy, distribute and/or modify this
4585 documentation under the terms of the GNU Free Documentation License,
4586 Version 1.3 or any later version published by the Free Software
4587 Foundation; with no Invariant Sections, with no Front-Cover Texts, and
4588 with no Back-Cover Texts. A copy of the license is included in the
4589 file LICENSES/GFDL-1.3-or-later.txt.
4591 =head2 Documentation license II
4593 You are free:
4595 =over 9
4597 =item B<to Share>
4599 to copy, distribute and transmit the work
4601 =item B<to Remix>
4603 to adapt the work
4605 =back
4607 Under the following conditions:
4609 =over 9
4611 =item B<Attribution>
4613 You must attribute the work in the manner specified by the author or
4614 licensor (but not in any way that suggests that they endorse you or
4615 your use of the work).
4617 =item B<Share Alike>
4619 If you alter, transform, or build upon this work, you may distribute
4620 the resulting work only under the same, similar or a compatible
4621 license.
4623 =back
4625 With the understanding that:
4627 =over 9
4629 =item B<Waiver>
4631 Any of the above conditions can be waived if you get permission from
4632 the copyright holder.
4634 =item B<Public Domain>
4636 Where the work or any of its elements is in the public domain under
4637 applicable law, that status is in no way affected by the license.
4639 =item B<Other Rights>
4641 In no way are any of the following rights affected by the license:
4643 =over 2
4645 =item *
4647 Your fair dealing or fair use rights, or other applicable
4648 copyright exceptions and limitations;
4650 =item *
4652 The author's moral rights;
4654 =item *
4656 Rights other persons may have either in the work itself or in
4657 how the work is used, such as publicity or privacy rights.
4659 =back
4661 =back
4663 =over 9
4665 =item B<Notice>
4667 For any reuse or distribution, you must make clear to others the
4668 license terms of this work.
4670 =back
4672 A copy of the full license is included in the file as
4673 LICENCES/CC-BY-SA-4.0.txt
4676 =head1 DEPENDENCIES
4678 GNU B<parallel> uses Perl, and the Perl modules Getopt::Long,
4679 IPC::Open3, Symbol, IO::File, POSIX, and File::Temp.
4681 For B<--csv> it uses the Perl module Text::CSV.
4683 For remote usage it uses B<rsync> with B<ssh>.
4686 =head1 SEE ALSO
4688 B<parallel_tutorial>(1), B<env_parallel>(1), B<parset>(1),
4689 B<parsort>(1), B<parallel_alternatives>(1), B<parallel_design>(7),
4690 B<niceload>(1), B<sql>(1), B<ssh>(1), B<ssh-agent>(1), B<sshpass>(1),
4691 B<ssh-copy-id>(1), B<rsync>(1)
4693 =cut