From 3c6483c6e6e24a3e457c631f031f83e81b5e930c Mon Sep 17 00:00:00 2001 From: John Kacur Date: Tue, 10 Dec 2019 02:23:10 +0100 Subject: [PATCH] rteval: hackbench Fix interating through nodes Fix iterating through the nodes in hackbench. When creating a dictionary of node, cpus, we need to iterate through the nodes and not through sysTop alone. Also use python3 syntax for iterating through a dictionary. Signed-off-by: John Kacur --- rteval/modules/loads/hackbench.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py index f31e29dd3f13..d951d1a0b930 100644 --- a/rteval/modules/loads/hackbench.py +++ b/rteval/modules/loads/hackbench.py @@ -61,7 +61,7 @@ class Hackbench(CommandLineLoad): # get the cpus for each node self.cpus = {} biggest = 0 - for n in sysTop: + for n in sysTop.getnodes(): self.cpus[n] = sysTop.getcpus(int(n)) # if a cpulist was specified, only allow cpus in that list on the node if self.cpulist: @@ -73,7 +73,7 @@ class Hackbench(CommandLineLoad): biggest = node_biggest # remove nodes with no cpus available for running - for node,cpus in self.cpus.items(): + for node,cpus in list(self.cpus.items()): if not cpus: self.nodes.remove(node) self._log(Log.DEBUG, "node %s has no available cpus, removing" % node) -- 2.20.1