Ticket 358

Summary: sacct fields are truncated one character before that is necessary
Product: Slurm Reporter: Puenlap Lee <puen-lap.lee>
Component: AccountingAssignee: Danny Auble <da>
Status: RESOLVED FIXED QA Contact:
Severity: 3 - Medium Impact    
Priority: ---    
Version: 2.6.x   
Hardware: Linux   
OS: Linux   
Site: Atos/Eviden Sites Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Puenlap Lee 2013-07-02 10:03:01 MDT
sudo sacct -o JobID%12,JobName%10,user%6,account%10,partition%10,qos%6
       JobID    JobName   User    Account  Partition    QOS
------------ ---------- ------ ---------- ---------- ------
           0 allocatio+  thipa validatio+            Unkno+
       55143     temoin jouvi+ validatio+        mpi norma+
       55146     temoin jouvi+ validatio+  TestSlurm norma+
       55147    stgj012 jouvi+ validatio+        mpi norma+

JobName : allocation 10 char
User : jouvin 6 char
Account : validation 10 char
Qos : normal 6 char


sudo sacct -o JobID%12,JobName%11,user%7,account%11,partition%10,qos%7
       JobID     JobName    User     Account  Partition     QOS
------------ ----------- ------- ----------- ---------- -------
           0  allocation   thipa  validation            Unknow+
       55143      temoin  jouvin  validation        mpi  normal
       55146      temoin  jouvin  validation  TestSlurm  normal
       55147     stgj012  jouvin  validation        mpi  normal
Comment 1 Puenlap Lee 2013-07-02 10:08:44 MDT
The 2.5.1 and older version of 2.6 are working fine. I think the problem is in the "extern void print_fields_str "routine in /src/common/print_fields.c file.

The old code was:

			if(strlen(value) > abs_len)
				temp_char[abs_len-1] = '+';
			print_this = temp_char;

and the new code is:
			if (abs_len && (len >= abs_len))
				temp_char[abs_len-1] = '+';
			else if ((abs_len == 0) && (len >= sizeof(temp_char)))
				temp_char[sizeof(temp_char)-1] = '+';
			print_this = temp_char;


I believe that the two ">=" should be just ">".
Comment 2 Danny Auble 2013-07-02 10:09:24 MDT
I agree.  I am looking at it now.  I'll see why it was changed.
Comment 3 Danny Auble 2013-07-02 10:46:29 MDT
It appears this is a side effect of commit 0ce7c9aaaf844bbed1e815162103d0a8a24e2c01 dealing with a %0 option in the format string.  I removed the relevant code since it appeared %0 would mess up the formatting of multiple jobs.

Things should be back to normal now after 914992591b28afed573510f5f25e769d1d512e14.

Let me know if you things don't work as you would expect.  Thanks for finding this.