[PATCH 2/3] rteval: kcompile: Fix offline node handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Having an empty NumaNode but with CPUs attached to it (IOW they are all
offline) causes kcompile.py to raise the following exception:

  calc_jobs_per_cpu():
      ratio = float(mem) / float(len(self.node))
  ZeroDivisionError: float division by zero

Remove nodes that do have CPUs but none of which are online.

Signed-off-by: Valentin Schneider <vschneid@xxxxxxxxxx>
---
 rteval/modules/loads/kcompile.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index 367f8dc..ac99964 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -211,7 +211,10 @@ class Kcompile(CommandLineLoad):
 
         # remove nodes with no cpus available for running
         for node, cpus in self.cpus.items():
-            if not cpus:
+            # If the intersection between the node CPUs and the cpulist is empty
+            # then either the cpulist exludes that node, or the CPUs allowed by
+            # the cpulist are actually offline
+            if not set(self.topology.nodes[node].cpus.cpulist) & set(cpus):
                 self.nodes.remove(node)
                 self._log(Log.DEBUG, "node %s has no available cpus, removing" % node)
 
-- 
2.27.0




[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux