Line 0
Link Here
|
|
|
1 |
.\" -*- coding: us-ascii -*- |
2 |
.if \n(.g .ds T< \\FC |
3 |
.if \n(.g .ds T> \\F[\n[.fam]] |
4 |
.de URL |
5 |
\\$2 \(la\\$1\(ra\\$3 |
6 |
.. |
7 |
.if \n(.g .mso www.tmac |
8 |
.TH parallel 1 2009-07-02 "" "" |
9 |
.SH NAME |
10 |
parallel \- run programs in parallel |
11 |
.SH SYNOPSIS |
12 |
'nh |
13 |
.fi |
14 |
.ad l |
15 |
\fBparallel\fR \kx |
16 |
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) |
17 |
'in \n(.iu+\nxu |
18 |
[options] [command] \fB--\fR [argument ...] |
19 |
'in \n(.iu-\nxu |
20 |
.ad b |
21 |
'hy |
22 |
'nh |
23 |
.fi |
24 |
.ad l |
25 |
\fBparallel\fR \kx |
26 |
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) |
27 |
'in \n(.iu+\nxu |
28 |
[options] \fB--\fR [command ...] |
29 |
'in \n(.iu-\nxu |
30 |
.ad b |
31 |
'hy |
32 |
.SH DESCRIPTION |
33 |
\fBparallel\fR runs the specified command, |
34 |
passing it a single one of the specified arguments. This is |
35 |
repeated for each argument. Jobs may be run in |
36 |
parallel. The default is to run one job per CPU. |
37 |
.PP |
38 |
If no command is specified before the --, |
39 |
the commands after it are instead run in parallel. |
40 |
.SH OPTIONS |
41 |
.TP |
42 |
\*(T<\fB\-j maxjobs\fR\*(T> |
43 |
Use to limit the number of jobs |
44 |
that are run at the same time. |
45 |
.TP |
46 |
\*(T<\fB\-l maxload\fR\*(T> |
47 |
Avoid starting new jobs when |
48 |
the system's load average is not below |
49 |
the specified limit. |
50 |
.TP |
51 |
\*(T<\fB\-i\fR\*(T> |
52 |
Normally the command is passed the |
53 |
argument at the end of its command line. With |
54 |
this option, the first instance of "{}" in |
55 |
the command is replaced with the argument. |
56 |
.TP |
57 |
\*(T<\fB\-n\fR\*(T> |
58 |
Number of arguments to pass to a |
59 |
command at a time. Default is 1. |
60 |
Incompatible with -i |
61 |
.SH EXAMPLE |
62 |
'nh |
63 |
.fi |
64 |
.ad l |
65 |
\fBparallel sh -c "echo hi; sleep 2; echo bye" -- 1 2 3\fR \kx |
66 |
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) |
67 |
'in \n(.iu+\nxu |
68 |
'in \n(.iu-\nxu |
69 |
.ad b |
70 |
'hy |
71 |
.PP |
72 |
This runs three subshells that each print a message, delay, |
73 |
and print another message. If your system has multiple |
74 |
CPUs, parallel will run some of the jobs in parallel, |
75 |
which should be clear from the order the messages are |
76 |
output. |
77 |
.PP |
78 |
'nh |
79 |
.fi |
80 |
.ad l |
81 |
\fBparallel -j 3 ufraw -o processed -- *.NEF\fR \kx |
82 |
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) |
83 |
'in \n(.iu+\nxu |
84 |
'in \n(.iu-\nxu |
85 |
.ad b |
86 |
'hy |
87 |
.PP |
88 |
This runs three ufraw processes at the same time until |
89 |
all of the NEF files have been processed. |
90 |
.PP |
91 |
'nh |
92 |
.fi |
93 |
.ad l |
94 |
\fBparallel -j 3 -- ls df "echo hi"\fR \kx |
95 |
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) |
96 |
'in \n(.iu+\nxu |
97 |
'in \n(.iu-\nxu |
98 |
.ad b |
99 |
'hy |
100 |
.PP |
101 |
This runs three independent commands in parallel. |
102 |
.SH "EXIT STATUS" |
103 |
Its exit status is the combination of the exit statuses of each |
104 |
command ran, ORed together. (Thus, if any one command |
105 |
exits nonzero, \fBparallel\fR as a whole will exit nonzero.) |