Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Why does Dagr use the physical processor count instead of logical for Macs only? #370

Closed
clintval opened this issue Jan 5, 2020 · 1 comment · Fixed by #385
Closed
Assignees
Labels

Comments

@clintval
Copy link
Member

clintval commented Jan 5, 2020

On my MacBook Pro with hyper-threading enabled I have 8 physical cores yet 16 addressable cores.

❯ sysctl -n hw.physicalcpu
8
❯ sysctl -n hw.logicalcpu
16

/** Total number of cores in the system */
val systemCores : Cores =
if (hal.isInstanceOf[MacHardwareAbstractionLayer])
Cores(this.hal.getProcessor.getPhysicalProcessorCount)
else
Cores(this.hal.getProcessor.getLogicalProcessorCount)

I may be under-utilizing my local compute resources if capped to 8 cores instead of the full 16. Here's a screenshot of when I ask Dagr to run a task with the maximum allowed system cores:

Screen Shot 2020-01-05 at 5 21 24 PM

Since hyper-threading is not unique to Macs, I am wondering why this design decision was made.

@nh13 nh13 added the question label Jan 10, 2020
@nh13
Copy link
Member

nh13 commented Jan 10, 2020

Pinging @tfenne if he can remember as I don't. You can override this with --cores 16 in the short-term.

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

Successfully merging a pull request may close this issue.

3 participants