Opened 14 years ago

Closed 10 years ago

#454 closed defect (fixed)

IZ2362: "qstat -f -xml" returns the sum of used and total slots in slots_total

Reported by: bs Owned by: Dave Love <…>
Priority: normal Milestone:
Component: sge Version: 6.1u2
Severity: Keywords: Macintosh clients


[Imported from gridengine issuezilla]

        Issue #:      2362             Platform:     Macintosh   Reporter: bs (bs)
       Component:     gridengine          OS:        All
     Subcomponent:    clients          Version:      6.1u2          CC:
                                                                           [_] opoplawski
                                                                           [_] Remove selected CCs
        Status:       NEW              Priority:     P3
      Resolution:                     Issue type:    DEFECT
                                   Target milestone: ---
      Assigned to:    roland (roland)
      QA Contact:     roland
       * Summary:     "qstat -f -xml" returns the sum of used and total slots in slots_total
   Status whiteboard:

     Issue 2362 blocks:
   Votes for issue 2362:

   Opened: Sat Sep 15 09:34:00 -0700 2007 

The number of used slots is added to the total number of slots configured for a particular queue
instance in the output of "qstat -f -xml".


"qstat -f" returns

queuename                      qtype used/tot. load_avg arch          states
all.q@powermac12               BIP   2/4       0.00     darwin-ppc
  57184 0.55500  bs           r     09/15/2007 17:27:09     1
  57185 0.55500  bs           r     09/15/2007 17:27:09     1

for a machine configured with four slots (output truncated).

"qstat -f -xml" returns

<?xml version='1.0'?>
<job_info  xmlns:xsd="">
      <job_list state="running">
      <job_list state="running">

for the same configuration (again, output truncated).

Looking at the source code of SGE version 6.1u2, it seems to me that this bug can be fixed with the
following little patch to source/clients/qstat/qstat_xml.c:

--- qstat_xml.c.orig    2007-06-15 10:34:13.000000000 +0200
+++ qstat_xml.c 2007-09-15 11:15:57.000000000 +0200
@@ -1012,10 +1012,10 @@

    /* number of used/free slots */
    xml_append_Attr_I(attribute_list, "slots_used", summary->used_slots);
-   xml_append_Attr_I(attribute_list, "slots_total", summary->used_slots + summary->free_slots);
+   xml_append_Attr_I(attribute_list, "slots_total", summary->free_slots);

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

This also resolves issue 2335 ("qstat -f -xml" not returning load_avg data).

   ------- Additional comments from opoplawski Fri Nov 2 08:45:04 -0700 2007 -------
Perhaps free_slots needs to get renamed to total_slots to avoid confusion?

Changing os to All since this happens on Linux too.

Change History (1)

comment:1 Changed 10 years ago by Dave Love <…>

  • Owner set to Dave 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.