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

Commit

Permalink
Always use the logical processor count for system max cores (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
clintval authored Jan 24, 2021
1 parent 7c31adf commit 1547cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

# Build tool specific
target

# jEnv
.java-version
7 changes: 1 addition & 6 deletions core/src/main/scala/dagr/core/execsystem/Resource.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,13 @@
package dagr.core.execsystem

import oshi.SystemInfo
import oshi.hardware.platform.mac.MacHardwareAbstractionLayer

/** Manipulates system resources */
object Resource {
private val hal = new SystemInfo().getHardware

/** 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)
val systemCores: Cores = Cores(this.hal.getProcessor.getLogicalProcessorCount)

/** The total amount of memory in the system. */
val systemMemory: Memory = new Memory(this.hal.getMemory.getTotal)
Expand Down

0 comments on commit 1547cf0

Please sign in to comment.