sim setup-silent produces float values for ppn in machine.ini file

Issue #2537 resolved
created an issue

Running sim setup-silent on a freshly updates macOS BigSur x86 VM I get:

% ./simfactory/bin/sim whoami
Error: value for key ppn in section osx-homebrew is not of required type int
Aborting Simfactory.

On that system python3 happens to be Python 3.8.2.

This can be fixed by:

diff --git a/lib/simdt.py b/lib/simdt.py
index 6b51053f..c1a63cea 100644
--- a/lib/simdt.py
+++ b/lib/simdt.py
@@ -528,7 +528,7 @@ class DecisionTree:
             # Throughout, we ignore hyperthreading.  That can be added later.
             if platform.system()== 'Darwin':
                 SocketsPerNode = int(cpu_info['hw.packages'])
-                CoresPerSocket = int(cpu_info['hw.physicalcpu']) / SocketsPerNode
+                CoresPerSocket = int(cpu_info['hw.physicalcpu']) // SocketsPerNode
             else:
                 CoresPerSocket = int(cpu_info['Core(s) per socket'])
                 SocketsPerNode = int(cpu_info['Socket(s)'])

which should be backported.

Comments (7)

  1. Roland Haas reporter

    Thank you.

    Applied as git hash 15f1764 "simdt: avoid producing float types when computing cores" of simfactory2 on ET_2021_05

    Applied as git hash 577204f "simdt: avoid producing float types when computing cores" of simfactory2 on master

  2. Log in to comment