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

Added option to set global thread number during runtime #33

Closed
wants to merge 1 commit into from

Conversation

tsoj
Copy link

@tsoj tsoj commented Apr 26, 2024

This is roughly my suggestion. Use case is that to run a program on different systems where I am each allowed to use half of all CPU threads.

@Araq
Copy link
Owner

Araq commented Apr 26, 2024

But a thread is not tied to a CPU so how is this even enforced.

@tsoj
Copy link
Author

tsoj commented Apr 26, 2024

Could be that I'm missing something obvious, but I thought that limiting the number of workers provides an upper bound how many threads can run at the same time, and thus how much a CPU gets utilized.

Also, it seems likely to me, that if N workers exist, that the OS tries to run these on as many (up to N) Cores/Hyperthreads as possible.

EDIT: or if you're referring to the systems where I am allowed to use "half of a CPU": This is not a hard limit but just a rough rule to follow. The reference would be something like htop (or taskmanager).

@Araq
Copy link
Owner

Araq commented Apr 26, 2024

EDIT: or if you're referring to the systems where I am allowed to use "half of a CPU": This is not a hard limit but just a rough rule to follow. The reference would be something like htop (or taskmanager).

That is what I meant. Well, I don't really like the idea -- you already need to use -d:maleSkipSetup so why not just use -d:ThreadPoolSize=8. Sure, you need to recompile for every machine but it's seems to be such a niche use case.

@tsoj
Copy link
Author

tsoj commented Apr 26, 2024

Fair enough. I'll keep the issue #27 open though, maybe there'll be more people who want something like this.

@tsoj tsoj closed this Apr 26, 2024
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.

2 participants