From 9c0807dabe03e547beb7c3a37ceb9ab4138d8668 Mon Sep 17 00:00:00 2001
From: d74ksy <aidan.chalk@durham.ac.uk>
Date: Fri, 30 Oct 2015 14:57:10 +0000
Subject: [PATCH] Some fixes to the last commit where I hadn't reverted removal
 of the used resources

---
 src/qsched.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/qsched.c b/src/qsched.c
index 4bf2173..40810ca 100644
--- a/src/qsched.c
+++ b/src/qsched.c
@@ -858,10 +858,10 @@ void qsched_partition_compute_costs( struct qsched *s, idx_t *res_costs)
             res_costs[getindex(t->locks[j],s)] += t->cost;
         }
 
-        for(j = 0; j < t->nr_uses; j++)
+        /*for(j = 0; j < t->nr_uses; j++)
         {
-            res_costs[getindex(t->uses[j],s)] += t->cost;
-        }
+            res_costs[getindex(t->uses[j],s)] = t->cost;
+        }*/
     }   
 }
 
@@ -884,14 +884,14 @@ void qsched_partition_build_nodelist(struct qsched *s, idx_t *nodelist, idx_t *n
     for(i = 0; i < s->res_ranks[s->count_ranks]; i++)
     {
         //If the resources is locked (or used).
-        if(s->res[i].num_lockers > 0 || s->res[i].num_users > 0){
+        if(s->res[i].num_lockers > 0 /*|| s->res[i].num_users > 0*/){
             
             r = &s->res[i];
             //If it has a parent.
             if(r->parent != -1)
             {
                 //If the parent is locked then we don't need this.
-                if(s->res[getindex(r->parent,s)].num_lockers > 0 || s->res[getindex(r->parent,s)].num_users > 0)
+                if(s->res[getindex(r->parent,s)].num_lockers > 0 /*|| s->res[getindex(r->parent,s)].num_users > 0*/)
                 {
                     noderef[node_count] = -1;
                     continue;
@@ -901,7 +901,7 @@ void qsched_partition_build_nodelist(struct qsched *s, idx_t *nodelist, idx_t *n
                     while(r->parent != -1)
                     {
                         r = getres(r->parent, s);
-                        if(r->num_lockers > 0 || r->num_users > 0)
+                        if(r->num_lockers > 0 /*|| r->num_users > 0*/)
                         {
                             noderef[node_count] = 0;
                             break;
@@ -1048,7 +1048,7 @@ void qsched_partition_build_edgelist(struct qsched *s, idx_t **edge_vwgts, idx_t
                     }/* If edge doesn't exist. */
                 }
             }/* k */
-//#ifdef NO_COMPILE
+#ifdef NO_COMPILE
             for(k = 0; k < t->nr_uses; k++)
             {
                 struct res *r4 = &s->res[getindex(t->uses[k], s)];
@@ -1131,7 +1131,7 @@ void qsched_partition_build_edgelist(struct qsched *s, idx_t **edge_vwgts, idx_t
                     }/* If edge doesn't exist. */
                 }
             }/* k */
-//#endif
+#endif
         }/* j */
     }/* i */
 }
-- 
GitLab