fulcrumgenomics/dagr

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

clintval opened this issue · 1 comments

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 commented

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