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

--parallel-workers not working as expected #36

Open
matteogrechi opened this issue Apr 30, 2024 · 3 comments
Open

--parallel-workers not working as expected #36

matteogrechi opened this issue Apr 30, 2024 · 3 comments

Comments

@matteogrechi
Copy link

matteogrechi commented Apr 30, 2024

When running colcon build --parallel-workers 1 on cpp code the number of compiler threads is not 1.
To have the "expected" behaviour I should run instead

export MAKEFLAGS=-j1
colcon build --parallel-workers 1

Is this behaviour intended?
Is it possible to cite this fact directly in the colcon documentation?

Thank you very much!

@cottsay cottsay transferred this issue from colcon/colcon-core Apr 30, 2024
@christophebedard
Copy link

As far as I know, that is the expected behaviour with colcon. --parallel-workers controls the number of "jobs" (i.e., packages in this case) being built in parallel, but then each package itself may or may not be built in parallel using multiple threads. That part depends on the underlying built system, e.g., CMake. As you've found, using the MAKEFLAGS environment variable is the proper way to control this for CMake packages.

@xiaoxiaozengzen
Copy link

I tried using --executor sequential , and the result was the same as above

@christophebedard
Copy link

--executor sequential only means that colcon will process (e.g., build or test) 1 package at a time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants