Opened 12 years ago

Closed 8 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 <d.love@…>
Priority: normal Milestone:
Component: sge Version: 6.1u2
Severity: Keywords: Macintosh clients
Cc:

Description

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

        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
          URL:
       * Summary:     "qstat -f -xml" returns the sum of used and total slots in slots_total
   Status whiteboard:
      Attachments:

     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".

Example:

"qstat -f" returns

queuename                      qtype used/tot. load_avg arch          states
----------------------------------------------------------------------------
...
all.q@powermac12               BIP   2/4       0.00     darwin-ppc
  57184 0.55500 codine.sh  bs           r     09/15/2007 17:27:09     1
  57185 0.55500 codine.sh  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="http://www.w3.org/2001/XMLSchema">
  <queue_info>
...
    <Queue-List>
      <name>all.q@powermac12</name>
      <qtype>BIP</qtype>
      <slots_used>2</slots_used>
      <slots_total>6</slots_total>
      <arch>darwin-ppc</arch>
      <job_list state="running">
        <JB_job_number>57184</JB_job_number>
        <JAT_prio>0.55500</JAT_prio>
        <JB_name>codine.sh</JB_name>
        <JB_owner>bs</JB_owner>
        <state>r</state>
        <JAT_start_time>2007-09-15T17:27:09</JAT_start_time>
        <slots>1</slots>
      </job_list>
      <job_list state="running">
        <JB_job_number>57185</JB_job_number>
        <JAT_prio>0.55500</JAT_prio>
        <JB_name>codine.sh</JB_name>
        <JB_owner>bs</JB_owner>
        <state>r</state>
        <JAT_start_time>2007-09-15T17:27:09</JAT_start_time>
        <slots>1</slots>
      </job_list>
    </Queue-List>
...

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 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.