Ticket #1455: sonofgridengine-qstatcqnoslots.diff

File sonofgridengine-qstatcqnoslots.diff, 1.1 KB (added by njoly, 7 years ago)

Fix for load output with 0 slots cluster queue

  • source/clients/common/sge_cqueue_qstat.c

    commit 1888d80c399d367b531006fe9c4bd4987038a32f
    Author: Nicolas Joly <njoly@pasteur.fr>
    Date:   Fri Mar 22 16:32:09 2013 +0100
    
        Fix load computation for 0 slots cluster queue
    
    diff --git a/source/clients/common/sge_cqueue_qstat.c b/source/clients/common/sge_cqueue_qstat.c
    index 84c2e80..0fc15eb 100644
    a b bool cqueue_calculate_summary(const lListElem *cqueue, 
    122122                                   qinstance, exechost_list, centry_list,
    123123                                   &has_value_from_object)) {
    124124            if (has_value_from_object) {
    125                *is_load_available = true;
    126125               load_slots += slots;
    127126               *load += host_load_avg * slots;
    128127            }
    bool cqueue_calculate_summary(const lListElem *cqueue, 
    183182            *error += slots;
    184183         }
    185184      } 
    186       *load /= load_slots;
     185      if (load_slots > 0) {
     186         *is_load_available = true;
     187         *load /= load_slots;
     188      }
    187189      *available -= used_available;
    188190   }
    189191   DEXIT;