Ticket 1603 - "sreport cluster AccountUtilizationByUser" gives negative Energy values
Summary: "sreport cluster AccountUtilizationByUser" gives negative Energy values
Status: RESOLVED FIXED
Alias: None
Product: Slurm
Classification: Unclassified
Component: Accounting (show other tickets)
Version: 14.11.5
Hardware: Linux Linux
: 4 - Minor Issue
Assignee: Danny Auble
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2015-04-16 10:03 MDT by Kilian Cavalotti
Modified: 2015-04-16 10:42 MDT (History)
2 users (show)

See Also:
Site: Stanford
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed: 14.11.6 15.08.0-0pre4
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments

Note You need to log in before you can comment on or make changes to this ticket.
Description Kilian Cavalotti 2015-04-16 10:03:41 MDT
Hi,

I just noticed that sreport gives negative Energy values. It looks like an int overflow (because I'm a big user :)

# sreport cluster AccountUtilizationByUser Users=kilian start=2015-03-01 end=2015-03-31
--------------------------------------------------------------------------------
Cluster/Account/User Utilization 2015-03-01T00:00:00 - 2015-03-30T23:59:59 (2588400 secs)
Time reported in CPU Minutes
--------------------------------------------------------------------------------
  Cluster         Account     Login     Proper Name       Used     Energy
--------- --------------- --------- --------------- ---------- ----------
 sherlock           ruthm    kilian Kilian Cavalot+      18115 -295873185


Thanks!
Kilian
Comment 1 Danny Auble 2015-04-16 10:16:54 MDT
Killian, could you try this patch real quick and see if it fixes your issue?

diff --git a/src/sreport/cluster_reports.c b/src/sreport/cluster_reports.c
index 9b7f2bc..8c89f67 100644
--- a/src/sreport/cluster_reports.c
+++ b/src/sreport/cluster_reports.c
@@ -512,7 +512,7 @@ static int _setup_print_fields_list(List format_list)
                        field->type = PRINT_CLUSTER_ENERGY;
                        field->name = xstrdup("Energy");
                        field->len = 10;
-                       field->print_routine = print_fields_int;
+                       field->print_routine = print_fields_uint64;
                } else {
                        exit_code=1;
                        fprintf(stderr, " Unknown field '%s'\n", object);
Comment 2 Kilian Cavalotti 2015-04-16 10:24:31 MDT
(In reply to Danny Auble from comment #1)
> Killian, could you try this patch real quick and see if it fixes your issue?

Yup, that's it:

# ./src/sreport/sreport cluster AccountUtilizationByUser Users=kilian start=2015-03-01 end=2015-03-31
--------------------------------------------------------------------------------
Cluster/Account/User Utilization 2015-03-01T00:00:00 - 2015-03-30T23:59:59 (2588400 secs)
Time reported in CPU Minutes
--------------------------------------------------------------------------------
  Cluster         Account     Login     Proper Name       Used     Energy
--------- --------------- --------- --------------- ---------- ----------
 sherlock           ruthm    kilian Kilian Cavalot+      18115 3999094111



Thanks!
Comment 3 Danny Auble 2015-04-16 10:40:22 MDT
A more robust fix is in commit 1f2ada02bb6437.  Thanks for testing so fast for me ;).
Comment 4 Kilian Cavalotti 2015-04-16 10:42:16 MDT
(In reply to Danny Auble from comment #3)
> A more robust fix is in commit 1f2ada02bb6437.  Thanks for testing so fast
> for me ;).

Thanks for fixing it so fast too! :)