bugmake - Bugs: bug #49844, 'make -j' without explicit process...

 
 

bug #49844: 'make -j' without explicit process count sometimes doesn't parallelize

Submitted by:  Dima Kogan <dkogan>
Submitted on:  Wed 14 Dec 2016 07:02:15 PM UTC  
 
Severity: 3 - NormalItem Group: None
Status: Not A BugPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: NoneOperating System: None
Fixed Release: NoneTriage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 22 Jun 2017 12:12:18 PM UTC, comment #2:

Even simpler is to just use "--" (and what's the goal of using xargs?):

+verbose+
make -j5 -- $(seq 1000)

make -j -- $(seq 1000)
-verbose-

If that ends up not solving your problem please add a new comment and I'll re-open this issue.

Paul D. Smith <psmith>
Project Administrator
Wed 21 Jun 2017 07:39:39 PM UTC, comment #1:

Hello.

There is a bug in your trivial example:

1) 'seq 1000 | xargs -n1000 make -j5'

expands to

'make -j5 1 2 3 4 5 6 7 ...'

and

2) 'seq 1000 | xargs -n1000 make -j'

expands to

'make -j 1 2 3 4 5 6 7 ...'

As we can see, in second example '1' after '-j' make interprets as number of jobs, so "it not do any parallelization at all".

Michael Builov <mbuilov>
Wed 14 Dec 2016 07:02:15 PM UTC, original submission:

Hi. I have this trivial Makefile:

%:
echo Starting $@ || true
timeout 5 bash -c 'while true; do true; done' || true
echo Done $@ || true

It's meant to spin the cpu for 5 seconds for each target being built. I can ask for 5 simultaneous jobs with something like 'seq 1000 | xargs -n1000 make -j5' and this command should always redline 5 CPUs. If I give 'make -j' instead of 'make -j5' I would expect it to redline ALL my CPUs, but I see it not do any parallelization at all instead. If the Makefile contains normal (not pattern) rules, then it works how I would expect.

Dima Kogan <dkogan>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by mbuilov (Posted a comment)
  • -unavailable- added by dkogan (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 22 Jun 2017 12:12:18 PM UTCpsmithStatusNone=>Not A Bug
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1