Skip to content

[flang] Add FLANG_PARALLEL_COMPILE_JOBS option #95672

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

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

tstellar
Copy link
Collaborator

This works the same way as LLVM_PARALLEL_COMPILE_JOBS except that it is specific to the flang source rather than for the whole project.

Configuring with -DFLANG_PARALLEL_COMPILE_JOBS=1 would mean that there would only ever be one flang source being compiled at a time.

Some of the flang sources require large amounts of memory to compile, so this option can be used to avoid OOM erros when compiling those files while still allowing the rest of the project to compile using the maximum number of jobs.

This works the same way as LLVM_PARALLEL_COMPILE_JOBS except that it
is specific to the flang source rather than for the whole project.

Configuring with -DFLANG_PARALLEL_COMPILE_JOBS=1 would mean that there
would only ever be one flang source being compiled at a time.

Some of the flang sources require large amounts of memory to compile,
so this option can be used to avoid OOM erros when compiling those
files while still allowing the rest of the project to compile using
the maximum number of jobs.
@llvmbot llvmbot added the flang Flang issues not falling into any other category label Jun 15, 2024
@tstellar
Copy link
Collaborator Author

If we know specifically which flang sources require a lot of memory to compile we could also add only those files to the pool, and keep the rest of the files in the default job pool.

Copy link
Collaborator

@joker-eph joker-eph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Contributor

@kiranchandramohan kiranchandramohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG. Thanks for this change.

Co-authored-by: Nikita Popov <[email protected]>
@tstellar tstellar merged commit 083c683 into llvm:main Jun 18, 2024
7 checks passed
@kiranchandramohan
Copy link
Contributor

One of the flang CI that tests builds for the flang runtime for offloading failed after this patch.
https://lab.llvm.org/buildbot/#/builders/7/builds/197

tstellar added a commit that referenced this pull request Jun 18, 2024
tstellar added a commit that referenced this pull request Jun 18, 2024
Reverts #95672

This is failing on build configurations that use the CMakeLists.txt file
from flang/runtime instead of flang/
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
This works the same way as LLVM_PARALLEL_COMPILE_JOBS except that it is
specific to the flang source rather than for the whole project.

Configuring with -DFLANG_PARALLEL_COMPILE_JOBS=1 would mean that there
would only ever be one flang source being compiled at a time.

Some of the flang sources require large amounts of memory to compile, so
this option can be used to avoid OOM erros when compiling those files
while still allowing the rest of the project to compile using the
maximum number of jobs.

---------

Co-authored-by: Nikita Popov <[email protected]>
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
Reverts llvm#95672

This is failing on build configurations that use the CMakeLists.txt file
from flang/runtime instead of flang/
@tstellar
Copy link
Collaborator Author

Updated PR with a fix for the runtime build: #127364

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants