Skip to content

Commit 9e87bcd

Browse files
saboritoscarasanchez1987
authored andcommitted
Improve memory efficiency computing in seff
Use memory value from AllocTRES instead of ReqTRES to compute memory efficiency. Bug 15569
1 parent 7d2c32e commit 9e87bcd

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

contribs/seff/seff

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,18 +178,20 @@ if ($state ne "PENDING") {
178178
printf("Memory Utilized: %s (estimated maximum)\n", kbytes2str($mem));
179179
}
180180
my $mem_eff;
181-
if ($reqmem != 0) {
182-
$mem_eff = $mem / $reqmem * 100;
181+
my $allocmem = Slurmdb::find_tres_count_in_string($job->{'tres_alloc_str'}, TRES_MEM);
182+
$allocmem = $allocmem * 1024;
183+
if ($allocmem != 0) {
184+
$mem_eff = $mem / $allocmem * 100;
183185
} else {
184186
$mem_eff = 0.0;
185187
}
186188
if ($ntasks == 1) {
187-
printf("Memory Efficiency: %.2f%% of %s\n", $mem_eff, kbytes2str($reqmem));
189+
printf("Memory Efficiency: %.2f%% of %s\n", $mem_eff, kbytes2str($allocmem));
188190
} else {
189191
if ($pernode) {
190-
printf("Memory Efficiency: %.2f%% of %s (%s\/node)\n", $mem_eff, kbytes2str($reqmem), kbytes2str($reqmem / $nnodes));
192+
printf("Memory Efficiency: %.2f%% of %s (%s\/node)\n", $mem_eff, kbytes2str($allocmem), kbytes2str($allocmem / $nnodes));
191193
} else {
192-
printf("Memory Efficiency: %.2f%% of %s (%s\/core)\n", $mem_eff, kbytes2str($reqmem), kbytes2str($reqmem / $ncpus));
194+
printf("Memory Efficiency: %.2f%% of %s (%s\/core)\n", $mem_eff, kbytes2str($allocmem), kbytes2str($allocmem / $ncpus));
193195
}
194196
}
195197
if ($state eq "RUNNING") {

0 commit comments

Comments
 (0)