Skip to content

Commit

Permalink
Fixed a bug with the numberOfThreads setting not working
Browse files Browse the repository at this point in the history
  • Loading branch information
sp00n committed Mar 9, 2021
1 parent deefc0e commit 1721204
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions script-corecycler.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.AUTHOR
sp00n
.VERSION
0.7.8.5
0.7.8.6
.DESCRIPTION
Sets the affinity of the Prime95 process to only one core and cycles through all the cores
to test the stability of a Curve Optimizer setting
Expand All @@ -17,7 +17,7 @@
#>

# Global variables
$version = '0.7.8.5'
$version = '0.7.8.6'
$curDateTime = Get-Date -format yyyy-MM-dd_HH-mm-ss
$settings = $null
$logFilePath = $null
Expand Down Expand Up @@ -54,6 +54,20 @@ $counterNames = @{
}


# The number of physical and logical cores
# This also includes hyperthreading resp. SMT (Simultaneous Multi-Threading)
# We currently only test the first core for each hyperthreaded "package",
# so e.g. only 12 cores for a 24 threaded Ryzen 5900x
# If you disable hyperthreading / SMT, both values should be the same
$processor = Get-WMIObject Win32_Processor
$numLogicalCores = $($processor | Measure-Object -Property NumberOfLogicalProcessors -sum).Sum
$numPhysCores = $($processor | Measure-Object -Property NumberOfCores -sum).Sum


# Set the flag if Hyperthreading / SMT is enabled or not
$isHyperthreadingEnabled = ($numLogicalCores -gt $numPhysCores)


# Add code definitions so that we can close the Prime95 window even if it's minimized to the tray
# The regular PowerShell way unfortunetely doesn't work in this case
$GetWindowDefinition = @'
Expand Down Expand Up @@ -1053,19 +1067,6 @@ Add-Type -TypeDefinition $CloseWindowDefinition
Get-Settings


# The number of physical and logical cores
# This also includes hyperthreading resp. SMT (Simultaneous Multi-Threading)
# We currently only test the first core for each hyperthreaded "package",
# so e.g. only 12 cores for a 24 threaded Ryzen 5900x
# If you disable hyperthreading / SMT, both values should be the same
$processor = Get-WMIObject Win32_Processor
$numLogicalCores = $($processor | Measure-Object -Property NumberOfLogicalProcessors -sum).Sum
$numPhysCores = $($processor | Measure-Object -Property NumberOfCores -sum).Sum


# Set the flag if Hyperthreading / SMT is enabled or not
$isHyperthreadingEnabled = ($numLogicalCores -gt $numPhysCores)


# The Prime95 process
$process = Get-Process $processName -ErrorAction SilentlyContinue
Expand Down

0 comments on commit 1721204

Please sign in to comment.