Opened 12 years ago

Closed 8 years ago

#446 closed defect (fixed)

IZ2335: load_avg data missing from "qstat -f -xml"

Reported by: craffi Owned by: Dave Love <d.love@…>
Priority: normal Milestone: 8.0.0d
Component: sge Version: 6.1u3
Severity: minor Keywords: qmaster patch
Cc:

Description

[Imported from gridengine issuezilla http://gridengine.sunsource.net/issues/show_bug.cgi?id=2335]

        Issue #:      2335             Platform:     All      Reporter: craffi (craffi)
       Component:     gridengine          OS:        All
     Subcomponent:    qmaster          Version:      6.1u3       CC:    None defined
        Status:       NEW              Priority:     P3
      Resolution:                     Issue type:    DEFECT
                                   Target milestone: ---
      Assigned to:    rayson (rayson)
      QA Contact:     ernst
          URL:
       * Summary:     load_avg data missing from "qstat -f -xml"
   Status whiteboard:
      Attachments:

     Issue 2335 blocks:
   Votes for issue 2335:  13


   Opened: Tue Jul 24 07:19:00 -0700 2007 
------------------------


Summary: qstat should produce the same output regardless of output format type.
The XML output option ("-xml") currently does not show load_avg data.


Easy to reproduce:

chrisdag-aliased:~ dag$ qstat -f
queuename                      qtype used/tot. load_avg arch          states
----------------------------------------------------------------------------
all.q@chrisdag-aliased         BIP   0/1       0.26     darwin-x86



chrisdag-aliased:~ dag$ qstat -f -xml
<?xml version='1.0'?>
<job_info  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <queue_info>
    <Queue-List>
      <name>all.q@chrisdag-aliased</name>
      <qtype>BIP</qtype>
      <slots_used>0</slots_used>
      <slots_total>1</slots_total>
      <arch>darwin-x86</arch>
    </Queue-List>
  </queue_info>
  <job_info>
  </job_info>
</job_info>

   ------- Additional comments from craffi Mon Mar 17 10:48:32 -0700 2008 -------
Is it possible to get a status update or target milestone added to this issue? I
may be biased (!!) but getting qstat output consistent is pretty important.

   ------- Additional comments from rayson Tue Feb 2 20:13:44 -0700 2010 -------
The difference comes from the code:

Normal qstat
============
- clients/qstat/qstat.c

   /* load avg */
   if (!summary->has_load_value) {
      if (summary->has_load_value_from_object) {
         sprintf(to_print, "%2.2f ", summary->load_avg);
      } else {
         sprintf(to_print, "---  ");
      }
   } else {
      sprintf(to_print, "-NA- ");
   }

qstat XML
=========
- clients/qstat/qstat_xml.c

   /* load avg */
   if (summary->has_load_value && summary->has_load_value_from_object) {
      xml_append_Attr_D(attribute_list, "load_avg", summary->load_avg);
   }


For normal qstat output, load_avg is displayed when summary->has_load_value is FALSE and summary->has_load_value_from_object is TRUE .

For qstat XML output, load_avg is displayed when summary->has_load_value is TRUE and summary->has_load_value_from_object is TRUE .

This explains the difference in behavior, and I will read the code and see if the logic for qstat XML makes sense.



   ------- Additional comments from rayson Fri Feb 12 18:58:29 -0700 2010 -------
A simple fix:

Index: clients/qstat/qstat_xml.c
===================================================================
RCS file: /cvs/gridengine/source/clients/qstat/qstat_xml.c,v
retrieving revision 1.43
diff -C 4 -r1.43 qstat_xml.c
*** clients/qstat/qstat_xml.c   4 Sep 2009 11:30:14 -0000       1.43
--- clients/qstat/qstat_xml.c   13 Feb 2010 01:55:51 -0000
***************
*** 1014,1022 ****
     xml_append_Attr_I(attribute_list, "slots_resv", summary->resv_slots);
     xml_append_Attr_I(attribute_list, "slots_total", summary->total_slots);

     /* load avg */
!    if (summary->has_load_value && summary->has_load_value_from_object) {
        xml_append_Attr_D(attribute_list, "load_avg", summary->load_avg);
     }

     /* arch */
--- 1014,1022 ----
     xml_append_Attr_I(attribute_list, "slots_resv", summary->resv_slots);
     xml_append_Attr_I(attribute_list, "slots_total", summary->total_slots);

     /* load avg */
!    if (!summary->has_load_value && summary->has_load_value_from_object) {
        xml_append_Attr_D(attribute_list, "load_avg", summary->load_avg);
     }

     /* arch */

Now qstat -f XML displays the load information:

hccgalaxy:~> /tmp/s/source/LINUXAMD64_26/qstat -f -xml
<?xml version='1.0'?>
<job_info  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <queue_info>
    <Queue-List>
      <name>all.q@hccgalaxy</name>
      <qtype>BIP</qtype>
      <slots_used>0</slots_used>
      <slots_resv>0</slots_resv>
      <slots_total>4</slots_total>
      <load_avg>1.03000</load_avg>
      <arch>lx26-amd64</arch>
    </Queue-List>
  </queue_info>
  <job_info>
  </job_info>
</job_info>

While standard qstat misses it:

hccgalaxy:~> qstat -f -xml
<?xml version='1.0'?>
<job_info  xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <queue_info>
    <Queue-List>
      <name>all.q@hccgalaxy</name>
      <qtype>BIP</qtype>
      <slots_used>0</slots_used>
      <slots_resv>0</slots_resv>
      <slots_total>4</slots_total>
      <arch>lx26-amd64</arch>
    </Queue-List>
  </queue_info>
  <job_info>
  </job_info>
</job_info>

Change History (2)

comment:1 Changed 8 years ago by dlove

  • Keywords patch added; removed
  • Milestone set to 8.0.0d
  • Severity set to minor

comment:2 Changed 8 years ago by Dave Love <d.love@…>

  • Owner set to Dave Love <d.love@…>
  • Resolution set to fixed
  • Status changed from new to closed

In [4074/sge]:

(The changeset message doesn't reference this ticket)

Note: See TracTickets for help on using tickets.