File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616
1717try :
1818 import psutil
19+
1920 PSUTIL_AVAILABLE = True
2021except ImportError :
2122 PSUTIL_AVAILABLE = False
Original file line number Diff line number Diff line change @@ -45,10 +45,12 @@ def set_CPU_tracking(self):
4545 max_power = self .tracker ._force_cpu_power
4646 else :
4747 max_power = tdp .tdp * cpu_number if tdp .tdp is not None else None
48-
48+
4949 # Check for forced constant mode first
5050 if self .tracker ._conf .get ("force_mode_constant" , False ):
51- logger .info ("Force constant mode requested - bypassing psutil and using constant CPU power" )
51+ logger .info (
52+ "Force constant mode requested - bypassing psutil and using constant CPU power"
53+ )
5254 model = tdp .model
5355 if max_power is None and self .tracker ._force_cpu_power :
5456 max_power = self .tracker ._force_cpu_power
@@ -63,7 +65,7 @@ def set_CPU_tracking(self):
6365 )
6466 self .tracker ._hardware .append (hardware_cpu )
6567 return
66-
68+
6769 if self .tracker ._conf .get ("force_mode_cpu_load" , False ) and (
6870 tdp .tdp is not None or self .tracker ._force_cpu_power is not None
6971 ):
Original file line number Diff line number Diff line change 1111
1212try :
1313 import psutil
14+
1415 PSUTIL_AVAILABLE = True
1516except ImportError :
1617 PSUTIL_AVAILABLE = False
@@ -129,7 +130,7 @@ def count_cpus() -> int:
129130 # Fallback to using os.cpu_count() or physical CPU count
130131 cpu_count = os .cpu_count ()
131132 return cpu_count if cpu_count is not None else 1
132-
133+
133134 if SLURM_JOB_ID is None :
134135 return psutil .cpu_count ()
135136
You can’t perform that action at this time.
0 commit comments