Skip to content

Commit fd8fac0

Browse files
committed
Fixed a bug with the detection of the starting values (fixes #79).
Added some additional error messages.
1 parent ce44dc2 commit fd8fac0

File tree

1 file changed

+32
-4
lines changed

1 file changed

+32
-4
lines changed

script-corecycler.ps1

+32-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.AUTHOR
33
sp00n
44
.VERSION
5-
0.10.0.0alpha1
5+
0.10.0.0alpha2
66
.DESCRIPTION
77
Sets the affinity of the selected stress test program process to only one
88
core and cycles through all the cores which allows to test the stability of
@@ -23,7 +23,7 @@ param(
2323

2424

2525
# Our current version
26-
$version = '0.10.0.0alpha1'
26+
$version = '0.10.0.0alpha2'
2727

2828

2929
# This defines the strict mode
@@ -4640,9 +4640,9 @@ function Initialize-AutomaticTestMode {
46404640

46414641

46424642
# The Automatic Test Mode without resuming from a reboot
4643+
# Get the Automatic Test Mode starting values from the settings
46434644
if (!$voltageStartValuesString) {
4644-
# Get the Automatic Test Mode starting values from the settings
4645-
$voltageStartValuesString = $settings['AutomaticTestMode']['startValues'].Trim()
4645+
$voltageStartValuesString = $settings['AutomaticTestMode']['startValues']
46464646

46474647
Write-Debug('The Automatic Test Mode starting values from the settings:')
46484648
Write-Debug($voltageStartValuesString)
@@ -4668,6 +4668,7 @@ function Initialize-AutomaticTestMode {
46684668
}
46694669
}
46704670

4671+
46714672
# The number of settings must equal the number of cores or be exactly one value
46724673
if ($voltageStartValuesArray.Count -ne $numPhysCores) {
46734674
# If it's only a single value, apply this value to each core
@@ -4678,11 +4679,18 @@ function Initialize-AutomaticTestMode {
46784679
else {
46794680
$msg = 'The number of ' + $modeDescription + ' starting values needs to match the number of cores'
46804681
$msg += [Environment]::NewLine + 'or be a single value for all cores!'
4682+
$msg += [Environment]::NewLine + '(' + $numPhysCores + ' cores found, but ' + $(if ($voltageStartValuesArray.Count -le $numPhysCores) { 'only ' } else { '' }) + $voltageStartValuesArray.Count + ' starting values)'
46814683

46824684
Exit-WithFatalError -text $msg
46834685
}
46844686
}
46854687

4688+
4689+
# We can have only integer values at this point
4690+
$voltageStartValuesArray = $voltageStartValuesArray | ForEach-Object { [Int] $_ }
4691+
4692+
4693+
# Curve Optimizer has a limit
46864694
if (!$isIntelProcessor) {
46874695
if (@($voltageStartValuesArray | Where-Object { [Math]::Abs($_) -gt $limitForCoValues }).Count -gt 0) {
46884696
Exit-WithFatalError -text ('Found invalid values (either higher or lower than +-' + $limitForCoValues + ')' + [Environment]::NewLine + $voltageStartValuesArray)
@@ -4761,6 +4769,10 @@ function Get-CurveOptimizerValues {
47614769
$msg += [Environment]::NewLine + $stdErr
47624770
}
47634771

4772+
if ($stdOut) {
4773+
$msg += [Environment]::NewLine + $stdOut
4774+
}
4775+
47644776
throw($msg)
47654777
}
47664778

@@ -4841,6 +4853,10 @@ function Set-CurveOptimizerValues {
48414853
$msg += [Environment]::NewLine + $stdErr
48424854
}
48434855

4856+
if ($stdOut) {
4857+
$msg += [Environment]::NewLine + $stdOut
4858+
}
4859+
48444860
throw($msg)
48454861
}
48464862

@@ -4909,6 +4925,10 @@ function Get-IntelVoltageOffset {
49094925
$msg += [Environment]::NewLine + $stdErr
49104926
}
49114927

4928+
if ($stdOut) {
4929+
$msg += [Environment]::NewLine + $stdOut
4930+
}
4931+
49124932
throw($msg)
49134933
}
49144934

@@ -4984,6 +5004,10 @@ function Set-IntelVoltageOffset {
49845004
$msg += [Environment]::NewLine + $stdErr
49855005
}
49865006

5007+
if ($stdOut) {
5008+
$msg += [Environment]::NewLine + $stdOut
5009+
}
5010+
49875011
throw($msg)
49885012
}
49895013

@@ -10148,6 +10172,10 @@ function Get-ProcessorCoresInformation {
1014810172
$msg += [Environment]::NewLine + $stdErr
1014910173
}
1015010174

10175+
if ($stdOut) {
10176+
$msg += [Environment]::NewLine + $stdOut
10177+
}
10178+
1015110179
throw($msg)
1015210180
}
1015310181

0 commit comments

Comments
 (0)