You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ch...@apache.org on 2015/05/14 19:24:27 UTC

svn commit: r1679411 - in /uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler: NodePool.java NodepoolScheduler.java

Author: challngr
Date: Thu May 14 17:24:27 2015
New Revision: 1679411

URL: http://svn.apache.org/r1679411
Log:
UIMA-4358 Clarify message for deferred FIXED_SHARE requests if there are no physical resources it can succeed on.

Modified:
    uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java
    uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodepoolScheduler.java

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java?rev=1679411&r1=1679410&r2=1679411&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java Thu May 14 17:24:27 2015
@@ -1205,6 +1205,23 @@ class NodePool
     }
 
     /**
+     * Count total physical machines that could accomodate a 'fixed' request that the job
+     * will fit in.
+     */
+    int countFixable(IRmJob j)
+    {
+        int order = j.getShareOrder();
+        int ret = 0;
+        for ( int i = order; i < maxorder; i++ ) {
+            if ( machinesByOrder.containsKey(order) ) {
+                ret += machinesByOrder.get(order).size();
+            }
+        }
+        return ret;
+    }
+
+    
+    /**
      * Adjust counts for something that takes full machines, like a reservation.
      * If "enforce" is set the machine order must match, otherwise we just do best effort to match.
      *

Modified: uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodepoolScheduler.java
URL: http://svn.apache.org/viewvc/uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodepoolScheduler.java?rev=1679411&r1=1679410&r2=1679411&view=diff
==============================================================================
--- uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodepoolScheduler.java (original)
+++ uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodepoolScheduler.java Thu May 14 17:24:27 2015
@@ -1312,9 +1312,15 @@ public class NodepoolScheduler
 
         if ( available == 0 ) {
             if (j.countNShares() == 0)  {
-                schedulingUpdate.defer(j, "Deferred because insufficient resources are availble.");
-                logger.info(methodName, j.getId(), "Deferring, insufficient shares available. NP", np.getId(), 
-                            "available[", np.countNSharesByOrder(order), "]");
+                if ( np.countFixable(j) > 0 ) {
+                    schedulingUpdate.defer(j, "Deferred because insufficient resources are availble.");
+                    logger.info(methodName, j.getId(), "Deferring, insufficient shares available. NP", np.getId(), 
+                                "available[", np.countNSharesByOrder(order), "]");
+                } else {
+                    schedulingUpdate.defer(j, "Deferred because no hosts in class " + rc.getName() + " have sufficient memory to accomodate the request.");
+                    logger.info(methodName, j.getId(), "Deferring, no machines big enough for the request. NP", np.getId(), 
+                                "available[", np.countNSharesByOrder(order), "]");
+                }
             } else {
                 logger.info(methodName, j.getId(), "Nodepool is out of shares: NP", np.getId(), 
                             "available[", np.countNSharesByOrder(order), "]");
@@ -1365,9 +1371,16 @@ public class NodepoolScheduler
         //
         // Now see if we have sufficient shares in the nodepool for this allocation.
         //
-        if ( np.countLocalNSharesByOrder(order) == 0 ) {
-            schedulingUpdate.defer(j, "Deferred  because insufficient resources are availble.");
-            logger.info(methodName, j.getId(), "Deferring, insufficient shares available. NP", np.getId(), "available[", np.countNSharesByOrder(order), "]");
+        if ( np.countLocalNSharesByOrder(order) == 0 ) {            
+            if (np.countFixable(j) > 0 ) {
+                schedulingUpdate.defer(j, "Deferred  because insufficient resources are availble.");
+                logger.info(methodName, j.getId(), "Deferring, insufficient shares available. NP", np.getId(), "available[", np.countNSharesByOrder(order), "]");
+                
+            } else {
+                schedulingUpdate.defer(j, "Deferred because no hosts in class " + rc.getName() + " have sufficient memory to accomodate the request.");
+                logger.info(methodName, j.getId(), "Deferring, no machines big enough for the request. NP", np.getId(), 
+                            "available[", np.countNSharesByOrder(order), "]");
+            }
             return;
         }
         
@@ -1503,7 +1516,7 @@ public class NodepoolScheduler
         int available = np.countReservables(j);
         if ( available == 0 ) {
             if (j.countNShares() == 0)  {
-                schedulingUpdate.defer(j, "Deferred because there are no hosts of the correct size.");
+                schedulingUpdate.defer(j, "Deferred because there are no hosts of the correct size in class " + rc.getName());
                 logger.info(methodName, j.getId(), "Deferred because no hosts of correct size. NP", np.getId());
                            
             } else {
@@ -1560,7 +1573,7 @@ public class NodepoolScheduler
         if ( ! validSingleAllotment(j) ) return;   // defers and logs 
 
         if ( np.countReservables(j) == 0 ) {
-            schedulingUpdate.defer(j, "Deferred because requested memory " + j.getMemory() + " does not match any machine."); 
+            schedulingUpdate.defer(j, "Deferred because there are no hosts of the correct size in class " + rc.getName());
             logger.warn(methodName, j.getId(), "Deferred because requested memory " + j.getMemory() + " does not match any machine.");
             return;
         }