[slurm-users] About seff command

412 views
Skip to first unread message

xiaoji...@163.com

unread,
Mar 9, 2021, 2:53:38 AM3/9/21
to slurm...@schedmd.com
Hi guys,
I would like to calculate the CPU efficiency and Memory efficiency of slurm jobs. I know that the “seff” command is for this. I’d like to do the same job on my own.
When I was studying the source code of the seff command, I saw the code below:

my $ncpus = 1;
if (exists $job->{'alloc_cpus'}) {
$ncpus = $job->{'alloc_cpus'};
} else {
if (exists $job->{'tres_alloc_str'}) {
$ncpus = Slurmdb::find_tres_count_in_string($job->{'tres_alloc_str'}, TRES_CPU);
}
}

I am wondering under what circumstance would the “alloc_cpus” field for a job to be empty while having corresponding value in AllocCPU field?

Very grateful for any help.
Thank you!

Prentice Bisbal

unread,
Mar 12, 2021, 4:10:49 PM3/12/21
to slurm...@lists.schedmd.com
I think you're misinterpreting the code. I don't see in that code
snippet where it says that the 'alloc_cpus' field is empty but there's a
corresponding value in AllocCPU.

They way I read it, it's saying that if  $job->{'alloc_cpus'} doesn't
exist, than Slurm is configured to count CPUs as a TRES, so look at the
TRES for a job and get the CPU count from there.

I think this behavior depends on the value of the SelectType parameter
in slurm.conf. Read the section of the slurm.conf documentation starting
at "SelectType".

https://slurm.schedmd.com/slurm.conf.html

Prentice
Reply all
Reply to author
Forward
0 new messages