Re: Proposed change to make -j



On Fri, Nov 24, 2006 at 08:04:17AM +0100, Rink Springer wrote:
On Thu, Nov 23, 2006 at 04:30:02PM -0800, Jason Evans wrote:
John Birrell wrote:
Currently 'make -j' reports an error if the number of jobs
isn't specified.

I'd like to change make(1) to treat -j (without a number) as
meaning "set the number of jobs to the number of processors".

On sun4v, each processor isn't too powerful and system performance
is only decent when you use all the processors - 32 in my case.

I've been working on a parallel 'make release' process which
would benefit from having -j set by default. At the moment I
set MAKEFLAGS=j32 in my environment and this achieves the desired
result, but -j would be more general.

For gmake, a bare -j says to not limit the number of simultaneous jobs.
I don't think that it's a good idea to use a flag name that already
has a different (and potentially useful) meaning for gmake.

I have some concern that no matter what number of jobs you decide to run
simultaneously when your proposed flag is specified (N, N+1, 2N, etc.,
where N is the number of CPUs), that choice will not be universally
useful, since the best choice of argument to -j depends on what 'make'
is building. Might it be better to use sysctl(8) in your command line?

make -j `sysctl -n hw.ncpu`

What about 'make -j0'? This current gives an error message...

That would be an unportable extension which depends on the FreeBSD
sysctl (hw.ncpu). What Jason suggested is just fine and UNIXish.
Also, on most systems around here where I did testing (UP and SMP),
I saw the imrpovement in wall clock time with -j going up to 2xNCPU,
but on other systems I only saw it with -j up to NCPU, so there's
no one true formula. It's a product of many factors, including
properly written makefiles in a build set.


Cheers,
--
Ruslan Ermilov
ru@xxxxxxxxxxx
FreeBSD committer

Attachment: pgpJyOkSe1oVx.pgp
Description: PGP signature



Relevant Pages

  • Re: to unprepare
    ... > The principals are not prepared for their jobs by education colleges. ... > That emergent meaning interferes with the plain intention of the sentence, ...
    (sci.lang)
  • Re: Proposed change to make -j
    ... meaning "set the number of jobs to the number of processors". ... I don't think that it's a good idea to use a flag name that already has a different (and potentially useful) meaning for gmake. ... I have some concern that no matter what number of jobs you decide to run simultaneously when your proposed flag is specified, that choice will not be universally useful, since the best choice of argument to -j depends on what 'make' is building. ...
    (freebsd-arch)
  • Re: Proposed change to make -j
    ... meaning "set the number of jobs to the number of processors". ... On sun4v, each processor isn't too powerful and system performance ... Besides the portability issues already pointed at, ...
    (freebsd-arch)
  • Re: Proposed change to make -j
    ... On 11/24/06, John Birrell wrote: ... meaning "set the number of jobs to the number of processors". ... set MAKEFLAGS=j32 in my environment and this achieves the desired ...
    (freebsd-arch)