File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44import json
55import os
6- import platform
76import subprocess
87import sys
98from dataclasses import dataclass
@@ -79,7 +78,7 @@ def parse_id_list(raw_str: str) -> list[int]:
7978
8079
8180def get_memory_node_info (node_id : int = 0 ) -> MemoryNodeInfo :
82- if platform . system () == "Darwin " :
81+ if sys . platform == "darwin " :
8382 # MacOS has no memory node
8483 return MemoryNodeInfo (
8584 total_memory = psutil .virtual_memory ().total ,
@@ -130,7 +129,7 @@ def get_allowed_cpu_list() -> list[LogicalCPUInfo]:
130129
131130
132131def get_visible_memory_node () -> list [int ]:
133- if platform . system () == "Darwin " :
132+ if sys . platform == "darwin " :
134133 return [0 ]
135134
136135 allowed_memory_node_list = get_memory_affinity ()
@@ -161,7 +160,7 @@ def _synthesize_cpu_list() -> list[LogicalCPUInfo]:
161160
162161
163162def _get_cpu_list () -> list [LogicalCPUInfo ]:
164- if platform . system () == "Darwin " :
163+ if sys . platform == "darwin " :
165164 # For MacOS, no user-level CPU affinity and SMT, return all CPUs
166165 return _synthesize_cpu_list ()
167166
You can’t perform that action at this time.
0 commit comments