Ticket #1550: 0001-sge_sort_pending_job_nodes-updated-comments-and-whit.patch

File 0001-sge_sort_pending_job_nodes-updated-comments-and-whit.patch, 2.9 KB (added by markdixon, 4 years ago)

1/6

  • source/libs/sched/sgeee.c

    From f330953eb78fe6b6f269c184128654424ab811f8 Mon Sep 17 00:00:00 2001
    From: Mark Dixon <m.c.dixon@leeds.ac.uk>
    Date: Thu, 13 Aug 2015 09:21:22 +0100
    Subject: [PATCH 1/6] sge_sort_pending_job_nodes - updated comments and whitespace
    
    ---
     source/libs/sched/sgeee.c |   23 ++++++++++++++++++-----
     1 files changed, 18 insertions(+), 5 deletions(-)
    
    diff --git a/source/libs/sched/sgeee.c b/source/libs/sched/sgeee.c
    index 1182640..f8a69a2 100644
    a b sge_sort_pending_job_nodes(lListElem *root, 
    34083408   double node_stt;
    34093409   double job_count=0;
    34103410   int job_nodes = 0;
    3411    
     3411
     3412   /* Prune sparsely populated sharetree */
     3413   /* Dispose of uppermost levels without pending jobs */
    34123414   if(root == node){
    34133415      int active_nodes = 0;
    34143416      lListElem *temp_root = NULL;
    sge_sort_pending_job_nodes(lListElem *root, 
    34193421            break;
    34203422         } else if ((lGetUlong(child, STN_job_ref_count)-lGetUlong(child, STN_active_job_ref_count))>0) {
    34213423            temp_root = child;
    3422             active_nodes ++;
     3424            active_nodes++;
    34233425         }
    34243426         if (active_nodes >1)
    34253427               break;
    34263428      }
     3429
     3430      /*
     3431       * Prune this node if:-
     3432       * - There are no pending jobs at higher levels, or in sibling nodes
     3433       * - It has no pending jobs
     3434       * - It has only one child object that contains pending jobs
     3435       */
    34273436      if (active_nodes == 1 && temp_root)
    34283437         return sge_sort_pending_job_nodes(temp_root, temp_root, total_share_tree_tickets);
    34293438   }
    3430    /* get the child job nodes in a single list */
    34313439
     3440   /* get the child job nodes in a single list */
    34323441   for_each(child, lGetList(node, STN_children)) {
    34333442      if (lGetUlong(child, STN_ref)) {
    34343443         /* this is a job node, chain it onto our list */
    sge_sort_pending_job_nodes(lListElem *root, 
    34473456         }
    34483457      }
    34493458   }
     3459
    34503460   /* free the temporary job nodes */
    34513461   if (job_nodes)
    34523462      lSetList(node, STN_children, NULL);
    sge_sort_pending_job_nodes(lListElem *root, 
    34653475         tickets. If we are dependent on another higher-level policy, we also add
    34663476         the tickets from those policies. */
    34673477
     3478      /* - get running job count */
    34683479      job_count = lGetUlong(node, STN_active_job_ref_count);
    34693480      if ((u=lGetElemStr(lGetList(node, STN_usage_list), UA_name,
    34703481                         "finished_jobs")))
    34713482         job_count += lGetDouble(u, UA_value);
     3483
     3484      /* - get entitlement */
    34723485      node_stt = lGetDouble(node, STN_stt);
     3486
     3487      /* - increment job count and dilute entitlement */
    34733488      for_each(job_node, job_node_list) {
    34743489         job_count++;
    34753490         lSetDouble(job_node, STN_shr, node_stt / job_count);
    34763491         lSetDouble(job_node, STN_sort, lGetDouble(job_node, STN_tickets) +
    34773492                    ((node_stt / job_count) * total_share_tree_tickets));
    34783493      }
    3479 
    34803494   }
    34813495
    34823496   /* return the new list */
    3483 
    34843497   return job_node_list;
    34853498}
    34863499