[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: #518696 ITP: parallel -- build and execute command lines from standard input in parallel]



Chuan-kai Lin, le Mon 09 Mar 2009 12:46:35 -0700, a écrit :
> On Mon, Mar 09, 2009 at 11:40:51AM +0100, Samuel Thibault wrote:
> > A lot of applications (including md5sum) would not necessarily print
> > their output atomically and then you get mixed output.  Either we add
> > the option to findutils, or we package parallel.
> 
> It appears to me that you can get the same functionality by using xargs
> with an adapted version of annotate-output(1) which is a part of
> devscripts.  Are there other reasons to use parallel?

Upstream author would say that xargs also misses

       -c       Line is a command.  The input line contains more than one
                argument or the input line needs to be evaluated by the shell.
                This is the default if command is not set. Can be reversed
                with -f.

which makes parallel not take a command, but executes commands from
stdin.  That can however be obtained by xargs sh -c.  Another option
that xargs misses is

       -j +N    Add N to the number of CPUs.  Run this many jobs in parallel.
                For compute intensive jobs -j +0 is useful as it will run
                number-of-cpus jobs in parallel.

       -j -N    Subtract N from the number of CPUs.  Run this many jobs in
                parallel.  If the evaluated number is less than 1 then 1 will
                be used.

       -j N%    Multiply N% with the number of CPUs.  Run this many jobs in
                parallel.  If the evaluated number is less than 1 then 1 will
                be used.

in particular -j +0 is really useful.  I would personally be happy if
xargs was just able to consider e.g. -P -1 as "run as many processes as
there are processors".

Samuel


Reply to: