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

Enable multithreading when numThreads == 0. #2216

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

yanxke
Copy link
Contributor

@yanxke yanxke commented Jul 5, 2023

It seems like multiple people have encountered this bug where the CPU is only 100% on the compute features stage.
#2198 #1730

After applying the change from #1730 (comment) it worked for me as well.

@@ -260,7 +260,8 @@ int main(int argc, char **argv)
if (iNumThreads > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Would not be better to have the value iNumThreads updated once with a IF, and then call once omp_set_num_threads(iNumThreads);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this, but the initial iNumThreads could be negative, in which case wouldn't want to call omp_set_num_threads()? I'm not sure what the effect would be, and so this seems like the safest change.

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

Successfully merging this pull request may close these issues.

None yet

2 participants