Skip to content

Commit cc52c5f

Browse files
committed
WIP
Signed-off-by: Francesco Romani <fromani@redhat.com>
1 parent 6d44922 commit cc52c5f

File tree

1 file changed

+2
-7
lines changed
  • pkg/performanceprofile/profilecreator/autosize

1 file changed

+2
-7
lines changed

pkg/performanceprofile/profilecreator/autosize/autosize.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ func objective(p Params, x []float64) float64 {
183183
// Must use positive CPU values (since gonum/optimize doesn't have simple bounds for all solvers)
184184
hardPenalty += defaultPenaltyWeight*math.Pow(math.Max(0, -x_c), 2) + math.Pow(math.Max(0, -x_w), 2)
185185

186-
// Allocate in multiples of SMT level (usually 2) -- TODO: should be soft?
187-
hardPenalty += defaultPenaltyWeight * math.Pow(math.Max(0, -float64(int(math.Round(x_c))%p.SMTLevel())), 2)
188-
189186
return target + hardPenalty
190187
}
191188

@@ -217,11 +214,9 @@ func Compute(env Env, params Params) (Values, Score, error) {
217214

218215
totCPUs := params.TotalCPUs()
219216
score := Score{Cost: result.F}
220-
x_c := int(math.Round(result.Location.X[0]))
221-
222217
opt := Values{
223-
ReservedCPUCount: x_c,
224-
IsolatedCPUCount: totCPUs - x_c, // we can use x_w, but we just leverage invariants
218+
ReservedCPUCount: int(math.Round(result.Location.X[0])),
219+
IsolatedCPUCount: int(math.Round(result.Location.X[1])),
225220
}
226221
env.Log.Printf("Optimization result: %s", opt.String())
227222

0 commit comments

Comments
 (0)