rteval/rteval-Fix-loads-cpulist-re...

72 lines
3.1 KiB
Diff

From 823870b5a28ead45881b3f400028b61217854dae Mon Sep 17 00:00:00 2001
From: Valentin Schneider <vschneid@redhat.com>
Date: Fri, 5 Aug 2022 14:42:39 +0100
Subject: [PATCH 13/19] rteval: Fix loads cpulist restriction
A recent batch of commits, one of them being:
39115f0a826d ("rteval: Make use of systopology instead of misc in hackbench")
has made the loads modules use CpuList.expand_cpulist() (which produces a
list(int)) instead of misc.expand_cpulist() (which produces a list(str)).
However, the bits handling restricting CPU affinity based on a user
argument still expects to handle a list(str), which results in:
[DEBUG] [kcompile] node 0 has no available cpus, removing
[...]
[DEBUG] [hackbench] node 0 has no available cpus, removing
Remove the leftover string casts.
Cyclictest is unaffected.
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
rteval/modules/loads/hackbench.py | 2 +-
rteval/modules/loads/kcompile.py | 2 +-
rteval/modules/loads/stressng.py | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py
index 538f60f00282..14e60d1ce2f6 100644
--- a/rteval/modules/loads/hackbench.py
+++ b/rteval/modules/loads/hackbench.py
@@ -76,7 +76,7 @@ class Hackbench(CommandLineLoad):
self.cpus[n] = sysTop.getcpus(int(n))
# if a cpulist was specified, only allow cpus in that list on the node
if self.cpulist:
- self.cpus[n] = [c for c in self.cpus[n] if str(c) in expand_cpulist(self.cpulist)]
+ self.cpus[n] = [c for c in self.cpus[n] if c in expand_cpulist(self.cpulist)]
# track largest number of cpus used on a node
node_biggest = len(sysTop.getcpus(int(n)))
diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index 7d78d0ff9cae..6faa686f81d0 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -235,7 +235,7 @@ class Kcompile(CommandLineLoad):
# if a cpulist was specified, only allow cpus in that list on the node
if self.cpulist:
- self.cpus[n] = [c for c in self.cpus[n] if str(c) in expand_cpulist(self.cpulist)]
+ self.cpus[n] = [c for c in self.cpus[n] if c in expand_cpulist(self.cpulist)]
# remove nodes with no cpus available for running
for node, cpus in self.cpus.items():
diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py
index 287f4e232d17..85cb47392bcb 100644
--- a/rteval/modules/loads/stressng.py
+++ b/rteval/modules/loads/stressng.py
@@ -68,7 +68,7 @@ class Stressng(CommandLineLoad):
cpus[n] = systop.getcpus(int(n))
# if a cpulist was specified, only allow cpus in that list on the node
if self.cpulist:
- cpus[n] = [c for c in cpus[n] if str(c) in expand_cpulist(self.cpulist)]
+ cpus[n] = [c for c in cpus[n] if c in expand_cpulist(self.cpulist)]
# remove nodes with no cpus available for running
for node, cpu in cpus.items():
--
2.37.3