Job CPU Frequency

How can I get the information about the frequency of the CPU which my job is running on?

I have tried the below command. However, there is no frequency information.

sstat 525499
JobID MaxVMSize MaxVMSizeNode MaxVMSizeTask AveVMSize MaxRSS MaxRSSNode MaxRSSTask AveRSS MaxPages MaxPagesNode MaxPagesTask AvePages MinCPU MinCPUNode MinCPUTask AveCPU NTasks AveCPUFreq ReqCPUFreqMin ReqCPUFreqMax ReqCPUFreqGov ConsumedEnergy MaxDiskRead MaxDiskReadNode MaxDiskReadTask AveDiskRead MaxDiskWrite MaxDiskWriteNode MaxDiskWriteTask AveDiskWrite TRESUsageInAve TRESUsageInMax TRESUsageInMaxNode TRESUsageInMaxTask TRESUsageInMin TRESUsageInMinNode TRESUsageInMinTask TRESUsageInTot TRESUsageOutAve TRESUsageOutMax TRESUsageOutMaxNode TRESUsageOutMaxTask TRESUsageOutMin TRESUsageOutMinNode TRESUsageOutMinTask TRESUsageOutTot

525499.batch 4114716K d13-02 0 4114716K 601776K d13-02 0 601776K 189 d13-02 0 189 01:06:44 d13-02 0 01:06:44 1 848K 0 0 0 0 78610526 d13-02 0 78610526 2609436 d13-02 0 2609436 cpu=01:06:44,+ cpu=01:06:44,+ cpu=d13-02,energy+ cpu=00:00:00,fs/d+ cpu=01:06:44,+ cpu=d13-02,energy+ cpu=00:00:00,fs/d+ cpu=01:06:44,+ energy=0,fs/di+ energy=0,fs/di+ energy=d13-02,fs/d+ fs/disk=0 energy=0,fs/di+ energy=d13-02,fs/d+ fs/disk=0 energy=0,fs/di+

What is the right command to obtain the frequncy?

Thank you.

Hi Hassan,

You can use the command lscpu to print information about the compute node/CPUs being used, like the CPU frequency. You could include this command in your job script, for example. Alternatively, you can use the command scontrol show node <node_name> to find the node model, and then search for that model’s specs.

For what your job actually uses, the sstat or sacct commands have an AveCPUFreq field (average weighted CPU frequency of all tasks in job). That’s the only relevant one available. You can use the --format option to specify which fields you want to print. For example:

user@discovery1:~$ sacct --job=525499 --format="JobID,CPUTime,AveCPUFreq,Nodelist"
       JobID    CPUTime AveCPUFreq        NodeList
------------ ---------- ---------- ---------------
525499         10:00:08                     d13-02
525499.batch   10:00:10        14K          d13-02
525499.exte+   10:00:09      1.00G          d13-02

And the commands sacct -e or sstat -e list the available fields.

1 Like

Hi Derek,

I have used the below command, still I am not getting the frequency of the CPU:

[afzaliku@discovery2 vp]$ sacct --job=553518 --format=“JobID,CPUTime,AveCPUFreq,Nodelist”
JobID CPUTime AveCPUFreq NodeList

553518 00:35:48 d18-18
553518.batch 00:35:48 0 d18-18
553518.exte+ 00:35:48 0 d18-18
[afzaliku@discovery2 vp]$ sacct --job=544460 --format=“JobID,CPUTime,AveCPUFreq,Nodelist”
JobID CPUTime AveCPUFreq NodeList

544460 07:25:59 d18-13
544460.batch 07:25:59 0 d18-13
544460.exte+ 07:25:59 0 d18-13

What should I do to fix this?

Thank you.

For AveCPUFreq, It looks like sacct only works for completed jobs. Try sstat instead for running jobs. Something like:

sstat --job=544460 --format="JobID,AveCPUFreq,Nodelist"
1 Like

Hi Derek,

Thank you. When I run the command it is giving me the below frequency:

[afzaliku@discovery2 vp]$ sstat --job=570973 --format=“JobID,AveCPUFreq,Nodelist”
JobID AveCPUFreq Nodelist

570973.batch 2.39M e21-03
Why the frequency is so low?

Thank you.

Could you share your job script?

1 Like

Hi Derek,

Sorry for my late reply.

Below is my script:

#SBATCH -J re_mu12
#SBATCH --partition=main
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --cpu-freq=3500000
#SBATCH --time=12:00:00
#SBATCH --mem-per-cpu=10GB
#SBATCH --account=pedram_570
#SBATCH --output=log_res50_app_mul_12.txt
#SBATCH --error=error_res50_app_mul_12.txt
cd …/…/…
expect /scratch/afzaliku/NVDLA/vp_test/vp/myscripts/res50/app_mul/exec_12.exp > /scratch/afzaliku/NVDLA/vp_test/vp/myscripts/res50/app_mul/log_12.txt &
exit 0

Please let me know if you need anything else.

Best Regards

Everything looks fine there. The --cpu-freq option actually only applies to srun commands, which is not needed in this case.

I think ultimately it is determined by what happens in the expect script. The AveCPUFreq is an average, so it’s potentially a misleading number. I’m not familiar with expect, but perhaps the CPU is idling a lot because it’s waiting for input/output tasks, which could result in a low AveCPUFreq. You would need to do some formal debugging to uncover more details about that.