[addressing-devel] FuraSrc/Server/Plugins/TaskSubmissionPlugin/plugin/src/com/gridsystems/tasksubmi
Brought to you by:
nodens2k
From: Gridsystems C. <gsc...@us...> - 2008-09-03 21:27:57
|
Update of /cvsroot/fura/FuraSrc/Server/Plugins/TaskSubmissionPlugin/plugin/src/com/gridsystems/tasksubmission/internal In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv8372/FuraSrc/Server/Plugins/TaskSubmissionPlugin/plugin/src/com/gridsystems/tasksubmission/internal Modified Files: AssignmentCancellation.java AssignmentProcessor.java TaskSubmissionConfiguration.java Log Message: cvssync-20080903232636 Index: TaskSubmissionConfiguration.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/TaskSubmissionPlugin/plugin/src/com/gridsystems/tasksubmission/internal/TaskSubmissionConfiguration.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** TaskSubmissionConfiguration.java 22 May 2008 14:55:30 -0000 1.2 --- TaskSubmissionConfiguration.java 3 Sep 2008 21:27:23 -0000 1.3 *************** *** 89,92 **** --- 89,97 ---- /** + * Use log debug when purging tasks. + */ + private static boolean purgingtaskdebug = false; + + /** * Use free CPU percent for autopartition. */ *************** *** 187,190 **** --- 192,205 ---- } try { + String ps = props.getProperty("tasksubmission.purgingtaskdebug"); + if (ps != null) { + purgingtaskdebug = "true".equals(ps.trim()); + } + log.debug("TSProperties: purgingtaskdebug set to " + purgingtaskdebug); + } catch (Exception e) { + log.warn("TSProperties: Could not get purgingtaskdebug from properties; " + + "using default value:" + purgingtaskdebug, e); + } + try { String ps = props.getProperty("tasksubmission.excessmaxpercent"); if (ps != null) { *************** *** 203,207 **** log.debug("TSProperties: deficitMinPercent set to " + deficitMinPercent); } catch (Exception e) { ! log.warn("TSProperties: Could not get useFreeCPUPercent from properties; " + "using default value:" + deficitMinPercent, e); } --- 218,222 ---- log.debug("TSProperties: deficitMinPercent set to " + deficitMinPercent); } catch (Exception e) { ! log.warn("TSProperties: Could not get deficitMinPercent from properties; " + "using default value:" + deficitMinPercent, e); } *************** *** 253,256 **** --- 268,279 ---- /** + * Gets the "purgingtaskdebug" configuration parameter. + * @return the purgingtaskdebug value + */ + public static boolean isPurgingTaskDebug() { + return purgingtaskdebug; + } + + /** * Gets the "deficitMinPercent" configuration parameter. * @return the deficitMinPercent Index: AssignmentProcessor.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/TaskSubmissionPlugin/plugin/src/com/gridsystems/tasksubmission/internal/AssignmentProcessor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AssignmentProcessor.java 16 Jul 2008 06:56:03 -0000 1.4 --- AssignmentProcessor.java 3 Sep 2008 21:27:22 -0000 1.5 *************** *** 215,219 **** AssignmentRequest request, long time) throws KernelException { ! boolean debug = log.isDebugEnabled(); ResourceId resId = resource.getId(); --- 215,221 ---- AssignmentRequest request, long time) throws KernelException { ! boolean debug; ! debug = log.isDebugEnabled() || TaskSubmissionConfiguration.isPurgingTaskDebug(); ! ResourceId resId = resource.getId(); *************** *** 231,235 **** if (taskList.size() == 0) { if (debug) { ! debugStr.append("Empty task list !!!!"); } return; --- 233,237 ---- if (taskList.size() == 0) { if (debug) { ! log.debug(debugStr.append("Empty task list !!!!").toString()); } return; *************** *** 248,252 **** } // 4.- Purge un-selectable tasks ! purgeUnselectableTasks(resource, taskList, request.isIterationInfoRequested()); if (debug) { debugStr.append("Number of tasks after purgeUnselectableTasks: " --- 250,255 ---- } // 4.- Purge un-selectable tasks ! boolean iterInfo = request.isIterationInfoRequested(); ! purgeUnselectableTasks(resource, taskList, iterInfo, debugStr, debug); if (debug) { debugStr.append("Number of tasks after purgeUnselectableTasks: " *************** *** 286,290 **** debugStr.append("} \r\n"); } ! log.debug(debugStr.toString()); } } --- 289,293 ---- debugStr.append("} \r\n"); } ! log.info(debugStr.toString()); } } *************** *** 328,332 **** + " but this resource does not support Long Running Process (LRP)"; if (debug) { ! debugStr.append(msg); } log.error(msg, new Exception()); --- 331,335 ---- + " but this resource does not support Long Running Process (LRP)"; if (debug) { ! debugStr.append(msg + "\r\n"); } log.error(msg, new Exception()); *************** *** 344,348 **** if (debug) { debugStr.append("Purging " + t.getId() + "( TaskQoS_LRP?" + taskLRP ! + " != Resquest_LRP? " + requestLRP + ")"); } iter.remove(); --- 347,351 ---- if (debug) { debugStr.append("Purging " + t.getId() + "( TaskQoS_LRP?" + taskLRP ! + " != Resquest_LRP? " + requestLRP + ")\r\n"); } iter.remove(); *************** *** 670,677 **** * @param tasks the tasks being filtered. * @param iterationInfo <code>true</code> if required iteration information * @throws KernelException on error */ private static void purgeUnselectableTasks(Resource resource, List<TaskHolder> tasks, ! boolean iterationInfo) throws KernelException { for (Iterator<TaskHolder> it = tasks.iterator(); it.hasNext();) { TaskHolder t = it.next(); --- 673,682 ---- * @param tasks the tasks being filtered. * @param iterationInfo <code>true</code> if required iteration information + * @param debugStr To print debug. + * @param debug used to indicate that must write messages in debugStr. * @throws KernelException on error */ private static void purgeUnselectableTasks(Resource resource, List<TaskHolder> tasks, ! boolean iterationInfo, StringBuffer debugStr, boolean debug) throws KernelException { for (Iterator<TaskHolder> it = tasks.iterator(); it.hasNext();) { TaskHolder t = it.next(); *************** *** 686,693 **** } // 1.- Is Selectable ! boolean selectable = TaskCompatibilityChecker.isSelectable(resource, t, exec); if (!selectable) { ! if (log.isDebugEnabled()) { ! log.debug("Task " + t.getId() + " is not selectable"); } it.remove(); --- 691,699 ---- } // 1.- Is Selectable ! boolean selectable = TaskCompatibilityChecker.isSelectable(resource, t, true, ! exec, debugStr, debug); if (!selectable) { ! if (debug) { ! debugStr.append("Task " + t.getId() + " is not selectable\r\n"); } it.remove(); *************** *** 700,705 **** && !TaskCompatibilityChecker.isCapableOfIterating(resource, t, iterationInfo, taskRanges, taskParams)) { ! if (log.isDebugEnabled()) { ! log.debug("Task " + t.getId() + " is not capable of iterating"); } it.remove(); --- 706,711 ---- && !TaskCompatibilityChecker.isCapableOfIterating(resource, t, iterationInfo, taskRanges, taskParams)) { ! if (debug) { ! debugStr.append("Task " + t.getId() + " is not capable of iterating\r\n"); } it.remove(); Index: AssignmentCancellation.java =================================================================== RCS file: /cvsroot/fura/FuraSrc/Server/Plugins/TaskSubmissionPlugin/plugin/src/com/gridsystems/tasksubmission/internal/AssignmentCancellation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AssignmentCancellation.java 23 Jul 2008 09:58:30 -0000 1.2 --- AssignmentCancellation.java 3 Sep 2008 21:27:22 -0000 1.3 *************** *** 210,214 **** * @param microtaskDstState End state of microtask * @param stopTask true, if exit code with StopTask flag enabled ! * @return Messsag logger * @throws KernelException on error */ --- 210,214 ---- * @param microtaskDstState End state of microtask * @param stopTask true, if exit code with StopTask flag enabled ! * @return Message logger * @throws KernelException on error */ *************** *** 231,241 **** + microTaskId + " -> " + reason); } if (reason != null) { - String state = (microtaskDstState == MicroTaskHolder.STATE_FAILED - ? "failed" : "canceled"); msgLog = "MicroTask " + microTaskId + " " + state + ": " + reason; task.theTaskLogger.info(id, msgLog, microTaskId, null, null, -1); } ! apiRMan.interruptResourceAssignment(id, ra); task.setMicroTaskState(mtask, microtaskDstState, stopTask); interrupted = true; --- 231,259 ---- + microTaskId + " -> " + reason); } + String state; + switch(microtaskDstState) { + case MicroTaskHolder.STATE_FAILED: + state = "failed"; + break; + case MicroTaskHolder.STATE_UNASSIGNED: + state = "canceled"; + break; + case MicroTaskHolder.STATE_FINISHED: + state = "finished"; + break; + default: + String m = "Unknown destination state " + microtaskDstState; + log.error(m, new Exception()); + return m; + } if (reason != null) { msgLog = "MicroTask " + microTaskId + " " + state + ": " + reason; task.theTaskLogger.info(id, msgLog, microTaskId, null, null, -1); } ! if (microtaskDstState == MicroTaskHolder.STATE_FINISHED) { ! apiRMan.finishResourceAssignment(id, ra); ! } else { ! apiRMan.interruptResourceAssignment(id, ra); ! } task.setMicroTaskState(mtask, microtaskDstState, stopTask); interrupted = true; |