| 
      
      
      From: <ha...@us...> - 2006-10-05 19:34:05
       | 
| Revision: 858
          http://svn.sourceforge.net/cogkit/?rev=858&view=rev
Author:   hategan
Date:     2006-10-05 12:34:00 -0700 (Thu, 05 Oct 2006)
Log Message:
-----------
removed debug stuff
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2006-10-05 18:39:54 UTC (rev 857)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2006-10-05 19:34:00 UTC (rev 858)
@@ -322,11 +322,6 @@
 				}
 				t.setService(i, services[i]);
 			}
-			if (services.length == 2
-					&& "localhost".equals(services[0].getServiceContact().getContact())
-					&& "localhost".equals(services[1].getServiceContact().getContact())) {
-				System.err.println("!");
-			}
 
 			if (services.length == 1 && t.getType() == Task.JOB_SUBMISSION) {
 				String project = (String) services[0].getAttribute("project");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2006-12-30 17:48:13
       | 
| Revision: 1513
          http://svn.sourceforge.net/cogkit/?rev=1513&view=rev
Author:   hategan
Date:     2006-12-30 09:48:12 -0800 (Sat, 30 Dec 2006)
Log Message:
-----------
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2006-12-30 17:47:45 UTC (rev 1512)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2006-12-30 17:48:12 UTC (rev 1513)
@@ -564,7 +564,7 @@
 					}
 					catch (ActiveTaskException e1) {
 						e1.printStackTrace();
-						Throwable t = new RuntimeException("Something is wrong here");
+						Throwable t = new RuntimeException("Something is wrong here", e1);
 						t.printStackTrace();
 					}
 					finally {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-01-06 20:55:02
       | 
| Revision: 1534
          http://svn.sourceforge.net/cogkit/?rev=1534&view=rev
Author:   hategan
Date:     2007-01-06 12:55:00 -0800 (Sat, 06 Jan 2007)
Log Message:
-----------
use new queue; better (?) performance; fixed (?) out of order status events with tasks warning
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-01-06 20:53:17 UTC (rev 1533)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-01-06 20:55:00 UTC (rev 1534)
@@ -36,6 +36,7 @@
 import org.globus.cog.karajan.scheduler.submitQueue.SubmitQueue;
 import org.globus.cog.karajan.util.BoundContact;
 import org.globus.cog.karajan.util.Contact;
+import org.globus.cog.karajan.util.Queue;
 import org.globus.cog.karajan.util.TaskHandlerWrapper;
 import org.globus.cog.karajan.util.TypeUtil;
 import org.globus.cog.karajan.util.VirtualContact;
@@ -66,6 +67,8 @@
 
 	private InstanceSubmitQueue submitQueue;
 
+	private boolean tasksFinished;
+
 	public LateBindingScheduler() {
 		virtualContacts = new HashMap();
 		executionHandlers = new HashMap();
@@ -94,8 +97,9 @@
 		return allocateContact(null);
 	}
 
-	public void releaseContact(BoundContact contact) {
+	public synchronized void releaseContact(BoundContact contact) {
 		virtualContacts.remove(contact.getHost());
+		tasksFinished = true;
 	}
 
 	public synchronized BoundContact resolveVirtualContact(Task t, Contact contact)
@@ -153,13 +157,13 @@
 
 	protected TaskConstraints getTaskConstraints(Task t) {
 		Object constraints = super.getConstraints(t);
-        if (constraints instanceof Contact[]) {
-        	Contact[] c = (Contact[]) constraints;
-            if (c.length > 0 && c[0] != null) {
-            	return c[0].getConstraints();
-            }
-        }
-        return null;
+		if (constraints instanceof Contact[]) {
+			Contact[] c = (Contact[]) constraints;
+			if (c.length > 0 && c[0] != null) {
+				return c[0].getConstraints();
+			}
+		}
+		return null;
 	}
 
 	public void enqueue(Task task, Object constraints) {
@@ -215,34 +219,29 @@
 	}
 
 	public void run() {
+		Queue queue = getJobQueue();
+		Queue.Cursor c = queue.cursor();
 		while (!isDone()) {
-			synchronized (this) {
-				while (getJobQueue().isEmpty() || (running >= getMaxSimultaneousJobs())) {
+			while (queue.isEmpty() || (running >= getMaxSimultaneousJobs())) {
+				synchronized (this) {
 					if (!sleep()) {
 						return;
 					}
 				}
 			}
-			boolean success = false;
-			int index = 0;
-			while (!success) {
-				if (index >= getJobQueue().size()) {
-					synchronized (this) {
-						if (!sleep()) {
-							return;
-						}
-					}
-					break;
-				}
-				Task t = (Task) getJobQueue().get(index);
+			synchronized (this) {
+				tasksFinished = false;
+				c.reset();
+			}
+			while (c.hasNext()) {
+				Task t = (Task) c.next();
 				boolean remove = true;
 				try {
 					submitUnbound(t);
-					success = true;
 				}
 				catch (NoSuchResourceException e) {
 					failTask(t, "Could not find any valid host for task \"" + t
-								+ "\" with constraints " + getTaskConstraints(t), e);
+							+ "\" with constraints " + getTaskConstraints(t), e);
 				}
 				catch (NoFreeResourceException e) {
 					remove = false;
@@ -251,18 +250,28 @@
 					failTask(t, "The scheduler could not execute the task", e);
 				}
 				if (remove) {
-					synchronized (this) {
-						getJobQueue().remove(index);
+					c.remove();
+				}
+				else {
+					while (!c.hasNext()) {
+						synchronized (this) {
+							if (!sleep()) {
+								return;
+							}
+							if (tasksFinished) {
+								tasksFinished = false;
+								c.reset();
+							}
+						}
 					}
 				}
-				index++;
 			}
 		}
 	}
 
 	private boolean sleep() {
 		try {
-			wait(250);
+			wait(2000);
 			return true;
 		}
 		catch (InterruptedException e) {
@@ -346,8 +355,8 @@
 		}
 		catch (Exception e) {
 			if (logger.isDebugEnabled()) {
-				logger.debug("Scheduler exception: job =" + t.getIdentity().getValue() + ", status = "
-					+ t.getStatus(), e);
+				logger.debug("Scheduler exception: job =" + t.getIdentity().getValue()
+						+ ", status = " + t.getStatus(), e);
 			}
 			failTask(t, e.toString(), e);
 			return;
@@ -521,7 +530,8 @@
 			Task task = (Task) e.getSource();
 			Status status = e.getStatus();
 			int code = status.getStatusCode();
-			if (!taskContacts.containsKey(e.getSource())) {
+			Contact[] contacts = (Contact[]) taskContacts.get(task);
+			if (contacts == null) {
 				return;
 			}
 			if (code == Status.COMPLETED) {
@@ -537,12 +547,12 @@
 			}
 			if (status.isTerminal()) {
 				synchronized (this) {
+					tasksFinished = true;
 					decRunning();
 					task.removeStatusListener(this);
 					if (task.getType() == Task.FILE_TRANSFER) {
 						currentTransfers--;
 					}
-					Contact[] contacts = (Contact[]) taskContacts.get(task);
 					synchronized (taskContacts) {
 						taskContacts.remove(task);
 					}
@@ -553,14 +563,27 @@
 						c.setActiveTasks(c.getActiveTasks() - 1);
 					}
 
+					TaskHandler handler = getHandler(task);
 					try {
-						TaskHandler handler = getHandler(task);
 						handler.remove(task);
 					}
 					catch (ActiveTaskException e1) {
-						e1.printStackTrace();
-						Throwable t = new RuntimeException("Something is wrong here", e1);
-						t.printStackTrace();
+						/*
+						 * I think this is the out of order status events
+						 * phenomenon, where a task gets in an ACTIVE state
+						 * after being COMPLETED. The good news is that it
+						 * should only once get into the state of ACTIVE
+						 */
+						task.getStatus().setStatusCode(code);
+						try {
+							handler.remove(task);
+						}
+						catch (ActiveTaskException e2) {
+							// now it's really weird
+							e1.printStackTrace();
+							Throwable t = new RuntimeException("Something is wrong here", e1);
+							t.printStackTrace();
+						}
 					}
 					finally {
 						removeHandler(task);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-02-06 00:56:31
       | 
| Revision: 1563
          http://svn.sourceforge.net/cogkit/?rev=1563&view=rev
Author:   hategan
Date:     2007-02-05 16:56:30 -0800 (Mon, 05 Feb 2007)
Log Message:
-----------
added fileop throtting
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-02-06 00:55:58 UTC (rev 1562)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-02-06 00:56:30 UTC (rev 1563)
@@ -42,12 +42,19 @@
 import org.globus.cog.karajan.util.VirtualContact;
 
 public abstract class LateBindingScheduler extends AbstractScheduler implements StatusListener {
+	public static final String JOBS_PER_CPU = "jobsPerCPU";
+	public static final String HOST_SUBMIT_THROTTLE = "hostSubmitThrottle";
+	public static final String SUBMIT_THROTTLE = "submitThrottle";
+	public static final String MAX_TRANSFERS = "maxTransfers";
+	public static final String SSH_INITIAL_RATE = "sshInitialRate";
+	public static final String MAX_FILE_OPERATIONS = "maxFileOperations";
 
 	public static final int K = 1024;
 	public static final int THREAD_STACK_SIZE = 192 * K;
 	public static final int DEFAULT_SSH_INITIAL_RATE = 6;
 	public static final int DEFAULT_JOBS_PER_CPU = 128;
 	public static final int DEFAULT_MAX_TRANSFERS = 32;
+	public static final int DEFAULT_MAX_FILE_OPERATIONS = 64;
 
 	private static final Logger logger = Logger.getLogger(LateBindingScheduler.class);
 
@@ -63,7 +70,8 @@
 
 	private final Map handlers, taskContacts;
 
-	private int jobsPerCPU, maxTransfers, currentTransfers, sshInitialRate;
+	private int jobsPerCPU, maxTransfers, currentTransfers, sshInitialRate, maxFileOperations,
+			currentFileOperations;
 
 	private InstanceSubmitQueue submitQueue;
 
@@ -75,6 +83,7 @@
 		taskContacts = new HashMap();
 		jobsPerCPU = DEFAULT_JOBS_PER_CPU;
 		maxTransfers = DEFAULT_MAX_TRANSFERS;
+		maxFileOperations = DEFAULT_MAX_FILE_OPERATIONS;
 		sshInitialRate = DEFAULT_SSH_INITIAL_RATE;
 		handlers = new HashMap();
 		submitQueue = new InstanceSubmitQueue();
@@ -84,7 +93,7 @@
 
 	public Contact allocateContact(Object constraints) throws NoFreeResourceException {
 		if (getResources().size() == 0) {
-			throw new NoFreeResourceException("No service contacts available");
+			throw new NoSuchResourceException("No service contacts available");
 		}
 		Contact contact = new VirtualContact();
 		if (constraints instanceof TaskConstraints) {
@@ -200,6 +209,9 @@
 		if (t.getType() == Task.FILE_TRANSFER && (currentTransfers >= maxTransfers)) {
 			throw new NoFreeResourceException();
 		}
+		else if (t.getType() == Task.FILE_OPERATION && (currentFileOperations >= maxFileOperations)) {
+			throw new NoFreeResourceException();
+		}
 	}
 
 	// make sure there is enough memory to run 8 more threads (approx).
@@ -480,6 +492,9 @@
 			if (t.getType() == Task.FILE_TRANSFER) {
 				currentTransfers++;
 			}
+			else if (t.getType() == Task.FILE_OPERATION) {
+				currentFileOperations++;
+			}
 		}
 	}
 
@@ -504,22 +519,25 @@
 	}
 
 	public void setProperty(String name, Object value) {
-		if (name.equalsIgnoreCase("jobsPerCpu")) {
+		if (name.equalsIgnoreCase(JOBS_PER_CPU)) {
 			logger.debug("Scheduler: setting jobsPerCpu to " + value);
 			jobsPerCPU = TypeUtil.toInt(value);
 		}
-		else if (name.equalsIgnoreCase("submitThrottle")) {
+		else if (name.equalsIgnoreCase(SUBMIT_THROTTLE)) {
 			submitQueue.setThrottle(TypeUtil.toInt(value));
 		}
-		else if (name.equalsIgnoreCase("hostSubmitThrottle")) {
+		else if (name.equalsIgnoreCase(HOST_SUBMIT_THROTTLE)) {
 			submitQueue.setHostThrottle(TypeUtil.toInt(value));
 		}
-		else if (name.equalsIgnoreCase("maxTransfers")) {
+		else if (name.equalsIgnoreCase(MAX_TRANSFERS)) {
 			maxTransfers = TypeUtil.toInt(value);
 		}
-		else if (name.equalsIgnoreCase("sshInitialRate")) {
+		else if (name.equalsIgnoreCase(SSH_INITIAL_RATE)) {
 			sshInitialRate = TypeUtil.toInt(value);
 		}
+		else if (name.equalsIgnoreCase(MAX_FILE_OPERATIONS)) {
+			maxFileOperations = TypeUtil.toInt(value);
+		}
 		else {
 			super.setProperty(name, value);
 		}
@@ -553,6 +571,9 @@
 					if (task.getType() == Task.FILE_TRANSFER) {
 						currentTransfers--;
 					}
+					else if (task.getType() == Task.FILE_OPERATION) {
+						currentFileOperations--;
+					}
 					synchronized (taskContacts) {
 						taskContacts.remove(task);
 					}
@@ -632,8 +653,8 @@
 	public synchronized String[] getPropertyNames() {
 		if (propertyNames == null) {
 			propertyNames = AbstractScheduler.combineNames(super.getPropertyNames(), new String[] {
-					"jobsPerCPU", "hostSubmitThrottle", "submitThrottle", "maxTransfers",
-					"sshInitialRate" });
+					JOBS_PER_CPU, HOST_SUBMIT_THROTTLE, SUBMIT_THROTTLE, MAX_TRANSFERS,
+					SSH_INITIAL_RATE, MAX_FILE_OPERATIONS });
 		}
 		return propertyNames;
 	}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-03-11 19:58:49
       | 
| Revision: 1606
          http://svn.sourceforge.net/cogkit/?rev=1606&view=rev
Author:   hategan
Date:     2007-03-11 12:58:47 -0700 (Sun, 11 Mar 2007)
Log Message:
-----------
changed log message when task is completed
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-03-11 19:45:27 UTC (rev 1605)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-03-11 19:58:47 UTC (rev 1606)
@@ -555,7 +555,7 @@
 			}
 			if (code == Status.COMPLETED) {
 				if (logger.isInfoEnabled()) {
-					logger.info("(" + task.getIdentity().getValue() + ") Completed. Waiting: "
+					logger.info(task + " Completed. Waiting: "
 							+ getJobQueue().size() + ", Running: " + (getRunning() - 1)
 							+ ". Heap size: "
 							+ (Runtime.getRuntime().totalMemory() / (1024 * 1024))
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-04-11 21:11:26
       | 
| Revision: 1633
          http://svn.sourceforge.net/cogkit/?rev=1633&view=rev
Author:   hategan
Date:     2007-04-11 14:11:21 -0700 (Wed, 11 Apr 2007)
Log Message:
-----------
test for the most common case first; better job throttling
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-04-06 15:39:41 UTC (rev 1632)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-04-11 21:11:21 UTC (rev 1633)
@@ -47,7 +47,7 @@
 	public static final String SUBMIT_THROTTLE = "submitThrottle";
 	public static final String MAX_TRANSFERS = "maxTransfers";
 	public static final String SSH_INITIAL_RATE = "sshInitialRate";
-	public static final String MAX_FILE_OPERATIONS = "maxFileOperations";
+	public static final String MAX_FILE_OPERATIONS = "maxFileOperations"; 
 
 	public static final int K = 1024;
 	public static final int THREAD_STACK_SIZE = 192 * K;
@@ -71,7 +71,7 @@
 	private final Map handlers, taskContacts;
 
 	private int jobsPerCPU, maxTransfers, currentTransfers, sshInitialRate, maxFileOperations,
-			currentFileOperations;
+			currentFileOperations, currentJobs;
 
 	private InstanceSubmitQueue submitQueue;
 
@@ -197,19 +197,19 @@
 	}
 
 	protected void checkGlobalLoadConditions() throws NoFreeResourceException {
-		if (getRunning() >= getMaxSimultaneousJobs()) {
-			throw new NoFreeResourceException("Maximum total tasks already running");
-		}
 		if (!checkFreeMemory()) {
 			throw new NoFreeResourceException("Not enough free memory for another job");
 		}
 	}
 
 	protected void checkTaskLoadConditions(Task t) throws NoFreeResourceException {
+		if (t.getType() == Task.FILE_OPERATION && (currentFileOperations >= maxFileOperations)) {
+			throw new NoFreeResourceException();
+		}
 		if (t.getType() == Task.FILE_TRANSFER && (currentTransfers >= maxTransfers)) {
 			throw new NoFreeResourceException();
 		}
-		else if (t.getType() == Task.FILE_OPERATION && (currentFileOperations >= maxFileOperations)) {
+		if (t.getType() == Task.JOB_SUBMISSION && (currentJobs >= getMaxSimultaneousJobs())) {
 			throw new NoFreeResourceException();
 		}
 	}
@@ -234,7 +234,7 @@
 		Queue queue = getJobQueue();
 		Queue.Cursor c = queue.cursor();
 		while (!isDone()) {
-			while (queue.isEmpty() || (running >= getMaxSimultaneousJobs())) {
+			while (queue.isEmpty()) {
 				synchronized (this) {
 					if (!sleep()) {
 						return;
@@ -490,12 +490,15 @@
 			NonBlockingSubmit nbs = new NonBlockingSubmit(handler, t, queues);
 			nbs.go();
 			incRunning();
-			if (t.getType() == Task.FILE_TRANSFER) {
+			if (t.getType() == Task.FILE_OPERATION) {
+				currentFileOperations++;
+			}
+			else if (t.getType() == Task.FILE_TRANSFER) {
 				currentTransfers++;
 			}
-			else if (t.getType() == Task.FILE_OPERATION) {
-				currentFileOperations++;
-			}
+			else if (t.getType() == Task.JOB_SUBMISSION) {
+				currentJobs++;
+			}	
 		}
 	}
 
@@ -569,11 +572,14 @@
 					tasksFinished = true;
 					decRunning();
 					task.removeStatusListener(this);
-					if (task.getType() == Task.FILE_TRANSFER) {
+					if (task.getType() == Task.FILE_OPERATION) {
+						currentFileOperations--;
+					}
+					else if (task.getType() == Task.FILE_TRANSFER) {
 						currentTransfers--;
 					}
-					else if (task.getType() == Task.FILE_OPERATION) {
-						currentFileOperations--;
+					if (task.getType() == Task.JOB_SUBMISSION) {
+						currentJobs--;
 					}
 					synchronized (taskContacts) {
 						taskContacts.remove(task);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2007-08-16 22:51:48
       | 
| Revision: 1681
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1681&view=rev
Author:   hategan
Date:     2007-08-16 15:51:47 -0700 (Thu, 16 Aug 2007)
Log Message:
-----------
fix for certain cases when a resource is not readily available
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-08-16 22:49:23 UTC (rev 1680)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2007-08-16 22:51:47 UTC (rev 1681)
@@ -47,7 +47,7 @@
 	public static final String SUBMIT_THROTTLE = "submitThrottle";
 	public static final String MAX_TRANSFERS = "maxTransfers";
 	public static final String SSH_INITIAL_RATE = "sshInitialRate";
-	public static final String MAX_FILE_OPERATIONS = "maxFileOperations"; 
+	public static final String MAX_FILE_OPERATIONS = "maxFileOperations";
 
 	public static final int K = 1024;
 	public static final int THREAD_STACK_SIZE = 192 * K;
@@ -345,9 +345,8 @@
 					services[i] = resolveService((BoundContact) contacts[i], t.getType());
 				}
 				if (services[i] == null) {
-					failTask(t, "Could not find a suitable service/provider for host "
-							+ contacts[i], null);
-					return;
+					throw new NoSuchResourceException(
+							"Could not find a suitable service/provider for host " + contacts[i]);
 				}
 				t.setService(i, services[i]);
 			}
@@ -392,8 +391,7 @@
 		return boundContact;
 	}
 
-	public Service resolveService(BoundContact contact, int taskType)
-			throws NoFreeResourceException {
+	public Service resolveService(BoundContact contact, int taskType) {
 		Iterator h = this.getTaskHandlerWrappers(getHandlerType(taskType)).iterator();
 		while (h.hasNext()) {
 			TaskHandlerWrapper handler = (TaskHandlerWrapper) h.next();
@@ -401,7 +399,7 @@
 				return contact.getService(handler);
 			}
 		}
-		throw new NoFreeResourceException("No service found");
+		return null;
 	}
 
 	public int getHandlerType(int taskType) {
@@ -498,7 +496,7 @@
 			}
 			else if (t.getType() == Task.JOB_SUBMISSION) {
 				currentJobs++;
-			}	
+			}
 		}
 	}
 
@@ -558,9 +556,8 @@
 			}
 			if (code == Status.COMPLETED) {
 				if (logger.isInfoEnabled()) {
-					logger.info(task + " Completed. Waiting: "
-							+ getJobQueue().size() + ", Running: " + (getRunning() - 1)
-							+ ". Heap size: "
+					logger.info(task + " Completed. Waiting: " + getJobQueue().size()
+							+ ", Running: " + (getRunning() - 1) + ". Heap size: "
 							+ (Runtime.getRuntime().totalMemory() / (1024 * 1024))
 							+ "M, Heap free: "
 							+ (Runtime.getRuntime().freeMemory() / (1024 * 1024)) + "M, Max heap: "
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <ha...@us...> - 2008-02-11 20:10:45
       | 
| Revision: 1879
          http://cogkit.svn.sourceforge.net/cogkit/?rev=1879&view=rev
Author:   hategan
Date:     2008-02-11 12:10:43 -0800 (Mon, 11 Feb 2008)
Log Message:
-----------
small updates
Modified Paths:
--------------
    trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
Modified: trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java
===================================================================
--- trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2008-02-11 19:33:06 UTC (rev 1878)
+++ trunk/current/src/cog/modules/karajan/src/org/globus/cog/karajan/scheduler/LateBindingScheduler.java	2008-02-11 20:10:43 UTC (rev 1879)
@@ -471,7 +471,7 @@
 		for (int i = 0; i < contacts.length; i++) {
 			if (!(contacts[i] instanceof BoundContact)) {
 				throw new TaskSubmissionException(
-						"submitBoundToServices called but at least a contact is not bound");
+						"submitBoundToServices called but at least a contact is not bound (" + contacts[i] + ")");
 			}
 			BoundContact c = (BoundContact) contacts[i];
 			c.setActiveTasks(c.getActiveTasks() + 1);
@@ -596,7 +596,6 @@
 					synchronized (taskContacts) {
 						taskContacts.remove(task);
 					}
-					removeConstraints(task);
 
 					for (int i = 0; i < contacts.length; i++) {
 						BoundContact c = (BoundContact) contacts[i];
@@ -639,6 +638,7 @@
 						return;
 					}
 				}
+				removeConstraints(task);
 			}
 		}
 		catch (Exception ee) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |