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

Always use the logical processor count for system max cores #385

Merged
merged 1 commit into from
Jan 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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