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

Change the number of threads #47

Open
cheng-hsiang-chiu opened this issue Nov 7, 2022 · 3 comments
Open

Change the number of threads #47

cheng-hsiang-chiu opened this issue Nov 7, 2022 · 3 comments

Comments

@cheng-hsiang-chiu
Copy link

Hello,

How could I modify the number of threads while running pipeline examples? According to README, the number of threads is defaulted to the number of cores. However, I would like to change the number of threads and see the runtime performance trend. How could I do that? Thank you so much.

@cheng-hsiang-chiu
Copy link
Author

Be more specific. I am running tests/test_noinput_pipe.cpp (https://github.com/fastflow/fastflow/blob/master/tests/test_noinput_pipe.cpp) and I would like to test the sample code with different number of threads. How could I do that? Thank you.

@massimotorquati
Copy link
Member

Hi, in FastFlow it is not possible to change the number of threads in a pipeline. It is only possible to change (i.e., activate/deactivate at run-time) the workers on a farm.
For an n-stage pipeline, there are n threads. To reduce the number of threads, you can combine pipeline stages by using the ff_comb* building block. However, such an operation has to be performed statically (in the current version).

@cheng-hsiang-chiu
Copy link
Author

Thank you so much for the reply. I will try your suggestions in the sample codes.

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

No branches or pull requests

2 participants