Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support unlimited number of parallel jobs #1379 #1309

Closed
martell opened this issue Aug 18, 2017 · 5 comments · Fixed by #1490
Closed

Support unlimited number of parallel jobs #1379 #1309

martell opened this issue Aug 18, 2017 · 5 comments · Fixed by #1490
Labels

Comments

@martell
Copy link
Contributor

martell commented Aug 18, 2017

Hey @nico,

I am looking to add a new mode, possibly a value passed to -j (or reading an environment variable to decide to enable this special mode or not) that runs as many parallel tasks as possible.
The easy way would be to just pass -j 1000 or something silly but I would like to actually get the number of concurrent tasks possible, which depends on the project, it could be limited by one part of a build depending on something previous being built and linked by the same project

Looking through the code, wanted_edges_ and command_edges_ pop out in src/build.cc
Could i get your input on how I would achieve this mode?

I assume this part is not possible because ninja just does what the it is told by the script but is there a way to differentiate between compile and link jobs for this.

Best,
Martell

@ilyapopov
Copy link

Can you use pools feature for this? Cmake allows you to configure pools for compilation and linking https://cmake.org/cmake/help/v3.9/prop_gbl/JOB_POOLS.html

@martell
Copy link
Contributor Author

martell commented Sep 12, 2017

@ilyapopov this is not something I want to do at the cmake level.
I want ninja to just run every task it possibly can in parallel which should not be too difficult.

CC @bradking would probably know best what to do here :)

@bradking
Copy link
Contributor

@martell take a look at RealCommandRunner::CanRunMore.

@mathstuf
Copy link
Contributor

Make does this by using -j0 to do it.

@nico nico changed the title Unlimited Core Mode Support unlimited number of parallel jobs #1379 Apr 5, 2018
@nico
Copy link
Collaborator

nico commented Apr 5, 2018

To me, passing -j 1000 is a good way to do this. It's understandable.

Supporting -j 0 would be consistent with -k 0 (which I'm not in love with; -k 100000 does the same and is more understandable – but we have -k 0 and won't take it away).

I think #1358 implements something like that.

@jhasse jhasse added the feature label Oct 29, 2018
mydongistiny pushed a commit to mydongistiny/ninja that referenced this issue Oct 1, 2019
This is a merge of upstream master up until this dep file parsing
change, which will need more verification given our depfiles:
  ninja-build#1039

The biggest change in this merge is probably the use of 64-bit
timestamps.

* commit '5a78423193c48cae4800eb1ec44b62d14ae03920': (80 commits)
  Add OSX build on travis (ninja-build#1502)
  Fit --help output into 80 columns and move verbose up, fix ninja-build#1500
  Improve error message when Python wasn't found for the browse tool
  Explain why there's no browse tool, fix ninja-build#1478
  HACKING: use `Python` for the project
  HACKING: fix some whitespace nits
  Fix rendering of code block, fix ninja-build#955
  Make -j 0 run unlimited parallel builds, fix ninja-build#1309
  Enable ANSI escape sequences on Windows 10 terminals
  Add --verbose as an alternative spelling for -v, fix ninja-build#1310
  Add unit test for ninja-build#1491
  Allow disabling of escape code stripping, fix ninja-build#1475
  subprocess-win32: add hint on ERROR_INVALID_PARAMETER
  Win32Fatal: support a "hint" for the error
  manual: mention the "invalid parameter" case
  util: don't add ellipses width when deciding if they're necessary
  Verify GetFullPathName return value
  Make output_test.py independent of the environment
  Fix older VS compatibility issues and PDB files generation issue. (ninja-build#1435)
  Fix parsing some special chars in depfiles
  ...

Change-Id: I315385cecc748ff351614792a9921ec87e5f4cf3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants