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

Allow control over nthreads() when launching worker? #70

Open
droodman opened this issue Jan 8, 2024 · 3 comments
Open

Allow control over nthreads() when launching worker? #70

droodman opened this issue Jan 8, 2024 · 3 comments
Labels
documentation Improvements or additions to documentation

Comments

@droodman
Copy link

droodman commented Jan 8, 2024

Thank you for this excellent package. I understand from the documentation that "whether worker execution is multi-threaded will depend on your operating system." But for my users, it would be very helpful to be able to control the number of threads when creating a worker, so the users don't need to know about and bother with system environment variables.

With Distributed.jl, one can do this. E.g.:

addprocs(1, exeflags="-t4")

creates a new, four-threaded instance.

Might the same functionality be added to Malt.jl?

@Pangoraw
Copy link
Member

Pangoraw commented Jan 9, 2024

You can use exeflags when spawning the worker in Malt too (this should probably be added to the docs):

julia> w = Malt.Worker(exeflags=["--threads=3"]);

julia> Malt.remote_call_fetch(Threads.nthreads, w)
3

@droodman
Copy link
Author

droodman commented Jan 9, 2024

Ah, great. So then the documentation is incomplete, as well as incorrect, since the threading behavior doesn't only depend on the OS?. Is this undocumented exeflags option going to be a stable feature?

@Pangoraw
Copy link
Member

Pangoraw commented Jan 9, 2024

Without exeflags setting --threads, then it fallbacks to the default julia behavior which is OS specific as the documentation indicates. Yes, it is a stable feature just currently undocumented as an oversight.

@Pangoraw Pangoraw added the documentation Improvements or additions to documentation label Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants