Skip to content

Commit 4e10fca

Browse files
committed
hpcc_slurm: register number of cores_per_socket directly from sinfo,
rather than cores_per_node / sockets_per_node
1 parent 4dc9d01 commit 4e10fca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/hpcc_slurm/discover.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import json
66
import logging
77
import os
8+
import shlex
89
import shutil
910
import subprocess
1011
from typing import Any
@@ -52,6 +53,7 @@ def read_sinfo() -> dict[str, Any] | None:
5253
raise ValueError(f"Unable to read sinfo output:\n{proc.stdout}")
5354
if var := os.getenv("SLURM_NNODES"):
5455
node_count = int(var)
56+
cmd_line = shlex.join(args)
5557
info: dict[str, Any] = {
5658
"type": "node",
5759
"count": node_count,
@@ -62,12 +64,13 @@ def read_sinfo() -> dict[str, Any] | None:
6264
"resources": [
6365
{
6466
"type": "cpu",
65-
"count": int(cpus_per_node / sockets_per_node),
67+
"count": cores_per_socket,
6668
},
6769
],
6870
}
6971
],
7072
"additional_properties": {
73+
cmd_line: line,
7174
"sockets_per_node": sockets_per_node,
7275
"cores_per_socket": cores_per_socket,
7376
"threads_per_core": threads_per_core,

0 commit comments

Comments
 (0)