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

Setting affinity does not work for Environment.ProcessorCount >= 32 #2211

Closed
Donis- opened this issue Dec 1, 2022 · 2 comments
Closed

Setting affinity does not work for Environment.ProcessorCount >= 32 #2211

Donis- opened this issue Dec 1, 2022 · 2 comments
Assignees
Milestone

Comments

@Donis-
Copy link
Contributor

Donis- commented Dec 1, 2022

https://github.com/dotnet/BenchmarkDotNet/blob/master/src/BenchmarkDotNet/Extensions/ProcessExtensions.cs#L48

int cpuMask = (1 << Environment.ProcessorCount)
becomes 0 for Environment.ProcessorCount >=32

This works:
long cpuMask = (1L << Environment.ProcessorCount) - 1;

@timcassell
Copy link
Collaborator

Affinity is a bit mask, so it will only work up to 64 cores? We already have processors with more threads than that...

Donis- added a commit to Donis-/BenchmarkDotNet that referenced this issue Dec 9, 2022
Donis- added a commit to Donis-/BenchmarkDotNet that referenced this issue Dec 9, 2022
@adamsitnik adamsitnik added this to the v0.13.3 milestone Dec 16, 2022
@adamsitnik
Copy link
Member

Fixed by #2228

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

No branches or pull requests

3 participants