Ticket #1550: 0002-sge_sort_pending_job_nodes-var-declarations-closer-t.patch

File 0002-sge_sort_pending_job_nodes-var-declarations-closer-t.patch, 1.9 KB (added by markdixon, 4 years ago)

2/6

  • source/libs/sched/sgeee.c

    From a84ba36ec4e78cf11ed5585e31b6e655b5dc0230 Mon Sep 17 00:00:00 2001
    From: Mark Dixon <m.c.dixon@leeds.ac.uk>
    Date: Thu, 13 Aug 2015 10:47:33 +0100
    Subject: [PATCH 2/6] sge_sort_pending_job_nodes - var declarations closer to execution
    
    ---
     source/libs/sched/sgeee.c |   16 +++++++++-------
     1 files changed, 9 insertions(+), 7 deletions(-)
    
    diff --git a/source/libs/sched/sgeee.c b/source/libs/sched/sgeee.c
    index f8a69a2..cb290e7 100644
    a b sge_sort_pending_job_nodes(lListElem *root, 
    34033403                           lListElem *node,
    34043404                           double total_share_tree_tickets)
    34053405{
    3406    lList *job_node_list = NULL;
    3407    lListElem *child, *job_node;
    3408    double node_stt;
    3409    double job_count=0;
    3410    int job_nodes = 0;
    3411 
    34123406   /* Prune sparsely populated sharetree */
    34133407   /* Dispose of uppermost levels without pending jobs */
    34143408   if(root == node){
    34153409      int active_nodes = 0;
     3410      lListElem *child;
    34163411      lListElem *temp_root = NULL;
    34173412
    34183413      for_each(child, lGetList(node, STN_children)) {
    sge_sort_pending_job_nodes(lListElem *root, 
    34383433   }
    34393434
    34403435   /* get the child job nodes in a single list */
     3436   int job_nodes = 0;
     3437   lList *job_node_list = NULL;
     3438
     3439   lListElem *child;
    34413440   for_each(child, lGetList(node, STN_children)) {
    34423441      if (lGetUlong(child, STN_ref)) {
    34433442         /* this is a job node, chain it onto our list */
    sge_sort_pending_job_nodes(lListElem *root, 
    34823481         job_count += lGetDouble(u, UA_value);
    34833482
    34843483      /* - get entitlement */
    3485       node_stt = lGetDouble(node, STN_stt);
     3484      double node_stt = lGetDouble(node, STN_stt);
    34863485
    34873486      /* - increment job count and dilute entitlement */
     3487      double job_count = 0;
     3488
     3489      lListElem *job_node;
    34883490      for_each(job_node, job_node_list) {
    34893491         job_count++;
    34903492         lSetDouble(job_node, STN_shr, node_stt / job_count);