[Swift-commit] r2889 - in trunk: src/org/griphyn/vdl/karajan/lib tests/language-behaviour

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Apr 28 07:39:19 CDT 2009


Author: benc
Date: 2009-04-28 07:39:18 -0500 (Tue, 28 Apr 2009)
New Revision: 2889

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
   trunk/tests/language-behaviour/run
Log:
make iterate give each iteration a unique thread ID, without launching
an entire karajan thread for each iteration.

add language-behaviour test to check that execute IDs are unique after
every test

Modified: trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java	2009-04-28 11:19:49 UTC (rev 2888)
+++ trunk/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java	2009-04-28 12:39:18 UTC (rev 2889)
@@ -9,6 +9,7 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.globus.cog.karajan.util.ThreadingContext;
 import org.globus.cog.karajan.workflow.nodes.*;
 import org.globus.cog.karajan.stack.VariableStack;
 import org.globus.cog.karajan.util.TypeUtil;
@@ -26,6 +27,9 @@
 
 	public void pre(VariableStack stack) throws ExecutionException {
 		stack.setVar("#condition", new Condition());
+		ThreadingContext tc = (ThreadingContext)stack.getVar("#thread");
+		stack.setVar("#iteratethread", tc);
+		stack.setVar("#thread", tc.split(0));
 		stack.setVar(VAR, "$");
 		String counterName = (String)stack.getVar(VAR);
 		stack.setVar(counterName, Arrays.asList(new Integer[] {new Integer(0)}));
@@ -62,6 +66,8 @@
 			Integer wrappedi = (Integer)l.get(0);
 			int i = wrappedi.intValue();
 			i++;
+			ThreadingContext tc = (ThreadingContext)stack.getVar("#iteratethread");
+			stack.setVar("#thread", tc.split(i));
 			stack.setVar(counterName, Arrays.asList(new Integer[] {new Integer(i)}));
 		}
 		else {

Modified: trunk/tests/language-behaviour/run
===================================================================
--- trunk/tests/language-behaviour/run	2009-04-28 11:19:49 UTC (rev 2888)
+++ trunk/tests/language-behaviour/run	2009-04-28 12:39:18 UTC (rev 2889)
@@ -87,6 +87,15 @@
       fi
     fi
 
+    # check that all execute and execute2 IDs are unique
+    swift-plot-log ${t}-*.log execute.transitions
+    if [ "$( cat execute.transitions | grep ' START ' | cut -d ' ' -f 2 | sort | uniq -d)" != "" ]; then
+      echo EXECUTE IDS NOT UNIQUE
+      exit 3
+    fi
+
+
+
   done
   echo "Test passed at $(date)"
   if [ "$SUB" == "" ]; then




More information about the Swift-commit mailing list