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

improve Windows process binding #78

Open
ompiteam opened this issue Sep 12, 2014 · 5 comments
Open

improve Windows process binding #78

ompiteam opened this issue Sep 12, 2014 · 5 comments
Assignees
Milestone

Comments

@ompiteam
Copy link
Contributor

Hartmut Kaiser (the user who has a 48core windows machine) once said
may I ask you to implement hwloc_get_cpubind() for Windows, please?

We have some support for get_cpubind() but I assume it's not enough for his large machine (use groups too). There are some TODO in the code, we'll need to implement all this and get Hartmut to test them.

@ompiteam ompiteam self-assigned this Sep 12, 2014
@ompiteam ompiteam added this to the Future milestone Sep 12, 2014
@ompiteam ompiteam added the bug label Sep 12, 2014
@ompiteam
Copy link
Contributor Author

Imported from trac issue 77. Created by bgoglin on 2012-06-27T01:54:25, last modified: 2013-03-06T09:21:15

@ompiteam
Copy link
Contributor Author

Trac comment by bgoglin on 2013-03-06 09:21:15:

Won't happen anytime soon, I don't have access to a Windows machine with more than 32 cores.

@bgoglin
Copy link
Contributor

bgoglin commented Sep 9, 2015

The next release will have set/get cpubind support for threads with support for large machines with multiple processor groups (as well as get_last_cpu_location).

For process-wide affinity, there's not much hope so far. The only function to move a process to a given group is not public [1]. And process-wide affinity is not equivalent to the sum of affinities of all threads (it contains something like the locality of the original process resources). By the way, that makes hwloc-bind useless on these machines (and we would have to replace execvp with CreateProcess(... INHERIT_PARENT_AFFINITY ...) first, see #151)

[1] NtSetInformationProcess() can change the process affinity group+mask as explained in the comments of https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/e0f49cda-4cbf-4da0-918a-0568271edb9f/process-affinity-on-a-system-with-128-processors?forum=wdk

@bgoglin
Copy link
Contributor

bgoglin commented Mar 5, 2016

Microsoft guys pointed me at JobObjects which can apply binding to processes. Unfortunately the API isn't very good either because a process can be in a hierarchy of nested jobs. It's not totally clear which job binding is applied to the process (looks like the first job that applies binding is the only one that will ever be able to change that process binding, other job bindings are not applied). Also querying job binding isn't easy because you don't know which job to query.

@bgoglin
Copy link
Contributor

bgoglin commented Jun 3, 2021

See #471 for more detaisl about why JobObjects are easy to use.

@bgoglin bgoglin changed the title improve Windows cpubind improve Windows process binding Jun 3, 2021
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