Obnoxious governor powersave

Obnoxious governor powersave

by Leo Egorov -
Number of replies: 6

Dear all, 

I've set up my job.sh like this:

#!/bin/bash -l
#
#SBATCH --nodes=1
#SBATCH --time=00:08:00
#SBATCH --job-name=INTEGRATE
#SBATCH --export=NONE
#SBATCH --constraint=hwperf
#SBATCH --cpu-freq=2400000-2400000:performance

unset SLURM_EXPORT_ENV

module load intel

# Check actual CPU frequency at job runtime
echo "=== CPU FREQ CHECK ==="
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 2>/dev/null || echo "scaling_cur_freq not readable"
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo "scaling_governor not readable"

./pi

Unfortunately, neither --cpu-freq=2400000-2400000:performance nor --constraint=hwperf seem to be capable to set the clock to 2.4GHz as the output of my CPU freq check is confirming:

=== CPU FREQ CHECK ===
857686
powersave

What is the issue here?

EDIT: This is my job output:
 
### Starting TaskPrologue of job 3483927 on f0312 at Mon Apr 27 16:26:41 CEST 2026
#   SLURM_JOB_NODELIST=f0312
#   SLURM_JOB_NUM_NODES=1
#   SLURM_NTASKS=
#   SLURM_NPROCS=
#   SLURM_TASKS_PER_NODE=72
#   SLURM_JOB_CPUS_PER_NODE=72
#   SLURM_EXPORT_ENV=NONE
Running on cores 0-71 with governor powersave
### Finished TaskPrologue
=== CPU FREQ CHECK ===
800749
powersave
pi = 3.1524114333 with N = 10
Time: 0.000000 s
In reply to Leo Egorov

Re: Obnoxious governor powersave

by Georg Hager -

Dear Leo Egorov,

as described in the kick-off tutorial (https://moodle.nhr.fau.de/pluginfile.php/9967/mod_resource/content/1/Ex-kickoff-2026.pdf) on slide 13, you have to use the --cpu-freq option with srun, not with sbatch.

Best

Georg.

In reply to Georg Hager

Re: Obnoxious governor powersave

by Leo Egorov -
Dear Georg Hager,
thank you. I tried calling srun --cpu-freq=2400000-2400000:performance ./pi from within the job.sh batch script with the same symptoms as described above. That is why I still wrote this into this forum (before actually analyzing timestamps). Does that cause pi to be executed in the high-performance context (even though it is mislabeled in the logs)?
In reply to Georg Hager

Re: Obnoxious governor powersave

by Leo Egorov -
Are #SBATCH pragmas compiled or only interpreted?
What happens to #SBATCH statements if they are started with srun command (as opposed to the sbatch command)?
Are there corresponding #SRUN pragmas for srun?
In reply to Georg Hager

Re: Obnoxious governor powersave

by Leo Egorov -
I'm riddled.
As it turns out, when I'm doing manually srun --cpu-freq=2400000-2400000:performance ./pi on the server there are no issues - everything is as it should be with governor performance.
When the exact same line is called by my git CI setup, it somehow downgrades to governor powersave. Why is that?
In reply to Leo Egorov

Re: Obnoxious governor powersave

by Jan Laukemann -
Dear Leo,

unfortunately, I can't reproduce your reported error.
When running your job script, wrapping the commands with srun, I get the expected behavior with the fixed clock frequency specified.

Maybe there is a misunderstanding, you don't need to have an interactive job to use srun, it works just as well in your batch script:
echo "=== CPU FREQ CHECK ==="
srun cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq 2>/dev/null || echo "scaling_cur_freq not readable"
srun cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null || echo "scaling_governor not readable"

srun ./pi

The SBATCH pragmas are used during job allocation/startup by Slurm and are only processed when you submit your job via sbatch.
For an interactive job, you basically replace the pragmas with your parameters after the salloc command.

Best,
Jan
In reply to Jan Laukemann

RESOLVED: Obnoxious governor powersave

by Leo Egorov -

Thank you. 

I removed the intermediate batch script and all #SBATCH pragmas. Now my CI directly calls srun and it works as expected