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/02/14 16:07:43 UTC
svn commit: r1659799 -
/uima/sandbox/uima-ducc/trunk/uima-ducc-rm/src/main/java/org/apache/uima/ducc/rm/scheduler/NodepoolScheduler.java
Author: challngr
Date: Sat Feb 14 15:07:42 2015
New Revision: 1659799
URL: http://svn.apache.org/r1659799
Log:
UIMA-4142 Adjust comments to clarify logic.
Modified:
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/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=1659799&r1=1659798&r2=1659799&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 Sat Feb 14 15:07:42 2015
@@ -1624,15 +1624,15 @@ public class NodepoolScheduler
int current = j.countNShares(); // currently allocated, plus pending, less those removed by earlier preemption
int needed = (counted - current);
int order = j.getShareOrder();
-
- // if ( needed < 0 ) {
- // int stophere = 1;
- // stophere++;
- // }
+ // Why abs and not max? Because if needed > 0, that's shares we need to make space for.
+ // if needed < 0, that's shares we need to dump because the
+ // counts say so.
+ // if needed == 0 then clearly nothing
+ needed = Math.abs(needed);
+ // needed = Math.max(0, needed);
+
logger.info(methodName, j.getId(), String.format("%12s %7d %7d %6d %5d", npn, counted, current, needed, order));
- needed = Math.abs(needed);
- //needed = Math.max(0, needed);
neededByOrder[order] += needed;
total_needed += needed;
}