On Wed, Dec 11, 2019 at 12:15 PM Joe Sapp <[email protected]> wrote:

> I would like to use GNU Parallel as a queue system/batch manager.  This
> will be especially useful with the "-S" feature.  When I start it up (as in
> the example in the man page), I submit JobSlots number of dummy jobs to
> initially fill the queue.  Up until now that number has been easy to know,
> being on the local machine.  But how can I know how many JobSlots there
> are to fill before subsequent commands start executing?  Doesn't it depend
> on how many CPUs or cores or threads Parallel finds on the remote machines
> (which could depend on which Parallel profile is selected)?  Is there a way
> to find out, maybe with a test command in advance of the actual run?
>

Here's a way to get an upper bound of JobSlots (the number of
CPUs/cores/threads):
  parallel echo '{=my $sum = 0; $sum += $Global::host{$_}->ncpus() for
(keys %Global::host); $_=$sum;=}' ::: dummy

I'm sure there's a better way.

-- 
Joe

Reply via email to