Skip to content

Commit

Permalink
Set LC_NUMERIC=C and handle empty MAXMHZ
Browse files Browse the repository at this point in the history
  • Loading branch information
colesbury committed Oct 28, 2024
1 parent 0849582 commit 6e731c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Tools/ftscalingbench/ftscalingbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ def determine_num_threads_and_affinity():
# Try to use `lscpu -p` on Linux
import subprocess
try:
output = subprocess.check_output(["lscpu", "-p=cpu,node,core,MAXMHZ"], text=True)
output = subprocess.check_output(["lscpu", "-p=cpu,node,core,MAXMHZ"],
text=True, env={"LC_NUMERIC": "C"})
except (FileNotFoundError, subprocess.CalledProcessError):
return [None] * os.cpu_count()

Expand All @@ -224,6 +225,8 @@ def determine_num_threads_and_affinity():
if line.startswith("#"):
continue
cpu, node, core, maxhz = line.split(",")
if maxhz == "":
maxhz = "0"
table.append((int(cpu), int(node), int(core), float(maxhz)))

cpus = []
Expand Down

0 comments on commit 6e731c6

Please sign in to comment.