From 2cf23588d768fa8b632d80354cb8501a97426af0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Jul 2009 15:16:26 -0400 Subject: [PATCH] parallel: New program, contributed by Tollef Fog Heen, that can run multiple jobs in parallel, optionally checking load average. --- Makefile | 5 +- README | 2 + debian/changelog | 8 ++++ debian/control | 1 + debian/copyright | 4 ++ parallel.docbook | 116 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 parallel.docbook diff --git a/Makefile b/Makefile index be51ab3..377121d 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ BINS=isutf8 ifdata ifne pee sponge mispipe lckdo parallel PERLSCRIPTS=vidir vipe ts combine zrun -MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 ifne.1 pee.1 zrun.1 mispipe.1 lckdo.1 +MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 ifne.1 pee.1 zrun.1 mispipe.1 lckdo.1 parallel.1 CFLAGS=-O2 -g -Wall INSTALL_BIN?=install -s PREFIX=/usr @@ -44,5 +44,8 @@ mispipe.1: mispipe.docbook lckdo.1: lckdo.docbook $(DOCBOOK2XMAN) $< +parallel.1: parallel.docbook + $(DOCBOOK2XMAN) $< + %.1: % pod2man --center=" " --release="moreutils" $< > $@; diff --git a/README b/README index ccc257c..0e42f6e 100644 --- a/README +++ b/README @@ -13,6 +13,8 @@ lckdo execute a program with a lock held mispipe pipe two commands, returning the exit status of the first +parallel + run multiple jobs at once pee tee standard input to pipes sponge diff --git a/debian/changelog b/debian/changelog index 896c260..bcdebf4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +moreutils (0.36) UNRELEASED; urgency=low + + * parallel: New program, contributed by Tollef Fog Heen, + that can run multiple jobs in parallel, optionally checking + load average. + + -- Joey Hess Thu, 02 Jul 2009 14:57:12 -0400 + moreutils (0.35) unstable; urgency=low * ifdata: Don't assume that all interface names are 6 characters or less, diff --git a/debian/control b/debian/control index 7c3e652..2dbf2b2 100644 --- a/debian/control +++ b/debian/control @@ -30,3 +30,4 @@ Description: additional unix utilities - mispipe: pipe two commands, returning the exit status of the first - isutf8: check if a file or standard input is utf-8 - lckdo: execute a program with a lock held + - parallel: run multiple jobs at once diff --git a/debian/copyright b/debian/copyright index c689a57..ebe3ee7 100644 --- a/debian/copyright +++ b/debian/copyright @@ -39,6 +39,10 @@ Files: ifne.c, ifne.docbook Copyright: 2008 Javier Merino License: GPL-2+ +Files: parallel.c +Copyright: 2008 Tollef Fog Heen +License: GPL-2 + Files: physmem.c Copyright: 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc. License: GPL-2+ diff --git a/parallel.docbook b/parallel.docbook new file mode 100644 index 0000000..07d2bf3 --- /dev/null +++ b/parallel.docbook @@ -0,0 +1,116 @@ + + + + + + + + +
+ joey@kitenet.net +
+ + Joey + Hess + + 2009-07-02 +
+ + + parallel + 1 + + + + parallel + run programs in parallel + + + + + parallel + options + command + -- + arguments + + + + + DESCRIPTION + + parallel runs the specified command, + passing it a single one of the specified arguments. This is + repeated for each argument. The default is to run all + the commands at the same time. + + + + + OPTIONS + + + + + + + Use to limit the number of jobs + that are run at the same time. + + + + + + + Avoid starting new jobs when + the system's load average is higher + than the specified limit. + + + + + + + Normally the command is passed the + argument at the end of its command line. With + this option, the first instance of "{}" in + the command is replaced with the argument. + + + + + + + + + EXAMPLE + + + + parallel -j 3 ufraw -o processed -- *.NEF + + + + This runs three ufraw processes at the same time until + all of the NEF files have been processed. + + + + + + EXIT STATUS + + + Its exit status is the combination of the exit statuses of each + command ran, ORed together. (Thus, if any one command + exists nonzero, parallel as a whole will exit nonzero.) + + + +
-- 2.39.5