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

ROBUSTNESS: Automatically disable multi-threading in forked processing ("multicore") #355

Closed
HenrikBengtsson opened this issue Dec 31, 2019 · 2 comments
Milestone

Comments

@HenrikBengtsson
Copy link
Collaborator

HenrikBengtsson commented Dec 31, 2019

Forked parallel processing and multi-threading are not the best friends, e.g. futureverse/future.apply#29 (comment). I think it might be worth having future disable multi-threading in such cases by default.

One solution would be do depend on RhpcBLASctl and use:

RhpcBLASctl::blas_set_num_threads(1L)
RhpcBLASctl::omp_set_num_threads(1L)

See also

@EmilRehnberg
Copy link

Thanks for all the digging @HenrikBengtsson I wouldn't have been able to diagnose this myself well enough.

I think the solution makes sense AFAIU it anyways. Still having 7 threads running while forking (as you mentioned in #348 ) doesn't seem helpful.

@HenrikBengtsson
Copy link
Collaborator Author

Next release will have an optional prototype/beta feature for temporarily disabling multi-threading in futures using OpenMP. I'm holding back on ditto BLAS for the reason that I don't know how to get the current number of BLAS threads, i.e. I don't know what the corresponding "getter" for RhpcBLASctl::blas_set_num_threads(1L) is.

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

No branches or pull requests

2 participants