Mailinglist Archive: opensuse (1264 mails)

< Previous Next >
[opensuse] xargs -n1 -P<#threads> = parallel execution (was Re: Quick question: how to call a script function from "find"?)
Vojtěch Zeisek wrote:

How is that different from using 'xargs -N1 -j#threads'?
oops: Make those -n1 and -P. I seem to remember arguing w/the
gnuboys about not using -j, but they usually do anything
other than what I suggest.

I'm not so familiar with xargs. 'parallel -j #' says how many of available CPU threads to use (otherwise Parallel uses all available CPU threads). My 'xargs' (TW) doesn't know args '-N' and '-j',
Notice the "oops" look at -n and -P -- n is how many args to
call / invocation, (so n1 says do 1 arg/thread), and -P is how
many threads.... ..

but xargs, as far as I understand, "just" does groups of given size (length of arguments).
It does as many as you tell it to, but if you want to do 1 arg/thread,
use -n1, if you want to do 4 args/thread, you'd do -n4...etc.

-P is just like parallel's -j.

You have to tell xargs how many args/to do per thread, otherwise,
it tries for max# args per thread -- potentially doing no parallelism.

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >