Author: burn
Date: Wed Oct 12 20:19:01 2016
New Revision: 1764538

URL: http://svn.apache.org/viewvc?rev=1764538&view=rev
Log:
UIMA-5086 After rounding up the request search machines up to reserve-overage 
GB larger

Modified:
    uima/uima-ducc/trunk/src/main/resources/default.ducc.properties
    
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part2/cli/ducc-reserve.tex
    uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/rm.tex
    
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/system-logs.tex
    
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java
    
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/Scheduler.java

Modified: uima/uima-ducc/trunk/src/main/resources/default.ducc.properties
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/resources/default.ducc.properties?rev=1764538&r1=1764537&r2=1764538&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/resources/default.ducc.properties (original)
+++ uima/uima-ducc/trunk/src/main/resources/default.ducc.properties Wed Oct 12 
20:19:01 2016
@@ -709,6 +709,12 @@ ducc.rm.admin.endpoint = ducc.rm.admin.c
 # This is the JMS endpoint type used for RM administrative requests.
 ducc.rm.admin.endpoint.type = queue
 
+# Unmanaged Reservations are usually assigned to machines whose size exactly 
matches the 
+# requested size, after rounding up to a multiple of the node pool's quantum.
+# When this property is positive, machines up to this many GB larger than the 
rounded up
+# size will be considered.
+ducc.rm.reserve_overage = 0
+
 # 
+==================================================================================================+
 # | Agents                                                                     
                      |
 # 
+==================================================================================================+

Modified: 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part2/cli/ducc-reserve.tex
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part2/cli/ducc-reserve.tex?rev=1764538&r1=1764537&r2=1764538&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part2/cli/ducc-reserve.tex
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part2/cli/ducc-reserve.tex
 Wed Oct 12 20:19:01 2016
@@ -92,6 +92,7 @@
     \paragraph{Notes:}
     Reservations must be for entire machines, in a job class implementing the 
RESERVE scheduling
     policy. The default DUCC distribution configures class {\em reserve} for 
entire machine
-    reservations.  If there is no available machine in that class matching the 
requested size (after
-    rounding up) the request is queued.  The user may cancel the request with 
{\em ducc\_unreserve}
+    reservations.  A reservation request will be queued if there is no 
available machine in that
+    class matching the requested size (after rounding up), or up to {\em 
ducc.rm.reserve\_overage} larger.
+    The user may cancel the request with {\em ducc\_unreserve} 
     or with CTRL-C if $--$cancel\_on\_interrupt was specified.

Modified: 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/rm.tex
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/rm.tex?rev=1764538&r1=1764537&r2=1764538&view=diff
==============================================================================
--- uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/rm.tex 
(original)
+++ uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/rm.tex 
Wed Oct 12 20:19:01 2016
@@ -184,9 +184,9 @@
 
           FIXED\_SHARE allocations have several uses:
           \begin{itemize}
-            \item Unmanaged reservations.  In this case DUCC starts no work in 
the share(s); the user must
-              log in (or run something via ssh), and then manually release the 
reservation to free
-              the resources.  This is often used for testing and debugging.
+%            \item Unmanaged reservations.  In this case DUCC starts no work 
in the share(s); the user must
+%              log in (or run something via ssh), and then manually release 
the reservation to free
+%              the resources.  This is often used for testing and debugging.
             \item Services.  If a service is registered to run in a 
FIXED\_SHARE allocation,
               DUCC allocates the resources, starts and manages the service, 
and releases the
               resource if the service is stopped or unregistered.
@@ -200,14 +200,16 @@
           
         \item[RESERVE] The RESERVE policy is used to allocate a dedicated 
machine.
           The allocation may be {\em evicted} but it is never {\em preempted}. 
It is
-          restricted to a single machine per request.  The memory size
-          specified in the reservation must match machine size
-          exactly, within the limits of rounding to the next highest multiple 
of the
-          quantum.  DUCC will not ``promote'' a reservation request to a 
larger machine
-          than is asked for.  A reservation that does not adequately match any
+          restricted to a single machine per request.  Usually the memory size
+          of the machine must match the size specified in the reservation 
+          exactly, after rounding up to the next highest multiple of the 
quantum.
+          But if {\em ducc.rm.reserve\_overage} is positive, DUCC can assign a
+          machine up to this many GB larger.
+          A reservation that does not adequately match any
           machine remains pending until resources are made available or it is 
           canceled by the user or an administrator. Reservations may be
           subject to \hyperref[sec:rm.allotment]{allotment caps}.
+          A class that implements the RESERVE policy is required for unmanaged 
reservations.
 
     \end{description}
     

Modified: 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/system-logs.tex
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/system-logs.tex?rev=1764538&r1=1764537&r2=1764538&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/system-logs.tex
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-duccdocs/src/site/tex/duccbook/part4/system-logs.tex
 Wed Oct 12 20:19:01 2016
@@ -986,7 +986,7 @@ Job 251214 Service state Waiting \
 \end{verbatim}
 
 
-\section{ (Orchestrator Log or.log)}
+\section{Orchestrator Log (or.log)}
     To be filled in.
 
 \section{Process Manager Log (pm.log)}

Modified: 
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java?rev=1764538&r1=1764537&r2=1764538&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodePool.java
 Wed Oct 12 20:19:01 2016
@@ -104,16 +104,8 @@ class NodePool
     IRmPersistence persistence = null;
     boolean canReserve = false;       // if we contain a class with policy 
Reserve, then stuff in this pool is reservable
 
-    static int reserve_overage = 
SystemPropertyResolver.getIntProperty("ducc.rm.reserve_overage", 0);
-
-//     NodePool(NodePool parent, String id, EvictionPolicy ep, int order)
-//     {
-//         this.parent = parent;
-//         this.id = id;
-//         this.evictionPolicy = ep;
-//         this.depth = 0;
-//         this.order = order;
-//     }
+    // Allowable excess size in GB for unmanaged reservations (ignore negative 
values)
+    static int reserve_overage = Math.max(0, 
SystemPropertyResolver.getIntProperty("ducc.rm.reserve_overage", 0));
 
     NodePool(NodePool parent, String id, Map<String, String> nodes, 
EvictionPolicy ep, int depth, int search_order, int share_quantum)
     {
@@ -1333,7 +1325,7 @@ class NodePool
     int countReservables(IRmJob j)
     {
         int order = j.getShareOrder();
-        int max_order = getMaxShareOrder(j);
+        int max_order = order + getReserveOverage(j);
         do {
             if (machinesByOrder.containsKey(order) && 
machinesByOrder.get(order).size() > 0) {
                 return machinesByOrder.get(order).size();
@@ -1359,17 +1351,16 @@ class NodePool
     }
 
     /*
-     * Add the allowable overage to the request and convert to shares
+     * Convert the GB overage to shares (rounding down) 
      * But only for unmanaged reservations
+     * UIMA-5086
      */
-    private int getMaxShareOrder(IRmJob j) {
-        if (j.getDuccType() != DuccType.Reservation) {
-            return j.getShareOrder();
-        }
-        long mem = (j.getMemory() + reserve_overage) << 20;              // GB 
-> KB
-        int share_quantum = j.getShareQuantum();   // share quantum is in KB! 
-        int mso = (int) ((mem + share_quantum - 1) / share_quantum);         
// round UP
-        return mso;
+    private int getReserveOverage(IRmJob j) {
+        if (j.getDuccType() != DuccType.Reservation || reserve_overage <= 0) {
+            return 0;
+        }
+        int share_quantum = j.getShareQuantum() >> 20;   // why is share 
quantum in KB?
+        return reserve_overage / share_quantum; 
     }
     
     /**
@@ -1403,7 +1394,7 @@ class NodePool
         // as it then might find a free machine more than reserve-overage 
above the original request.
         if (! j.shareOrderUpgraded() ) {
             actual_order = 0;   // Not yet known
-            max_share_order = getMaxShareOrder(j);
+            max_share_order = share_order + getReserveOverage(j);
         } else {
             actual_order = share_order;      // Additional machines must match 
this
             max_share_order = share_order;   // Restrict search to just the 
(possibly adjusted) actual order.

Modified: 
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/Scheduler.java
URL: 
http://svn.apache.org/viewvc/uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/Scheduler.java?rev=1764538&r1=1764537&r2=1764538&view=diff
==============================================================================
--- 
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/Scheduler.java
 (original)
+++ 
uima/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/Scheduler.java
 Wed Oct 12 20:19:01 2016
@@ -234,6 +234,7 @@ public class Scheduler
         logger.info(methodName, null, "                       default memory   
       : ", defaultMemory);
         logger.info(methodName, null, "                       default 
fairshare class : ", defaultFairShareName);
         logger.info(methodName, null, "                       default reserve  
       : ", defaultReserveName);
+        logger.info(methodName, null, "                       reserve overage  
       : ", SystemPropertyResolver.getIntProperty("ducc.rm.reserve_overage", 
0), " GB");
         logger.info(methodName, null, "                       class definition 
file   : ", class_definitions);
         logger.info(methodName, null, "                       default domain   
       : ", defaultDomain);      // UIMA-4142
         logger.info(methodName, null, "                       eviction policy  
       : ", evictionPolicy);


Reply via email to