bug-make
[Top][All Lists]
Advanced

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

Feature request: -j100%


From: Frank Heckenbach
Subject: Feature request: -j100%
Date: Wed, 20 Apr 2022 18:36:09 +0200

GNU parallel has a "-j" option quite like GNU make. But it also
allows to specify the number of jobs relative to the number of
CPU cores present:

  --jobs N
  -j N     Number of jobslots on each machine. Run up to N jobs in parallel.  0 
means as many as possible.
           Default is 100% which will run one job per CPU core on each machine.

In my experience, that's what I almost always do when running
parallel jobs (either 100%, or even something like 150% or 200% for
I/O intensive and not very memory hungry jobs).

Of couse, with make I can compute the number of cores myself (e.g.
in a wrapper script by reading /proc/cpuinfo), but that's not very
portable and rather cumbersome to do in various places, so it would
seem useful for make to support this in a centralized location and
more portable than anyone's individual solution.

The implementation is hopefully not too difficult. Under Linux you
can use "sysconf (_SC_NPROCESSORS_ONLN)", and other systems probably
have similar methods. The implemention of GNU parallel can serve as
an example. In the worst case, it can always default to 1.

Regards,
Frank



reply via email to

[Prev in Thread] Current Thread [Next in Thread]